|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Mon May 20 2002 - 22:56:08 CDT
php-general Digest 21 May 2002 03:56:08 -0000 Issue 1357
Topics (messages 98445 through 98556):
Re: Email harvesters
98445 by: Leif K-Brooks
98450 by: Manuel Lemos
98467 by: Brian McGarvie
98476 by: Miguel Cruz
98488 by: Rasmus Lerdorf
98489 by: Hugh Bothwell
Re: refresh (part of) a page?
98446 by: savaidis
98466 by: Jason Wong
98469 by: 1LT John W. Holmes
98502 by: Sqlcoders.com Programming Dept
gmdate question
98447 by: SP
98479 by: Miguel Cruz
test
98448 by: SP
undefined function: sybase_pconnect()
98449 by: Vivek Kumar Agrawal
98462 by: Patrick Laverty
98475 by: Jason Wong
Re: Using PHP for NULLs
98451 by: Jay Blanchard
Re: Running php program when mail received
98452 by: Manuel Lemos
98453 by: Manuel Lemos
dbase
98454 by: eoghan
online bidding
98455 by: regnivon.netscape.net
98470 by: Bogdan Stancescu
date Question
98456 by: Randy Johnson
98473 by: Jason Wong
98551 by: Justin French
timezone problem
98457 by: SP
98478 by: Miguel Cruz
98535 by: SP
98536 by: Miguel Cruz
Re: multiply by 2
98458 by: Bogdan Stancescu
Cookies
98459 by: Darren Edwards
Re: Problem with mktime()
98460 by: Jim Winstead
98463 by: Dan Hardiker
98480 by: Rasmus Lerdorf
PHP Cookies
98461 by: Darren Edwards
98471 by: Jay Blanchard
98477 by: Miguel Cruz
98505 by: Miguel Cruz
Re: MSIE & GZIP problem
98464 by: Garth Dahlstrom
98465 by: Garth Dahlstrom
More on escaping for SQL statements
98468 by: Dennis Gearon
Re: mysql_fetch_array errors
98472 by: Philip Olson
Expiring certain session data while keeping the session itself
98474 by: Chris Knipe
98516 by: Scott Hurring
eval()
98481 by: jtjohnston
98482 by: Miguel Cruz
98484 by: Bogdan Stancescu
98485 by: Bogdan Stancescu
Re: bug in SLEEP() function...
98483 by: Rasmus Lerdorf
Re: Register_Shutdown_Function ??
98486 by: Rasmus Lerdorf
98487 by: Rasmus Lerdorf
Re: php.net sloooooooowwww
98490 by: Rasmus Lerdorf
98497 by: Rasmus Lerdorf
98503 by: Eric Coleman
List content of folders?
98491 by: Hawk
98493 by: Jas
98504 by: Jason Wong
Re: while loop question - problem (new set of eyes needed)
98492 by: Rasmus Lerdorf
Re: Variable won't work in function, even when I global it?
98494 by: Scott Hurring
PHP & Excel
98495 by: LeTortorec, Jean-Louis
98498 by: 1LT John W. Holmes
98499 by: Scott Hurring
98500 by: Scott Hurring
98501 by: 1LT John W. Holmes
98517 by: Evan
Re: Why would this command just Die!
98496 by: Rasmus Lerdorf
verify file against array?
98506 by: Jas
98549 by: Analysis & Solutions
Re: [PHP-EVANGELISM] PHPDocumentor v1.0rc1 release announcement
98507 by: Dave Mertens
Refresh doesn't work
98508 by: Olexandr Vynnychenko
98510 by: pong-TC
98511 by: Thalis A. Kalfigopoulos
98512 by: Olexandr Vynnychenko
98513 by: Bogdan Stancescu
98544 by: Olexandr Vynnychenko
display errors for developers only?
98509 by: Jeff Bearer
98546 by: Jim lucas
98550 by: Analysis & Solutions
imagecopy() no errors, but does nothing :-(
98514 by: Evan
98530 by: Evan
98539 by: Philip Hallstrom
Re: Any Ideas "
" becomes "_Xy"
98515 by: Analysis & Solutions
98519 by: Scott Hurring
Re: xml parsing
98518 by: Analysis & Solutions
Re: Read a var from stdin
98520 by: Analysis & Solutions
Calling Compiled File From PHP File
98521 by: Bruce Miller
98522 by: Rasmus Lerdorf
98531 by: Manuel Lemos
98534 by: Manuel Lemos
Text file
98523 by: Rodrigo
98525 by: Scott Hurring
98527 by: Miguel Cruz
98555 by: Cleeker
Re: A new GUI client for mySQL
98524 by: Vinod Palan
exec() sytem() problem with starting ext. prg
98526 by: Alexander Saupe
98528 by: Miguel Cruz
98529 by: Rasmus Lerdorf
Sane path? Avoiding people climbing in directory structure ../../
98532 by: Jimmy Lantz
98543 by: Bogdan Stancescu
98545 by: Philip Hallstrom
Installing PHP 4.2.1
98533 by: Conover, Ryan
98541 by: Johan Ekström
98542 by: Johan Ekström
Running out of sockets! Help!
98537 by: Casey Allen Shobe
98538 by: Miguel Cruz
98540 by: Casey Allen Shobe
Re: Whats the best way?
98547 by: Analysis & Solutions
Re: CGI / Apache module session permissions
98548 by: Analysis & Solutions
php4.2.0 (win) error message question
98552 by: Martin Towell
98553 by: Peter
98554 by: Martin Towell
MySQL and sorting
98556 by: Cleeker
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I think it would be a good idea to have whatever software sends list
messages to the newsgroup block out the addresses.
Miguel Cruz wrote:
>If you're concerned and don't have effective anti-spam filtering on your
>email box, I'd suggest coming up with a second address to use for "public"
>purposes such as this.
>
>The list shows up all over the place. For instance, Google groups picks it
>up off the news.php.net server, and you're surely not going to convince
>them to hide email addresses.
>
>miguel
>
>
attached mail follows:
Hello,
On 05/20/2002 04:46 AM, Richard Baskett wrote:
> I wrote this email to the php Archive list and I would like to get your
> opinions on it.. Thanks! :)
>
> "Is there any way that we could get the archives password protected? Apple
> does a nice thing where they tell you the username and password to login and
> the whole purpose of it is so that email harvesters can not go through and..
> Well.. Harvest our emails from the list :) I think a lot of people would
> not mind having something like this added to the pages since my guess is
> that we're all sick and tired of spam and junkmail and eliminating one
> possible garden for harvesters would be nice :) I am going to email this to
> the list also to see what kind of feedback comes from it."
I use anti-email harvesting techniques in my sites but that works
because in HTML you can do more things than with plain text. The problem
is that these lists are stored in text. So, only when you display the
lists in HTML pages the protection has any effect.
If is that what you mean, I can explain what I do.
--Regards, Manuel Lemos
attached mail follows:
but then no one would be able to reply to an individual...
> -----Original Message-----
> From: Leif K-Brooks [mailto:eurleif
buyer-brokerage.com]
> Sent: 20 May 2002 11:42 AM
> To: Miguel Cruz
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] Email harvesters
>
>
> I think it would be a good idea to have whatever software sends list
> messages to the newsgroup block out the addresses.
>
> Miguel Cruz wrote:
>
> >If you're concerned and don't have effective anti-spam
> filtering on your
> >email box, I'd suggest coming up with a second address to
> use for "public"
> >purposes such as this.
> >
> >The list shows up all over the place. For instance, Google
> groups picks it
> >up off the news.php.net server, and you're surely not going
> to convince
> >them to hide email addresses.
> >
> >miguel
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
But then how would newsgroup users write back to people?
miguel
On Mon, 20 May 2002, Leif K-Brooks wrote: > I think it would be a good idea to have whatever software sends list > messages to the newsgroup block out the addresses. > > Miguel Cruz wrote: > > >If you're concerned and don't have effective anti-spam filtering on your > >email box, I'd suggest coming up with a second address to use for "public" > >purposes such as this. > > > >The list shows up all over the place. For instance, Google groups picks it > >up off the news.php.net server, and you're surely not going to convince > >them to hide email addresses. > > > >miguel > > > > > > >
attached mail follows:
If there was just one archive of this list and we controlled it, then this would be ok. But the fact is that there are dozens, and we don't control any of them. So I don't see how this could be done.
-Rasmus
On Mon, 20 May 2002, Richard Baskett wrote:
> I wrote this email to the php Archive list and I would like to get your > opinions on it.. Thanks! :) > > "Is there any way that we could get the archives password protected? Apple > does a nice thing where they tell you the username and password to login and > the whole purpose of it is so that email harvesters can not go through and.. > Well.. Harvest our emails from the list :) I think a lot of people would > not mind having something like this added to the pages since my guess is > that we're all sick and tired of spam and junkmail and eliminating one > possible garden for harvesters would be nice :) I am going to email this to > the list also to see what kind of feedback comes from it." > > Rick > > "How wonderful it is that nobody need wait a single moment to improve the > world." - Anne Frank > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
"Miguel Cruz" <mnc
stoic.net> wrote in message
news:Pine.LNX.4.44.0205201217080.6705-100000
stoic.net...
> But then how would newsgroup users write back to people?
>
> miguel
>
> On Mon, 20 May 2002, Leif K-Brooks wrote:
> > I think it would be a good idea to have whatever software sends list
> > messages to the newsgroup block out the addresses.
Okay, I'm not saying any of these are necessarily 'good'; but for argument, here goes:
(1. ) pass-thru server:
(.a) Replace email addresses with hyperlink to server-based reply form, ie
abd
def.com
becomes
www.listserv.com/replyto/9317401
(.b) Replace with email address with processed email, ie
abd
def.com
becomes
forward9317401
listserv.com
This will of course still require spam- filtering.
(.c) request-for-contact. Server form will forward user's email and request an email reply.
(2. ) They can't - all contact via the newsgroup - all email addresses censored, no work-around provided.
(2.b) Make this opt-in on request.
attached mail follows:
I look and I search everything, it looks I'm reaching to a wall :) I used Netscape, I uploaded to my internet server, still the same. Plus, I cannot find "header already send" at manual.
The error message is : Warning: Cannot add header information - headers already sent by (output started at /mpla-mpla/main.php:41) in /mpla-mpla /main.php on line 83
Note that I use "header()" without problem on another php script on the same server.(to redirect from a "parcked" domain)
Someone could help?
Thanks
Makis
> -----Original Message-----
> From: Jason Wong [mailto:php-general
gremlins.com.hk]
> Sent: Sunday, May 19, 2002 3:35 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] refresh (part of) a page?
>
>
> On Sunday 19 May 2002 18:03, savaidis wrote:
> > I want to refrech a part of my page (or the whole page) using PHP.
> > Periodically, using a time delay.
> > Should I use frames?
>
> You cannot refresh part of a page without resending the whole
> page. You can
> use frames.
>
> > Also I tried to use "header (...)" calling the same page with different
> > name (and then back to the same page) but I got the warning:
> > "header already send".
>
> *Read* the manual and see what it says about header() and "header already
> send".
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> A great many people think they are thinking when they are merely
> rearranging their prejudices.
> -- William James
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On Monday 20 May 2002 16:39, savaidis wrote: > I look and I search everything, it looks I'm reaching to a wall :) > I used Netscape, I uploaded to my internet server, still the same. > Plus, I cannot find "header already send" at manual. > > The error message is : > Warning: Cannot add header information - headers already sent by (output > started at /mpla-mpla/main.php:41) in /mpla-mpla /main.php on line 83 > > Note that I use "header()" without problem on another php script on the > same server.(to redirect from a "parcked" domain) > > Someone could help?
As I've said, look up the header() function in the manual. It has all you need to know.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Always think of something new; this helps you forget your last rotten idea. -- Seth Frankel */
attached mail follows:
You can't have any output before you call header. Something in main.php on line 41 is causing some output that breaks the header() call. Be sure you don't have any whitespace at the end of included files.
---John Holmes...
----- Original Message -----
From: "savaidis" <savaidis
hol.gr>
To: <php-general
lists.php.net>
Sent: Monday, May 20, 2002 4:39 AM
Subject: RE: [PHP] refresh (part of) a page?
> I look and I search everything, it looks I'm reaching to a wall :)
> I used Netscape, I uploaded to my internet server, still the same.
> Plus, I cannot find "header already send" at manual.
>
> The error message is :
> Warning: Cannot add header information - headers already sent by (output
> started at /mpla-mpla/main.php:41) in /mpla-mpla /main.php on line 83
>
> Note that I use "header()" without problem on another php script on the
same
> server.(to redirect from a "parcked" domain)
>
> Someone could help?
>
> Thanks
>
> Makis
>
> > -----Original Message-----
> > From: Jason Wong [mailto:php-general
gremlins.com.hk]
> > Sent: Sunday, May 19, 2002 3:35 PM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] refresh (part of) a page?
> >
> >
> > On Sunday 19 May 2002 18:03, savaidis wrote:
> > > I want to refrech a part of my page (or the whole page) using PHP.
> > > Periodically, using a time delay.
> > > Should I use frames?
> >
> > You cannot refresh part of a page without resending the whole
> > page. You can
> > use frames.
> >
> > > Also I tried to use "header (...)" calling the same page with
different
> > > name (and then back to the same page) but I got the warning:
> > > "header already send".
> >
> > *Read* the manual and see what it says about header() and "header
already
> > send".
> >
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> >
> > /*
> > A great many people think they are thinking when they are merely
> > rearranging their prejudices.
> > -- William James
> > */
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi there!, To keep both <iframes> on the same line, you need to put them inside a table (like this: <table border=0><tr><td><iframe></iframe></td><td><iframe></iframe></td></tr></tabl e>)
You can switch off any borders with the following: in the iframe code use an iframe tag like this: <iframe border=0 height=200 width=400 FRAMEBORDER="0" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=NO NORESIZE scrolling=no src="pageToLoad.php"></iframe>
So to combine the two (both on the same line with no borders), something like this... <table border=0> <tr> <td> <iframe border=0 height=200 width=400 FRAMEBORDER="0" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=NO NORESIZE scrolling=no src="pageToLoad.php"></iframe> </td> <td> <iframe border=0 height=200 width=400 FRAMEBORDER="0" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=NO NORESIZE scrolling=no src="pageToLoad.php"></iframe> </td> </tr> </table>
HTH, Dw
----- Original Message -----
From: "savaidis" <savaidis
hol.gr>
To: "Sqlcoders.com Programming Dept" <coders
sqlcoders.com>
Sent: May 20 2002 08:42 AM
Subject: RE: [PHP] refresh (part of) a page?
> Thanks a lot!
>
> Is possible to make invisible the borders? I tried "border=0" and
"noborder"
> but didn't work.
>
> Also to keep the 2 frames (I did put and another <iframe to the right) in
> the same line and not to break the other at the bottom of the first?
>
> You will see it from tomorow at http://www.macedonia-hotels.gr
>
>
> Thanks again!
>
>
>
>
>
> Makis
>
>
> > -----Original Message-----
> > From: Sqlcoders.com Programming Dept [mailto:coders
sqlcoders.com]
> > Sent: Tuesday, May 21, 2002 4:57 AM
> > To: savaidis
> > Subject: Re: [PHP] refresh (part of) a page?
> >
> >
> > Hi there!,
> > You cannot refresh part of a single page,
> > you would have to resend the entire page.
> >
> > There is another option which you could use, this will work on IE5+ and
> > NS6+:
> > An inline frame would allow you to update the page within it's
> > boundary, so
> > in other words you could have a page which has an <iframe
> > src="partWhichWillRefresh.php" width=400 height=200></iframe>
> > tag, then you
> > would need a page called partWhichWillRefresh.php which contains
> > the content
> > you want to refresh,
> > inside partWhichWillRefresh.php, add whatever content you want to
refresh,
> > and the following JavaScript to accomplish the refresh:
> >
> > <script language="JavaScript">
> > x = setTimeout(reloadme,5000); //the 5000 means 5 seconds, 60
> > seconds would
> > be 60000, etc.
> >
> > function reloadme(){
> > document.location.href = 'partWhichWillRefresh.php?rnd=0393'; //the
> > rnd=0394 is simply to stop most caching.
> > }
> > </script>
> >
> > HTH,
> > Dw
> >
> > ----- Original Message -----
> > From: "savaidis" <savaidis
hol.gr>
> > To: <php-general
lists.php.net>
> > Sent: May 20 2002 01:39 AM
> > Subject: RE: [PHP] refresh (part of) a page?
> >
> >
> > > I look and I search everything, it looks I'm reaching to a wall :)
> > > I used Netscape, I uploaded to my internet server, still the same.
> > > Plus, I cannot find "header already send" at manual.
> > >
> > > The error message is :
> > > Warning: Cannot add header information - headers already sent by
(output
> > > started at /mpla-mpla/main.php:41) in /mpla-mpla /main.php on line 83
> > >
> > > Note that I use "header()" without problem on another php script on
the
> > same
> > > server.(to redirect from a "parcked" domain)
> > >
> > > Someone could help?
> > >
> > > Thanks
> > >
> > > Makis
> > >
> > > > -----Original Message-----
> > > > From: Jason Wong [mailto:php-general
gremlins.com.hk]
> > > > Sent: Sunday, May 19, 2002 3:35 PM
> > > > To: php-general
lists.php.net
> > > > Subject: Re: [PHP] refresh (part of) a page?
> > > >
> > > >
> > > > On Sunday 19 May 2002 18:03, savaidis wrote:
> > > > > I want to refrech a part of my page (or the whole page) using PHP.
> > > > > Periodically, using a time delay.
> > > > > Should I use frames?
> > > >
> > > > You cannot refresh part of a page without resending the whole
> > > > page. You can
> > > > use frames.
> > > >
> > > > > Also I tried to use "header (...)" calling the same page with
> > different
> > > > > name (and then back to the same page) but I got the warning:
> > > > > "header already send".
> > > >
> > > > *Read* the manual and see what it says about header() and "header
> > already
> > > > send".
> > > >
> > > > --
> > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > > > Open Source Software Systems Integrators
> > > > * Web Design & Hosting * Internet & Intranet Applications
> > Development *
> > > >
> > > > /*
> > > > A great many people think they are thinking when they are merely
> > > > rearranging their prejudices.
> > > > -- William James
> > > > */
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
>
attached mail follows:
I am using gmdate to get the GMT timezone and it's working but how does it know what timezone my server is to make the time adjustment? Where's the setting for this?
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
attached mail follows:
On Mon, 20 May 2002, SP wrote: > I am using gmdate to get the GMT timezone and it's working but how does > it know what timezone my server is to make the time adjustment? > Where's the setting for this?
In your server's configuration files somewhere. Nothing to do with PHP.
miguel
attached mail follows:
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
attached mail follows:
Hi All,
I am getting some error like this: "Fatal error: Call to undefined function: sybase_pconnect() in /home/httpd/php/db_sybase.inc on line 47"
Please tell me its solution.
Regards, Vivek
attached mail follows:
Create a function called sybase_pconnect(). That is the soluction.
At 05:11 PM 5/20/02 +0530, Vivek Kumar Agrawal wrote: >Hi All, > >I am getting some error like this: > "Fatal error: Call to undefined function: sybase_pconnect() in > /home/httpd/php/db_sybase.inc on line 47" > >Please tell me its solution. > >Regards, >Vivek
Patrick Laverty CIS Web Specialist Brown University (401) 863-9267
attached mail follows:
On Monday 20 May 2002 23:56, Patrick Laverty wrote: > Create a function called sybase_pconnect(). That is the soluction.
I doubt it.
> At 05:11 PM 5/20/02 +0530, Vivek Kumar Agrawal wrote: > >Hi All, > > > >I am getting some error like this: > > "Fatal error: Call to undefined function: sybase_pconnect() in > > /home/httpd/php/db_sybase.inc on line 47" > > > >Please tell me its solution.
Recompile PHP to include support for the sybase functions.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The farther you go, the less you know. -- Lao Tsu, "Tao Te Ching" */
attached mail follows:
[snip] I do believe it is a MySql question!!
What's wrong with the old standard way as:
$result = mysql_query(" SELECT *, if (last_name is NULL,'zzz end',last_name) as last_name_sort FROM new_miatapix ORDER BY last_name_sort LIMIT $page, 20");
$result = mysql_query("SELECT * FROM new_miatapix ORDER BY last_name LIMIT $page, 20"); [/snip]
And then there is the very old standard;
SELECT * FROM new_miatapix ORDER BY last_name DESC LIMIT $page 20
HTH!
Jay
attached mail follows:
Hello,
On 05/20/2002 01:42 AM, CDitty wrote: > I get this error and the program code outputted to the screen. > > Failed loading /usr/local/Zend/lib/ZendOptimiser.so: > /usr/local/Zend/lib/ZendOptimiser.so: cannot open shared object file: No > such file or directory > > I just looked in that directory and there is a ZendOptimizer.so file. I > copied it to ZendOptimiser.so and ran it again. No error, but still > getting the code output.
I think the script runs ok but the actual message that is sent from the script is not accepted or gets stuck somewhere.
PHP mail() implementation s*cks in many ways because you do not get much feedback from it to sort out any errors.
If you don't see anything else in the logs, maybe you need to use some SMTP sending client PHP component where you can see the dialog with the server to figure why it is probably being rejected or otherwise not delivered.
Regards, Manuel Lemos
> At 11:17 PM 5/19/2002, you wrote:
>
>> On 05/20/2002 12:38 AM, Cditty wrote:
>>
>>> Hello all. I am trying to write a small program that will run
>>> everytime an email is received at a certain mailbox on my sever. I
>>> had this running at one time, but for some reason, it will not run.
>>> I am not getting any errors and I can't figure out what is going on.
>>> Below is the code that I am trying to run.
>>> #!/usr/bin/php -q
>>> ### CHANGE VALUES OF THE FOLLOWING VARIABLES ###
>>> $to = "webmaster
redhotsweeps.com";
>>> $subj = "message";
>>> $hdrs = "From: webmaster
redhotsweeps.com\n";
>>> $msg = "This is going out";
>>> mail($to, $subj, $msg, $hdrs);
>>> This is what is returned in the maillog file.
>>> May 19 22:29:07 server1 sendmail[3502]: WAA03501:
>>> to="|/path/to/file/imap.php", delay=00:00:00, xdelay=00:00:00,
>>> mailer=prog, stat=Sent
>>> Can anyone point me in the right direction? The script has been
>>> chmod 755.
>>
>>
>> What happens when you do /usr/bin/php -q /path/to/file/imap.php ?
--Regards, Manuel Lemos
attached mail follows:
Hello,
On 05/20/2002 09:00 AM, CDitty wrote: > When I run /usr/bin/php -q /path/to/file/imap.php, is it supposed to run > the program or output the actual program code to the screen? When I run > it, it is showing the actual program code, not the program output.
Oh, of course, silly me that did not notice that you did not enclose your script code between <?php and ?> like ALL PHP scripts! :-)
--Regards, Manuel Lemos
attached mail follows:
Hello
Can anyone point to an PHP example ( code )of searching a dBase Db. I know dBase is horrible, but thats the brief.
Thanks.
attached mail follows:
the following code represents an ineloquent way of capturing data from multiple form fields. currently, i am capturing the data from 4 fields(e.g. ."Choice 1: ".$line1."\n") i could have up to 222 inputs when this is completed.
what might be a better way of doing this instead of hardcoding 222 different variables? using and array? i want to be able to send this information as part of the $bid_information variable. i will eventually write this info. to a database, but for now, baby steps.
<? $name=trim($name); $employee_id=trim($employee_id); $month=($month); $aircraft=($aircraft); $position=($position); $bid_position=trim($bid_position); $revision=trim($revision);
$line1=trim($line1); $line2=trim($line2); $line3=trim($line3); $line4=trim($line4);
$contact= "me"; // person to contact for assistance
$toaddress = "me
foo.com"; // the default value
$fromaddress = "From: webmaster
foo.com";
$subject = "Online Bidding";
$bid_information = "Name: ".$name."\n" // all the information from the line_bid_sheet form. ."Employee ID: ".$employee_id."\n" ."Month: ".$month."\n" ."Aircraft: ".$aircraft."\n" ."Position: ".$position."\n" ."Bid Position: ".$bid_position."\n" ."Revision: ".$revision."\n\n" ."Choice 1: ".$line1."\n" ."Choice 2: ".$line2."\n" ."Choice 3: ".$line3."\n" ."Choice 4: ".$line4."\n";
mail($toaddress, $subject, $bid_information, $fromaddress);
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop
Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
attached mail follows:
Hi! My opinion is that you should skip the array step and jump to database implementation - it's a slightly different approach and you'd have to change most of the array code...
Bogdan
regnivon
netscape.net wrote:
>the following code represents an ineloquent way of capturing data from multiple form fields. currently, i am capturing the data from 4 fields(e.g. ."Choice 1: ".$line1."\n") i could have up to 222 inputs when this is completed.
>
>what might be a better way of doing this instead of hardcoding 222 different variables? using and array? i want to be able to send this information as part of the $bid_information variable. i will eventually write this info. to a database, but for now, baby steps.
>
><?
> $name=trim($name);
> $employee_id=trim($employee_id);
> $month=($month);
> $aircraft=($aircraft);
> $position=($position);
> $bid_position=trim($bid_position);
> $revision=trim($revision);
>
> $line1=trim($line1);
> $line2=trim($line2);
> $line3=trim($line3);
> $line4=trim($line4);
>
> $contact= "me"; // person to contact for assistance
>
> $toaddress = "me
foo.com"; // the default value
>
> $fromaddress = "From: webmaster
foo.com";
>
> $subject = "Online Bidding";
>
> $bid_information = "Name: ".$name."\n" // all the information from the line_bid_sheet form.
> ."Employee ID: ".$employee_id."\n"
> ."Month: ".$month."\n"
> ."Aircraft: ".$aircraft."\n"
> ."Position: ".$position."\n"
> ."Bid Position: ".$bid_position."\n"
> ."Revision: ".$revision."\n\n"
> ."Choice 1: ".$line1."\n"
> ."Choice 2: ".$line2."\n"
> ."Choice 3: ".$line3."\n"
> ."Choice 4: ".$line4."\n";
>
> mail($toaddress, $subject, $bid_information, $fromaddress);
>
>
>__________________________________________________________________
>Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop
Netscape! http://shopnow.netscape.com/
>
>Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
>
>
attached mail follows:
Is their a way to retrieve the previous month using/altering the code below:
// get the current timestamp into an array $timestamp = time(); $date_time_array = getdate($timestamp); $month = $date_time_array["mon"]; $day = $date_time_array["mday"]; $year = $date_time_array["year"]; $tmonth= $date_time_array["month"];
outputs
5202002 May
i need it to output 4/20/2002 April
Thanks
Randy
attached mail follows:
On Monday 20 May 2002 23:01, Randy Johnson wrote: > Is their a way to retrieve the previous month using/altering the code > below: > > // get the current timestamp into an array > $timestamp = time(); > $date_time_array = getdate($timestamp); > $month = $date_time_array["mon"]; > $day = $date_time_array["mday"]; > $year = $date_time_array["year"]; > $tmonth= $date_time_array["month"]; > > outputs > > 5202002 May > > i need it to output > 4/20/2002 April
strtotime();
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Speaking of purchasing a dog, never buy a watchdog that's on sale. After all, everyone knows a bargain dog never bites! */
attached mail follows:
Hi,
If you want "last month" from the *CURRENT* date + time, then look at something like strtotime('last month'), which may help, generating a time stamp of the same day, time, etc in the previous month.
To format a different time stamp into what you want, consider the date() function in the manual... for starters, it's quicker for the code you have below:
NOTE: untested code :)
<? $timestamp = time(); $formated_date = date('m/d/Y', $timestamp); echo $formated_date; // echos what you already had ?>
however, since we want to have one less month:
<? $timestamp = time(); $month = date('m', $timestamp); $day = date('d', $timestamp); $year = date('Y', $timestamp);
// subtract 1 from $month, unless it's // value is 1, in which case it should be // 12, and the year dropped by 1 as well
if($month == 1) { $month = 12; $year = $year - 1; } else { $month = $month - 1; }
$formatted_date = "{$month}/{$day}/{$year}"; echo $formatted_date;
?>
I have no idea why you want to output "April" in addition to "4", but you can take your $formatted_date, feed it into strtotime(), which gives you the new timestamp. From there, you can get a word month out of the date() function, which gives you the text "April":
<? //.. continued from above code
$new_timestamp = strtotime($formatted_date); $month_t = date('F', $new_timestamp); echo $month_t; ?>
There are prolly better ways to do this, but you can see, if you think about it, and read the manual (just two pages!!!!!!!!!), you'll get what you want.
Justin French
on 21/05/02 1:01 AM, Randy Johnson (php
icecoldgold.com) wrote:
> Is their a way to retrieve the previous month using/altering the code > below: > > // get the current timestamp into an array > $timestamp = time(); > $date_time_array = getdate($timestamp); > $month = $date_time_array["mon"]; > $day = $date_time_array["mday"]; > $year = $date_time_array["year"]; > $tmonth= $date_time_array["month"]; > > outputs > > 5202002 May > > i need it to output > 4/20/2002 April > > > Thanks > > Randy > >
attached mail follows:
I am trying to convert date/times to different timezones using putenv but I am having problems using the right TZ names. I am trying the zones I found here http://fuck.org/~ryan/squirrel/timezone/timezones. php but it seems the only ones that work are EST5EDT, CST6CDT, MST7MDT, PST8PDT and GMT.
OUTPUT =======
May 20 2002 10:46 am Eastern Standard Time May 20 2002 3:46 pm Ame May 20 2002 3:46 pm Ame May 20 2002 10:46 am EST May 20 2002 2:46 pm GMT May 20 2002 3:46 pm Eur May 20 2002 3:46 pm Asi
CODE =====
echo date("F j Y g:i a T"), "<br>";
putenv("TZ=America/Los_Angeles"); echo date("F j Y g:i a T"), "<br>";
putenv("TZ=America/New_York"); echo date("F j Y g:i a T"), "<br>";
putenv("TZ=EST5EDT"); echo date("F j Y g:i a T"), "<br>";
putenv("TZ=GMT"); echo date("F j Y g:i a T"), "<br>";
putenv("TZ=Europe/Paris"); echo date("F j Y g:i a T"), "<br>";
putenv("TZ=Asia/Hong_Kong"); echo date("F j Y g:i a T"), "<br>";
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
attached mail follows:
I think these are system-specific. You'll probably have to check which time zone your machine understands. For instance, on this FreeBSD machine there are hundreds of them in /usr/share/zoneinfo but on other machines there are only a handful.
In short, I believe it's an OS rather than a PHP thing.
miguel
On Mon, 20 May 2002, SP wrote: > I am trying to convert date/times to different > timezones using putenv but I am having problems > using the right TZ names. I am trying the zones I > found here > http://fuck.org/~ryan/squirrel/timezone/timezones. > php but it seems the only ones that work are > EST5EDT, CST6CDT, MST7MDT, PST8PDT and GMT. > > OUTPUT > ======= > > May 20 2002 10:46 am Eastern Standard Time > May 20 2002 3:46 pm Ame > May 20 2002 3:46 pm Ame > May 20 2002 10:46 am EST > May 20 2002 2:46 pm GMT > May 20 2002 3:46 pm Eur > May 20 2002 3:46 pm Asi > > CODE > ===== > > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=America/Los_Angeles"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=America/New_York"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=EST5EDT"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=GMT"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=Europe/Paris"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=Asia/Hong_Kong"); > echo date("F j Y g:i a T"), "<br>"; > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system > (http://www.grisoft.com). > Version: 6.0.361 / Virus Database: 199 - Release > Date: 07/05/02 > > >
attached mail follows:
hi miguel
i'm testing on a windows so not sure where the timezone info would be but what you are saying that if i port my app to a unix box then it would be easy to just add the missing timezones in /usr/share/zoneinfo, right? if that's the case then i could just test with pacific, eastern and mountain time for now.
also, do you know if i store all my dates as GMT then when i convert to different timezones using putenv, will this take into account the daylight savings?
-----Original Message-----
From: Miguel Cruz [mailto:mnc
stoic.net]
Sent: May 20, 2002 1:27 PM
To: SP
Cc: php-general
lists.php.net
Subject: Re: [PHP] timezone problem
I think these are system-specific. You'll probably have to check which time zone your machine understands. For instance, on this FreeBSD machine there are hundreds of them in /usr/share/zoneinfo but on other machines there are only a handful.
In short, I believe it's an OS rather than a PHP thing.
miguel
On Mon, 20 May 2002, SP wrote: > I am trying to convert date/times to different > timezones using putenv but I am having problems > using the right TZ names. I am trying the zones I > found here > http://fuck.org/~ryan/squirrel/timezone/timezones. > php but it seems the only ones that work are > EST5EDT, CST6CDT, MST7MDT, PST8PDT and GMT. > > OUTPUT > ======= > > May 20 2002 10:46 am Eastern Standard Time > May 20 2002 3:46 pm Ame > May 20 2002 3:46 pm Ame > May 20 2002 10:46 am EST > May 20 2002 2:46 pm GMT > May 20 2002 3:46 pm Eur > May 20 2002 3:46 pm Asi > > CODE > ===== > > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=America/Los_Angeles"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=America/New_York"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=EST5EDT"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=GMT"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=Europe/Paris"); > echo date("F j Y g:i a T"), "<br>"; > > putenv("TZ=Asia/Hong_Kong"); > echo date("F j Y g:i a T"), "<br>"; > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system > (http://www.grisoft.com). > Version: 6.0.361 / Virus Database: 199 - Release > Date: 07/05/02 > > >
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.361 / Virus Database: 199 - Release Date: 07/05/02
attached mail follows:
On Mon, 20 May 2002, SP wrote: > i'm testing on a windows so not sure where the timezone info would be > but what you are saying that if i port my app to a unix box then it > would be easy to just add the missing timezones in /usr/share/zoneinfo, > right? if that's the case then i could just test with pacific, eastern > and mountain time for now.
I'm not sure about the file format for those time zones - it seems to be some weird binary format. But hopefully your server will have a full complement available.
> also, do you know if i store all my dates as GMT then when i convert to > different timezones using putenv, will this take into account the > daylight savings?
Yup.
miguel
attached mail follows:
Just for confirmation:
Linux Mandrake 8.1, PHP 4.0.6, PIII 600MHz, using Jason's code:
- Original code via HTTP: 1st attempt 3.4497429132462 3.1789749860764 [7.85% faster with bit op's]
2nd attempt (reload) 3.3336659669876 3.1573359966278 [5.29% faster with bit op's]
- Original code from the command line:
[bogdan
localhost bogdan]$ php -q ../httpd/mul.php
3.2482839822769
3.1069300174713
[4.35% faster with bit op's]
[bogdan
localhost bogdan]$ php -q ../httpd/mul.php
3.2525320053101
3.1399850845337
[3.46% faster with bit op's]
- Same code, but with $j*4 and $j<<2:
[bogdan
localhost bogdan]$ php -q ../httpd/mul.php
3.23199903965
[3.0816890001297]
4.65% faster with bit op's
- Same code with $j*256 and $j<<8:
[bogdan
localhost bogdan]$ php -q ../httpd/mul.php
3.2386699914932
3.0807039737701
[4.88% faster with bit op's]
- Original code (*2 and <<1), but also added $q=$p/2; and $q=$p>>1;
respectively in the two loops:
[bogdan
localhost bogdan]$ php -q ../httpd/mul.php
4.6924660205841
4.4853490591049
[4.41% faster with bit op's]
Switching the loops (making the bit op's loop first and the multiplication loop second) doesn't change the results.
Bogdan
Jason Wong wrote:
>On Monday 20 May 2002 12:03, Martin Towell wrote:
>
>>I was doing some timing of a function on the weekend and in one of the
>>loops, I had to multiply a variable by 2 - easy enough - $i*2
>>
>>but then I remembered that in C, it's quicker to do a left shift - so $i<<1
>>
>>but this actually took longer to execute in php than the $i*2 - can anyone
>>confirm my test? I iterated ~28,000 times. Each time, there was 2 places
>>where I was doing the left shift. The time (including all the other stuff I
>>was doing in the function) for $i*2 was ~12secs, and $i<<1 was ~19secs.
>>
>>I am running PHP4.0.6 (download cgi version from php.net) on a win98 system
>>(500MHz Celeron if that changes anything)
>>
>
>My tests don't show much difference, shifting is slightly faster.
>
><?php
> ini_set('max_execution_time', 600);
> function gettime() {
> list($usec, $sec) = explode(" ", microtime());
> return ((float)$usec + (float)$sec);
> }
> $start=gettime();
> $j = 24;
> for($i = 1; $i <= 1000000; $i++) {
> $p = $j * 2; #echo $p;
> }
> $end=gettime();
> echo $end - $start, "\n";
> $start=gettime();
> $j = 24;
> for($i = 1; $i <= 1000000; $i++) {
> $p = $j << 1; #echo $p;
> }
> $end=gettime();
> echo $end - $start, "\n";
>?>
>
>Results
>=======
>
>[jason
x27 jason]$ php -q doo.php
>7.4377170801163
>7.2966409921646
>[jason
x27 jason]$ php -q doo.php
>7.4303779602051
>7.2926670312881
>
>
attached mail follows:
Hi, i want to use a cookie to set a skin for a site but when i go to the site when there is no cookie set then it will display no images background colors ect... So what i need to do is have a command that will set other images background ect. as default if there is no cookie there. How can i acheave this.
(The cookie gets set when the user selects the skin that they want not when they enter the site)
Please some one help me out with this. Thanks.
Darren
attached mail follows:
Johannes Tyra <info
braindata.de> wrote:
> $startDate['Jungfrau'] = mktime (0, 0, 0, 08, 24,
> 2000);
> $startDate['Waage'] = mktime (0, 0, 0, 09, 24,
> 2000);
>
> but with 'Jungfrau' AND 'Waage' something is wrong!!
numbers with a leading zero are in octal format, and '8' and '9' are not valid octal digits.
jim
attached mail follows:
> $startDate['Jungfrau'] = mktime (0, 0, 0, 08, 24, 2000); > $startDate['Waage'] = mktime (0, 0, 0, 09, 24, 2000);
Replace 08 and 09 with 8 and 9 respectivly and you will have the effect you desire.
-- Dan Hardiker [dhardikerstaff.firstcreative.net] ADAM Software & Systems Engineer
attached mail follows:
08 and 09 are not real numbers. Any number starting with a 0 is an octal number which means you can only use digits 0-7
Drop the leading 0 and everything will work.
-Rasmus
On Mon, 20 May 2002, Johannes Tyra [BrainData] wrote:
> Hi, > > I want to read out the asterisk from a birthdate. > > First off all I need the timestamp: > > $startDate['Steinbock'] = mktime (0, 0, 0, 12, 22, > 1999); > $startDate['Wassermann'] = mktime (0, 0, 0, 01, 21, > 2000); > $startDate['Fisch'] = mktime (0, 0, 0, 02, 21, > 2000); > $startDate['Widder'] = mktime (0, 0, 0, 03, 21, > 2000); > $startDate['Stier'] = mktime (0, 0, 0, 04, 21, > 2000); > $startDate['Zwilling'] = mktime (0, 0, 0, 05, 21, > 2000); > $startDate['Krebs'] = mktime (0, 0, 0, 06, 22, > 2000); > $startDate['Löwe'] = mktime (0, 0, 0, 07, 23, > 2000); > $startDate['Jungfrau'] = mktime (0, 0, 0, 08, 24, > 2000); > $startDate['Waage'] = mktime (0, 0, 0, 09, 24, > 2000); > $startDate['Skorpion'] = mktime (0, 0, 0, 10, 24, > 2000); > $startDate['Schütze'] = mktime (0, 0, 0, 11, 23, > 2000); > $startDate['Steinbock2'] = mktime (0, 0, 0, 12, 22, > 2000); > > but with 'Jungfrau' AND 'Waage' something is wrong!! > > if I want to debug this lines with: > > echo date("m - Y",$startDate['Steinbock'])."<BR>"; > echo date("m - Y",$startDate['Wassermann'])."<BR>"; > echo date("m - Y",$startDate['Fisch'])."<BR>"; > echo date("m - Y",$startDate['Widder'])."<BR>"; > echo date("m - Y",$startDate['Stier'])."<BR>"; > echo date("m - Y",$startDate['Zwilling'])."<BR>"; > echo date("m - Y",$startDate['Krebs'])."<BR>"; > echo date("m - Y",$startDate['Löwe'])."<BR>"; > echo date("m - Y",$startDate['Jungfrau'])."<BR>"; > echo date("m - Y",$startDate['Waage'])."<BR>"; > echo date("m - Y",$startDate['Skorpion'])."<BR>"; > echo date("m - Y",$startDate['Schütze'])."<BR>"; > echo date("m - Y",$startDate['Steinbock2'])."<BR>"; > > to read out the month and year of the asterisks PHP returns: > > 12 - 1999 > 01 - 2000 > 02 - 2000 > 03 - 2000 > 04 - 2000 > 05 - 2000 > 06 - 2000 > 07 - 2000 > 12 - 1999 <<<< error > 12 - 1999 <<<< error > 10 - 2000 > 11 - 2000 > 12 - 2000 > > all other asterisks are ok... > > Does anyone know how to fix it?? > Or is it a bug?? > Anyone knows a better idea to get the asterisk from a given date??? > > Thanx... > > -- > Mit freundlichem Gruß, > Johannes Tyra > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi, i want to use a cookie to set a skin for a site but when i go to the site when there is no cookie set then it will display no images background colors ect... So what i need to do is have a command that will set other images background ect. as default if there is no cookie there. How can i acheave this.
(The cookie gets set when the user selects the skin that they want not when they enter the site)
Please some one help me out with this. Thanks.
Darren
attached mail follows:
[snip] Hi, i want to use a cookie to set a skin for a site but when i go to the site when there is no cookie set then it will display no images background colors ect... So what i need to do is have a command that will set other images background ect. as default if there is no cookie there. How can i acheave this. [/snip]
check for cookie if no cookie exists use defaults, else use information from cookie to set skin.
Jay
"We are all apparently 'net' literate, why don't we use it to get the information we need? After all, isn't that what a Google search is all about?"
"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime."
attached mail follows:
On Mon, 20 May 2002, Darren Edwards wrote: > Hi, i want to use a cookie to set a skin for a site but when i go to the > site when there is no cookie set then it will display no images background > colors ect... So what i need to do is have a command that will set other > images background ect. as default if there is no cookie there. How can i > acheave this.
if ($cookie_was_set) { // set images and background based on cookie contents } else { // set default images and background }
Surely there's some more challenging aspect to your query but I'm at a loss as to what it is.
miguel
attached mail follows:
[ by the way Darren, your email address doesn't work ]
On Mon, 20 May 2002, Darren wrote: > Ok what i mean is this if the $skin cookie is not present then what can i > add to this so that it has a default value with the color #000000 > > if($skin=="default") { $skin="#6e6e6e"; }; > if($skin=="red") { $skin="#FFFFFF"; };
switch($_COOKIE['skin']) { case 'red': $framecolor = '#ffffff'; $backgroundcolor = '#e6ffd8'; break; case 'blue': $framecolor = '#666666'; $backgroundcolor = '#aa2231'; break: default: $framecolor = '#000000'; $backgroundcolor = '#99cc99'; }
attached mail follows:
('binary' encoding is not supported, stored as-is) > Has anyone heard of the problem with MSIE 6? If this is a > known problem; I'll have to perform some browser check to make > sure I can gzip to that MSIE > version 6 build (whatever) -- kind of a hassle. > > I just did a search on Technet, and could find no mention of it.
I've experinced similar results with the version of MSIE6 that comes with visual studio.net, I was running horde for IMP (mail) and Chora (cvs) apps. The tables kept getting chopped, view source showed the document was not complete (missing the last bunch of tags)... NN6 was no problem, I turned off gzip compression (horde defaults to on) and the problem went away.
-GED
attached mail follows:
('binary' encoding is not supported, stored as-is) > Has anyone heard of the problem with MSIE 6? If this is a > known problem; I'll have to perform some browser check to make > sure I can gzip to that MSIE > version 6 build (whatever) -- kind of a hassle. > > I just did a search on Technet, and could find no mention of it.
I've experinced similar results with the version of MSIE6 that comes with visual studio.net, I was running horde for IMP (mail) and Chora (cvs) apps. The tables kept getting chopped, view source showed the document was not complete (missing the last bunch of tags)... NN6 was no problem, I turned off gzip compression (horde defaults to on) and the problem went away.
-GED
attached mail follows:
I appreciate all the replies to my question before about this. And also to the person who asked the question later in the day!
What I'm looking for is a database neutral, comprehensive way to do escaping.
First of all, though, will a php string hold binary data with the value of 0x00 at multiple locations and NOT self terminate on the first occurrence of it? In short, are php strings null terminated, or count terminated like pascal and ada?
1/ If PHP strings are count terminated, as per above, then escaping 0x00 is necessary and functional. Probably a '\' character would be appropriate.
2/ obviously, the <'> character should be escaped, but I want it escaped with another <'>.
3/ I'm not sure if a <"> needs to be quoted in the data that goes into a database. Does it? How should it be escaped, '\'?
4/ The page on <add_slashes()> has some comment about escaping '_', '%' chars. I seem to remember that ANSI standard escape for the '%' is another one. What is the reason for escaping the '_' char and how is it done?
--If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/
attached mail follows:
A key to understanding your mysql errors is by using the mysql_error() function. It's wonderful! Here's a simple example with a little error checking:
<?php error_reporting(E_ALL);
$conn = mysql_connect('host','user','pass');
if (!$conn) { print "Could not connect to mysql : " . mysql_error(); exit; }
mysql_select_db('dbname');
$sql = "SELECT foo,bar FROM blah";
$result = mysql_query($sql);
// mysql_query returns false on failure. if (!$result) { print "Could not query DB ($sql) : " . mysql_error(); exit; }
while($row = mysql_fetch_assoc($result)) {
extract($row);
print "Hello $foo, I like $bar too\n"; }
?>
Regards, Philip Olson
On Sun, 19 May 2002, Justin Latham wrote:
> I am trying to clone my webserver because I am switching ISPs. So I copied > the MySQL database, and then I copied the php pages. But my new server > insists that any query I do is not a valid result resource when I try to use > it in a mysql_fetch_array command. I know that both php and the database > are functional (to an extent) because all other commands work. > I'm using PHP 4.something over MySQL 3.2.3 running RedHat 7.0. > Thanks > > Justin > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hiya, me again :-)
Is it possible to expire certain session data, while still keeping the session itself in tact?
Example...
$_SESSION['AlwaysTrue'] = "True"; $_SESSION['ExpireThis'] = "10:20:00";
At 10:19:50 the session is registered. AlwaysTrue must remain True for as long as the session itself is true (as specified in the documentation - this would be until the browser is closed, or after a certain amount of inactive time).
However, at 10:20:00 (10 seconds later), I want the ExpireThis value of the session, to be destroyed, without having to de-register the entire session (this would then also destroy the AlwaysTrue value...
Am I right in presuming this cannot be done, and I'll have to come up with my own little function to do this with? If so, how can I see at what time a session variable was written, or would I need to register the time that the session variable was set to the session as well? For instance....
$_SESSION['AlwaysTrue'] = "True"; $_SESSION['ExpireThis'] = "10:20:00"; $_SESSION['ExpireThisTime'] = "10:19:50";
Then, just do a comparison, and if ExpireThisTime is past 10:20:00, then just delete that one variable...
There's no easier / better way to do this ??
Basically, I'm needing something like this to bring down the number of possible database queries. I have a application which will have new information in a database, every 75 seconds. The queries are performed on every single page that a user is logged in to on a site. To make sure that the same queries is not issued over and over on the database, I want to implement some sort of caching where I will only need to do another query after the database received new information (every 75 seconds). It's all numbers (integers), so I was thinking.... It may well work if I can save these values to session data, and then just "refresh" the session data every 75 seconds.... The problem is, there's lots of other information saved to the session as well, which I cannot afford to loose with a possible session_destroy()......
-- me
attached mail follows:
What about something like this: (un-tested, just off the top of my head) It'll set a cookie the first time a user gets to the page, and will then only re-load data every 75+ seconds (from the time the user first loads data) -- and only updates the cookie when data is re-loaded
if (date("U") > ($cookie_load+75)) { print "fetch from DB"; SetCookie("cookie_load", date("U")); } else { print "Loaded ($cookie_load), now ". date("U") ." -- NOT fetching\n"; }
if (!$cookie_load) SetCookie("cookie_load", date("U"));
--- Scott Hurring Systems Programmer EAC Corporation ScottHeac.com Voice: 201-462-2149 Fax: 201-288-1515
> -----Original Message----- > From: Chris Knipe [mailto:savage
savage.za.org] > Sent: Monday, May 20, 2002 3:15 AM > To: php-general
lists.php.net > Subject: [PHP] Expiring certain session data while keeping the session > itself > > > Hiya, me again :-) > > Is it possible to expire certain session data, while still keeping the > session itself in tact? > > Example... > > $_SESSION['AlwaysTrue'] = "True"; > $_SESSION['ExpireThis'] = "10:20:00"; > > At 10:19:50 the session is registered. AlwaysTrue must > remain True for as > long as the session itself is true (as specified in the > documentation - this > would be until the browser is closed, or after a certain > amount of inactive > time). > > However, at 10:20:00 (10 seconds later), I want the > ExpireThis value of the > session, to be destroyed, without having to de-register the > entire session > (this would then also destroy the AlwaysTrue value... > > Am I right in presuming this cannot be done, and I'll have to > come up with > my own little function to do this with? If so, how can I see > at what time a > session variable was written, or would I need to register the > time that the > session variable was set to the session as well? For instance.... > > $_SESSION['AlwaysTrue'] = "True"; > $_SESSION['ExpireThis'] = "10:20:00"; > $_SESSION['ExpireThisTime'] = "10:19:50"; > > Then, just do a comparison, and if ExpireThisTime is past > 10:20:00, then > just delete that one variable... > > There's no easier / better way to do this ?? > > Basically, I'm needing something like this to bring down the number of > possible database queries. I have a application which will have new > information in a database, every 75 seconds. The queries are > performed on > every single page that a user is logged in to on a site. To > make sure that > the same queries is not issued over and over on the database, > I want to > implement some sort of caching where I will only need to do > another query > after the database received new information (every 75 > seconds). It's all > numbers (integers), so I was thinking.... It may well work if > I can save > these values to session data, and then just "refresh" the > session data every > 75 seconds.... The problem is, there's lots of other > information saved to > the session as well, which I cannot afford to loose with a possible > session_destroy()...... > > -- > me > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I know I'm not doing this right, but ..
What I want to do is display the value of $q1 through $q3. How? I can't get eval() to do it, can I?
for ($i = 1; $i <= 3; $i++) { $x= eval ("\$q".$i); echo"<b>$x</b>\n"; echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; }
John
attached mail follows:
On Mon, 20 May 2002, jtjohnston wrote: > I know I'm not doing this right, but .. > > What I want to do is display the value of $q1 through $q3. > How? I can't get eval() to do it, can I? > > for ($i = 1; $i <= 3; $i++) > { > $x= eval ("\$q".$i); > echo"<b>$x</b>\n"; > echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; > }
eval() is for running code, not parsing strings.
Try something like:
for ($i = 1; $i <= 3; $i++) { $var = "q$i"; print "<br><input type='hidden' name='{$$var}'>\n"; }
Or use arrays.
miguel
attached mail follows:
for ($i = 1; $i <= 3; $i++) { $x= "$q$i"; $val=$$x; echo"<b>$val</b>\n"; echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; }
jtjohnston wrote:
>I know I'm not doing this right, but .. > >What I want to do is display the value of $q1 through $q3. >How? I can't get eval() to do it, can I? > >for ($i = 1; $i <= 3; $i++) >{ >$x= eval ("\$q".$i); >echo"<b>$x</b>\n"; >echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; >} > >John > >
attached mail follows:
Sorry, please change line 2 with $x="q$i".
Bogdan
Bogdan Stancescu wrote:
> for ($i = 1; $i <= 3; $i++) { > $x= "$q$i"; > $val=$$x; > echo"<b>$val</b>\n"; > echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; > } > > > > jtjohnston wrote: > >> I know I'm not doing this right, but .. >> >> What I want to do is display the value of $q1 through $q3. >> How? I can't get eval() to do it, can I? >> >> for ($i = 1; $i <= 3; $i++) >> { >> $x= eval ("\$q".$i); >> echo"<b>$x</b>\n"; >> echo"<br><input type=\"hidden\" name=\"a".$i."\" value=\"\">\n"; >> } >> >> John >> >> > > > >
attached mail follows:
This is well-documented. Right out of the set_time_limit() docs:
Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), the sleep() function, database queries, etc. is not included when determining the maximum time that the script has been running.
Like anything else, you need to check user input. There are all sorts of malicious things that can happen if you use user-data incorrectly.
-Rasmus
On Sat, 18 May 2002, Jason Caldwell wrote:
> Dunno if this has been mentioned or fixed in the latest release (I'm using > PHP version 4.1.1) -- but, a script will not timeout until the sleep() > function has finished it's duration -- for example: > > In my script, if I set "set_time_limit(30)" -- then later in the script I > call a "sleep(45)" -- the script will not timeout until 45 seconds later, > from the point at which the sleep() function was called. > > Now, being a conscious programmer -- I'd probably never set my sleep() > function to exceed my default or defined timeout setting. However, the > sleep value can be set via a $var -- and depending on what functions are > performed -- I can see how, when a programmer wants his script to timeout > within a certain amount of time and then it doesn't; can cause a problem -- > in-fact, I can foree some sort of sleep-attack whereby a malicious hacker > figures out that a particular script on a particular website has a dynamic > $var for the sleep() function -- then s/he writes a script which calls the > page many times --- "injecting" the $var (say for example: > http://www.whateverweb.goo/home.php?t=65536, where $t is the time $var in > the script; sleep($t);" > > Effectively; in this case, the scripts won't timeout for 18 some hours. > Filling up memory fast. > > Just FYI. > Jason > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Windows? Blah. This stuff may very well not work there. No idea.
-Rasmus
On Sat, 18 May 2002, Jason Caldwell wrote:
> It doesn't matter. I'm setting the output *not* to the browser, but to the
> command shell, where I am running the script from. If you look at the
> errors, you'll see 2 of them, one points to line 7, where the IF() command
> is -- the script terminates there...
>
> I've put error_log() and exec() functions in place of the print()
> function -- it doesn't make a difference -- the script just won't execute
> the function in the register_shutdown_function() --
>
> The following script works great (see below) -- it seems that for some
> reason its a TIMEOUT issue (bug).
>
> Running the script below, I will get the output of the print() function --
> as stated, from the command line. I understand that it wouldn't show up in
> the browser.
>
> If I replace the "exit;" command with say a "while(1);" where the script
> will loop indefinitely, the timeout, set by the set_time_limit(1) will stop
> the script, but again -- register_shutdown_function() seems to "want to
> work" as the function IS CALLED, but NEVER executed, and instead errors on
> the 1st line in the FUNCTION -- always on a TIMEOUT.
>
> Run this script from your command line (ie. C:>php test.php) -- then change
> the "set_time_limit(30)" to "set_time_limit(1)", and replace the "exit" with
> a "while(1)" -- run the script again, you'll see what I mean.
>
> And, if you still don't believe me, replace the print() in the function with
> "error_log('Script Terminated', 3, 'errorlog.txt');" and see if the
> "errorlog.txt" file is ever created -- it isn't.
>
> <?
> set_time_limit(30);
> function clean_up()
> {
> print("Script Terminated");
> }
> register_shutdown_function("clean_up");
> exit;
> ?>
>
> If anyone can offer any reason why its doing this, please help -- thanks.
>
> Jason
>
>
>
>
> "Cc Zona" <email
cczona.com> wrote in message
> news:email-95A23B.19072218052002
pb1.pair.com...
> > In article <20020519005201.26095.qmail
pb1.pair.com>,
> > jason
thinkingman.org (Jason Caldwell) wrote:
> >
> > > Here's my code:
> > > ----------------
> > > <?
> > > set_time_limit(1);
> > > function clean_up()
> > > {
> > > if(connection_status() & TIMEOUT)
> > > print("Script timed out.\n");
> > > }
> > > register_shutdown_function("clean_up");
> > > while(1);
> > > ?>
> > >
> > > Here's the message I get: (I should get "Script timed out.")
> >
> > No, you shouldn't/wouldn't, because--as is noted in the docs
> > <http://php.net/register-shutdown-function>--no more output ("print" is
> > specifically mentioned as an example) can be sent to the browser at that
> > stage. Try sending youself an email, or logging to a file instead.
> >
> > --
> > CC
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
What makes you think you can echo something after your script has timed out? Change that print to write something to a file in /tmp and you will see that it works just fine.
-Rasmus
On Sat, 18 May 2002, Jason Caldwell wrote:
> Here's my code:
> ----------------
> <?
> set_time_limit(1);
> function clean_up()
> {
> if(connection_status() & TIMEOUT)
> print("Script timed out.\n");
> }
> register_shutdown_function("clean_up");
> while(1);
> ?>
>
> Here's the message I get: (I should get "Script timed out.")
> -----------------------------------------------------------
> <br>
> <b>Fatal error</b>: Maximum execution time of 1 second exceeded in
> <b>C:\test999.php</b> on line <b>14</b><br
> >
> <br>
> <b>Fatal error</b>: Maximum execution time of 1 second exceeded in
> <b>C:\test999.php</b> on line <b>7</b><br>
> ----------------------------------------------------------
>
>
> "Jason Caldwell" <jason
thinkingman.org> wrote in message
> news:20020518212445.37756.qmail
pb1.pair.com...
> > I'm playing with the register_shutdown_function -- it's seems to work fine
> > if I call exit() within my script -- however, it doesn't seem to work when
> > the script times-out. Anyone know why? It's supposed to work in the
> event
> > of an error, time-out, user-abort, or script-exit.
> >
> > Thanks
> > Jason
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Use a mirror. us2.php.net is quick
We are having some network problems on the main server. A good reminded to everyone to go find your local mirrors and use them instead.
On Sat, 18 May 2002, Jason Caldwell wrote:
> Anyone know why http://www.php.net is soooooooooooo incredibly slow today > (all day) ??? > > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
http://php.he.net/distributions/php-4.2.1-Win32.zip
On Sat, 18 May 2002, Jason Caldwell wrote:
> Is there some place else I can download release 4.2.1 ??? www.php.net is > dead slow, and us2.php.net is taking forever to prompt me for the > download -- I keep getting hit with the "Page Cannot be Displayed" error. > > Looking for the Win32 binary. > > Thanks. > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello Rasmus Lerdorf,
======= At 2002-05-18, 22:45:00 Rasmus Lerdorf wrote: =======
>http://php.he.net/distributions/php-4.2.1-Win32.zip > Why not use a cookie and some type of redirection on php.net, where a user is forced to choose a mirror, and then when they go to php.net, it redirects them to the proper mirror, based on there cookie?
>On Sat, 18 May 2002, Jason Caldwell wrote: > >> Is there some place else I can download release 4.2.1 ??? www.php.net is >> dead slow, and us2.php.net is taking forever to prompt me for the >> download -- I keep getting hit with the "Page Cannot be Displayed" error. >> >> Looking for the Win32 binary. >> >> Thanks. >> Jason >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
= = = = = = = = = = = = = = = = = = = =
Best regards.
Eric Coleman
eric.coleman
zaireweb.com
2002-05-20
attached mail follows:
Is there some var that does this automaticly? I don't really know what to search for on php.net.. :P If there isn't, is there any other way to do this? I know it's possible with asp but I have no plans on using asp :P
Håkan
attached mail follows:
readdir(); search for that and you should find what you need. HTH Jas
"Hawk" <hw2k
barrysworld.com> wrote in message
news:20020520182948.6008.qmail
pb1.pair.com...
> Is there some var that does this automaticly? I don't really know what to
> search for on php.net.. :P
> If there isn't, is there any other way to do this? I know it's possible
with
> asp but I have no plans on using asp :P
>
> Håkan
>
>
attached mail follows:
On Tuesday 21 May 2002 02:24, Hawk wrote: > Is there some var that does this automaticly? I don't really know what to > search for on php.net.. :P > If there isn't, is there any other way to do this? I know it's possible > with asp but I have no plans on using asp :P
Download the manual and look for directory.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* A dead man cannot bite. -- Gnaeus Pompeius (Pompey) */
attached mail follows:
You are resetting $row inside your loop. Don't do that.
On Sun, 19 May 2002, Lee P Reilly wrote:
> Hi, > > I wonder if someone could have a quick look at this for me? It's a > simple while loop, but it's not acting the way (I think) it should. If I > break down the while loop, it reads: > > -------------------------------------------- > // $result contains 3 rows > while($row = mysql_fetch_array($result)) > { > echo " xxx "; > } > -------------------------------------------- > => xxx xxx xxx is displayed (as expected) > > If I add the following code to the loop, it only seems to iterate > through it *once*: > > -------------------------------------------- > while($row = mysql_fetch_array($result)) > { > $pri = $row['pri']; > $fg = $row['fg']; > $molw = $row['molw']; > $density = $row['density']; > $denstype = $row['denstype']; > $pctd = $row['pctd']; > $maxpctd = $row['maxpctd']; > $compid = $row['compid']; > > $sql = "select * from compounds where compid = \"$compid\""; > $result = mysql_query($sql,$conn); > $row = mysql_fetch_array($result); > > $compname = $row['compname']; > $concentration = $row['concentration']; > $concunit = $row['concunit']; > $type = $row['type']; > $composition = $row['composition']; > > if ($fg=="Y") > $html .= "<b>$concentration $concunit $compname</b><br>"; > else if ($pri=="Y") > $html .= "<font color=\"#000066\"> $concentration $concunit > $compname</font><br>"; > else > $html .= " $concentration $concunit $compname<br>"; > } > -------------------------------------------- > > Expected results: > -------------------------------------------- > Actin #2543: Description here. > > 1 mol AEBSF > 1.3 mol Calcium Chloride > 1.4 mol Potassium Chloride > -------------------------------------------- > > Actual results: > -------------------------------------------- > Actin #2543: Description here. > > 1 mol AEBSF > -------------------------------------------- > i.e the last two compounds are not displayed. > > I can't for the life of me see the problem. A new set of eyes looking at > this would be GREATLY appreciated. Thanks very much in advance. > > - Best regards, > > Lee > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Or why not just use include_once() or require_once() ?? That's their purpose.
--- Scott Hurring Systems Programmer EAC Corporation ScottHeac.com Voice: 201-462-2149 Fax: 201-288-1515
> -----Original Message----- > From: Paul Roberts [mailto:roberts_paul
bigfoot.com] > Subject: Re: [PHP] Variable won't work in function, even when I global > it? > > try > > eval("?>$footertext"); > > also take the code out of the function and try it, you may > need to global some more variables. > > Paul Roberts > roberts_paul
bigfoot.com
attached mail follows:
Hello every one:
I'm trying to create XLS files on the fly. I found BiffWriter. Looks great for adding texts and numbers, but not formulas.
Has anyone implemented something about formulas?
Thanks.
attached mail follows:
Can you just write out the formula to a cell? i.e. write the value "=SUM(C1:C5)" to a cell and see if it's evaluated? Just throwing things out...
I would think that you wouldn't need formulas. Isn't that the idea of using PHP to create the Excel document? Have PHP compute the values of the "formulas" and print out the actual value. May not work for your case, though...
---John Holmes...
----- Original Message -----
From: "LeTortorec, Jean-Louis" <JLeTortorec
healthcore.com>
To: <php-general
lists.php.net>
Sent: Monday, May 20, 2002 2:42 PM
Subject: [PHP] PHP & Excel
> Hello every one: > > I'm trying to create XLS files on the fly. > I found BiffWriter. Looks great for adding texts and numbers, but not > formulas. > > Has anyone implemented something about formulas? > > Thanks. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Are you on a Win32 platform?
If so, use COM...
$cell = $sheet->Cells($row,$col); $cell->activate; $cell->formula = "your formula";
--- Scott Hurring Systems Programmer EAC Corporation ScottHeac.com Voice: 201-462-2149 Fax: 201-288-1515
> -----Original Message----- > From: LeTortorec, Jean-Louis [mailto:JLeTortorec
healthcore.com] > Sent: Monday, May 20, 2002 2:42 PM > To: php-general
lists.php.net > Subject: [PHP] PHP & Excel > > > Hello every one: > > I'm trying to create XLS files on the fly. > I found BiffWriter. Looks great for adding texts and numbers, but not > formulas. > > Has anyone implemented something about formulas? > > Thanks. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
> -----Original Message-----
> From: 1LT John W. Holmes [mailto:holmes072000
charter.net]
> Subject: Re: [PHP] PHP & Excel
>
> I would think that you wouldn't need formulas. Isn't that the
> idea of using
> PHP to create the Excel document? Have PHP compute the values of the
> "formulas" and print out the actual value. May not work for your case,
> though...
>
> ---John Holmes...
What if the user opens up the sheet and changes a number after PHP creates it? Wouldn't you want formulas to re-compute the sheet and keep it correct? :)
attached mail follows:
> What if the user opens up the sheet and changes a number > after PHP creates it? Wouldn't you want formulas to > re-compute the sheet and keep it correct? :)
Like I said, it depends on your case. When I create an Excel file, it's a "snapshot" of everything. If you need an updated speadsheet, you go back to the webpage and hit the button again... I don't expect people to be updating the actual excel file.
---John Holmes...
attached mail follows:
Have a look at my post of 17/05/2002, I got a lot of help from there.
Bye, Evan
"Jean-Louis Letortorec" <JLeTortorec
healthcore.com> ha scritto nel
messaggio news:615315231286D21182E40008C7B1EED241EDF7
COMPAQ3000...
> Hello every one:
>
> I'm trying to create XLS files on the fly.
> I found BiffWriter. Looks great for adding texts and numbers, but not
> formulas.
>
> Has anyone implemented something about formulas?
>
> Thanks.
attached mail follows:
Change your die() call to this:
die(mysql_error())
so you can actually see what is going on.
-Rasmus
On Mon, 20 May 2002, Php Developers wrote:
> This command just dies!
>
> I have checked sql connection ... ok
> the insert into line ... ok
>
> Pfft it just don't wanna work
>
>
> <?php
>
> $answers="$band, $middlename, $pot";
> $date=date ("l dS of F Y h:i:s A");
>
> $sql = "INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date')";
>
> echo $sql;
>
> mysql_query($sql) or die ("There has been an error");
>
>
> ?>
>
>
> ## Out put on page ##
>
> INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', 'newmanpj
philipsdomain.com', 'newman', '12 Newman ave Auckland', 'In Season, James, John', 'Monday 20th of May 2002 10:22:05 AM')There has been an error
>
attached mail follows:
I am trying to register an array containing file types, htm, jpg, jpeg, gif
and pdf. I think I am missing something, if someone could look at this and
tell me what I am doing wrong that would be awesome, thanks in advance.
jas
<?php
$types = array(".gif"=>"1",
".jpg"=>"2",
".jpeg"=>"2",
".htm"=>"3",
".pdf"=>"4");
if ($img1_name != "" && eregi('$types', $img1_name)) {
copy("$img1", "/path/to/images/$img1_name") or die ("Could not upload file,
please try again after making sure the file is less than 2mb in size and the
file name correct");
} else {
die("No file selected for upload, or the file was not the correct type.
Please only upload .jpg files.");
}
?>
attached mail follows:
On Mon, May 20, 2002 at 01:26:20PM -0600, Jas wrote:
> $types = array(".gif"=>"1", ... snip ... > > if ($img1_name != "" && eregi('$types', $img1_name)) {
A few things FYI:
* eregi() takes a string as the pattern, not an array.
* you put $types in single quotes, which doesn't get evaluated... double quotes are needed for evaluation... but you don't need to put a single variable in quotes anyway.
* If you want, you can implode the types array into a string which you then use as the pattern. BUT, in your array() statement, you're putting the extension name into the key, rather than the value section, so this wouldn't work unless you change that.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
On Sun, May 19, 2002 at 07:54:45PM -0500, Greg Beaver wrote: > PHPDocumentor is a JavaDoc-like automatic documentation generator for PHP > written in PHP. It is the most versatile tool for documenting PHP. This sounds like the phpdoc tool that php/pear is using already. But what can *WE*, as advocating team, do with this tool?? We're not writing any software or so..
I think this message is better of on the pear-dev and php-dev mailinglist rather than on the evangelism list.
-- With best regards,Dave Mertens, Development Manager dmertens
ism.nl
Innovative Solutions in Media BV Schiekade 101 3033 BG Rotterdam, Netherlands Tel. +31-10-2436060 Fax. +31-10-2436066
attached mail follows:
Hello php-general,
Has anyone else here the same proplem as I have? I write in my php:
header("Refresh: 3; url=newpage.php");
Netscape 4.79 works fine and goes to page.php after 3 seconds pass. But IE 6 doesn't want to do that. Can anyone explain such a wonderful behavior?
-- Best regards, Olexandr mailto:supaboyi.com.ua
attached mail follows:
supaboy
i.com.ua writes:
>Hello php-general,
>
> Has anyone else here the same proplem as I have? I write in my php:
>
>header("Refresh: 3; url=newpage.php");
>
>Netscape 4.79 works fine and goes to page.php after 3 seconds pass.
>But IE 6 doesn't want to do that. Can anyone explain such a wonderful
>behavior?
>
>--
>Best regards,
> Olexandr
try to use this:
echo "<META HTTP-EQUIV='REFRESH' CONTENT='3; URL=newpage.php'>";
I cannot use header either. Perhaps, I run PHP under Wins. However, the above syntax works well with any browser.
Pong
attached mail follows:
Have you tried creating HTML with the equivalent META header?
<HEAD> <META HTTP-EQUIV="refresh" CONTENT="3; URL=newpage.php/"> </HEAD>
Does it work for you?
cheers, thalis
On Mon, 20 May 2002, Olexandr Vynnychenko wrote:
> Hello php-general,
>
> Has anyone else here the same proplem as I have? I write in my php:
>
> header("Refresh: 3; url=newpage.php");
>
> Netscape 4.79 works fine and goes to page.php after 3 seconds pass.
> But IE 6 doesn't want to do that. Can anyone explain such a wonderful
> behavior?
>
> --
> Best regards,
> Olexandr mailto:supaboy
i.com.ua
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello Thalis,
Monday, May 20, 2002, 10:51:57 PM, you wrote:
TAK> Have you tried creating HTML with the equivalent META header?
TAK> <HEAD> TAK> <META HTTP-EQUIV="refresh" CONTENT="3; URL=newpage.php/"> TAK> </HEAD>
TAK> Does it work for you?
TAK> cheers, TAK> thalis
TAK> On Mon, 20 May 2002, Olexandr Vynnychenko wrote:
>> Hello php-general, >> >> Has anyone else here the same proplem as I have? I write in my php: >> >> header("Refresh: 3; url=newpage.php"); >> >> Netscape 4.79 works fine and goes to page.php after 3 seconds pass. >> But IE 6 doesn't want to do that. Can anyone explain such a wonderful >> behavior?
Of course, it works. But I wanted to do it by HTTP headers because I generate HTML from XML thru XSLT, so I don't want to dig in there.
I just wanted to know if it's usual for IE of any version, or it's something wrong with my IE6 on WinXP.
-- Best regards, Olexandr mailto:supaboyi.com.ua
attached mail follows:
Do you really need that 3 second delay? You can use a location header instead...
Bogdan
Olexandr Vynnychenko wrote:
>Hello Thalis, > >Monday, May 20, 2002, 10:51:57 PM, you wrote: > >TAK> Have you tried creating HTML with the equivalent META header? > >TAK> <HEAD> >TAK> <META HTTP-EQUIV="refresh" CONTENT="3; URL=newpage.php/"> >TAK> </HEAD> > >TAK> Does it work for you? > >TAK> cheers, >TAK> thalis > >TAK> On Mon, 20 May 2002, Olexandr Vynnychenko wrote: > >>>Hello php-general, >>> >>> Has anyone else here the same proplem as I have? I write in my php: >>> >>>header("Refresh: 3; url=newpage.php"); >>> >>>Netscape 4.79 works fine and goes to page.php after 3 seconds pass. >>>But IE 6 doesn't want to do that. Can anyone explain such a wonderful >>>behavior? >>> > >Of course, it works. But I wanted to do it by HTTP headers because I >generate HTML from XML thru XSLT, so I don't want to dig in there. > >I just wanted to know if it's usual for IE of any version, or it's >something wrong with my IE6 on WinXP. > >
attached mail follows:
Hello Johan,
Tuesday, May 21, 2002, 2:13:07 AM, you wrote:
JE> I'am admining both a IIS5.1 server and a Apache 2.0.35 server, under WinXP. JE> (say's it all, chaos!) JE> And I've never got the header to work, but location, does the trick, JE> sometimes... I don't know how it works
Sometimes? Do you mean Location sometimes doesn't work?
JE> with XML though... let me know if you figure it out... JE> Good Luck!
-- Best regards, Olexandr mailto:supaboyi.com.ua
attached mail follows:
In the php.ini file I have display_errors = Off, how would I configure the server, or the application to display the errors for specific hosts, the developers?
-- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper
attached mail follows:
if you are running apache you could turn that option on inside of a specific <VirtualHost>...</VirtualHost> block.
Jim Lucas
----- Original Message -----
From: "Jeff Bearer" <jbearer
pittsburghlive.com>
To: <php-general
lists.php.net>
Sent: Monday, May 20, 2002 12:44 PM
Subject: [PHP] display errors for developers only?
> In the php.ini file I have display_errors = Off, how would I configure > the server, or the application to display the errors for specific hosts, > the developers? > > > -- > Jeff Bearer, RHCE > Webmaster > PittsburghLIVE.com > 2002 EPpy Award, Best Online U.S. Newspaper > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hey Jeff:
> In the php.ini file I have display_errors = Off, how would I configure > the server, or the application to display the errors for specific hosts, > the developers?
How about combining a user defined error handler function that tests for various $_SERVER and/or $_HTTP variables, that if correct, allows the output to be displayed.
http://www.php.net/manual/en/function.set-error-handler.php
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
What I'm planning to do is to add the logo of the site over every image uploaded. Here is the code after upload:
$dst_im =
ImageCreateFromJPEG ("../".$pathImg.$NomeFile);
$src_im =
ImageCreateFromJPEG ("../imgsite/logo.jpg");
$dst_size = GetImageSize("../".$pathImg.$NomeFile); //800x600
$src_size = GetImageSize("../imgsite/logo.jpg"); //50x50
ImageCopy( $dst_im, $src_im, 150, 150, 0, 0, 50, 50);
I don't get errors but it happens nothing to the original img ($dst_im). The image logo.jpg is 50x50 and the $dst_img is 800x600.
Thanks for your help, Evan
attached mail follows:
Here is how i fixed the problem:
//Adding logo
$dst_im =
ImageCreateFromJPEG("../".$pathImg.$NomeFile);
$src_im =
ImageCreateFromPNG("../imgsite/logoxmail.png");
$dst_size = GetImageSize("../".$pathImg.$NomeFile);
$src_size = GetImageSize("../imgsite/logoxmail.png");
ImageCopy( $dst_im, $src_im, 0, $dst_size[1] - $src_size[1], 0, 0,
$src_size[0], $src_size[1]);
//*******this makes the difference!!!!!
ImageJPEG($dst_im,"../".$pathImg.$NomeFile);
ImageDestroy($dst_im);
But now I have another question: how to mantain the transparency of the png (src_im)?
Evan
"Evan" <evan80
libero.it> ha scritto nel messaggio
news:20020520202804.16491.qmail
pb1.pair.com...
> What I'm planning to do is to add the logo of the site over every image
> uploaded.
> Here is the code after upload:
>
> $dst_im =
ImageCreateFromJPEG ("../".$pathImg.$NomeFile);
> $src_im =
ImageCreateFromJPEG ("../imgsite/logo.jpg");
> $dst_size = GetImageSize("../".$pathImg.$NomeFile); //800x600
> $src_size = GetImageSize("../imgsite/logo.jpg"); //50x50
> ImageCopy( $dst_im, $src_im, 150, 150, 0, 0, 50, 50);
>
> I don't get errors but it happens nothing to the original img ($dst_im).
> The image logo.jpg is 50x50 and the $dst_img is 800x600.
>
> Thanks for your help,
> Evan
>
>
attached mail follows:
take a look at ImageAlphaBlending()
On Mon, 20 May 2002, Evan wrote:
> Here is how i fixed the problem:
>
> //Adding logo
> $dst_im =
ImageCreateFromJPEG("../".$pathImg.$NomeFile);
> $src_im =
ImageCreateFromPNG("../imgsite/logoxmail.png");
> $dst_size = GetImageSize("../".$pathImg.$NomeFile);
> $src_size = GetImageSize("../imgsite/logoxmail.png");
> ImageCopy( $dst_im, $src_im, 0, $dst_size[1] - $src_size[1], 0, 0,
> $src_size[0], $src_size[1]);
> //*******this makes the difference!!!!!
> ImageJPEG($dst_im,"../".$pathImg.$NomeFile);
> ImageDestroy($dst_im);
>
> But now I have another question:
> how to mantain the transparency of the png (src_im)?
>
> Evan
>
> "Evan" <evan80
libero.it> ha scritto nel messaggio
> news:20020520202804.16491.qmail
pb1.pair.com...
> > What I'm planning to do is to add the logo of the site over every image
> > uploaded.
> > Here is the code after upload:
> >
> > $dst_im =
ImageCreateFromJPEG ("../".$pathImg.$NomeFile);
> > $src_im =
ImageCreateFromJPEG ("../imgsite/logo.jpg");
> > $dst_size = GetImageSize("../".$pathImg.$NomeFile); //800x600
> > $src_size = GetImageSize("../imgsite/logo.jpg"); //50x50
> > ImageCopy( $dst_im, $src_im, 150, 150, 0, 0, 50, 50);
> >
> > I don't get errors but it happens nothing to the original img ($dst_im).
> > The image logo.jpg is 50x50 and the $dst_img is 800x600.
> >
> > Thanks for your help,
> > Evan
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On Sat, May 18, 2002 at 11:45:49AM +0100, Henry wrote:
>
> http://GetResponse.com/k.cgi?a=blahblah&f=henry_Xyteacake.force9.co.uk
> I subscribed using the email address henry
teacake.force9.co.uk
> They appear to have translated the "
" symbol to "_Xy".
> Any guess why? Is there a PHP function that does this translation for me? Is
> it some sort of standard?
That's something they did manually to their own standard. The standard
encoding for
is %40. Why? Beats me. They don't really need to.
Encoding URL's can be done via urlencode() and urldecode().
If you want to do the same thing they're doing, you can use str_replace(): http://www.php.net/manual/en/function.str-replace.php
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
> -----Original Message-----
> From: Analysis & Solutions [mailto:danielc
analysisandsolutions.com]
> Subject: Re: [PHP] Any Ideas "
" becomes "_Xy"
>
> On Sat, May 18, 2002 at 11:45:49AM +0100, Henry wrote:
> >
> >
> http://GetResponse.com/k.cgi?a=blahblah&f=henry_Xyteacake.force9.co.uk
> > I subscribed using the email address henry
teacake.force9.co.uk
> > They appear to have translated the "
" symbol to "_Xy".
> > Any guess why? Is there a PHP function that does this
> translation for me? Is
> > it some sort of standard?
>
> That's something they did manually to their own standard.
> The standard
> encoding for
is %40. Why? Beats me. They don't really need to.
> Encoding URL's can be done via urlencode() and urldecode().
>
> If you want to do the same thing they're doing, you can use
> str_replace(): http://www.php.net/manual/en/function.str-replace.php
>
> Enjoy,
>
> --Dan
Perhaps they did it to thwart "smart" spambots that can
translate "%40" to "
".
--- Scott Hurring Systems Programmer EAC Corporation ScottHeac.com Voice: 201-462-2149 Fax: 201-288-1515
attached mail follows:
Hi:
To be honest, I don't feel like wading through their example to figure out what's wrong. The way they're parsing doesn't seem very efficient to me. Check this tutorial/example out: http://www.analysisandsolutions.com/code/phpxml.htm
Way cleaner and straight ahead.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
On Sun, May 19, 2002 at 12:38:36AM -0500, Miguel Cruz wrote: > On Sat, 18 May 2002, Rafael Perazzo wrote: > > Is there any way to ask the user to type the value of > > a variable from stdin ? (like read in Pascal, or scanf > > in C). I'm using PHP from command line. > > $f = fopen('php://stdin', 'r'); // this line answers your question
Just in case Rafael is asking about how to read items put into the command line, use the $argv array.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
I have an algorithm that I don't want anyone to see; therefore I can't put it in a php file. Is there a way I can create a compiled file containing the algorithm/method that a php file can call? I see information on creating extensions--is this the way to go? If so, it looks like there's php source code for UNIX available. How about Win32?
Bruce
attached mail follows:
Yes, building a small custom extension is the way to go. And the source tree is the same for UNIX and Windows.
On Mon, 20 May 2002, Bruce Miller wrote:
> I have an algorithm that I don't want anyone to see; therefore I can't put > it in a php file. Is there a way I can create a compiled file containing the > algorithm/method that a php file can call? I see information on creating > extensions--is this the way to go? If so, it looks like there's php source > code for UNIX available. How about Win32? > > Bruce > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello,
On 05/20/2002 05:02 PM, Bruce Miller wrote: > I have an algorithm that I don't want anyone to see; therefore I can't put > it in a php file. Is there a way I can create a compiled file containing the > algorithm/method that a php file can call? I see information on creating > extensions--is this the way to go? If so, it looks like there's php source > code for UNIX available. How about Win32?
Yes,
--Regards, Manuel Lemos
attached mail follows:
Hello,
On 05/20/2002 05:02 PM, Bruce Miller wrote: > I have an algorithm that I don't want anyone to see; therefore I can't put > it in a php file. Is there a way I can create a compiled file containing the > algorithm/method that a php file can call? I see information on creating > extensions--is this the way to go? If so, it looks like there's php source > code for UNIX available. How about Win32?
Yes, you can use for instance APC which is a cache extension which in MMAP mode stores compiled code in files in disk the first time the files are executed. Then you may remove the original PHP script files and the compiled files will be used without the source files.
http://apc.communityconnect.com/
--Regards, Manuel Lemos
attached mail follows:
Hi guys: What I need is a php file that will read a text file and show it on a html file. And it will also write to a text file, but at the end of the file. Thanx, Rodrigo de Oliveira Costa.
attached mail follows:
... so open up the text file and read it.
What problem are you having? Are permissions set correctly? Are you making sure to escape "\" on Win?
--- Scott Hurring Systems Programmer EAC Corporation ScottHeac.com Voice: 201-462-2149 Fax: 201-288-1515
> -----Original Message----- > From: Rodrigo [mailto:tagzero
tagzero.com] > Sent: Monday, May 20, 2002 4:57 PM > To: php-general
lists.php.net > Subject: [PHP] Text file > > > Hi guys: > > What I need is a php file that will read a text file and show it on a > html file. > > And it will also write to a text file, but at the end of the file. > > Thanx, Rodrigo de Oliveira Costa. > >
attached mail follows:
On Mon, 20 May 2002, Rodrigo wrote: > What I need is a php file that will read a text file and show it on a > html file. > > And it will also write to a text file, but at the end of the file.
Well, you're in luck; that's all very easy to do.
Are you having a specific problem with some aspect of it?
A good starting point is the PHP manual page for fopen().
miguel
attached mail follows:
/* Opens the file in the current dir and allows read only parimiters to it (R) */ $foo = f