[PHP] Re: Forms and Netscape -- spacing problem -- Help!
form tag in NS (4x - 6x) there is some additional space The form tag is a block level tag, thus white space will be appended after the closing tag. To avoid this, I use a style on the form element. I do this for both IE and Navigator, in different ways, as I've found they seem to react differently to the required CSS. For Navigator, in the style sheet, .form { display: inline; } and in the HTML, form class=form method=post and for IE, in the style sheet, form { display: inline; } and in the HTML, form method=post I prefer using PHP to send the correct style and HTML dependent on the user agent, but you can incorporate the two - in the style sheet, form, .form { display: inline; } and in the HTML, form class=form method=post and IE will ignore the bits it doesn't do, as will Navigator. Hope that helps. Regards James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] generating charts/graphics
Phil Davis has developed HTML_graphs : it draws various html base charts. See his website at http://www.webguys.com/pdavis/programs/html_graphs/ Philippe Mirek Novak [EMAIL PROTECTED] a écrit dans le message news: [EMAIL PROTECTED] Try this http://www.aditus.nu/jpgraph/ M.N. --- Christian Dechery wrote: I'm working on (actually I'm almost finished) on a very nice ad management system. It has a script that generates a very informative report, in HTML. But I wanted something more... like some comparative chart... or pie chart... can anyone give some hints, where can I find info on this? Is this easy to do in PHP? Can I get something already implemented? Some class or something? thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Max int value of char field? How to find...
Hello all, How can I find the highest integer value in a result set like: 1 10 11 2 3 a ab abc I'm looking for the value 11. The statement 'select max(field) from table' gives me 'abc' so this won't do. Any ideas for a SQL statement that will do the trick? I'm using PHP / MySQL. Thanks! Simon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SV: Max int value of char field? How to find...
How about select max(floor(field)) from table ? TK -Opprinnelig melding- Fra: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sendt: 22. oktober 2001 08:44 Til: Php-General (E-mail); MySQL (E-mail) Emne: Max int value of char field? How to find... Hello all, How can I find the highest integer value in a result set like: 1 10 11 2 3 a ab abc I'm looking for the value 11. The statement 'select max(field) from table' gives me 'abc' so this won't do. Any ideas for a SQL statement that will do the trick? I'm using PHP / MySQL. Thanks! Simon. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Update onBlur or onChange
Helo: I¹m working on a form that I¹d like to have a feature that adds your total as items are selected. Currently, I¹ve got some javascript doing the job but it only works in ie, and besides, I¹d rather use php if possible. The current prototype form lives at http://www.seatthole.com/order2.php Can anyone tell me if there¹s a way to update the total at the bottom of the page in realtime as the user makes changes? Thanks... Django
[PHP] Re: Max int value of char field? How to find...
How can I find the highest integer value in a result set like: 1 10 11 2 3 a ab abc If the table isn't huge, you could pull back all the values and try PHP's natsort() function. That will apply a natural sort algorithm, ordering the numbers as you expect, but I'm unsure whether the character values will be higher or lower than the numbers. Regards James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Date-TimeStamp
Original message From: Daniel Harik [EMAIL PROTECTED] Date: Sat, Oct 20, 2001 at 09:10:05AM -0800 Message-ID: [EMAIL PROTECTED] Subject: [PHP] Re:Date-TimeStamp I've tried this code: $timea = explode( ,$timepostsed); $timea1 = explode(-,$timea[0]); $timea2 = explode(:,$timea[1]); $timestamp = mktime($timea2[0],$timea2[1],$timea2[2],$timea1[1],$timea1[2],$timea1[0]); But it return -1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] /Original message Reply Maybe a bit late, but I wasn't at work during the weekend ;) strtotime() works fine for this! /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Update onBlur or onChange
From: KING OGNAJD [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 9:33 AM Subject: [PHP] Update onBlur or onChange Helo: I¹m working on a form that I¹d like to have a feature that adds your total as items are selected. Currently, I¹ve got some javascript doing the job but it only works in ie, and besides, I¹d rather use php if possible. The current prototype form lives at http://www.seatthole.com/order2.php Can anyone tell me if there¹s a way to update the total at the bottom of the page in realtime as the user makes changes? Thanks... Django PHP is a server-side language, which means that it had to be reloaded each time you want to do an update which is not realtime. IMHO that's not that what a user expects because it takes more time to send and reload than to calculate the new price yourself ;-) (as long as you have a poor connection) Two possible solutions: -I think the javascript solution ist the best. I don't see any reason why it doesn't run in Netscape (I didn't look at the code but I know that there is a way to get it work) -Second: Not realtime - total appears after sending it. You can combine this solution with the first to avoid problems with browsers that have JavaScript disabled (I'd recomend that anyway) Regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] unset Cookies
Hello everyone! Is there a way to unset or expire a cookie which was not set by my pages? Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sv: ezmlm response
Will you please stop sending your mail to us immidiately -and we would not accept you can't find our e-mail address in your databse - because how can you send e-mail to us on this e-mail account if you don't have it in your database STOP IT AND DO IT NOW! Regards Frank Mikkelsen - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 11:38 AM Subject: ezmlm response Hi! This is the ezmlm program. I'm managing the [EMAIL PROTECTED] mailing list. I'm working for my owner, who can be reached at [EMAIL PROTECTED] Acknowledgment: The address [EMAIL PROTECTED] was not on the php-general mailing list when I received your request and is not a subscriber of this list. READ THIS ENTIRE MESSAGE TO FIND OUT HOW TO UNSUBSCRIBE YOURSELF IF YOU ARE SUBSCRIBED WITH A DIFFERENT MAILING ADDRESS. If you're subscribed to the digest form of the mailing list, make sure you're sending your unsubscribe request to the -digest-unsubscribe address. If you unsubscribe, but continue to receive mail, you're subscribed under a different address than you currently use. Please look at the header for: 'Return-Path: [EMAIL PROTECTED]' The unsubscribe address for this user would be: '[EMAIL PROTECTED]'. Just mail to that address, substituting user=host.dom for the real values, reply to the confirmation request, and you should receive a message that you're off the list. For some mail programs, you need to make the headers visible to see the return path: For Eudora 4.0, click on the Blah blah ... button. For PMMail, click on Window-Show entire message/header. If this still doesn't work, I'm sorry to say that I can't help you. Please FORWARD a list message together with a note about what you're trying to achieve and a list of addresses that you might be subscribed under to my owner: [EMAIL PROTECTED] who will take care of it. My owner is a little bit slower than I am, so please be patient. --- Administrative commands for the php-general list --- I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: For help and a description of available commands, send a message to: [EMAIL PROTECTED] To subscribe to the list, send a message to: [EMAIL PROTECTED] To remove your address from the list, just send a message to the address in the ``List-Unsubscribe'' header of any list message. If you haven't changed addresses since subscribing, you can also send a message to: [EMAIL PROTECTED] or for the digest to: [EMAIL PROTECTED] For addition or removal of addresses, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction. If you need to get in touch with the human owner of this list, please send a message to: [EMAIL PROTECTED] Please include a FORWARDED list message with ALL HEADERS intact to make it easier to help you. --- Enclosed is a copy of the request I received. Return-Path: [EMAIL PROTECTED] Received: (qmail 84737 invoked from network); 22 Oct 2001 09:38:37 - Received: from unknown (HELO dns1.host2000.dk) (64.39.31.249) by pb1.pair.com with SMTP; 22 Oct 2001 09:38:37 - Received: from fm (62.214.16.111) by SERVER249 (MailMax 4. 7. 1. 4) with ESMTP id 44171560 for [EMAIL PROTECTED]; Mon, 22 Oct 2001 11:53:38 +0200 WDT Message-ID: 008201c15add$b571f060$2904fe0a@fm From: Din Web Udbyder [EMAIL PROTECTED] To: [EMAIL PROTECTED] References: [EMAIL PROTECTED] Subject: Sv: confirm unsubscribe from [EMAIL PROTECTED] Date: Mon, 22 Oct 2001 11:41:20 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 - Original Message -=20 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 11:05 AM Subject: confirm unsubscribe from [EMAIL PROTECTED] Hi! This is the ezmlm program. I'm managing the [EMAIL PROTECTED] mailing list. =20 I'm working for my owner, who can be reached at [EMAIL PROTECTED] =20 To confirm that you would like =20 [EMAIL PROTECTED] =20 removed from the php-general mailing list, please send an empty reply=20 to this address: =20 = [EMAIL PROTECTED]= et =20 Usually, this happens when you just hit the reply button. If this does not work, simply copy the address and paste it into the To: field of a new message. =20 or click here: = mailto:php-general-uc.1003741541.ehpfeaonkmonedcaocai-info=3Ddkwo.dk@list= s.php.net =20 PLEASE NOTE: I haven't checked whether your address is currently on the mailing list. To see what address you used to subscribe, look at the messages you are
[PHP] MessageBox in PHP?
Hi!, How can I make a messagebox in PHP to print errors or warning (such as in VB or VC++)?. Is it possible? Silvia Mahiques
[PHP] Re: MessageBox in PHP?
you can use JavaScript to do that... script alert('your message goes here'); /script embed this in your HTML source code. it is not possible to do so in PHP since it is server side. Silvia Mahiques [EMAIL PROTECTED] wrote in message 005101c15aec$9ccac280$1a9cd29b@tscpc6">news:005101c15aec$9ccac280$1a9cd29b@tscpc6... Hi!, How can I make a messagebox in PHP to print errors or warning (such as in VB or VC++)?. Is it possible? Silvia Mahiques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: MessageBox in PHP?
But you can write javascript code with php like this: if ($err) { echo "htmlbody" echo "script\n"; echo "alert('ERRORR');\n"; echo "/script\n"; echo "/body/html\n"; exit(); } -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 3:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: MessageBox in PHP? you can use JavaScript to do that... script alert('your message goes here'); /script embed this in your HTML source code. it is not possible to do so in PHP since it is server side. "Silvia Mahiques" [EMAIL PROTECTED] wrote in message 005101c15aec$9ccac280$1a9cd29b@tscpc6">news:005101c15aec$9ccac280$1a9cd29b@tscpc6... Hi!, How can I make a messagebox in PHP to print errors or warning (such as in VB or VC++)?. Is it possible? Silvia Mahiques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Thick arc with PHP
try this: ImageSetThickness() Ville Mattila [EMAIL PROTECTED] wrote in message 009801c15a31$e7f56140$0100a8c0@ville">news:009801c15a31$e7f56140$0100a8c0@ville... Hi there, How it would be possible to draw a thich arc with PHP GD? You can see a picture here about thing I mean: http://www.pilotmedia.fi/xfiles/circle.jpg ImageArc -function is just what I need, but it makes all arcs only 1 pixel width. Any ideas? Cheers, - Ville -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Funny thing with variables
What causes this: I have a page getting variable $BackLink with string http://www.domain.com/my_page.php4;. I accidentaly wrote ?=~$BackLink? and what I got out was —‹‹ÅÐЈˆˆÑ™–‘“ž‘›š‡‹ŒÑœ’Й™š šŽŠšŒ‹ ™‘‹Ñ—Ë. What causes this? What does that ~ sign do before a variable? Niklas Lampén
[PHP] validating form data...
I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: unset Cookies
Michael Thanry wrote: Hello everyone! Is there a way to unset or expire a cookie which was not set by my pages? Overriding an existing cookie with setcookie()and 1 sec expiry should do the trick. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Funny thing with variables
rtfm :o http://www.php.net/manual/en/language.operators.bitwise.php Wagner Tomy Web Developer Editus Luxembourg S.A. - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Monday, October 22, 2001 1:59 PM Subject: [PHP] Funny thing with variables What causes this: I have a page getting variable $BackLink with string http://www.domain.com/my_page.php4. I accidentaly wrote ?=~$BackLink? and what I got out was —‹‹ÅÐЈˆˆÑ™– ‘“ž‘›š‡‹ŒÑœ’Й™š šŽŠšŒ‹ ™‘‹Ñ—Ë. What causes this? What does that ~ sign do before a variable? Niklas Lampén -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
re: [PHP] validating form data...
hellorghh !!! I think that : if ((email_is_valid($Email)) ($Name != ) ($Message != )){ do stuff ... } ...should be better . (, not and) Toke Herkild [EMAIL PROTECTED] a écrit dans le message news: [EMAIL PROTECTED] I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] (°-Nayco. //\[EMAIL PROTECTED] v_/_http://nayco.free.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: unset Cookies
Depends on that if the cookie is set on your server or not. If it is set on your server and the cookie_domain is set to /, that means - every script from the server has right to access it, if the path is more restrictive you cannot access it. And of course if the cookie is from another domain - no chance because of browser restrictive policy about cookies. -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Monday 22 October 2001 08:07 am, you wrote: Michael Thanry wrote: Hello everyone! Is there a way to unset or expire a cookie which was not set by my pages? Overriding an existing cookie with setcookie()and 1 sec expiry should do the trick. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] validating form data...
and and are same except that they stay at different levels in the precedence table. But if the programmer is skilled he will never write code which depends on the precedence table but put brackets here and there, everywhere they are needed. -- Andrey Hristov Web Developer Icygen Corporation BUILDING SOLUTIONS http://www.icygen.com On Monday 22 October 2001 08:19 am, you wrote: hellorghh !!! I think that : if ((email_is_valid($Email)) ($Name != ) ($Message != )){ do stuff ... } ...should be better . (, not and) Toke Herkild [EMAIL PROTECTED] a écrit dans le message news: [EMAIL PROTECTED] I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] (°-Nayco. //\[EMAIL PROTECTED] v_/_http://nayco.free.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] language question
why does this work: foreach ($table as $row) list ($a, $b) = $row; but this doesn't? foreach ($table as list ($a, $b)); it seems to me that the two are equivalent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] validating form data...
Divide and conquer Have you tried it one function at a time -- e.g. if (email_is_valid($Email) { do stuff ... also, what values do these tests return? have you echoed the values? HTH - Miles At 02:07 PM 10/22/01 +0200, Toke Herkild wrote: I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: validating form data...
Very embaressing The error where not in my if-statement... but in what I did later on in the else-clause... so boys and girls... remember you do not set variables like this: $Var = = Avariable; // Doesn't work. (slap me!) the correct is : $Var = Avariable; Sorry for vasting your time... And Thanks for all the help... Toke. Toke Herkild [EMAIL PROTECTED] skrev i en meddelelse [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP Authentication
Wilbert Enserink wrote: Hi all, is it possible to do a HTTP Authentication with my own loginform instead of using the ugly pop up window? regards, Wilbert With a lot of thought, yes. You need to consider a few factors before you start. Security: Checking the IP address of the user. Performance: to DB or not to DB, that is the question! Security again: what kind of password algoritm are you going to use. And so on and so forth. I wish you the best of luck. I made such a script just a month ago :) -- Stig-Ørjan Smelror Systemutvikler Linux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: AW: PHP/CGI problem: #!/path/php at top of CGI script appears in output
Hi, Yes I have used --enable-discard-path, the script work with #!/usr/local/bin/php I'll give the full configuration later Philippe Stefan Siefert writes: Hi, well I do understand your needing. First a question. What are your compile options, e.g. your configure call? Do you use --enable-discard-path ? If not, try this. You need this option to run Phpscripts from cgi-bin folders!!! Greetings, Stefan Siefert -Ursprüngliche Nachricht- Von: Philippe [mailto:[EMAIL PROTECTED]] Gesendet: Sonntag, 21. Oktober 2001 17:53 An: Stefan Siefert; php-general; php-install Betreff: Re: PHP/CGI problem: #!/path/php at top of CGI script appears in output Hi, Thanks Stefan for your answer First, I'll explain why I want to use php in cgi I'ts a simple reason, some users want to use php without safemode (which is required with Apache due to safety problems). So I want to use php in cgi mode with suexec. I've tryed your solution, it works in all non-cgi directory But it doesn't work in cgi directory with suexec or not If I put #/usr/local/bin/php in the script, the script work but we can see #/usr/local/bin/php at the top. If I don't put it, there is an 500 error (Internal Server Error) In error_log, we can see these lines [Sun Oct 21 17:30:10 2001] [error] (8)Exec format error: exec of /home/webbourse/cgi-bin/php.cphp failed [Sun Oct 21 17:30:10 2001] [error] [client 212.103.7.98] Premature end of script headers: /home/webbourse/cgi-bin/php.cphp Someone has an idea Thanks Philippe Stefan Siefert writes: Hi @all.. I'm not sure if this can fix (or explain) your problem (cause I didn't tried it in lack of time) but theoretical it could be :). I think you only need the #!/usr/local/bin/php if you would like to run scripts from the bash, or as a real cgi. But I think, there could be another solution .. compile your php as cgi like you did and add these lines in your httpd.conf ScriptAlias /php/ /usr/local/bin/ AddType application/x-httpd-php .php .phtml .cgi Action application/x-httpd-php /php/php This should also launch the cgi - version of php, but doesn't requires the #! line in the scripts. I'm not sure, but it should work. Hope this helps you, Stefan Siefert - Original Message - From: Dave Goodrich [EMAIL PROTECTED] To: Philippe [EMAIL PROTECTED] Cc: php-general [EMAIL PROTECTED]; php-install [EMAIL PROTECTED] Sent: Saturday, October 20, 2001 6:05 PM Subject: [PHP-INST] Re: [PHP] PHP/CGI problem: #!/path/php at top of CGI script appears in output It's not you. I just built a bare cgi version of php, nothing but './configure' and got the same result. I used this simple script to be sure I was in fact running the cgi binary and it showed I was. info.cgi #!/usr/local/bin/php ?php phpinfo(); ? I got the correct info page, but with the #!/usr/local/bin/php at the top as you stated. Odd, but I've never used the cgi version so other than confirming your problem I am afraid I'm no help. DAve On Sat, Oct 20, 2001 at 03:31:06PM +, Philippe wrote: Hi, I'll synthetize the problem with the response I have givven to Curt. I've FreeBSD 4.2/Apache 1.3.9/PHP 4.0.6 I've installed PHP in Apache, it works very well I need to have too PHP 4.0.6 in CGI mode (With Suexec but I don't think it's the problem) but I've a problem. In CGI mode, the path of PHP is always written at the top of the result I'll take for example this script which is in the cgi-bin with the execute mod (755), the extension is .cgi : #!/usr/local/bin/php ? print Hello World; ? When the file is called by the browser, the result is : #!/usr/local/bin/php Hello World Does someone know the problem and the solution ? Have I forgotten something ? I think that's a misconfiguration in PHP Thanks for your help Philippe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- My other computer is your Windows machine... -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP/CGI problem: #!/path/php at top of CGI script appears in output
Hi, You're right Dave But nobody had already used PHP with CGI and with Apache ??? I searched on the net, but I've found no documentation on this problem Bye Philippe Dave Goodrich writes: Nope it fails when he removes the line. It fails on me as well, I tried it. Also note I did say that the ouput of phpinfo() was correct. The output showed the page had been handled by the php cgi binary, not the module. The module has a large config line and several extensions configured in, the cgi binary was compiled with nothing but ./configure and the info page confirms this. So it seems Apache is handling everything correct, the page gets passed to the proper php binary, and the result is correctly served back to the client. DAve On Sun, Oct 21, 2001 at 12:18:07PM -0500, Brian Mauter wrote: Seems to me that the problems is that you have two instances of PHP going at the same time. The first is the one compiled into Apache and the second is the cgi module. My bet is that the PHP compiled into Apache is catching it first (maybe you told all .cgi files to be parsed by the PHP parser?). In that case, the first line would be treated as HTML output, not PHP. This would be the reason you get that line in all of your scripts. Here's a test: remove that line from your file and then try it. If it continues to work, I would seriously suspect that the built-in Apache-PHP parser is handling your .cgi files. -Brian -Original Message- From: Dave Goodrich [mailto:[EMAIL PROTECTED]] * snip info.cgi #!/usr/local/bin/php ?php phpinfo(); ? -- My other computer is your Windows machine... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Funny thing with variables
F... read it and got it! ;) I had no idea what to look for.. Niklas P.S. Thanks -Original Message- From: Tomy Wagner [mailto:[EMAIL PROTECTED]] Sent: 22. lokakuuta 2001 15:16 To: Niklas Lampén; Php-General Subject: Re: [PHP] Funny thing with variables rtfm :o http://www.php.net/manual/en/language.operators.bitwise.php Wagner Tomy Web Developer Editus Luxembourg S.A. - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Monday, October 22, 2001 1:59 PM Subject: [PHP] Funny thing with variables What causes this: I have a page getting variable $BackLink with string http://www.domain.com/my_page.php4. I accidentaly wrote ?=~$BackLink? and what I got out was —‹‹ÅÐЈˆˆÑ™– ‘“ž‘›š‡‹ŒÑœ’Й™š šŽŠšŒ‹ ™‘‹Ñ—Ë. What causes this? What does that ~ sign do before a variable? Niklas Lampén -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] format date
Hi all, i would like a simple way to get date field formatted from my little sybase, for some reason the output of it is showing the wrong date example Jan 1 1900 12:00:00:000AM thanks Caleb Carvalho Application Engineer LoadRunner/APM - Enterprise Testing and Performance Management Solutions - Mercury Interactive 410 Frimley Business Park Frimley, Surrey. GU16 7ST United Kingdom Telephone : +44 (0)1276 808300 _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php code to fax
I am working on a project that will require the ability to take input from a web interface and then fax the content out to some of the members. If anyone has had any experience with a similar project, I would greatly appreciate any assistance. Thanks in advance, Glenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] DATE FORMAT ISSUES
I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: DATE FORMAT ISSUES
maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] language question
On Monday 22 October 2001 14:28, David Otton wrote: why does this work: foreach ($table as $row) list ($a, $b) = $row; but this doesn't? foreach ($table as list ($a, $b)); because the correct syntax is foreach ($table as $key = $val) { ... } RTFM :) BTW: overwriting $a, $b in each iteration isn't particularly useful... -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Those who will not reason, are bigots, those who cannot, are fools, and those who dare not, are slaves. - George Gordon Noel Byron (1788-1824), [Lord Byron] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP on fu!$#@ing PWS
How do I run *.php on PWS I download php4, edit php.ini reg and NOTHING! Please someone HELP ME! My OS is Win 98 PWS 4.0 (Sorry by my poor English, I speak spanish 8o( /G£rmÅn// German Benzano [EMAIL PROTECTED] Montevideo - Uruguay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Getting session to work
I'm trying to use my own session handler. I tried several examples before trying it out on my local box. It worked, and I don't know why it didn't work on the other. Here are the setups: My local box (where it works): OS: Windows 2000 PHP 4.0.6 Apache 1.3.x I didn't even have to set the handler setting from files to user, and it worked. Original box (where it does not work) OS: FreeBSD 4.4 PHP 4.0.6 Apache 1.3.22 The session value basically doesn't get changed at all. No errors get printed, just no change in session value. The example I ended up finally using is the one described here: http://www.phpbuilder.com/columns/ying2602.php3 BTW, the vanilla session handler is not working under the FreeBSD setup, either. This is the target platform, so I really need to figure this out Please, any and all help is appreciated!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: DATE FORMAT ISSUES
No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not _lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP on fu!$#@ing PWS
I am going to make the assumption that you did not download the installer from the following URL (only the zip package).. http://www.php.net/downloads.php If you downloaded both the zip package and the installer and are still having a problem, please post the error message(s) that you are receiving. HTH Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 [EMAIL PROTECTED] - Original Message - From: German Benzano [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 11:19 AM Subject: [PHP] PHP on fu!$#@ing PWS How do I run *.php on PWS I download php4, edit php.ini reg and NOTHING! Please someone HELP ME! My OS is Win 98 PWS 4.0 (Sorry by my poor English, I speak spanish 8o( /G£rmÅn// German Benzano [EMAIL PROTECTED] Montevideo - Uruguay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php hosting
They've been mentioned on the list before, but I had a great experience with Cedant.com. Apache, PHP4, MySQL, and shell access via SSH (and the ability to compile your own software in a /home/youraccount/bin directory). I hosted a site with them for a few months earlier this year before taking the plunge and hosting on a dedicated Linux box at home, and found their support staff to be knowledgeable and responsive. Their basic account is $12.95/month for up to a gig of traffic, and they have an extensive web control panel. -Andy P.S. I don't work for Cedant or know anyone who works there, etc., etc.,.. I'm just a happy customer :) -Original Message- From: Heidi Belal [mailto:[EMAIL PROTECTED]] Sent: Saturday, October 20, 2001 1:29 PM To: Php Subject: [PHP] php hosting Anybody know of good reliable hosting that supports php, and has a control panel to go with it? thanks, Heidi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Getting session to work
I wanted to add some more details: Apache on Windows 2000 box is 1.3.20 Database connection to MySQL IS working, so that's not the problem. -Original Message- From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 9:53 AM To: [EMAIL PROTECTED] Subject: [PHP] Getting session to work I'm trying to use my own session handler. I tried several examples before trying it out on my local box. It worked, and I don't know why it didn't work on the other. Here are the setups: My local box (where it works): OS: Windows 2000 PHP 4.0.6 Apache 1.3.x I didn't even have to set the handler setting from files to user, and it worked. Original box (where it does not work) OS: FreeBSD 4.4 PHP 4.0.6 Apache 1.3.22 The session value basically doesn't get changed at all. No errors get printed, just no change in session value. The example I ended up finally using is the one described here: http://www.phpbuilder.com/columns/ying2602.php3 BTW, the vanilla session handler is not working under the FreeBSD setup, either. This is the target platform, so I really need to figure this out Please, any and all help is appreciated!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: DATE FORMAT ISSUES
Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not _lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: Forms and Netscape -- spacing problem -- Help!
It's almost certainly not W3C compliant, but if your form is inside a table (I know, I know - you're not supposed to use tables for layout) you can hide the FORM tags outside the TD tags of the cell containing the form: E.G.: table tr form action='somescript.php' td input type='text' name='input1'br input type='submit' /td /form /tr /table I've never had a problem with this workaround in IE/Netscape 4.x as long as the tags are nested correctly. Not sure about Lynx/Konqueror/Opera. I try whenever possible to follow the W3C's standards, but inconsistent browser implementation of HTML and CSS usually gets in the way. :P -Original Message- Subject: Re: Forms and Netscape -- spacing problem -- Help! form tag in NS (4x - 6x) there is some additional space -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: DATE FORMAT ISSUES
Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am using date(M d, Y g:ia,$myrow[creation_datetime]) at the end of a printf statement but the date comes back as Dec 31 1969 7:00pm for all entries. When the date was inserted I used now() in the insert statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not _lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: DATE FORMAT ISSUES
Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am using date(M d, Y g:ia,$myrow[creation_datetime]) at the end of a printf statement but the date comes back as Dec 31 1969 7:00pm for all entries. When the date was inserted I used now() in the insert statement. You should be doing: select UNIX_TIMESTAMP(creation_datetime) as foo date(M d, Y g:ia,$myrow['foo']) -Rasmus Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not _lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Html email
Please help me. I have problem with html email. I send email to 3 email address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED] The email client for yahoo eudoramail is their web. And for the last destination, the email client is ms outlook. The html email for yahoo eudoramail are well received. But for the last destination the ms outlook display the wrong result like encrypted text. Below is my code and the result in ms outlook. My code : $s_to = '[EMAIL PROTECTED]'; $s_subject = 'Subject xxx'; $s_headers = From: [EMAIL PROTECTED]\r\n; $s_headers .= MIME-Version: 1.0\r\n; $s_boundary = uniqid(id); $s_headers .= Content-Type: multipart/alternative . ; boundary = $s_boundary\r\n\r\n; $s_headers .= This is a MIME encoded message.\r\n\r\n; $s_headers .= --$s_boundary\r\n . $s_headers .= Content-Type: text/html; charset=\iso-8859-1\\r\n . Content-Transfer-Encoding: base64\r\n\r\n; $s_headers2 = chunk_split(base64_encode(bla...bbla.../bbla...)); $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--'; @mail ($s_to, $s_subject,, $s_headers); Result in ms outlook : Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 - Date: 22 Oct 2001 23:35:00 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Subject xxx From: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is a MIME encoded message. --id3bd4ad2486465 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: base64 PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i aXY+PC9mb250C90cj48L3RhYmxlPg== --id3bd4ad2486465-- Regards; Benny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: DATE FORMAT ISSUES
That worked. Thanks a lot... You rock -Beeman Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am using date(M d, Y g:ia,$myrow[creation_datetime]) at the end of a printf statement but the date comes back as Dec 31 1969 7:00pm for all entries. When the date was inserted I used now() in the insert statement. You should be doing: select UNIX_TIMESTAMP(creation_datetime) as foo date(M d, Y g:ia,$myrow['foo']) -Rasmus Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not _lallous [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... maybe you have in your database a DATE field instead of DATETIME field? Beeman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What attribute is used ... when a session will expire?
Just curious -- What system attribute is used to help in determining when a session file will be cleaned up (GTC) or in other words, deleted? Is it the delete time calculated based on the file's CREATED or MODIFIED time? Thanks Jason [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: validating form data...
To verify the existence of both a name and message, try a test similar to the following: if ((email_is_valid($email)) (strlen($name) 0) (strlen($name) 0)) { ... } I've found that using in a conditional block tends to be a bit buggy. strlen() seems to be pretty solid for verifying the existence of text in a variable. Mike Frazer Toke Herkild [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've made a script which ought to validate if there is data in the fields or not... but it doesn't seem to work... the validation is following: if ((email_is_valid($Email)) and ($Name != ) and ($Message != )){ do stuff ... } But even if I submit an empty form it executes do stuf... I have tried to put an empty space into the $Name and $Message test but that doesn't seem to do any difference either... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: MessageBox in PHP?
Or shorten your code: put the Javascript into a separate file, then use if ($err) { include(/javascript/file/path/here); } Use it over and over again via this method. Fatih Ustundag [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... But you can write javascript code with php like this: if ($err) { echo htmlbody echo script\n; echo alert('ERRORR');\n; echo /script\n; echo /body/html\n; exit(); } -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 3:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: MessageBox in PHP? you can use JavaScript to do that... script alert('your message goes here'); /script embed this in your HTML source code. it is not possible to do so in PHP since it is server side. Silvia Mahiques [EMAIL PROTECTED] wrote in message 005101c15aec$9ccac280$1a9cd29b@tscpc6">news:005101c15aec$9ccac280$1a9cd29b@tscpc6... Hi!, How can I make a messagebox in PHP to print errors or warning (such as in VB or VC++)?. Is it possible? Silvia Mahiques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Update onBlur or onChange
On Mon, 22 Oct 2001 00:33:39 -0700, KING OGNAJD wrote: Helo: I¹m working on a form that I¹d like to have a feature that adds your total as items are selected. Currently, I¹ve got some javascript doing the job but it only works in ie, and besides, I¹d rather use php if possible. The current prototype form lives at http://www.seatthole.com/order2.php Can anyone tell me if there¹s a way to update the total at the bottom of the page in realtime as the user makes changes? Thanks... Django the problem is from using 'this' from inside the input tag, netscape don't like this. take it out and use document.forms[0].inputname it will work. -- Mark, [EMAIL PROTECTED] on 10/22/2001 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Copying to network drive (Win32)
Hi there, Referring to one question I sent here over a month ago, I'd like to get back with subject: I need to copy a image file from the server box to another computer in our local network. All computers have WinNT 4.1 on it (also the server box PHP Apache running) expect that file server where the file should be copied to (it's Sun Unix etc). But as I told before, the copy can be executed fine in Windows Explorer, no problems, but when trying to do the copy via PHP it won't success. I tried the copy also with exec() and passthru() -functions: cmd /c copy file.jpg x:\\path\\destifile.jpg. No error message appear, only text 0 files copied (from Windows itself). If I execute the same command from Start-Run, it will success without problems. First idea is that maybe there is some mess with user privileges? PHP is a module of Apache and Apache is running as a Windows' system service. Is Apache so running as a nobody user or something? How could I get same privileges for my PHP script as the logged user? (I am unable to modify privileges in the Sun box) Hmm... That's all. Maybe little bit confused explanation but hope that you got the point ;) Cheers, - Ville . Ville Mattila Ikaalinen, Finland [EMAIL PROTECTED] www.pilotmedia.fi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Logic/method question...
It's not really, but kind of, a PHP question. I mean it is being written in PHP :) I am putting together a search feature for our classified ads and there are about 4000 each day. Now I am bulding a query to search by newspaper, date, and keywords. One last thing is categories. Curious how others would handle this...on the search screen (and on the site) we have broken down the classified codes into about 8-10 main groups (stuff like Merchandise, Transportation, Services etc). Now the problem is this: in the database, each ad goes in with it's class code which matches up with the actual category. So instead of just Merchandise we have sub categories like Christmas Trees. There are close to 1500 class codeas and when I build this I need to allow the user to select just one of the 8-10 codes and have the program return everything. Will I need to do something like: if $selection=Merchandise then { select all ads where code=2 AND code=5 AND code=123 AND code=567 etc etc } Jeff
[PHP] Print statements , syntax , usage, etc
Hi, ¡'m new to php, but not to programming, I'm having problems using a simple print statement : *print 'td width=25% bgcolor=#FcaF00bfont face=Tahoma, Verdana, Arial, Sans SerifRef:/fontb//td';* *print 'td width=25% bgcolor=#00bfont face=Tahoma, Verdana, Arial, Sans Serif$reference/fontb//td';* the problem is with the output, the table is fine but the variable $reference otputs it's name $reference instead of it's value i.e. 345. I'm getting mad because I know this has to be some kind of syntax error but I tried exchanging quotes for double quotes, adding parenthesis and stuff like that and I couldn't figure out what the prob is ... Regards, Rick Right the output shows Ref:$reference -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Print statements , syntax , usage, etc
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ricardo Fitzgerald) wrote: *print 'td width=25% bgcolor=#FcaF00bfont face=Tahoma, Verdana, Arial, Sans SerifRef:/fontb//td';* *print 'td width=25% bgcolor=#00bfont face=Tahoma, Verdana, Arial, Sans Serif$reference/fontb//td';* the problem is with the output, the table is fine but the variable $reference otputs it's name $reference instead of it's value i.e. 345. I'm getting mad because I know this has to be some kind of syntax error but I tried exchanging quotes for double quotes, adding parenthesis and stuff like that and I couldn't figure out what the prob is ... Re-try the double quotes. Variable expansion is available within double quotes. It is not within single quotes. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php code to fax
I could be wrong, but it would seem easiest to have an an email to fax gateway and use your php to send mail Regards, Jerry Lake Interface Engineering Technician -Original Message- From: Glenn Antoine [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] php code to fax I am working on a project that will require the ability to take input from a web interface and then fax the content out to some of the members. If anyone has had any experience with a similar project, I would greatly appreciate any assistance. Thanks in advance, Glenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] *** I want a swanky icon in the address bar, like major sites (e.g. php.net, google.com)...
Anyone out there know how to set the icon that is shown in the address bar, to the left of the URL? It's also used in the favourites pane. I know this isn't really the right place to make this post, but I figured that there are so many experienced programmers out there writing websites, that someone would have come across this before... Regards, Robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] *** I want a swanky icon in the address bar, like major sites (e.g. php.net, google.com)...
Um...this isn't php related and I already get a ton of emailcould we keep things on-topic? that said, check out www.favicon.com -- it should have the info you need. --kurt On Monday 22 October 2001 11:37, you wrote: Anyone out there know how to set the icon that is shown in the address bar, to the left of the URL? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php code to fax
Check out phpfax.sourceforge.net This is a project I have pretty much abandoned, and never even posted the code. I have had some people interested in it though, and would like to give the code to the community, I just never found the time. Drop me a line if your interested, and I'll do my best to gather the code into a tarball and post it. Chris On Mon, 22 Oct 2001, Glenn Antoine wrote: Date: Mon, 22 Oct 2001 08:38:42 -0500 To: [EMAIL PROTECTED] From: Glenn Antoine [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Subject: [PHP] php code to fax I am working on a project that will require the ability to take input from a web interface and then fax the content out to some of the members. If anyone has had any experience with a similar project, I would greatly appreciate any assistance. Thanks in advance, Glenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP3 file upload
This is from the manual -- ?php function is_uploaded_file($filename) { if (!$tmp_file = get_cfg_var('upload_tmp_dir')) { $tmp_file = dirname(tempnam('', '')); } $tmp_file .= '/' . basename($filename); } if (is_uploaded_file($userfile)) { copy($userfile, file.test); } else { echo brPossible file upload attack: filename '$userfile_name'.; } ? This uploads the file into the correct temp directory, it recognizes the filename, etc., but it won't copy it. I only can achieve the error message. I need to use PHP3 for this, I'm obviously missing something. Thanks, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] syntax for checking if string contains something
Hi, I was just going through my PHP book and I noticed that there was a way to check whether or not a form was filled out after pressing submit. Things worked okay when I used the form checking method of just checking if a particular field was filled in. for example if ($email ==) checks if the $email variable was inputted by the user. However I was wondering how can I refine it so that it will also check if the $email variable contains an '@' sign? Thanks. Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Copying to network drive (Win32)
On Mon, 22 Oct 2001 20:11:32 +0300, Ville Mattila wrote: Hi there, Referring to one question I sent here over a month ago, I'd like to get back with subject: I need to copy a image file from the server box to another computer in our local network. All computers have WinNT 4.1 on it (also the server box PHP Apache running) expect that file server where the file should be copied to (it's Sun Unix etc). But as I told before, the copy can be executed fine in Windows Explorer, no problems, but when trying to do the copy via PHP it won't success. I tried the copy also with exec() and passthru() -functions: cmd /c copy file.jpg x:\\path\\destifile.jpg. No error message appear, only text 0 files copied (from Windows itself). If I execute the same command from Start-Run, it will success without problems. try using an absolute path for the first file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] str_replace binary safe??
Hi folks, following problem appeared on PHP 3.0.16 on LINUX I have a binary file, where I want to replace some letters I do the following: $filename = xyz.sdc; $fd = fopen( $filename, r+b ); // also tried r $x=filesize( $filename ); // this shows the correct filesize 22528 byte $contents = fread( $fd, $x ); fclose( $fd ); $y=strlen($contents); // The first mistake $y = 32956 byte echo BEFOREbr.$contents; $contents=str_replace(UU,123456, $contents); echo AFTERbr.$contents; It seems, that php converts HEX 00 00 to HEX 5C 30 just when it reads the data in memory because at the BEFORE echo the data will be shown as \0 (hex 00 00 ). The filesize will be correct when I save the str_replaced text and the text will be cahnged correct. Any idea, where this comes from?? Thanks in advance Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Session control issue
I am experiencing a problem of trying to run several variants of the same code and keep the sessions separate. Here is the scenario. I am launching all of this from a CMS. So, the CMS displays a page that has 3 links on it. Link 1 is version A of an application, Link 2 version B, etc. The three links are all the same application but different builds, in essence. They all have the same session control code. They each launch a new window, but the session variables are staying in the pool for each link, which is not acceptable. When I call Link1 and then I call Link2, they need to have an independent pool (session). I have tried to unregister, destroy, unset, to no avail. Is there a way, or am I out of luck? Hard coding is not an option, as the code has to be standard across all platforms and releases. -- Gaylen [EMAIL PROTECTED] http://www.gaylenandmargie.com PHP KISGB v2.1 Guestbook http://www.gaylenandmargie.com/phpwebsite -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] str_replace binary safe??
Hi folks, following problem appeared on PHP 3.0.16 on LINUX I have a binary file, where I want to replace some letters I do the following: $filename = xyz.sdc; $fd = fopen( $filename, r+b ); // also tried r $x=filesize( $filename ); // this shows the correct filesize 22528 byte $contents = fread( $fd, $x ); fclose( $fd ); $y=strlen($contents); // The first mistake $y = 32956 byte echo BEFOREbr.$contents; $contents=str_replace(UU,123456, $contents); echo AFTERbr.$contents; It seems, that php converts HEX 00 00 to HEX 5C 30 just when it reads the data in memory because at the BEFORE echo the data will be shown as \0 (hex 00 00 ). The filesize will be correct when I save the str_replaced text and the text will be cahnged correct. Any idea, where this comes from?? Oliver, Let's start with the fopen(), where the mode expression might be causing problems - should it be rb? http://www.php.net/manual/en/function.fopen.php If the 'binary' component hasn't been recognised it might explain the first mistake. The ensuing problems may even stem from there... Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] str_replace binary safe??
At 22.10.01 21:36, you wrote: Hi folks, following problem appeared on PHP 3.0.16 on LINUX I have a binary file, where I want to replace some letters I do the following: $filename = xyz.sdc; $fd = fopen( $filename, r+b ); // also tried r $x=filesize( $filename ); // this shows the correct filesize 22528 byte $contents = fread( $fd, $x ); fclose( $fd ); $y=strlen($contents); // The first mistake $y = 32956 byte echo BEFOREbr.$contents; $contents=str_replace(UU,123456, $contents); echo AFTERbr.$contents; It seems, that php converts HEX 00 00 to HEX 5C 30 just when it reads the data in memory because at the BEFORE echo the data will be shown as \0 (hex 00 00 ). The filesize will be correct when I save the str_replaced text and the text will be cahnged correct. Any idea, where this comes from?? Let's start with the fopen(), where the mode expression might be causing problems - should it be rb? http://www.php.net/manual/en/function.fopen.php If the 'binary' component hasn't been recognised it might explain the first mistake. The ensuing problems may even stem from there... Thanks DLNeil, I tried rb r r+b(C-style) always the same :( Any other suggestions ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: syntax for checking if string contains something
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Peter) wrote: for example if ($email ==) checks if the $email variable was inputted by the user. Better: if(!empty($email)) http://php.net/empty However I was wondering how can I refine it so that it will also check if the $email variable contains an '@' sign? http://php.net/strstr -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Form Question
Chip, I read all of the posts regarding this topic that I could find, and just *had* to reply. (Take the TIME to look at this. It is about the most Efficient, Powerful way I know of) Do this! __ ?php //If the hidden variable ACTION == DOIT then process the form //This way, the form will not get processed the first time around... if($ACTION=='DOIT') { //Validate Form Here if(empty($txtNAME)) $oErr-txtNAME=Required; if(empty($txtADDRESS)) $oErr-txtADDRESS=Required; //if there is an error message, break out here if(isset($oErr)) break; //Save your form here... //All went ok... Redirect to the next page... header(Location: nextpage.php); exit; } ? form name=frmMyForm method=post action=?php echo $PHP_SELF; ? input type=hidden name=ACTION value=DOIT ?php echo($oErr-txtNAME); ? input type=text name=txtNAME value=?php echo(htmlspecialchars($txtNAME)); ? *or* ?php1 if(isset($oErr-txtADDRESS)) echo($oErr-txtADDRESS); ? input type=text name=txtADDRESS value=?php echo(htmlspecialchars($txtADDRESS)); ? /form -Jason Garber At 03:49 PM 10/21/2001 -0400, Chip Landwehr wrote: I got a form that a user fills out. When they hit submit they are transfered to a PHP page that verifies their data. If a problem is found (They forgot to enter an e-mail address) the PHP sends them back to the original form with the field they forgot to fill out highlighted in red. Unfortunately all there entries are wiped out and they have to re-enter everything. Any easy way to keep there original entries? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] require include
Coverting from perl ... What's the differencw between require and include? Where, when, why? John? Email post reply always appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Wicked, Array add problem!
I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] = Array ( [posted] = Posted by1 [source] = Bron ) ) */ echo /pre; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] require include
http://www.php.net/manual/en/function.require.php require() pulls in the target file when the source file is parsed/compiled, include() pulls in the target file when the source file is executed. So an include() nested in an if statement will only be included if the if statement evaluates to true, a require() nested in an if statement will be included regardless. Also check out include_once() and require_once(). -Steve On Monday, October 22, 2001, at 05:15 PM, jtjohnston wrote: Coverting from perl ... What's the differencw between require and include? Where, when, why? John? Email post reply always appreciated -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] str_replace binary safe??
following problem appeared on PHP 3.0.16 on LINUX I have a binary file, where I want to replace some letters I do the following: $filename = xyz.sdc; $fd = fopen( $filename, r+b ); // also tried r $x=filesize( $filename ); // this shows the correct filesize 22528 byte $contents = fread( $fd, $x ); fclose( $fd ); $y=strlen($contents); // The first mistake $y = 32956 byte echo BEFOREbr.$contents; $contents=str_replace(UU,123456, $contents); echo AFTERbr.$contents; It seems, that php converts HEX 00 00 to HEX 5C 30 just when it reads the data in memory because at the BEFORE echo the data will be shown as \0 (hex 00 00 ). The filesize will be correct when I save the str_replaced text and the text will be cahnged correct. Any idea, where this comes from?? Let's start with the fopen(), where the mode expression might be causing problems - should it be rb? http://www.php.net/manual/en/function.fopen.php If the 'binary' component hasn't been recognised it might explain the first mistake. The ensuing problems may even stem from there... Thanks DLNeil, I tried rb r r+b(C-style) always the same :( Any other suggestions ? =not really, but (here's the end of a beautiful friendship) I've managed to get the code to work as required (on my WinNT box - I thought it was us Windows users who always have to accept second-best!?). I took your code, added various extras and amended things that wouldn't run on my system - my added code is indented and your original commented out where necessary - see section 1 below. I then threw my c:\boot.ini file (287b used, 512b allocated) against it, and asked that the three appearances of the word multi be replaced by 123, which caused a 6-byte contraction - see section 2 below. I don't think anything I changed has altered the original logic. =Despite my earlier observations, my system doesn't care whether the fopen() mode is set to r, rb, or r+b. However as soon as I shifted from the ultra-short boot.ini to using the binary ntldr file I noticed that PHP baulked at the backslash (fine with forward slash though). =a few thoughts: 1 the file must be local to be able to use filesize() (it may not be a remote URL for example) - but then you say the filesize is initially correct so that's not it. 2 the replace function is case sensitive (I can't see your data file, so is that a possible problem?). 3 the manual does say that the replace function was buggy in older versions of PHP. 4 I've added some error checks. If you run them against your data, do they throw out anything? =let us know, =dn -- html headtitleOliver/[PHP]/title/head body ?php //$filename = xyz.sdc; //$fd = fopen( $filename, r+b ); // also tried r $filename = c:\boot.ini; $fd = fopen( $filename, rb ); if (!( $fd ) ) echo Could not open file: $filename; $x=filesize( $filename ); // this shows the correct filesize 22528 byte echo filesize=$x; $contents = fread( $fd, $x ); if (!$contents) echo FileSysRead failed~BR; //$contents = fread( $fd, $x ); fclose( $fd ); $y=strlen($contents); // The first mistake $y = 32956 byte echo brBEFOREbr.$contents; echo brlength=$y; $contents=str_replace(multi,123, $contents); //$contents=str_replace(UU,123456, $contents); echo brAFTERbr.$contents; echo brlength=.strlen($contents); ? /body /html -- filesize=287 BEFORE [operating systems] multi...etc... length=287 AFTER [operating systems] 123...etc... length=281 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP on PWS
I use PWS on a Win 95; to be able to run php files here, I have to specify that the virtual directory in my machine can, not only read and run scripts, but also *execute* (Advanced | Edit properties | checkbox execute). Also, I have to type the http address, not the filename: http://myserver/dir/file.php. C://dir/file.php won't work... Since both of my OS and Web Manager are different from yours, I don't know if any of this can actually help ... sweetju
[PHP] HTTP_RAW_POST_DATA / Content-type
Hello, I'm running into a problem accessing $HTTP_RAW_POST_DATA in my scripts. I am interfacing with an external system that is doing a HTTP POST to my php script (I'm running 4.0.6). The variable $HTTP_RAW_POST_DATA is always blank even though the external system is sending me data. The problem is that the external system is not passing me a Content-type; they are including Content-length and the various other headers, but not Content-type. There is a known bug for this (http://bugs.php.net/bug.php?id=12208), and it seems that it is resolved in 4.0.7. Does anyone know of a patch for 4.0.6 that would resolve this bug? I wouldn't mind re-compiling 4.0.6 after patching the code, but I would rather not install 4.0.7 since it is still in the release candidate stage and the server in question is a production server. Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Wicked, Array add problem!
Uhm found a solution for my own problem somewere else on this list.. credits go2 Andrey Hristov ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); function array_overlay($ar1,$ar2){ foreach ($ar2 as $k=$v){ if (isset($ar1[$k]) is_array($ar1[$k]) is_array($ar2[$k]) ) array_overlay($ar1[$k],$ar2[$k]); elseif (!isset($ar1[$k])) $ar1[$k]=$v; } } print_r(array_overlay($array2,$array1)); echo print_r($array2); echo /pre; ? Emile Bosch [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] = Array ( [posted] = Posted by1 [source] = Bron ) ) */ echo /pre; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Wicked, Array add problem!
I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] = Array ( [posted] = Posted by1 [source] = Bron ) ) */ echo /pre; ? Emile Bosch [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] = Array ( [posted] = Posted by1 [source] = Bron ) ) */ echo /pre; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Odd is_int() behaviour
Yasuo Ohgaki wrote: This is expected behaviour. Ashley M. Kirchner wrote: I have the following snippet in my file: if ($PATH_INFO == ) { $PATH_INFO = /; } echo PATH_INFO: $PATH_INFObr\n; // All we want is the fist element, call it $section list($section) = explode('/', substr($PATH_INFO,1)); explode() is string function and returns array of strings. Therefore, type is integer. Oops. Obviously this line is wrong. It should be There for type is STRING not integer... -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: What attribute is used ... when a session will expire?
Jason Caldwell wrote: Just curious -- What system attribute is used to help in determining when a session file will be cleaned up (GTC) or in other words, deleted? Is it the delete time calculated based on the file's CREATED or MODIFIED time? Modified time is used for mod_files. There is case that session data files will not be deleted and user has to delete session data files manually. This behaviour might be changed, see mod_files.c for details and current status. -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: require include
Jtjohnston wrote: Coverting from perl ... What's the differencw between require and include? Where, when, why? I forgot from which version, but current PHP's require/include works the same way except - require() raise fatal error, if it can't find file - include() raise warning, if it can't find file requrie_once()/include_once() works almost the same as require()/include() except they include file only once. (Hash table is used to determine if files are included or not) See also get_{required|included}_files() -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Wicked, Array add problem!
you want array_merge() On Tue, 23 Oct 2001 00:27:29 +0200, Emile Bosch wrote: I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch ? echo pre; $array1 = array(text=array(posted=Posted by,source=Bron)); $array2 = array(text=array(posted=Posted by1)); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] = Array ( [posted] = Posted by1 [source] = Bron ) ) */ echo /pre; ? -- Mark, [EMAIL PROTECTED] on 10/22/01 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] format date
On Mon, 22 Oct 2001 22:38, Caleb Carvalho wrote: Hi all, i would like a simple way to get date field formatted from my little sybase, for some reason the output of it is showing the wrong date example Jan 1 1900 12:00:00:000AM thanks Perhaps if you could show what you are doing and which is not working, someone might be able to help you. As it is we have no idea of the format of your data or the method you are using. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Politics is the entertainment branch of industry. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] preg_match_all...grrrr!!!
I've never had good luck with this function. I first learned how to (sorta) use it from looking at other code. It worked fine when I made a meta search engine, but when I tried on expanding on it, well, I've started losing hair. =) Here's the scenario: I'm trying to parse results from Yahoo's People Search page, to grab the info from it. A specific link in the results contains all the info I need for each entry. A link from one such entry looks like this: psPhoneEntry.py?firstname=Adamlastname=Collierstreet=3912+Foley+Glen+Circity=Fentonstate=MIzip=48430-3435phone=8107507456 My matching pattern looks like this: $engreg = '/psPhoneEntry.py?firstname=(.*?)lastname=(.*?)street=(.*?)city=(.*?)state=(.*?)zip=(.*?)phone=(.*?)\/i'; Note the / at the beginning, and /i at the end. those have always been there in other projects, and have worked. Is there anything else I'm doing wrong here? I dont get any errors, but it returns 0 matches. =) ~ Tim -- - Tim PHP Galaxy: http://www.phpgalaxy.com/ The LavaWarp Engine: http://www.phpgalaxy.com/engine.php3 BitSearch: http://www.phpgalaxy.com/bitsearch.php3 MetaWarp: http://www.phpgalaxy.com/metawarp.php3 PhotoRate: http://www.phpgalaxy.com/photorate.php3 Earn $10 per order selling these scripts on your site! http://www.phpgalaxy.com/aff/
Re: [PHP] Update onBlur or onChange
Try this: *** 'varname' is equivalent to input name='varname' type=text value='var_value'*** //adding var total; //html input name=varname1 type=text value=5 onChange=javascript: total=total+form.varname1.value //once the content of varname1 is changed, the value will be added to total input name=varname2 type=text value=10 onChange=javascript:total=total+form.varname2.value //add varname2 to total ...or something to that effect. Double check the syntax... hope that that helped. __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Mon, 22 Oct 2001, Stefan Rusterholz wrote: From: KING OGNAJD [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 9:33 AM Subject: [PHP] Update onBlur or onChange Helo: I¹m working on a form that I¹d like to have a feature that adds your total as items are selected. Currently, I¹ve got some javascript doing the job but it only works in ie, and besides, I¹d rather use php if possible. The current prototype form lives at http://www.seatthole.com/order2.php Can anyone tell me if there¹s a way to update the total at the bottom of the page in realtime as the user makes changes? Thanks... Django PHP is a server-side language, which means that it had to be reloaded each time you want to do an update which is not realtime. IMHO that's not that what a user expects because it takes more time to send and reload than to calculate the new price yourself ;-) (as long as you have a poor connection) Two possible solutions: -I think the javascript solution ist the best. I don't see any reason why it doesn't run in Netscape (I didn't look at the code but I know that there is a way to get it work) -Second: Not realtime - total appears after sending it. You can combine this solution with the first to avoid problems with browsers that have JavaScript disabled (I'd recomend that anyway) Regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Apache Request Ids?
I am pretty sure I am dreaming here but I once wrote a locking tool for UNIX that kept as part of it's information the process ID. If another process went to grab the lock, one thing it would do was check if the process that had taken it was still running. If it wasn't, it knew it could safely take the lock. This of course won't work under PHP in it's module form because the process ID belongs to Apache. What I was wondering was there any kind of ID that was attached to a particular CGI request that I could access and use? Brian - Brian White Step Two Designs Pty Ltd - SGML, XML HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] won't erase $
Marc, I have prepared a function to erase syntax from a input type=text But it won't erase $ in its output when I echo. What am I doing wrong? A post-reply would be real handy, Thanks, John $filename = stripslashes(strip_punctuation($filename)); $filename = $filename...randString(5)..htm; echo here it is: .$filename.!!; -coupe-- function strip_punctuation ($mystring) { $mystring = ereg_replace (.html, , $mystring); $mystring = ereg_replace (.htm, , $mystring); $mystring = ereg_replace ( , , $mystring); $mystring = ereg_replace (}, , $mystring); $mystring = ereg_replace ({, , $mystring); $mystring = ereg_replace (\|, , $mystring); $mystring = ereg_replace (\], , $mystring); $mystring = ereg_replace (\[, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (:, , $mystring); $mystring = ereg_replace (\, , $mystring); $mystring = ereg_replace (;, , $mystring); $mystring = ereg_replace (', , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\?, , $mystring); $mystring = ereg_replace (,, , $mystring); $mystring = ereg_replace (\., , $mystring); $mystring = ereg_replace (/, , $mystring); $mystring = ereg_replace (\~, , $mystring); $mystring = ereg_replace (!, , $mystring); $mystring = ereg_replace (@, , $mystring); $mystring = ereg_replace (#, , $mystring); $mystring = ereg_replace (\$, , $mystring); $mystring = ereg_replace (%, , $mystring); $mystring = ereg_replace (\^, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\*, , $mystring); $mystring = ereg_replace (\(, , $mystring); $mystring = ereg_replace (\), , $mystring); $mystring = ereg_replace (_, , $mystring); $mystring = ereg_replace (\+, , $mystring); $mystring = ereg_replace (`, , $mystring); $mystring = ereg_replace (-, , $mystring); $mystring = ereg_replace (=, , $mystring); return $mystring; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] won't erase $
Oh man, use str_replace() please and to remove the $ just use '$' -Rasmus On Mon, 22 Oct 2001, jtjohnston wrote: Marc, I have prepared a function to erase syntax from a input type=text But it won't erase $ in its output when I echo. What am I doing wrong? A post-reply would be real handy, Thanks, John $filename = stripslashes(strip_punctuation($filename)); $filename = $filename...randString(5)..htm; echo here it is: .$filename.!!; -coupe-- function strip_punctuation ($mystring) { $mystring = ereg_replace (.html, , $mystring); $mystring = ereg_replace (.htm, , $mystring); $mystring = ereg_replace ( , , $mystring); $mystring = ereg_replace (}, , $mystring); $mystring = ereg_replace ({, , $mystring); $mystring = ereg_replace (\|, , $mystring); $mystring = ereg_replace (\], , $mystring); $mystring = ereg_replace (\[, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (:, , $mystring); $mystring = ereg_replace (\, , $mystring); $mystring = ereg_replace (;, , $mystring); $mystring = ereg_replace (', , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\?, , $mystring); $mystring = ereg_replace (,, , $mystring); $mystring = ereg_replace (\., , $mystring); $mystring = ereg_replace (/, , $mystring); $mystring = ereg_replace (\~, , $mystring); $mystring = ereg_replace (!, , $mystring); $mystring = ereg_replace (@, , $mystring); $mystring = ereg_replace (#, , $mystring); $mystring = ereg_replace (\$, , $mystring); $mystring = ereg_replace (%, , $mystring); $mystring = ereg_replace (\^, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\*, , $mystring); $mystring = ereg_replace (\(, , $mystring); $mystring = ereg_replace (\), , $mystring); $mystring = ereg_replace (_, , $mystring); $mystring = ereg_replace (\+, , $mystring); $mystring = ereg_replace (`, , $mystring); $mystring = ereg_replace (-, , $mystring); $mystring = ereg_replace (=, , $mystring); return $mystring; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: syntax for checking if string contains something
Thanks for your reply. But I tried it and it seems to pass right through the if condition without checking if the string is empty or not. Here is another PHP file where I tried using the empty function The input form contains the following: h2QTY:/h2input type=text name=qty size=7br Here is the part that checks whether or not the user has pressed submit and checks if $qty is empty or not: if (isset($submit)){ if (!empty($qty)) { echo Please enter the quantity for your quotation enquiry.;} When nothing was filled in for $qty the if condition did not prompt me to enter a quantity. Any suggestions? thanks. On Mon, 22 Oct 2001, CC Zona wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Peter) wrote: for example if ($email ==) checks if the $email variable was inputted by the user. Better: if(!empty($email)) http://php.net/empty However I was wondering how can I refine it so that it will also check if the $email variable contains an '@' sign? http://php.net/strstr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Error POP3 Class
Hello, I try pop3 class to access pop3 server, why error result like, Fatal error: Maximum execution time of 30 seconds exceeded in c:\new\sample\oh\pop3.php on line 23 before finish. file: pop3.php /* Private methods - DO NOT CALL */ Function GetLine(){ for($line=;;){ if(feof($this-connection)) return(0); $line.=fgets($this-connection,100); /* this is line 23 */ $length=strlen($line); if($length=2 substr($line,$length-2,2)==\r\n) return(substr($line,0,$length-2)); } } Thanks, Hotma MS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Session control issue
Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am experiencing a problem of trying to run several variants of the same code and keep the sessions separate. Here is the scenario. I am launching all of this from a CMS. So, the CMS displays a page that has 3 links on it. Link 1 is version A of an application, Link 2 version B, etc. The three links are all the same application but different builds, in essence. They all have the same session control code. They each launch a new window, but the session variables are staying in the pool for each link, which is not acceptable. When I call Link1 and then I call Link2, they need to have an independent pool (session). I have tried to unregister, destroy, unset, to no avail. Is there a way, or am I out of luck? Hard coding is not an option, as the code has to be standard across all platforms and releases. Sounds similar to a problem I had. I had a production site, and then in a sub-directory below it, a testing/development site. The code was essentially the same. The problem was that a user could log in as an administrative user in the testing system, then change their URL to the production site, and keep their session from the testing site! Obviously not acceptable. (grin) My solution was to include a ChangedSite function that gets called on every page access. When a user loggs in, the base address of the site is stored in their session variable. If they go to a different page, then the ChangedSite function will detect it because the base sites are different. The session is destroyed, and a security warning is thrown up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Matching strings in a flat/text file?
Hey everyone, Anyone out there know how i could do this: I have a client who is an import car tuner. They would like to feature the cars they work on in their website. Instead of creating a new .html or .php file for every car they add to include the background setup, and the general content (type of car, owner, etc...) i want to put the information in to text file and search for it in there. So that's where i need help. I want to be able to put the info into a text file and pass the string to search for through the URL, then match everything between that line and an ending line in the text file, and print that out to the browser. Example: I want to pass a string using the URL (blah.php?car=civic_si) then search for ##civic_si in the text file, and print everything until it finds ##end. So the text file will look like this: ##civic_si This is my content, blah blah ##end ##nissan This is more content... yadda yadda ##end Any ideas on how i can do this??? //Nick Richardson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Matching strings in a flat/text file?
lots of ideas nick, but can you use a database? MySQL is free and i've found its almost always better to use databases when you can... if you can't, you could do something like this: 1. find the pos of the string you need using strpos 2. find the pos of the ending delimiter 3. substr from the first pos to the end (you'll need to add/subtract some strlen's to slice off the delimiters as well... jack -Original Message- From: Nick Richardson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 1:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Matching strings in a flat/text file? Hey everyone, Anyone out there know how i could do this: I have a client who is an import car tuner. They would like to feature the cars they work on in their website. Instead of creating a new .html or .php file for every car they add to include the background setup, and the general content (type of car, owner, etc...) i want to put the information in to text file and search for it in there. So that's where i need help. I want to be able to put the info into a text file and pass the string to search for through the URL, then match everything between that line and an ending line in the text file, and print that out to the browser. Example: I want to pass a string using the URL (blah.php?car=civic_si) then search for ##civic_si in the text file, and print everything until it finds ##end. So the text file will look like this: ##civic_si This is my content, blah blah ##end ##nissan This is more content... yadda yadda ##end Any ideas on how i can do this??? //Nick Richardson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: Help with Query
Hi there. I have the following question for u. I want to join two tables but it must be displayed in the a specific format. The data of the tables are as follow : Table employee : idsurname initialsba 1 PoepH ER 2 SnotC ER 3 Skoen AS ER 4 Sak Q WQ Table courses_completed : idcourse_id completed 1 WH1.1 Yes 1 WH1.2 Yes 1 WH1.3 Yes 2 WH1.1 Yes 2 WH1.2 Yes 3 WH1.1 Yes 3 WH1.2 Yes 3 WH1.4 Yes 3 WH1.5 no 4 PS1.1 Yes 4 PS1.2 Yes 4 PS1.5 Yes 1 PS1.2 Yes 1 PS1.2 Yes I want to have the following data in a temp table or query : idsurname initialsba WH1.1 WH1.2 WH1.3 WH1.4 1 PoepH ER Yes Yes Yes Yes 2 SnotC ER Yes Yes Yes Yes 3 Skoen AS ER Yes Yes Yes Yes idsurname initialsba PS1.1 PS1.2 PS1.4 PS1.5 1 PoepH ER Yes Yes Yes Yes 4 Sak Q WQ Yes Yes Yes Yes I want to make all the copies of person listed in the rows listed just in one row,with all his skills listed in colums in that some row. The information above must be displayed in Exel just like this.There is about 50 of these courses in one production line,and there is 8 production lines. Is there a way that i can do this or how must i join this tables to get a table in that form? thank u hoender -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] won't erase $
:) Thanks. Just learning. Suggestions for improvement anyone? Oh man, use str_replace() please and to remove the $ just use '$' $filename = stripslashes(strip_punctuation($filename)); $filename = $filename...randString(5)..htm; echo here it is: .$filename.!!; -coupe-- function strip_punctuation ($mystring) { $mystring = ereg_replace (.html, , $mystring); $mystring = ereg_replace (.htm, , $mystring); $mystring = ereg_replace ( , , $mystring); $mystring = ereg_replace (}, , $mystring); $mystring = ereg_replace ({, , $mystring); $mystring = ereg_replace (\|, , $mystring); $mystring = ereg_replace (\], , $mystring); $mystring = ereg_replace (\[, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (:, , $mystring); $mystring = ereg_replace (\, , $mystring); $mystring = ereg_replace (;, , $mystring); $mystring = ereg_replace (', , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\?, , $mystring); $mystring = ereg_replace (,, , $mystring); $mystring = ereg_replace (\., , $mystring); $mystring = ereg_replace (/, , $mystring); $mystring = ereg_replace (\~, , $mystring); $mystring = ereg_replace (!, , $mystring); $mystring = ereg_replace (@, , $mystring); $mystring = ereg_replace (#, , $mystring); $mystring = ereg_replace (\$, , $mystring); $mystring = ereg_replace (%, , $mystring); $mystring = ereg_replace (\^, , $mystring); $mystring = ereg_replace (, , $mystring); $mystring = ereg_replace (\*, , $mystring); $mystring = ereg_replace (\(, , $mystring); $mystring = ereg_replace (\), , $mystring); $mystring = ereg_replace (_, , $mystring); $mystring = ereg_replace (\+, , $mystring); $mystring = ereg_replace (`, , $mystring); $mystring = ereg_replace (-, , $mystring); $mystring = ereg_replace (=, , $mystring); return $mystring; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Matching strings in a flat/text file?
Jack, thanks for the response: I can use a database if really really needed. The main reason for wanting to use a flat file is for ease of update from the client's side. They are not technical in the least, and this will save me from having to update a database everytime. Although i guess i could write a front end to let them add stuff to the database... but i'm lazy like that ;). To do the 3 things you suggested, can you give me a code snippet to do that? //Nick -Original Message- From: Jack Dempsey [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 10:20 PM To: [EMAIL PROTECTED]; Nick Richardson Subject: RE: [PHP] Matching strings in a flat/text file? lots of ideas nick, but can you use a database? MySQL is free and i've found its almost always better to use databases when you can... if you can't, you could do something like this: 1. find the pos of the string you need using strpos 2. find the pos of the ending delimiter 3. substr from the first pos to the end (you'll need to add/subtract some strlen's to slice off the delimiters as well... jack -Original Message- From: Nick Richardson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 1:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Matching strings in a flat/text file? Hey everyone, Anyone out there know how i could do this: I have a client who is an import car tuner. They would like to feature the cars they work on in their website. Instead of creating a new .html or .php file for every car they add to include the background setup, and the general content (type of car, owner, etc...) i want to put the information in to text file and search for it in there. So that's where i need help. I want to be able to put the info into a text file and pass the string to search for through the URL, then match everything between that line and an ending line in the text file, and print that out to the browser. Example: I want to pass a string using the URL (blah.php?car=civic_si) then search for ##civic_si in the text file, and print everything until it finds ##end. So the text file will look like this: ##civic_si This is my content, blah blah ##end ##nissan This is more content... yadda yadda ##end Any ideas on how i can do this??? //Nick Richardson [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] NEXT Page and BACK page
Dear list, I would like to query only the last 50 records/rows (order by ID desc) in the following script file which uses MySQL, and I want to have NEXT page for the 50 rows earlier than last 50 queried and go on. I think I can use JavaScript for BACK page to go back. Could you pl add for me the script to implement NEXT page. Here is the script file: html body ?php $db = mysql_connect(localhost, root, root); mysql_select_db(penpal,$db); if ($id) $result = mysql_query(select * from penpal where id = $id,$db); $myrow = mysql_fetch_array($result); printf(bID:/b %s\nbr, $myrow[id]); printf(bName:/b %s\nbr, $myrow[name]); printf(bAge/Sex/Location:/b %s\nbr, $myrow[asl]); printf(bDescription:/b %s\nbr, $myrow[description]); printf(bEmail:/b %s\nbr, $myrow[email]); } else { $result = mysql_query(select * from penpal order by id desc, $db); if ($myrow = mysql_fetch_array($result)) { do { printf(a href = \%s?id=%s\%s %s/abr\n, $PHP_SELF, $myrow[id], $myrow[name], $myrow[asl]); } while ($myrow = mysql_fetch_array($result)); } else { echo Sorry, no records; } } ? /body /html Thank you in advance. NOBBY
Re: [PHP] won't erase $
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Jtjohnston) wrote: Suggestions for improvement anyone? $mystring = ereg_replace (.html, , $mystring); $mystring = ereg_replace (.htm, , $mystring); $mystring = ereg_replace ( , , $mystring); $mystring = ereg_replace (}, , $mystring); $mystring = ereg_replace ({, , $mystring); $mystring = ereg_replace (\|, , $mystring); $mystring = ereg_replace (\], , $mystring); $mystring = ereg_replace (\[, , $mystring); $mystring = ereg_replace (, , $mystring); snip much, more of same Since you ask... You can save yourself a lot of trouble and a ton of wasted function calls by checking out a POSIX (ereg_*) or PCRE (preg_*) syntax tutorial. When you want to match space or punctuation characters, character classes are a Good Thing(TM). That whole loong block of code could be rendered with a single good, concise regex. With the bonus of a lot less escaping. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: require include
From the manual: Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed. Similarly, looping structures do not affect the behaviour of require(). Although the code contained in the target file is still subject to the loop, the require() itself happens only once. At 08:48 AM 10/23/2001 +0900, Yasuo Ohgaki wrote: Jtjohnston wrote: Coverting from perl ... What's the differencw between require and include? Where, when, why? I forgot from which version, but current PHP's require/include works the same way except - require() raise fatal error, if it can't find file - include() raise warning, if it can't find file requrie_once()/include_once() works almost the same as require()/include() except they include file only once. (Hash table is used to determine if files are included or not) See also get_{required|included}_files() -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: require include
That's outdated. The only difference today is that if a file can't be included/required for some reason it is a fatal error with require and a warning with include. -Rasmus On Tue, 23 Oct 2001, Jason G. wrote: From the manual: Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed. Similarly, looping structures do not affect the behaviour of require(). Although the code contained in the target file is still subject to the loop, the require() itself happens only once. At 08:48 AM 10/23/2001 +0900, Yasuo Ohgaki wrote: Jtjohnston wrote: Coverting from perl ... What's the differencw between require and include? Where, when, why? I forgot from which version, but current PHP's require/include works the same way except - require() raise fatal error, if it can't find file - include() raise warning, if it can't find file requrie_once()/include_once() works almost the same as require()/include() except they include file only once. (Hash table is used to determine if files are included or not) See also get_{required|included}_files() -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Root Certificate
Hi All- I recently went to a website which popped up with a dialog in Internet Explorer asking if I wanted to install their root certificate into IE's list of trusted root certificates. I now need to do this with a website I am developing but for the life of me cannot find the code (either server-side or client side..) which will pop this window up and ask the user if they want to install the root certificate. Can it be done with PHP? I believe this site did it using client-side VBScript (which would be fine given that all visitors to this site WILL be using IE) but I don't have the code for this, and I'd like a better solution. I'd prefer not to go the route of having a link to the certificate, asking them to save it, right click it. install it etc. Cheers. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Print statement : Thanx for all who helped ;)
I'd like to thank all those who helped me with the print statement prob, it was simple a matter of adding the appropriate string joiner and it worked flawlessly ;))) Regards, Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]