[PHP] Error Handling question
Hi, I am new to PHP and need some help for error handling. I read in the docs that i can handle the errors this way in my PhP: set_error_handler('errorHandler'); function errorHandler($errnum,$errmsg,$file,$lineno){ [...] } But does that mean that I have to copy paste this code in all my Php pages or is there a better way ? Thank you. -- View this message in context: http://www.nabble.com/Error-Handling-question-tf4223141.html#a12013437 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PhP / MySQL problem
Hi, I created a form asking username, password, country, etc. On the submit of this form I make a sql connection and update the database, add the user. The problem is that whenever the field 'password' is filled in, it (I don't know what) is asking to confirm the change of the password. I made a printscreen to clarify : http://matthew16.free.fr/sql.jpg This is what I get when I try to submit the form and I filled in field password. The users displayed in the pop-up are the MySQL users. The php/sql code is the following : mysql_select_db(mydb, $link) or die(mysql_error()); $query = INSERT INTO members (username,password,date_of_birth,e_mail,country) VALUES ('. $_POST['username'].','. $_POST['password'].','. $_POST['dateofbirth'].','. $_POST['email'].','. $_POST['country'].'); $result = mysql_query($query, $link) or die($query . - . mysql_error()); Thank you for any help ! -- View this message in context: http://www.nabble.com/PhP---MySQL-problem-tf4349742.html#a12393567 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PhP / MySQL problem
I'm using FF. But it asks to confirm the change of password of my MySQL users. If I comment the php/mysql lines in the .php files, I do not have such a pop-up. Ludovic André wrote: Hi, I created a form asking username, password, country, etc. On the submit of this form I make a sql connection and update the database, add the user. The problem is that whenever the field 'password' is filled in, it (I don't know what) is asking to confirm the change of the password. I made a printscreen to clarify : http://matthew16.free.fr/sql.jpg This is what I get when I try to submit the form and I filled in field password. The users displayed in the pop-up are the MySQL users. This has nothing to do with your PHP/MySQL, but it's a feature of your browser (you're using Firefox, aren't you?) Did you use the functionnality remember the password ? If so, then the users listed here are the ones for whom you wanted to remember the password. Firefox tries to be smart in this case: if you're updating the password, it asks you which user has changed... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/PhP---MySQL-problem-tf4349742.html#a12394801 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Configure mail to use Gmail smtp
Hello, I have read here : http://www.geekzone.co.nz/tonyhughes/599 that I can use Gmail as a free SMTP server. Is it possible to change the php.ini in order to have this running ? I need to specify in some way the following : Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication) Use Authentication: Yes Use STARTTLS: Yes (some clients call this SSL) Port: 465 or 587 Account Name: your Gmail username (including '@gmail.com') Email Address: your original isp address ([EMAIL PROTECTED]) Password: your Gmail password I can see in the php.ini that I can specify the port, smtp server and the from. But how do I do for he other parameters ? Thank you !! -- View this message in context: http://www.nabble.com/Configure-mail-to-use-Gmail-smtp-tf4450311.html#a12697262 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Configure mail to use Gmail smtp
I succeeded using the Zend Framework. debussy007 wrote: Hello, I have read here : http://www.geekzone.co.nz/tonyhughes/599 that I can use Gmail as a free SMTP server. Is it possible to change the php.ini in order to have this running ? I need to specify in some way the following : Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication) Use Authentication: Yes Use STARTTLS: Yes (some clients call this SSL) Port: 465 or 587 Account Name: your Gmail username (including '@gmail.com') Email Address:your original isp address ([EMAIL PROTECTED]) Password: your Gmail password I can see in the php.ini that I can specify the port, smtp server and the from. But how do I do for he other parameters ? Thank you !! -- View this message in context: http://www.nabble.com/Configure-mail-to-use-Gmail-smtp-tf4450311.html#a12698490 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timeout for fopen ?
Hello, I want to use fopen to open an URL, but is it possible to add a timeout ? This to avoid that fopen slows down my script ? Because if site I access takes 10 secs to respond, I suppose my script will just wait fopen returns something. Thank you. -- View this message in context: http://www.nabble.com/Timeout-for-fopen---tf4620009.html#a13194530 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strtolower doesn't work for character Ô
Hello, strtolower(...) returns a weird character when i try to convert upper case Ô to ô, can anyone help ? Thank you ! -- View this message in context: http://www.nabble.com/strtolower-doesn%27t-work-for-character-%22%C3%94%22-tf4621862.html#a13199296 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strtolower doesn't work for character Ô
I have also tried to enable Multibyte string feature, and tried the following : echo mb_strtolower ( 'Ô' ) . 'br'; But it still gives me a weird character. My page is also UTF-8 encoded. debussy007 wrote: Hello, strtolower(...) returns a weird character when i try to convert upper case Ô to ô, can anyone help ? Thank you ! -- View this message in context: http://www.nabble.com/strtolower-doesn%27t-work-for-character-%22%C3%94%22-tf4621862.html#a13199478 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strtolower doesn't work for character Ô
Nevermind, didn't see second param of mb_strtolower function which let you specify encoding type. debussy007 wrote: I have also tried to enable Multibyte string feature, and tried the following : echo mb_strtolower ( 'Ô' ) . 'br'; But it still gives me a weird character. My page is also UTF-8 encoded. debussy007 wrote: Hello, strtolower(...) returns a weird character when i try to convert upper case Ô to ô, can anyone help ? Thank you ! -- View this message in context: http://www.nabble.com/strtolower-doesn%27t-work-for-character-%22%C3%94%22-tf4621862.html#a13200077 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen + fputs
Hello, I use fsockopen and fputs to call a distant URL, but I have the following error : The requested URL /registration/test was not found on this server. This is my code: $req = 'username=' . $usr . 'password=' . $pass . 'date_of_birth=' . $year . - . $month . - . $day . 'email=' . $email . 'country=' . $country; $fp = fsockopen(www.example.com, 80, $errno, $errstr, 30); if (!$fp) { echo $errstr ($errno)br\n; } else { $header = POST /registration/test HTTP/1.0\r\n; $header .= Content-Type: application/x-www-form-urlencoded\r\n; $header .= Content-Length: . strlen($req) . \r\n\r\n; fputs ($fp, $header . $req); while (!feof($fp)) { echo fgets($fp, 1024); } fclose($fp); } However the path www.example.com/registration/test exists so why does it says it cannot find the requested url ? Any idea ? Thank you for any help !! -- View this message in context: http://www.nabble.com/fsockopen-%2B-fputs-tp17264395p17264395.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail problem (newlines becomes =0A)
Hi, When a member register in my site, I send him a mail with activation link. This is the string I send: $mailContent = Thank you for your interest in XYZ !\n\n . In order to activate your account, please click the link below.\n\n . (If the link . I tested on my gmail address, and the message appears well. However recently I had a member alerting me that the message was broken: Thank you for your interest in XYZ!=0A=0AIn order= to activate your account, please click the link below.=0A=0A(If the link Instead of new lines he gets =0A characters Message is hard to read and activation URL is broken. Anyone has an idea on how to solve this problem ? Thank you very much !! -- View this message in context: http://www.nabble.com/mail-problem-%28newlines-becomes-%3D0A%29-tp17993688p17993688.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert local dates into GMT+1 dates
Hello everyone! I have local dates (Belgium), which I want to convert to GMT+1 date. The dates are stored in the DB and are of the following format: '2008-06-24 23:30:02' So I think I'll need to check wether the date in DB is GMT+1 or GMT+2 (winter or summer), if date is GMT+2, subtract one hour from the date. Thank you for any help achieving this !! -- View this message in context: http://www.nabble.com/Convert-local-dates-into-GMT%2B1-dates-tp19687861p19687861.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] send mail to group defined in .mailrc file
Hi, When I execute the following command from PHP: exec('content | mail exam...@gmail.com -s hello there'); it works fine; But not when using an alias group defined in the .mailrc file, e.g.: exec('content | mail myGroup -s hello there'); When I execute the command above in the linux command line it works though. Anyone has an idea on how to acheive this ? Thank you! -- View this message in context: http://www.nabble.com/send-mail-to-group-defined-in-.mailrc-file-tp22911231p22911231.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] send mail to group defined in .mailrc file
I found it out ... I had to set a environment variable MAILRC, to the rc file, e.g.: exec('export MAILRC=/home/sav/.mailrc; mail ' . $toMail . ' -s hello world'); debussy007 wrote: Hi, When I execute the following command from PHP: exec('content | mail exam...@gmail.com -s hello there'); it works fine; But not when using an alias group defined in the .mailrc file, e.g.: exec('content | mail myGroup -s hello there'); When I execute the command above in the linux command line it works though. Anyone has an idea on how to acheive this ? Thank you! -- View this message in context: http://www.nabble.com/send-mail-to-group-defined-in-.mailrc-file-tp22911231p22912251.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php