Re: [PHP] Warning at PDO:Firebird driver manual page removed.
Davi Marcondes Moreira wrote: The question is: why the warning message was removed, and now this extension is safe for use, without risks of being discontinued or depreciated? Davi The current version of the extension is stable and a number of the initial bugs have been cleared up. If you use it you will find that it does work fine, but most PHP/Firebird users - like myself - stay with the php_interbase driver on it's own simply because some function are not available via the PDO driver. That only replaces the 'data' interface and does not address some of the control stuff. This is the case with many of the PDO drivers since it is not easy to provide a 'compatible' version of this across all database engines. I've still got FB1.5 on a number of sites mainly because of legacy apps that can no longer be recompiled, but PHP provides an additional interface to fill the gaps. http://groups.yahoo.com/group/firebird-php/ is the home for a more in depth discussion and assistance :) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning at PDO:Firebird driver manual page removed.
Dear Lester, Thank you very much for your attention. You gave me the exact explanation which solved all my doubts about using PDO:Firebird. Actually I'm building step by step a abstract layer file for general use on these projects, and it works fine for us, using the php_interbase extension functions. Unfortunately I can't share the code here, due to ethics contract. But I'll stay in touch in the discussion group you've sent and keep informed. Certainly I'll find more PHP/Firebird developers there. Sincerely, 2012/9/21 Lester Caine les...@lsces.co.uk Davi Marcondes Moreira wrote: The question is: why the warning message was removed, and now this extension is safe for use, without risks of being discontinued or depreciated? Davi The current version of the extension is stable and a number of the initial bugs have been cleared up. If you use it you will find that it does work fine, but most PHP/Firebird users - like myself - stay with the php_interbase driver on it's own simply because some function are not available via the PDO driver. That only replaces the 'data' interface and does not address some of the control stuff. This is the case with many of the PDO drivers since it is not easy to provide a 'compatible' version of this across all database engines. I've still got FB1.5 on a number of sites mainly because of legacy apps that can no longer be recompiled, but PHP provides an additional interface to fill the gaps. http://groups.yahoo.com/group/**firebird-php/http://groups.yahoo.com/group/firebird-php/is the home for a more in depth discussion and assistance :) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=**contacthttp://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.**ukhttp://rainbowdigitalmedia.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- *Davi Marcondes Moreira* + Info: http://about.me/davi.m.moreira
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
On Fri, May 20, 2011 at 1:45 AM, Marc Guay marc.g...@gmail.com wrote: Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I don't believe the version has anything to do with it, but who knows. I set error_reporting = E_ALL | E_STRICT and verified that display_errors = On, still nothing. Any ideas what could be allowing a header('Location:'); call to redirect without throwing an error after output has been sent to the browser? Marc Marc, I think you should mimic this in command line using curl. You can easily understand where the extra byte before headers are coming. -- Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu Innovation distinguishes between follower and leader
Re: [PHP] Warning: Cannot modify header information - headers alreadysent by - classic
Am 20.05.2011 10:38, schrieb shiplu: On Fri, May 20, 2011 at 1:45 AM, Marc Guaymarc.g...@gmail.com wrote: Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I don't believe the version has anything to do with it, but who knows. I set error_reporting = E_ALL | E_STRICT and verified that display_errors = On, still nothing. Any ideas what could be allowing a header('Location:'); call to redirect without throwing an error after output has been sent to the browser? Marc Marc, I think you should mimic this in command line using curl. You can easily understand where the extra byte before headers are coming. -- Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu Innovation distinguishes between follower and leader Delete de ? from all php files, if there are not using HTML but only php. Regards Carlos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot modify header information - headers alreadysent by - classic
To everyone who did not read my original message but responded to it, Thank you. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: session_start()
On 18 May 2011 19:15, Nazish naz...@jhu.edu wrote: Hi everyone, I recently uploaded my website files to a server. When I tried to log into my website, I received these error messages: *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start]: Cannot send session cookie - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: Cannot modify header information - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in* /home2/myparcoa/public_html/includes/login_form.php* on line *36* * * The website worked fine on the Apache localhost server (I could log in), so I'm not sure what's wrong with the code which is creating the error on the online server. Any ideas? I've highlighted the two error lines (31 34). I'd appreciate any insight! Thnx! !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php $submit = ($_POST['submit']); if ($submit) // If user clicks the 'ENTER' button to login { // Connect to server and select database include (includes/mysql_connect.inc); include (includes/connect_res_directory.php); // define login variables $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $check_login = mysql_query(SELECT * FROM unit_info WHERE login = '$login' AND password = '$password'); $data = mysql_fetch_assoc($check_login); // Are all the fields filled? if($login $password) { // If fields are entered, verify username and password in mysql database if (mysql_num_rows($check_login)) // If the login and password exists { //Login * session_start();* $_SESSION ['login'] = $data['login']; * header (Location: index_test.php); // webpage for correct login* exit; } else { // Invalid username/password echo div class='alert'The username or password you entered is incorrect./div; } } else echo div class='alert'Please enter all the fields!/div; } ? The session cookie must be sent prior to any output. Including, but not limited to, comments, whitespace, HTML code, etc. Even a blank line before the first ?php line will be enough to tell the web server that all the headers have been sent and to start sending data. At that stage, the session cookie - which is sent as a header - cannot be sent as all the headers have been sent. Options. 1 - Use output buffering. This tells PHP to not output anything until the end of the script. So echo's, print's, etc. don't send their data directly. This allows out of order headers and body to be sent and the server sorts it all out at the end. You can override output_buffering at runtime, but if headers have been sent due to white space, it won't help with the session cookie. 2 - Remove all white space. Personally, this is the route I would use. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Warning: session_start()
On 19 May 2011 at 10:20, Richard Quadling rquadl...@gmail.com wrote: On 18 May 2011 19:15, Nazish naz...@jhu.edu wrote: Hi everyone, !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php code, code, code. ? The session cookie must be sent prior to any output. Including, but not limited to, comments, whitespace, HTML code, etc. 2 - Remove all white space. Personally, this is the route I would use. For the sake of completeness, that is whitespace *outside* the ?php ? tags. tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: session_start()
On 19/05/11 10:37, Tim Streater wrote: On 19 May 2011 at 10:20, Richard Quadlingrquadl...@gmail.com wrote: On 18 May 2011 19:15, Nazishnaz...@jhu.edu wrote: Hi everyone, !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php code, code, code. ? The session cookie must be sent prior to any output. Including, but not limited to, comments, whitespace, HTML code, etc. 2 - Remove all white space. Personally, this is the route I would use. For the sake of completeness, that is whitespace *outside* the?php ? tags. tim The comment should really be inside the php block: ?php /* WHEN USER CLICKS 'ENTER' TO LOGIN */ ... code ... ? otherwise (notwithstanding the session_start() problem) you'll get the comments in you HTML source - probably not what you wanted... -- Peter Ford, Developer phone: 01580 89 fax: 01580 893399 Justcroft International Ltd. www.justcroft.com Justcroft House, High Street, Staplehurst, Kent TN12 0AH United Kingdom Registered in England and Wales: 2297906 Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: session_start()
-Original Message- From: Pete Ford [mailto:p...@justcroft.com] Sent: 19 May 2011 11:36 To: php-general@lists.php.net Subject: Re: [PHP] Warning: session_start() On 18 May 2011 19:15, Nazishnaz...@jhu.edu wrote: Hi everyone, !-- - WHEN USER CLICKS 'ENTER' TO LOGIN !-- -- ?php code, code, code. ? The comment should really be inside the php block: Not to mention that not all of that so-called comment is actually comment, due to the little-understood principle that every -- inside !-- -- flips between comment and renderable text, and counting your hyphens *very* carefully reveals that the WHEN USER message is liable to be treated as renderable text. It is good practice, for this reason, NEVER to use any double-hyphen combinations within an HTML comment - single ones are fine, but any other kind of usage such as the above should be studiously avoided. (Speaking as one bitten on the bum multiple times by badly-formatted HTML comments in a specialist bought-in system, which constantly threatened to ruin my carefully crafted CSS layouts!) Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507 City Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
Re: [PHP] Warning: session_start()
On 19 May 2011 16:05, Nazish naz...@jhu.edu wrote: I didn't realize that connecting to the MySQL database involved sending a header: eg. mysql_connect($host, $user, $mysql_pass); It doesn't. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/iZdpBR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: session_start()
On 19 May 2011 16:05, Nazish naz...@jhu.edu wrote: Thanks for all your suggestions such as removing whitespace before the ?php tag and commenting issues. I made those changes. I didn't realize that connecting to the MySQL database involved sending a header: eg. mysql_connect($host, $user, $mysql_pass); Does this mean this mysql_connect statement should go before the html tag - even though mysql_connect is part of my conditional statement for logging in? (code is below) I primarily solved the header problem on my login page with a simple replacement. I used this line: echo 'script language=javascriptlocation.href=first_page.php/script'; Instead of: header (Location: first_page.php); And the page redirected :) However, I'm still experiencing issues with session_start() -- once the user's login password has been verified, the session begins and their session ID is saved as a variable -- this process takes place in the middle of the code, after the header. I can't put this right at the beginning of the code. In this case, from what I understand, I should use output buffering? Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/myparcoa/public_html/index.php:10) in /home2/myparcoa/public_html/includes/login_form.php on line 32 Thanks again for the insights. On Wed, May 18, 2011 at 2:54 PM, Andre Polykanine an...@oire.org wrote: Hello Nazish, Try to delete your HTML comments before the ?php starting tag. So remove *anything* before ?php. -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Nazish naz...@jhu.edu To: php-general@lists.php.net Date created: , 9:15:37 PM Subject: [PHP] Warning: session_start() Hi everyone, I recently uploaded my website files to a server. When I tried to log into my website, I received these error messages: *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start ]: Cannot send session cookie - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start ]: Cannot send session cache limiter - headers already sent (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: Cannot modify header information - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in* /home2/myparcoa/public_html/includes/login_form.php* on line *36* * * The website worked fine on the Apache localhost server (I could log in), so I'm not sure what's wrong with the code which is creating the error on the online server. Any ideas? I've highlighted the two error lines (31 34). I'd appreciate any insight! Thnx! !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php $submit = ($_POST['submit']); if ($submit) // If user clicks the 'ENTER' button to login { // Connect to server and select database include (includes/mysql_connect.inc); include (includes/connect_res_directory.php); // define login variables $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $check_login = mysql_query(SELECT * FROM unit_info WHERE login = '$login' AND password = '$password'); $data = mysql_fetch_assoc($check_login); // Are all the fields filled? if($login $password) { // If fields are entered, verify username and password in mysql database if (mysql_num_rows($check_login)) // If the login and password exists { //Login * session_start();* $_SESSION ['login'] = $data['login']; * header (Location: index_test.php); // webpage for correct login* exit; } else { // Invalid username/password echo div class='alert'The username or password you entered is incorrect./div; } } else echo div class='alert'Please enter all the fields!/div; } ? ---The next line is the first line of the file. ?php session_start(); ? -The previous line is the last line of the file. Save the file as test.php Run it. Now remove the blank line and re-run it. See? -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY :
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
Hi Header just be modified if its at the start of your script... right code: ?php ... header(); ... ? and not.. ?php ... ? php header(); ? Valentine On Thu, May 19, 2011 at 9:45 PM, Marc Guay marc.g...@gmail.com wrote: Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I don't believe the version has anything to do with it, but who knows. I set error_reporting = E_ALL | E_STRICT and verified that display_errors = On, still nothing. Any ideas what could be allowing a header('Location:'); call to redirect without throwing an error after output has been sent to the browser? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
Thank you Balint but if you read my message I have a good understanding of what causes this error. My confusion is why it is not being thrown in this partciular instance. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
Sorry, I forgot the alternative.. You can use simply meta refresh which is working anyway. Usually I insert more than one redirector function to my script... Eg.: ... $back = $_SERVER['PHP_SELF'] . '?action=login'; //header('Location: '.$back.''); echo 'meta http-equiv=refresh content=0;url='.$back.' /'; ... Valentine 2011/5/19 Bálint Horváth hbal...@gmail.com Hi Header just be modified if its at the start of your script... right code: ?php ... header(); ... ? and not.. ?php ... ? php header(); ? Valentine On Thu, May 19, 2011 at 9:45 PM, Marc Guay marc.g...@gmail.com wrote: Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I don't believe the version has anything to do with it, but who knows. I set error_reporting = E_ALL | E_STRICT and verified that display_errors = On, still nothing. Any ideas what could be allowing a header('Location:'); call to redirect without throwing an error after output has been sent to the browser? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
See if output_buffering and output_handler are set the same in your php.ini and/or phpinfo() output between working and non-working versions. Thanks Daniel. With output_buffering On the error was not displayed and the re-location fired, while Off caused it to display the error and continue loading the page. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot modify header information - headers already sent by - classic
On Thu, May 19, 2011 at 15:45, Marc Guay marc.g...@gmail.com wrote: Hi folks, I'm running some code locally which should produce this fun error we all know and love: Warning: Cannot modify header information - headers already sent by... but does not. Switching from 5.3 to 5.2 reveals the error and running it on another server with 5.2 also shows the error. I don't believe the version has anything to do with it, but who knows. I set error_reporting = E_ALL | E_STRICT and verified that display_errors = On, still nothing. Any ideas what could be allowing a header('Location:'); call to redirect without throwing an error after output has been sent to the browser? See if output_buffering and output_handler are set the same in your php.ini and/or phpinfo() output between working and non-working versions. More info on these can be found here: http://php.net/manual/en/outcontrol.configuration.php -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: session_start()
On Wed, May 18, 2011 at 7:15 PM, Nazish naz...@jhu.edu wrote: Hi everyone, I recently uploaded my website files to a server. When I tried to log into my website, I received these error messages: *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start ]: Cannot send session cookie - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start ]: Cannot send session cache limiter - headers already sent (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: Cannot modify header information - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in* /home2/myparcoa/public_html/includes/login_form.php* on line *36* * * The website worked fine on the Apache localhost server (I could log in), so I'm not sure what's wrong with the code which is creating the error on the online server. Any ideas? I've highlighted the two error lines (31 34). I'd appreciate any insight! Thnx! !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php $submit = ($_POST['submit']); if ($submit) // If user clicks the 'ENTER' button to login { // Connect to server and select database include (includes/mysql_connect.inc); include (includes/connect_res_directory.php); // define login variables $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $check_login = mysql_query(SELECT * FROM unit_info WHERE login = '$login' AND password = '$password'); $data = mysql_fetch_assoc($check_login); // Are all the fields filled? if($login $password) { // If fields are entered, verify username and password in mysql database if (mysql_num_rows($check_login)) // If the login and password exists { //Login * session_start();* $_SESSION ['login'] = $data['login']; *header (Location: index_test.php); // webpage for correct login* exit; } else { // Invalid username/password echo div class='alert'The username or password you entered is incorrect./div; } } else echo div class='alert'Please enter all the fields!/div; } ? Compare your configuration files. The option that's likely different here is output_buffering. See the manual for full details: http://php.net/outcontrol.configuration To avoid this in future I suggest you make sure the configuration you're running in production matches that which you're running in development, other than display_errors (off or to a file in production, on in dev). In fact it doesn't really matter if they're different so long as you know what's different, why and that the code you write can cope with both, but I'd recommend they're as similar as is logical. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] Warning: session_start()
Hello Nazish, Try to delete your HTML comments before the ?php starting tag. So remove *anything* before ?php. -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http://twitter.com/m_elensule Facebook: http://facebook.com/menelion Original message From: Nazish naz...@jhu.edu To: php-general@lists.php.net Date created: , 9:15:37 PM Subject: [PHP] Warning: session_start() Hi everyone, I recently uploaded my website files to a server. When I tried to log into my website, I received these error messages: *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start]: Cannot send session cookie - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: session_start() [function.session-starthttp://www.myparcoasis.com/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/myparcoa/public_html/index.php:10) in * /home2/myparcoa/public_html/includes/login_form.php* on line *33* *Warning*: Cannot modify header information - headers already sent by (output started at /home2/myparcoa/public_html/index.php:10) in* /home2/myparcoa/public_html/includes/login_form.php* on line *36* * * The website worked fine on the Apache localhost server (I could log in), so I'm not sure what's wrong with the code which is creating the error on the online server. Any ideas? I've highlighted the two error lines (31 34). I'd appreciate any insight! Thnx! !--- WHEN USER CLICKS 'ENTER' TO LOGIN ! ?php $submit = ($_POST['submit']); if ($submit) // If user clicks the 'ENTER' button to login { // Connect to server and select database include (includes/mysql_connect.inc); include (includes/connect_res_directory.php); // define login variables $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $check_login = mysql_query(SELECT * FROM unit_info WHERE login = '$login' AND password = '$password'); $data = mysql_fetch_assoc($check_login); // Are all the fields filled? if($login $password) { // If fields are entered, verify username and password in mysql database if (mysql_num_rows($check_login)) // If the login and password exists { //Login * session_start();* $_SESSION ['login'] = $data['login']; *header (Location: index_test.php); // webpage for correct login* exit; } else { // Invalid username/password echo div class='alert'The username or password you entered is incorrect./div; } } else echo div class='alert'Please enter all the fields!/div; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning when calling session_start()
On Tue, Dec 21, 2010 at 9:27 PM, web...@blaettner.com wrote: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /./sess.php:3) in /./sess.php on line 5 first - this is probably your culprit: don't output empty lines before you do anything (just a general good practice) also i'd turn on output buffering. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
On Tue, 2010-06-22 at 10:41 -0400, Daniel P. Brown wrote: On Tue, Jun 22, 2010 at 10:17, Mike Davies m...@integrawebdesign.co.uk wrote: [snip!] Warning: reset() [function.reset]: Passed variable is not an array or object in /home/b23aadf/public_html/news/details.php on line 72 [snip!] Is anyone able to help resolve this? If you let me know what further information you require I can provide it. Note the first error (quoted herein). That tells you that the variable ($thumbsarray) is not actually an array. How is it being instantiated and defined? The only earlier reference to $thumbsarray is in the first lines of the file : ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); $totalRows_thumbs = mysql_num_rows($thumbs); $i = 1; while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
Mike, Little weird. I executed the same lines of code against my sample database and did not got any warning. You might want to send the code for projects and news to do any comparison? *[I will silently wait for the PHP demi-gods (the Ashleys, the Pauls et al) at hover their vigilant eyes on your lines .:) ]* Regards, Shreyas On Wed, Jun 23, 2010 at 2:48 PM, Mike Davies m...@integrawebdesign.co.ukwrote: The only earlier reference to $thumbsarray is in the first lines of the file : ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); $totalRows_thumbs = mysql_num_rows($thumbs); $i = 1; while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Shreyas Agasthya
Re: [PHP] Warning messages on web page.
On Wed, 2010-06-23 at 15:55 +0530, Shreyas Agasthya wrote: Mike, Little weird. I executed the same lines of code against my sample database and did not got any warning. You might want to send the code for projects and news to do any comparison? *[I will silently wait for the PHP demi-gods (the Ashleys, the Pauls et al) at hover their vigilant eyes on your lines .:) ]* Regards, Shreyas On Wed, Jun 23, 2010 at 2:48 PM, Mike Davies m...@integrawebdesign.co.ukwrote: The only earlier reference to $thumbsarray is in the first lines of the file : ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); $totalRows_thumbs = mysql_num_rows($thumbs); $i = 1; while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you didn't get any warnings on your test machine, it might just be because of a different error reporting being set up. As for the local test, did it work as expected? If so, and the code hasn't changed, then it might be the actual tables in the database. If there are no rows returned where you expected some, and the code expects rows as an array, then it could be the cause of the problem. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Warning messages on web page.
Hold everything, Mike! On Wed, Jun 23, 2010 at 05:18, Mike Davies m...@integrawebdesign.co.uk wrote: [snip!] ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; /** * Above line is placed here so that we can be easily, * deliberately, and permanently destroyed. Of course, * I suppose we *could* avoid that by sanitizing the input. * Perhaps mysql_real_escape_string() or something */ $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); // You don't need to reconnect to the database between queries. // Since you're using the same here as above, the same link is fine. $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); // You don't need to tell mysql_query() which database to use every time // either, when using the same database for queries. $totalRows_thumbs = mysql_num_rows($thumbs); // Doesn't look like you use this --- at least in this code snippet. Necessary? $i = 1; // I'd lose the above line as well. You'll see why in a second /** REPLACE THIS: while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } **/ // WITH THIS: while($row_thumbs = mysql_fetch_assoc($thumbs)) { $thumbsarray[] = $row_thumbs; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Okay. On the database to which you're connecting, use phpMyAdmin, the MySQL CLI, or something other than this and run the following query: SELECT * FROM news_thumbs; Is anything returned? -- /Daniel P. Brown UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
On Wed, 2010-06-23 at 09:09 -0400, Daniel Brown wrote: Hold everything, Mike! On Wed, Jun 23, 2010 at 05:18, Mike Davies m...@integrawebdesign.co.uk wrote: [snip!] ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; /** * Above line is placed here so that we can be easily, * deliberately, and permanently destroyed. Of course, * I suppose we *could* avoid that by sanitizing the input. * Perhaps mysql_real_escape_string() or something */ $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); // You don't need to reconnect to the database between queries. // Since you're using the same here as above, the same link is fine. $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); // You don't need to tell mysql_query() which database to use every time // either, when using the same database for queries. $totalRows_thumbs = mysql_num_rows($thumbs); // Doesn't look like you use this --- at least in this code snippet. Necessary? $i = 1; // I'd lose the above line as well. You'll see why in a second /** REPLACE THIS: while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } **/ // WITH THIS: while($row_thumbs = mysql_fetch_assoc($thumbs)) { $thumbsarray[] = $row_thumbs; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Okay. On the database to which you're connecting, use phpMyAdmin, the MySQL CLI, or something other than this and run the following query: SELECT * FROM news_thumbs; Is anything returned? Nothing is returned for SELECT query as there is nothing in the table as yet. Perhaps this is the problem. Typically all projects would have an associated thumb image but all news items may not. Perhaps a thumb image is necessary to stop this warning? Should I change the code to allow for there being no thumb image, if so can you suggest how I might modify it? Thanks to everyone who has responded, it has been most useful. regards, Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
On Wed, 2010-06-23 at 16:14 +0100, Mike Davies wrote: On Wed, 2010-06-23 at 09:09 -0400, Daniel Brown wrote: Hold everything, Mike! On Wed, Jun 23, 2010 at 05:18, Mike Davies m...@integrawebdesign.co.uk wrote: [snip!] ?php mysql_select_db($database_general, $general); $query_details = SELECT * FROM news WHERE news_id = '$_GET[id]'; /** * Above line is placed here so that we can be easily, * deliberately, and permanently destroyed. Of course, * I suppose we *could* avoid that by sanitizing the input. * Perhaps mysql_real_escape_string() or something */ $details = mysql_query($query_details, $general) or die(mysql_error()); $row_details = mysql_fetch_assoc($details); $totalRows_details = mysql_num_rows($details); mysql_select_db($database_general, $general); // You don't need to reconnect to the database between queries. // Since you're using the same here as above, the same link is fine. $query_thumbs = SELECT * FROM news_thumbs; $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); // You don't need to tell mysql_query() which database to use every time // either, when using the same database for queries. $totalRows_thumbs = mysql_num_rows($thumbs); // Doesn't look like you use this --- at least in this code snippet. Necessary? $i = 1; // I'd lose the above line as well. You'll see why in a second /** REPLACE THIS: while ($row_thumbs = mysql_fetch_assoc($thumbs)){ $thumbsarray[$i] = $row_thumbs; $i++; } **/ // WITH THIS: while($row_thumbs = mysql_fetch_assoc($thumbs)) { $thumbsarray[] = $row_thumbs; } //print_r($thumbsarray); ? This is exactly the same as the code which is working for the 'projects' pages. Okay. On the database to which you're connecting, use phpMyAdmin, the MySQL CLI, or something other than this and run the following query: SELECT * FROM news_thumbs; Is anything returned? Nothing is returned for SELECT query as there is nothing in the table as yet. Perhaps this is the problem. Typically all projects would have an associated thumb image but all news items may not. Perhaps a thumb image is necessary to stop this warning? Should I change the code to allow for there being no thumb image, if so can you suggest how I might modify it? Thanks to everyone who has responded, it has been most useful. regards, Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk If you haven't in your code, then make sure you define $thumbsarray as an array before you attempt to use it in the loop. This will have no effect where rows are returned, but it will ensure an empty array exists if your code expects it and there is no data in the database to populate it. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Warning messages on web page.
On Wed, Jun 23, 2010 at 11:14, Mike Davies m...@integrawebdesign.co.uk wrote: Nothing is returned for SELECT query as there is nothing in the table as yet. Perhaps this is the problem. Typically all projects would have an associated thumb image but all news items may not. Perhaps a thumb image is necessary to stop this warning? Should I change the code to allow for there being no thumb image, if so can you suggest how I might modify it? With no rows returned, there's no array. The while() loop doesn't even trigger there. You could either add some dummy data, populate the rows, or adjust the code like so: ?php if (isset($thumbsarray) is_array($thumbsarray)) { while (list($key, $value) = each($thumbsarray)) { // ... } } else { // There are no thumbs. Oh, my God, the horror! No thumbs! } ? -- /Daniel P. Brown UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
On Wed, 2010-06-23 at 16:22 +0100, Ashley Sheridan wrote: On Wed, 2010-06-23 at 16:14 +0100, Mike Davies wrote: If you haven't in your code, then make sure you define $thumbsarray as an array before you attempt to use it in the loop. This will have no effect where rows are returned, but it will ensure an empty array exists if your code expects it and there is no data in the database to populate it. Thanks, Ash http://www.ashleysheridan.co.uk Thanks Ash and to everyone else. I added : $thumbsarray=array() above the first instance and the warning no longer appears. Hopefully nothing else will be affected. Many thanks for all your time. regards, Mike -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
Mike Davies wrote: Hello, This is my first post to this list and I am a novice at php coding. I can generally follow the code but not good at writing from scratch. I have recently been trying to add to a website which was originally developed by someone else and is written in php and mysql. I am trying to add a 'news' section to the site. This would be similar to an existing 'projects' section so, rather than write it completely from scratch I copied the php and the database tables from the 'project' section and renamed 'project' to 'news'. This is working well except for one thing – I get the following error messages when looking at the detailed news item. This code does not produce this warning in the project section which is using the same php code Warning: reset() [function.reset]: Passed variable is not an array or object in /home/b23aadf/public_html/news/details.php on line 72 Warning: Variable passed to each() is not an array or object in /home/b23aadf/public_html/news/details.php on line 73 The relevant lines are : put a var_dump($thumbarray); right here and see what $thumbarray is 72 reset($thumbsarray); 73 while (list($key, $value) = each($thumbsarray)) { The site is at www.aadf.co.uk and select 'News'. Is anyone able to help resolve this? If you let me know what further information you require I can provide it. Mike Davies -- Jim Lucas A: Maybe because some people are too annoyed by top-posting. Q: Why do I not get an answer to my question(s)? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
Mike, A couple of things that I could understand reading carefully at the error. 1. reset takes an array as the input and perhaps your $thumbsarray is *not *an array? Reset will set the internal pointer to the start of the array. 2. Warning # 2 is very closely related to #1 since you can iterate on an array and not on a variable. 3. Just FYI - You can control the behavior should or not these warnings/notices/errors in your php.ini file. Do a quick google and you should be happy to see the result. Regards, Shreyas On Tue, Jun 22, 2010 at 7:47 PM, Mike Davies m...@integrawebdesign.co.ukwrote: Hello, This is my first post to this list and I am a novice at php coding. I can generally follow the code but not good at writing from scratch. I have recently been trying to add to a website which was originally developed by someone else and is written in php and mysql. I am trying to add a 'news' section to the site. This would be similar to an existing 'projects' section so, rather than write it completely from scratch I copied the php and the database tables from the 'project' section and renamed 'project' to 'news'. This is working well except for one thing – I get the following error messages when looking at the detailed news item. This code does not produce this warning in the project section which is using the same php code Warning: reset() [function.reset]: Passed variable is not an array or object in /home/b23aadf/public_html/news/details.php on line 72 Warning: Variable passed to each() is not an array or object in /home/b23aadf/public_html/news/details.php on line 73 The relevant lines are : 72 reset($thumbsarray); 73 while (list($key, $value) = each($thumbsarray)) { The site is at www.aadf.co.uk and select 'News'. Is anyone able to help resolve this? If you let me know what further information you require I can provide it. Mike Davies -- Mike Davies Integra Web Design, Rhynie, By Huntly, AB54 4LS 01464 861535www.integrawebdesign.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Shreyas Agasthya
Re: [PHP] Warning messages on web page.
On Tue, Jun 22, 2010 at 10:17, Mike Davies m...@integrawebdesign.co.uk wrote: [snip!] Warning: reset() [function.reset]: Passed variable is not an array or object in /home/b23aadf/public_html/news/details.php on line 72 [snip!] Is anyone able to help resolve this? If you let me know what further information you require I can provide it. Note the first error (quoted herein). That tells you that the variable ($thumbsarray) is not actually an array. How is it being instantiated and defined? -- /Daniel P. Brown UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning messages on web page.
On Tue, Jun 22, 2010 at 03:17:53PM +0100, Mike Davies wrote: Hello, This is my first post to this list and I am a novice at php coding. I can generally follow the code but not good at writing from scratch. I have recently been trying to add to a website which was originally developed by someone else and is written in php and mysql. I am trying to add a 'news' section to the site. This would be similar to an existing 'projects' section so, rather than write it completely from scratch I copied the php and the database tables from the 'project' section and renamed 'project' to 'news'. This is working well except for one thing – I get the following error messages when looking at the detailed news item. This code does not produce this warning in the project section which is using the same php code Warning: reset() [function.reset]: Passed variable is not an array or object in /home/b23aadf/public_html/news/details.php on line 72 Warning: Variable passed to each() is not an array or object in /home/b23aadf/public_html/news/details.php on line 73 The relevant lines are : 72 reset($thumbsarray); 73 while (list($key, $value) = each($thumbsarray)) { The site is at www.aadf.co.uk and select 'News'. Is anyone able to help resolve this? If you let me know what further information you require I can provide it. Well formed question. Thanks for that. I see too many which aren't. I can't say why it's happening, but the $thumbsarray variable isn't getting built the way it should. You can insert a line just before your errors pop up like: ?php echo '$thumbsarray: '; print_r($thumbsarray); ? or ?php echo '$thumbsarray: '; echo var_dump($thumbsarray); ? or something similar. This will tell you if the variable is set and what type it has. I'm guessing it's not set. You'll have to look earlier to see where it should be built and isn't. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning?
At 7:02 PM + 2/6/10, Jochem Maas wrote: Op 2/6/10 4:29 PM, tedd schreef: Hi: Has anyone encountered this warning? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 I seem to remember this happening before, but I don't remember the solution. As I remember, it wasn't really reporting an error, but something else. I just don't remember how I dealt with it before. I don't know how to set session.bug_compat_warn to off. doesn't this work?: ?php ini_set('session.bug_compat_warn', 0); ? otherwise you'll have to set it in php.ini (or a .htaccess file) IIRC it means your using session_register() .. which is depreciated and will be dropped in 5.3 ... AFAIK best practices is not to use this function but instead assing to the $_SESSION superglobal. Jochem: Two things: 1. Your solution worked. Setting -- ?php ini_set('session.bug_compat_warn', 0); ? -- worked!!! Thank you. 2. I don't use session_register(). So has to be something else, but I don't know what that might be. Anyone have any ideas? Daniel? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning?
Op 2/7/10 3:40 PM, tedd schreef: At 7:02 PM + 2/6/10, Jochem Maas wrote: Op 2/6/10 4:29 PM, tedd schreef: Hi: Has anyone encountered this warning? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 I seem to remember this happening before, but I don't remember the solution. As I remember, it wasn't really reporting an error, but something else. I just don't remember how I dealt with it before. I don't know how to set session.bug_compat_warn to off. doesn't this work?: ?php ini_set('session.bug_compat_warn', 0); ? otherwise you'll have to set it in php.ini (or a .htaccess file) IIRC it means your using session_register() .. which is depreciated and will be dropped in 5.3 ... AFAIK best practices is not to use this function but instead assing to the $_SESSION superglobal. Jochem: Two things: 1. Your solution worked. Setting -- ?php ini_set('session.bug_compat_warn', 0); ? -- worked!!! Thank you. np :) 2. I don't use session_register(). So has to be something else, but I don't know what that might be. Anyone have any ideas? pretty sure Shawn nailed it. Daniel? Cheers, tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Thu, Aug 6, 2009 at 8:20 AM, abdulazeez alugodefati...@hotmail.com wrote: Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Hello Ash, Could that be termed as aiding and abetting that 'nice fellow from Nigeria'?. Let me know your term for it and while you're at it, could you not spend the money? Cheers. Alugo Abdulazeez Greetings from Nigeria. I believe the term you are looking for is fraud victim. I also believe Ash was being quite facetious. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
Hey guys, Did some digging... looks like the host for http://outsourcingroom.com is http://hosting.ua/. Also, outsourcingroom looks to be owned by http://www.cbsystematics.com. The host for this company website is http://parking.ru. Hopefully this information can be of use to someone a little more legal-eagle than myself. Nate n...@grapepudding.com On Thu, Aug 6, 2009 at 8:05 AM, Andrew Ballard aball...@gmail.com wrote: On Thu, Aug 6, 2009 at 8:20 AM, abdulazeez alugodefati...@hotmail.com wrote: Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Hello Ash, Could that be termed as aiding and abetting that 'nice fellow from Nigeria'?. Let me know your term for it and while you're at it, could you not spend the money? Cheers. Alugo Abdulazeez Greetings from Nigeria. I believe the term you are looking for is fraud victim. I also believe Ash was being quite facetious. :-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email addresses it found, but it is including other personal information, i.e. the username and password on the original site. Also, as it got that information as a result of hacking, and they are the ones directly using that information, well, they could be in a lot of trouble depending on where in the world they are. Thanks, Ash
Re: [PHP] Warning: OutsourcingRoom.com
On Wed, 2009-08-05 at 15:14 +0100, Ashley Sheridan wrote: On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email addresses it found, but it is including other personal information, i.e. the username and password on the
Re: [PHP] Warning: OutsourcingRoom.com
What we can do is make a Report Web Forgery for this site. If you use Firefox there is an option in the help menu. Also you can report to search engines like Google or Yahoo (that's what I did) well... in this thread we are doing something On Wed, Aug 5, 2009 at 11:14 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: Nobody can actually do anything. This happen all the time. Sites like facebook or myspace send invitations to all your mail's contacts, but that's not the problem. What I can't understand is why do they do pre-signup just you for the easy of you. I have _created_ an account just to edit my personal data, that's nonsense!!! If you give your contact info you are allowing this kind of issues, but if you don't... well, you can't use internet if you don't. On Wed, Aug 5, 2009 at 10:56 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Wed, 2009-08-05 at 09:54 -0400, Eric Butera wrote: On Wed, Aug 5, 2009 at 3:06 AM, Ashley Sheridana...@ashleysheridan.co.uk wrote: On Tue, 2009-08-04 at 20:49 -0700, Steve wrote: Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! Well, I try not to give out my details to too many people each month, and this month they were beat to it by a nice fellow in Nigeria who I'm helping out by letting him put some money into my account. Next month I had originally planned to invest in those berrys everyone is talking about and some watches, and then after that, I need to update my account details on Ebay (I forgot I even had an account with them!) as they keep asking me to go and do it because of a security update they've made. Ho hum... Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Har har. This was not a mindless 411 scam. It is a bit different when an actual site people use gets hacked and their personal information stolen. I too received one of these emails and it was very convincing. It has my exact username from the Elance site and was crafted in such a way that it seems this new site was a partner with Elance somehow. -- http://www.ericbutera.us/ Is there nothing that anybody can actually do about this? Where is the new company based? Are there laws in that country about this sort of thing? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Nicely said, but doesn't answer the question. Sites like that will send out emails all the time as invites, because they have the permission of whoever they are sending the emails on behalf of, hence why they can access the contacts list. This is a different situation, where the site was hacked, and the company is not only sending out invite links to all the email
Re: [PHP] Warning: OutsourcingRoom.com
Daniel Brown wrote: Just as a heads-up, in case you guys weren't yet aware (cross-posting): Elance.com was the victim of an SQL injection attack earlier this summer (they apparently missed our billions of threads on sanity). According to their folks, only names, company names, phone numbers, and email addresses were taken. Whether or not that's true, I don't know, but that's beyond the scope of this warning. The most recent attempt to get more of your personal information comes from a (*possibly* legitimate) website named OutsourcingRoom.com. If you have been a member of Elance, you may have already received the message from OSR that claims that you signed up with them, and gives you a username and password. Now, I'm not here to tell you guys and gals what to do, but taking the facts into account - the stealing of private information by breeching the security of a competitor - it's entirely up to you as to whether or not you'll consider OSR a trustworthy business. Chances are, they'll not only charge you for using the service, but will also be so kind as to reuse (or redistribute) your private and financial information, should you be willing to give it to them. We've already received numerous hits on our network for OutsourcingRoom.com and one or two other shoddy attempts to gain more information. Today the emails seem to have picked up significantly, and appear to be not only valid, but professionally-crafted. Thankfully, we were anticipating such, after being alerted to the attack by Elance themselves. Perhaps a bit embarrassing for them, but it was a good move to mitigate the damage post-fact, in my opinion. That's it. Just trying to keep everyone from getting scammed and screwed. For more information, check Google, as always. ;-P I got that email. I was wondering what that was about. Thanks for the info! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Division by zero
It's always better to validate your inputs in any was possible, this helps prevent exploits. -Original Message- From: Gary [mailto:gwp...@ptd.net] Sent: Thursday, April 30, 2009 8:51 AM To: php-general@lists.php.net Subject: [PHP] Warning: Division by zero I have a script that is a result of data entered in a form On the script (when I test without data entry), I am getting a warning that Warning: Division by zero in .inc.php on line 15. The warning is correct, however the viewer cannot access the second script without entering the data that would cancel the warning. Is this something I should worry about? or would it be better to right in an isset? I'm sorry if this does not seem clear. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Division by zero
I have a script that is a result of data entered in a form On the script (when I test without data entry), I am getting a warning that Warning: Division by zero in .inc.php on line 15. The warning is correct, however the viewer cannot access the second script without entering the data that would cancel the warning. Is this something I should worry about? or would it be better to right in an isset? Well, just as a general rule, you'll want to validate all possible user input. That includes checking whether or not particular input has been defined, whether or not it is valid for it's intended use and whether or not it's malicious. Applying that guideline to your situation, I would check to see if: * the input is set * the input is numeric If either or those are not true, I would default the value to 1 since division is being used. e.g., $iVar = 1; if(( isset( $_REQUEST['MY_NUMBER'] ) ( is_numeric( $_REQUEST[MY_NUMBER']))) { $iVar = $_REQUEST['MY_NUMBER']; } $iCalculatedValue = $x / $iVar; thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Division by zero
Thanks for your response. The error I am getting is when I am defining a variable. (line 15) $percent_difference=($assess_difference)/($assess_value); Does this make a difference? Thanks again for all your help. Gary Christoph Boget christoph.bo...@gmail.com wrote in message news:540509760904300600i7af94667w6bad30ed068d1...@mail.gmail.com... I have a script that is a result of data entered in a form On the script (when I test without data entry), I am getting a warning that Warning: Division by zero in .inc.php on line 15. The warning is correct, however the viewer cannot access the second script without entering the data that would cancel the warning. Is this something I should worry about? or would it be better to right in an isset? Well, just as a general rule, you'll want to validate all possible user input. That includes checking whether or not particular input has been defined, whether or not it is valid for it's intended use and whether or not it's malicious. Applying that guideline to your situation, I would check to see if: * the input is set * the input is numeric If either or those are not true, I would default the value to 1 since division is being used. e.g., $iVar = 1; if(( isset( $_REQUEST['MY_NUMBER'] ) ( is_numeric( $_REQUEST[MY_NUMBER']))) { $iVar = $_REQUEST['MY_NUMBER']; } $iCalculatedValue = $x / $iVar; thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Division by zero
The error I am getting is when I am defining a variable. (line 15) $percent_difference=($assess_difference)/($assess_value); Does this make a difference? No, it doesn't make a difference. The simple fact is that $assess_value is either undefined or has been set to 0 at some point. For it's use in the above equation, neither case is valid. Consequently, you really should be doing some validation at some point prior to that line. thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
Rene Fournier wrote: On 19-Nov-08, at 12:52 PM, Nathan Rixham wrote: Rene Fournier wrote: Hi, I have four identical command-line PHP scripts running, and each will frequently fetch some data from another server via file_get_contents(). By frequently, I mean on average, every second. Periodically, one of the processes (command-line PHP scripts), will fail on file_get_contents(), with the error message: first thing that springs to mind is some form of hardware limitation, quite sure it's not php - could be a firewall with flood protection (or even your own isp's anti malware set-up) to combat it try binding the outgoing request to a random ip each time (if you have multiple ip's on the box) [context: socket - bindto] That could explain it, except that all the traffic is on the same LAN. There's no firewall between Server A and Servers B and C. next up (very unlikely) but possibly outgoing port conflict where the previous local port is still closing whilst trying to be re-opened. That's interesting. I will look into that. to get an ideal fix though you'll want to move away from file_get_contents() as you're not doing things Yes, I've also read that CURL is preferred to file_get_contents for reasons of performance and security. I'm going to try that too. the most efficient way; HTTP/1.1 allows you to keep a port open and make multiple requests through the same socket/connection, simply keep the socket open and don't send a connection: close header after the request. (i say simply but you'll be needing to make you're own, or find a good, http handler that allows you to write raw requests and decode the raw http responses that come back) best of luck; feel free to post your code incase anything jumps out as obvious. I will let you know how it goes. Thanks for the advice! ...Rene had another thought, it could be the web server you're requesting that is locking up, not enough worker threads, running cpu high etc etc - worth checking -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 20-Nov-08, at 2:59 AM, Nathan Rixham wrote: Rene Fournier wrote: On 19-Nov-08, at 12:52 PM, Nathan Rixham wrote: Rene Fournier wrote: Hi, I have four identical command-line PHP scripts running, and each will frequently fetch some data from another server via file_get_contents(). By frequently, I mean on average, every second. Periodically, one of the processes (command-line PHP scripts), will fail on file_get_contents(), with the error message: first thing that springs to mind is some form of hardware limitation, quite sure it's not php - could be a firewall with flood protection (or even your own isp's anti malware set-up) to combat it try binding the outgoing request to a random ip each time (if you have multiple ip's on the box) [context: socket - bindto] That could explain it, except that all the traffic is on the same LAN. There's no firewall between Server A and Servers B and C. next up (very unlikely) but possibly outgoing port conflict where the previous local port is still closing whilst trying to be re- opened. That's interesting. I will look into that. to get an ideal fix though you'll want to move away from file_get_contents() as you're not doing things Yes, I've also read that CURL is preferred to file_get_contents for reasons of performance and security. I'm going to try that too. the most efficient way; HTTP/1.1 allows you to keep a port open and make multiple requests through the same socket/connection, simply keep the socket open and don't send a connection: close header after the request. (i say simply but you'll be needing to make you're own, or find a good, http handler that allows you to write raw requests and decode the raw http responses that come back) best of luck; feel free to post your code incase anything jumps out as obvious. I will let you know how it goes. Thanks for the advice! ...Rene had another thought, it could be the web server you're requesting that is locking up, not enough worker threads, running cpu high etc etc - worth checking Don't think that can be it, since (a) the other processes are not being denied their http requests and (b) requests are going to two servers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On Thu, Nov 20, 2008 at 11:50 AM, Rene Fournier [EMAIL PROTECTED] wrote: Don't think that can be it, since (a) the other processes are not being denied their http requests and (b) requests are going to two servers. Have you checked your firewall settings? It may be configured to deny requests temporarily on hosts it thinks may be attempting an HTTP DDoS, or perhaps something similar. Nathan mentioned the same, but is it possible that you're only considering a hardware firewall? Unless explicitly configured, a software firewall on the OS level could be blocking all matching traffic on all interfaces (including the LAN). -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] 1 LEFT: $149/mo. $0 Setup - Dual-Core/320GB HDD/1GB RAM/3TB 100Mbps/cPanel - SAME-DAY SETUP! Contact me to buy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 11:50 AM, Rene Fournier [EMAIL PROTECTED] wrote: Don't think that can be it, since (a) the other processes are not being denied their http requests and (b) requests are going to two servers. Have you checked your firewall settings? It may be configured to deny requests temporarily on hosts it thinks may be attempting an HTTP DDoS, or perhaps something similar. Nathan mentioned the same, but is it possible that you're only considering a hardware firewall? Unless explicitly configured, a software firewall on the OS level could be blocking all matching traffic on all interfaces (including the LAN). Rene, are you forking the command line script for each request by any chance? if you are remember to do an exit() after each one is finished otherwise the new forked process will stay open until cleaned up by the system (or until the thread that forked is finished) which could be creating you're problem. apologies if way off the mark, just attempting some lateral thinking on this one! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 20-Nov-08, at 9:56 AM, Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 11:50 AM, Rene Fournier [EMAIL PROTECTED] wrote: Don't think that can be it, since (a) the other processes are not being denied their http requests and (b) requests are going to two servers. Have you checked your firewall settings? It may be configured to deny requests temporarily on hosts it thinks may be attempting an HTTP DDoS, or perhaps something similar. Nathan mentioned the same, but is it possible that you're only considering a hardware firewall? Unless explicitly configured, a software firewall on the OS level could be blocking all matching traffic on all interfaces (including the LAN). There is no firewall between any of the servers -- they are all on the same LAN. ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 20-Nov-08, at 10:46 AM, Nathan Rixham wrote: Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 11:50 AM, Rene Fournier [EMAIL PROTECTED] wrote: Don't think that can be it, since (a) the other processes are not being denied their http requests and (b) requests are going to two servers. Have you checked your firewall settings? It may be configured to deny requests temporarily on hosts it thinks may be attempting an HTTP DDoS, or perhaps something similar. Nathan mentioned the same, but is it possible that you're only considering a hardware firewall? Unless explicitly configured, a software firewall on the OS level could be blocking all matching traffic on all interfaces (including the LAN). Rene, are you forking the command line script for each request by any chance? if you are remember to do an exit() after each one is finished otherwise the new forked process will stay open until cleaned up by the system (or until the thread that forked is finished) which could be creating you're problem. apologies if way off the mark, just attempting some lateral thinking on this one! No apologies necessary -- I really appreciate the feedback. But no, I'm not forking anything. Each script (process) runs in a loop, and during each iteration it will call file_get_contents(Server A/B) one or more times. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On Thu, Nov 20, 2008 at 2:41 PM, Rene Fournier [EMAIL PROTECTED] wrote: There is no firewall between any of the servers -- they are all on the same LAN. I read when you said that, but I must not have explained myself well enough before. Sorry. Linux, by default, has firewalls installed with the OS. It doesn't matter whether you're on a LAN, WAN, or all by your lonesome. -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] 1 LEFT: $149/mo. $0 Setup - Dual-Core/320GB HDD/1GB RAM/3TB 100Mbps/cPanel - SAME-DAY SETUP! Contact me to buy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 20-Nov-08, at 12:44 PM, Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 2:41 PM, Rene Fournier [EMAIL PROTECTED] wrote: There is no firewall between any of the servers -- they are all on the same LAN. I read when you said that, but I must not have explained myself well enough before. Sorry. Linux, by default, has firewalls installed with the OS. It doesn't matter whether you're on a LAN, WAN, or all by your lonesome. That's a good point, but I don't believe it can explain the failures, since even though one process repeatedly fails at an HTTP request to Server A, several other processes on the same box are successfully executing HTTP requests (file_get_contents()). It seems to me that I'm periodically maxing-out a certain per-process resource limit. For example, number of open files or something similar... (Assuming file_get_contents() counts as that)... After 10-60 seconds, previous open files/connections for that particular process close, allowing it to again open HTTP requests to Server A. I I guess my next question is, what resource does file_get_contents() use upon execution? ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
Rene Fournier wrote: On 20-Nov-08, at 12:44 PM, Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 2:41 PM, Rene Fournier [EMAIL PROTECTED] wrote: There is no firewall between any of the servers -- they are all on the same LAN. I read when you said that, but I must not have explained myself well enough before. Sorry. Linux, by default, has firewalls installed with the OS. It doesn't matter whether you're on a LAN, WAN, or all by your lonesome. That's a good point, but I don't believe it can explain the failures, since even though one process repeatedly fails at an HTTP request to Server A, several other processes on the same box are successfully executing HTTP requests (file_get_contents()). It seems to me that I'm periodically maxing-out a certain per-process resource limit. For example, number of open files or something similar... (Assuming file_get_contents() counts as that)... After 10-60 seconds, previous open files/connections for that particular process close, allowing it to again open HTTP requests to Server A. I I guess my next question is, what resource does file_get_contents() use upon execution? ...Rene is it an https(ssl) address you're calling, and more specifically IIS servers? if so they don't close the connection properly meaning the connections will be left open until they time out andthus cause you're problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 20-Nov-08, at 3:57 PM, Nathan Rixham wrote: Rene Fournier wrote: On 20-Nov-08, at 12:44 PM, Daniel P. Brown wrote: On Thu, Nov 20, 2008 at 2:41 PM, Rene Fournier [EMAIL PROTECTED] wrote: There is no firewall between any of the servers -- they are all on the same LAN. I read when you said that, but I must not have explained myself well enough before. Sorry. Linux, by default, has firewalls installed with the OS. It doesn't matter whether you're on a LAN, WAN, or all by your lonesome. That's a good point, but I don't believe it can explain the failures, since even though one process repeatedly fails at an HTTP request to Server A, several other processes on the same box are successfully executing HTTP requests (file_get_contents()). It seems to me that I'm periodically maxing-out a certain per- process resource limit. For example, number of open files or something similar... (Assuming file_get_contents() counts as that)... After 10-60 seconds, previous open files/connections for that particular process close, allowing it to again open HTTP requests to Server A. I I guess my next question is, what resource does file_get_contents() use upon execution? ...Rene is it an https(ssl) address you're calling, and more specifically IIS servers? if so they don't close the connection properly meaning the connections will be left open until they time out andthus cause you're problem. Nope, it's just http, port 80, and not to IIS. To be clear, PHP scripts/processes on Server A (Mac OS X Server 10.4.11, PHP 5.2.4) are issuing these http requests (file_get_contents) to Servers B (Centos 5.2) and itself (Server A). The failures occur on attempts to Server B and A (itself), but only in one process at a time. (Server A is running several identical scripts/ processes -- even while one fails for a while, the others work -- that is, Servers B and A respond fine.) ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
Rene Fournier wrote: Hi, I have four identical command-line PHP scripts running, and each will frequently fetch some data from another server via file_get_contents(). By frequently, I mean on average, every second. Periodically, one of the processes (command-line PHP scripts), will fail on file_get_contents(), with the error message: PHP Warning: file_get_contents(http://.../): failed to open stream: HTTP request failed! Sometimes it's a single failure, other times, it fails repeatedly for 30-60 seconds, then starts working again. Strange, no? At first, I thought maybe I've maxed out the server in question, but I'm not. This problem happens on both servers that the scripts fetch data from. And more significantly, while one process may fail at file_get_contents(), the other processes (running identical code) on the same box continue to execute the function (against the same servers) without incident. My question is, is there some resource in Mac OS X Server 10.4 (or PHP 5.2.4) that would limit a continuously running PHP script from executing file_get_contents()? And to be clear, the failure doesn't kill the script, and after the failure, it will start working again. ...Rene first thing that springs to mind is some form of hardware limitation, quite sure it's not php - could be a firewall with flood protection (or even your own isp's anti malware set-up) to combat it try binding the outgoing request to a random ip each time (if you have multiple ip's on the box) [context: socket - bindto] next up (very unlikely) but possibly outgoing port conflict where the previous local port is still closing whilst trying to be re-opened. to get an ideal fix though you'll want to move away from file_get_contents() as you're not doing things the most efficient way; HTTP/1.1 allows you to keep a port open and make multiple requests through the same socket/connection, simply keep the socket open and don't send a connection: close header after the request. (i say simply but you'll be needing to make you're own, or find a good, http handler that allows you to write raw requests and decode the raw http responses that come back) best of luck; feel free to post your code incase anything jumps out as obvious. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Warning: HTTP request failed -- BSD resource limit reached?
On 19-Nov-08, at 12:52 PM, Nathan Rixham wrote: Rene Fournier wrote: Hi, I have four identical command-line PHP scripts running, and each will frequently fetch some data from another server via file_get_contents(). By frequently, I mean on average, every second. Periodically, one of the processes (command-line PHP scripts), will fail on file_get_contents(), with the error message: first thing that springs to mind is some form of hardware limitation, quite sure it's not php - could be a firewall with flood protection (or even your own isp's anti malware set-up) to combat it try binding the outgoing request to a random ip each time (if you have multiple ip's on the box) [context: socket - bindto] That could explain it, except that all the traffic is on the same LAN. There's no firewall between Server A and Servers B and C. next up (very unlikely) but possibly outgoing port conflict where the previous local port is still closing whilst trying to be re- opened. That's interesting. I will look into that. to get an ideal fix though you'll want to move away from file_get_contents() as you're not doing things Yes, I've also read that CURL is preferred to file_get_contents for reasons of performance and security. I'm going to try that too. the most efficient way; HTTP/1.1 allows you to keep a port open and make multiple requests through the same socket/connection, simply keep the socket open and don't send a connection: close header after the request. (i say simply but you'll be needing to make you're own, or find a good, http handler that allows you to write raw requests and decode the raw http responses that come back) best of luck; feel free to post your code incase anything jumps out as obvious. I will let you know how it goes. Thanks for the advice! ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php warning message
Yuval Schwartz wrote: Hello and thank you, Another question, I get a message: *Warning*: feof(): supplied argument is not a valid stream resource in * /home/content/t/h/e/theyuv/html/MessageBoard.php* on line *52* ** And I've tried troubleshooting for a while; I'm pretty sure I'm opening the file handle correctly and everything but I can't get feof or similar functions like fgets to work. Here is my code if you're interested (it's so that I color every 2nd line in the text): *$boardFile = MessageBoard.txt; $boardFileHandle = fopen($boardFile,r); for ($counter = 1; !feof($boardFileHandle); $counter += 1) { $colorLine = fgets(boardFilehandle); if ($counter % 2 == 0) { echo font color='00ff00'$colorline/font; } else { echo $colorline; } } fclose($boardFileHandle);* Thank you I might do something like: if(($lines = file(MessageBoard.txt))) { foreach ($lines as $num = $line){ if($num % 2 == 0) { echo font color='00ff00'$line/fontbr /; } else { echo $linebr /; } } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Thu, April 19, 2007 6:05 pm, Roman Neuhauser wrote: Here's what happens without E_NOTICE: [EMAIL PROTECTED] ~ $ php -r 'var_dump($foo);' Notice: Undefined variable: foo in Command line code on line 1 Sorry. I meant *with* E_NOTICE Yeah, that's what I had posted. I think you have mistaken me with Tijnema !: I don't have you confused (yet). You're just getting nailed by Reply All... Sorry. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
# [EMAIL PROTECTED] / 2007-04-18 23:03:08 -0500: On Wed, April 18, 2007 2:21 am, Tijnema ! wrote: Hmm, this is what i get: ~# php -r 'var_dump($foo);' NULL ~# php -r 'var_dump(@$foo);' NULL PHP6 snapshot from a month ago. Your php.ini doesn't have error_reporting cranked up to include E_NOTICE. That's your first mistake. :-) :-) :-) [Roman's does have that setting changed.] No, I've been using php-recommended.ini for the last several years. It has that error_reporting = E_ALL by default, and that's one of the reasons I've been using it. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Thu, April 19, 2007 2:27 am, Roman Neuhauser wrote: No, I've been using php-recommended.ini for the last several years. It has that error_reporting = E_ALL by default, and that's one of the reasons I've been using it. I don't think your PHP CLI is using the php.ini that you think it's using... Here's what happens without E_NOTICE: [EMAIL PROTECTED] ~ $ php -r 'var_dump($foo);' Notice: Undefined variable: foo in Command line code on line 1 Call Stack: 0.0002 1. {main}() Command line code:0 Dump $_SERVER Dump $_GET Dump $_POST Dump $_COOKIE Dump $_FILES Dump $_ENV Dump $_SESSION Dump $_REQUEST NULL [EMAIL PROTECTED] ~ $ php -v PHP 4.4.4-pl6-gentoo (cli) (built: Feb 9 2007 21:33:47) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Xdebug v2.0.0RC1, Copyright (c) 2002, 2003, 2004, 2005, 2006, by Derick Rethans [EMAIL PROTECTED] ~ $ Though, granted, I have some funky call-stack add-on happening here, that all kicks in AFTER the E_NOTICE fires off. Double check what php.ini is getting used by your CLI by doing this: php -i | grep php.ini If the php.ini file at that path doesn't have E_NOTICE on, you ain't got it. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
# [EMAIL PROTECTED] / 2007-04-19 17:28:42 -0500: On Thu, April 19, 2007 2:27 am, Roman Neuhauser wrote: No, I've been using php-recommended.ini for the last several years. It has that error_reporting = E_ALL by default, and that's one of the reasons I've been using it. I don't think your PHP CLI is using the php.ini that you think it's using... Here's what happens without E_NOTICE: [EMAIL PROTECTED] ~ $ php -r 'var_dump($foo);' Notice: Undefined variable: foo in Command line code on line 1 [EMAIL PROTECTED] ~ 1060:0 php -r 'echo E_ALL, \n;' 6143 [EMAIL PROTECTED] ~ 1061:0 php -r 'echo error_reporting(), \n; var_dump($foo);' 6143 PHP Notice: Undefined variable: foo in Command line code on line 1 NULL [EMAIL PROTECTED] ~ 1062:0 php -r 'error_reporting(E_ALL ~E_NOTICE); echo error_reporting(), \n; var_dump($foo);' 6135 NULL -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Thu, April 19, 2007 5:47 pm, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-04-19 17:28:42 -0500: On Thu, April 19, 2007 2:27 am, Roman Neuhauser wrote: No, I've been using php-recommended.ini for the last several years. It has that error_reporting = E_ALL by default, and that's one of the reasons I've been using it. I don't think your PHP CLI is using the php.ini that you think it's using... Here's what happens without E_NOTICE: [EMAIL PROTECTED] ~ $ php -r 'var_dump($foo);' Notice: Undefined variable: foo in Command line code on line 1 Sorry. I meant *with* E_NOTICE -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
# [EMAIL PROTECTED] / 2007-04-19 17:57:25 -0500: On Thu, April 19, 2007 5:47 pm, Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-04-19 17:28:42 -0500: On Thu, April 19, 2007 2:27 am, Roman Neuhauser wrote: No, I've been using php-recommended.ini for the last several years. It has that error_reporting = E_ALL by default, and that's one of the reasons I've been using it. I don't think your PHP CLI is using the php.ini that you think it's using... Here's what happens without E_NOTICE: [EMAIL PROTECTED] ~ $ php -r 'var_dump($foo);' Notice: Undefined variable: foo in Command line code on line 1 Sorry. I meant *with* E_NOTICE Yeah, that's what I had posted. I think you have mistaken me with Tijnema !: On Thu, April 19, 2007 2:27 am, Roman Neuhauser wrote: : # [EMAIL PROTECTED] / 2007-04-18 23:03:08 -0500: : On Wed, April 18, 2007 2:21 am, Tijnema ! wrote: : Hmm, this is what i get: : ~# php -r 'var_dump($foo);' : NULL : ~# php -r 'var_dump(@$foo);' : NULL : : : PHP6 snapshot from a month ago. : : Your php.ini doesn't have error_reporting cranked up to include E_NOTICE. : : That's your first mistake. :-) :-) :-) : : [Roman's does have that setting changed.] : : No, I've been using php-recommended.ini for the last several years. : It has that error_reporting = E_ALL by default, and that's one of the : reasons I've been using it. IOW, I don't have error_reporting changed, to the contrary: I use the the default value from php.ini-recommended unchanged. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On 4/17/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote: try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); Actually, the manual explicitly documents the @ operator as being valid in front of any EXPRESSION. It goes on to say that if you can get the value of something, you can use @ on it. The assignment operator returns a value. It is an expression. @$conn = pg_connect($conn_string); is therefore a documented feature. Using @ as a long-term solution is stll morally wrong, of course. :-) Ok, you're right, both are valid. But i think it's better to use it before the function name. (like all examples in the manual do ). Else you might end up with code like this: my_function(@$var); Which will result in a parse error... Tijnema -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
# [EMAIL PROTECTED] / 2007-04-18 07:55:05 +0100: On 4/17/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote: try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); Actually, the manual explicitly documents the @ operator as being valid in front of any EXPRESSION. Ok, you're right, both are valid. But i think it's better to use it before the function name. (like all examples in the manual do ). Else you might end up with code like this: my_function(@$var); Which will result in a parse error... Any expression means any expression. [EMAIL PROTECTED] ~ 1007:0 php -r 'var_dump($foo);' PHP Notice: Undefined variable: foo in Command line code on line 1 NULL [EMAIL PROTECTED] ~ 1008:0 php -r 'var_dump(@$foo);' NULL -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On 4/18/07, Roman Neuhauser [EMAIL PROTECTED] wrote: # [EMAIL PROTECTED] / 2007-04-18 07:55:05 +0100: On 4/17/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote: try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); Actually, the manual explicitly documents the @ operator as being valid in front of any EXPRESSION. Ok, you're right, both are valid. But i think it's better to use it before the function name. (like all examples in the manual do ). Else you might end up with code like this: my_function(@$var); Which will result in a parse error... Any expression means any expression. [EMAIL PROTECTED] ~ 1007:0 php -r 'var_dump($foo);' PHP Notice: Undefined variable: foo in Command line code on line 1 NULL [EMAIL PROTECTED] ~ 1008:0 php -r 'var_dump(@$foo);' NULL Hmm, this is what i get: ~# php -r 'var_dump($foo);' NULL ~# php -r 'var_dump(@$foo);' NULL PHP6 snapshot from a month ago. Tijnema -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
Tijnema ! wrote: On 4/18/07, Roman Neuhauser [EMAIL PROTECTED] wrote: # [EMAIL PROTECTED] / 2007-04-18 07:55:05 +0100: On 4/17/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote: try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); Actually, the manual explicitly documents the @ operator as being valid in front of any EXPRESSION. Ok, you're right, both are valid. But i think it's better to use it before the function name. (like all examples in the manual do ). Else you might end up with code like this: my_function(@$var); Which will result in a parse error... Any expression means any expression. [EMAIL PROTECTED] ~ 1007:0 php -r 'var_dump($foo);' PHP Notice: Undefined variable: foo in Command line code on line 1 NULL [EMAIL PROTECTED] ~ 1008:0 php -r 'var_dump(@$foo);' NULL Hmm, this is what i get: ~# php -r 'var_dump($foo);' NULL ~# php -r 'var_dump(@$foo);' NULL PHP6 snapshot from a month ago. a, php6 is akin to pre-alpha, no saying what state it is in atm. b, try turning on error_reporting to E_ALL Tijnema -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Wed, April 18, 2007 1:55 am, Tijnema ! wrote: @$conn = pg_connect($conn_string); Ok, you're right, both are valid. But i think it's better to use it before the function name. (like all examples in the manual do ). Else you might end up with code like this: my_function(@$var); Which will result in a parse error... What makes you think that will result in a parse error?... :-) $var is an expression @$var will suppress any error messages of that expression So I'm pretty sure that not only will that not result in a parse error, it's a Documented Feature. For example, if you have E_NOTICE on, and you didn't want to actaully FIX your code correctly, the @ would suppress the E_NOTICE from this (complete) script: ?php function my_function identity($foo){ return $foo; } my_function($bar); //E_NOTICE is output my_function(@$baz); //no E_NOTICE ? At least, that's what *I* would expect to happen, and it did in my quickie CLI test I just ran, I think... Not sure I even had E_NOTICE cranked up in CLI, but it sure wasn't a parse error. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Wed, April 18, 2007 2:21 am, Tijnema ! wrote: Hmm, this is what i get: ~# php -r 'var_dump($foo);' NULL ~# php -r 'var_dump(@$foo);' NULL PHP6 snapshot from a month ago. Your php.ini doesn't have error_reporting cranked up to include E_NOTICE. That's your first mistake. :-) :-) :-) [Roman's does have that setting changed.] -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
Short-term, you can toss an @ in front of pg_eonnect. Long-term: http://php.net/set_error_handler Also check out ini_set for error_log and friends. After you've done it the Right Way, get rid of the @ On Sat, April 14, 2007 8:44 am, Alain Roger wrote: Hi, Today i discovered that when my host webserver has some issue with PostgreSQL database, my code displays the following error message : *Warning*: pg_connect() [function.pg-connecthttp://www.immense.sk/function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host pgsql.exohosting.sk and accepting TCP/IP connections on port 5432? in */www/.php* on line yyy. I would like instead of that, to display my own error message... in fact, i would like to display something like : We are sorry but temporary we have some technical issues. Please try again later. how can i do that ? i tried to do : $conn = pg_connect($conn_string); if ($conn) // check if database is online { // close database connection pg_close($conn); } else { // impossible to connect to DB die('Maintenance in progress... Try later.'); } but it still display the previous warning message. thanks for your help. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5 -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On Sat, April 14, 2007 12:12 pm, Tijnema ! wrote: try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); Actually, the manual explicitly documents the @ operator as being valid in front of any EXPRESSION. It goes on to say that if you can get the value of something, you can use @ on it. The assignment operator returns a value. It is an expression. @$conn = pg_connect($conn_string); is therefore a documented feature. Using @ as a long-term solution is stll morally wrong, of course. :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
Look at http://devzone.zend.com/node/view/id/652 It explains it there. On 14/04/07, Alain Roger [EMAIL PROTECTED] wrote: Hi, Today i discovered that when my host webserver has some issue with PostgreSQL database, my code displays the following error message : *Warning*: pg_connect() [function.pg-connecthttp://www.immense.sk/function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host pgsql.exohosting.sk and accepting TCP/IP connections on port 5432? in */www/.php* on line yyy. I would like instead of that, to display my own error message... in fact, i would like to display something like : We are sorry but temporary we have some technical issues. Please try again later. how can i do that ? i tried to do : $conn = pg_connect($conn_string); if ($conn) // check if database is online { // close database connection pg_close($conn); } else { // impossible to connect to DB die('Maintenance in progress... Try later.'); } but it still display the previous warning message. thanks for your help. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5 -- Tom Chubb [EMAIL PROTECTED]
Re: [PHP] warning message to hide
Quoting Alain Roger [EMAIL PROTECTED]: Hi, Today i discovered that when my host webserver has some issue with PostgreSQL database, my code displays the following error message : *Warning*: pg_connect() [function.pg-connecthttp://www.immense.sk/function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host pgsql.exohosting.sk and accepting TCP/IP connections on port 5432? in */www/.php* on line yyy. I would like instead of that, to display my own error message... in fact, i would like to display something like : We are sorry but temporary we have some technical issues. Please try again later. how can i do that ? i tried to do : $conn = pg_connect($conn_string); try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); that should do the job for you in this case. Siavash if ($conn) // check if database is online { // close database connection pg_close($conn); } else { // impossible to connect to DB die('Maintenance in progress... Try later.'); } but it still display the previous warning message. thanks for your help. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] warning message to hide
On 4/14/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quoting Alain Roger [EMAIL PROTECTED]: Hi, Today i discovered that when my host webserver has some issue with PostgreSQL database, my code displays the following error message : *Warning*: pg_connect() [function.pg-connecthttp://www.immense.sk/function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host pgsql.exohosting.sk and accepting TCP/IP connections on port 5432? in */www/.php* on line yyy. I would like instead of that, to display my own error message... in fact, i would like to display something like : We are sorry but temporary we have some technical issues. Please try again later. how can i do that ? i tried to do : $conn = pg_connect($conn_string); try putting an @ sign before this line. something like this: @$conn = pg_connect($conn_string); According to the manual: http://www.php.net/manual/en/language.operators.errorcontrol.php the @ should be placed before the function, so like this: $conn = @pg_connect($conn_string); And if you want also to generate your own error. $conn = @pg_connect($conn_string) or die(My error here!); This will show My error here! when the function can't connect. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
tedd wrote: At 11:18 AM -0400 5/17/06, John Nichel wrote: tedd wrote: Hi (please insert your preference): This should be simple, but I'm having problems. I have a program that uploads an image file and then tries to set the permissions for the image (to be altered later). However, I get a Warning: chmod(): Operation not permitted error when trying to set the permission, what gives? If my program created the file, shouldn't it have permission to set the files permissions? What am I not understanding? Without seeing code, permissions of the directories, what sticky bits might or might not be set, etc., you could not be understanding many thingsor just onewho knows. I read all of your Google links, but no help. Just another example of how Google is not the answer. Then you're asking the wrong question. In any event, my code is pretty simple, just: chmod($url, 0755); //where $url is the file I want to change. The error I receive is noted above in the subject line. The permissions of the directories vary, but the folder that has the file I want to change permissions is currently set at 0777. Nice security there. Regardless, even if the user your webserver is running as has write permission to the directory (don't know who owns/what group that directory belongs to, as you didn't tell us that), you won't be able to change permissions of a file in that directory if the file isn't owned by the same user apache is running as. In doing a lstat() of both the parent program that created the file and the child file shows that they both have the identical uid and gid (i.e., the same user and group id's). And what user does Apache run as? Now, everything I've read, says: chmod() changes the permission of the specified file with the following caveat. chmod() can only change the permissions of files that are owned by the user running the command. In most cases, this is the user that the web server runs on. That confuses me, because who's the user here? Is it just the system administrator or the application? And if it is just the system administrator, then can't the system admin change anything he/she wants anyway? What's the point of having uid and gid's if a program can't change the permissions of a sibling file? This question should answer the previous question for you. I have tons of references as to what php filesystem functions are available, but I need a good reference as to what permissions are and how they actually can be changed in php -- does anyone have one a good reference OR care to explain? As it is now, I know how ride the horse, but I can't get the gate open. File permissions is beyond the scope of this mailing list. You need to buy a book, research on the web, etc., on *nix system administration, and concentrate on the filesystem/security/permissions sections, and the section on how apps/daemons operate. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
File permissions is beyond the scope of this mailing list. You need to buy a book, research on the web, etc., on *nix system administration, and concentrate on the filesystem/security/permissions sections, and the section on how apps/daemons operate. -- John C. Nichel IV John: My question basically was why isn't chmod() working for me? So, I thought it might be a question to pose to a php mailing list -- my mistake, sorry. In any event, I'll figure it out. Thanks. tedd PS: 0777 -- so you never go to extremes, or press limits, to try to solve a problem? -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
tedd wrote: File permissions is beyond the scope of this mailing list. You need to buy a book, research on the web, etc., on *nix system administration, and concentrate on the filesystem/security/permissions sections, and the section on how apps/daemons operate. -- John C. Nichel IV John: My question basically was why isn't chmod() working for me? So, I thought it might be a question to pose to a php mailing list -- my mistake, sorry. chmod() is working the way it's supposed to. You're not getting the results you desire, and to understand why, you need to understand how file ownership and permissions work on a *nix system. PS: 0777 -- so you never go to extremes, or press limits, to try to solve a problem? Not when it will compromise the security of my system. There is always another way to solve the problem. -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: chmod(): Operation not permitted ?
At 5:11 PM -0600 5/17/06, Brady Mitchell wrote: chmod() can only change the permissions of files that are owned by the user running the command. In most cases, this is the user that the web server runs on. That confuses me, because who's the user here? Is it just the system administrator or the application? This is the user that Apache (or whatever webserver) is running as. If you're using Apache, look at your httpd.conf file to find out who that user is. If you're creating files successfully, you can just look at the owner of that file to find out who it is. Is safe_mode enabled? From the manual (http://us3.php.net/chmod): In my code, I use: ini_set( 'safe_mode', '0' ); Which I think disables safe_mode and from what I've read, the default is off and in my phpinfo, it says it's 'off -- so I think it's off. :-) Note: When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. I understand that, except for the sticky bits -- I don't know what they are, but will look them up later. But safe_mode is off, so any application should be able to chmod(), right? However, when my application tries to change permissions via chmod(), it fails and generates a warning. BUT -- considering that this is a permission issue and not a php one, as I've been told, I'll end this thread and look elsewhere for an answer. Thanks. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
On Wed, May 17, 2006 10:01 am, tedd wrote: I have a program that uploads an image file and then tries to set the permissions for the image (to be altered later). However, I get a Warning: chmod(): Operation not permitted error when trying to set the permission, what gives? If my program created the file, shouldn't it have permission to set the files permissions? What am I not understanding? If you are trying to chmod() the file that is in /tmp from the $_FILES array, you probably can't do that -- but after you move_uploaded_file() you should be able to chmod that... Works for me. You may need to play with the directory to which the files are moving and you may want to do: $old = umask(0); move_uploaded_file(...); umask($old); http://php.net/umask Also research what current owner/group and permissions are on the file to see how you got into this problem to start with. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
On Wed, May 17, 2006 6:01 pm, tedd wrote: chmod($url, 0755); //where $url is the file I want to change. If $url is an actual URL to the file, with http:// in the front, you almost for sure cannot chmod that... You have to chmod it as a FILE in the file-system. That confuses me, because who's the user here? Is it just the system administrator or the application? In Apache with PHP as a Module, it's the User directive in httpd.conf With CGI, it's that same user, unless it's with suExec, then it could be anybody, unless... In IIS, it's probably E_MACHINE_USERNAME user -- but you're on your own for that one. The EASIEST way to find out, however, is ?php phpinfo();? which will TELL you which user it is. And if it is just the system administrator, then can't the system admin change anything he/she wants anyway? What's the point of having uid and gid's if a program can't change the permissions of a sibling file? You do *NOT* want your webserver running as sysadmin!!! THAT WOULD BE REALLY BAD!!! And as to what's the point of uid and gid and who can change what, it's so far off-topic here, in general, that I'll just ignore it, except to say that PHP runs as a specific user, and that user can ONLY change the files it is allowed to change, and that is a GOOD THING. I have tons of references as to what php filesystem functions are available, but I need a good reference as to what permissions are and how they actually can be changed in php -- does anyone have one a good reference OR care to explain? You should be able to Google for a Linux filesystem permissions how-to and get what you want here. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
On Thu, May 18, 2006 10:50 am, tedd wrote: File permissions is beyond the scope of this mailing list. You need to buy a book, research on the web, etc., on *nix system administration, and concentrate on the filesystem/security/permissions sections, and the section on how apps/daemons operate. My question basically was why isn't chmod() working for me? So, I thought it might be a question to pose to a php mailing list -- my mistake, sorry. In any event, I'll figure it out. Thanks. tedd PS: 0777 -- so you never go to extremes, or press limits, to try to solve a problem? 0777 is what you told us for the DIRECTORY containing the file, not the file itself. You did not tell use which user/group owned the file, nor directory, nor which user PHP is running as. We CANNOT answer your question directly, because you've asked your question rather badly. Posting abusive/argumentative replies to those at least trying to help you is not likely to make things better, is it? You're on the horse, and can't get the gate open. We're leading the horse to water, and can't make him drink. Maybe you can't get the gate open because you SHOULDN'T ride the horse down that dangerous path. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
tedd wrote: Hi GANG: :-) This should be simple, but I'm having problems. I have a program that uploads an image file and then tries to set the permissions for the image (to be altered later). However, I get a Warning: chmod(): Operation not permitted error when trying to set the permission, what gives? If my program created the file, shouldn't it have permission to set the files permissions? chances are that the file is created as user nobody, your not nobody ;-), ergo you can't chmod it ... can't remember the last time I didn't have root access to configure/fuck (you pick) the server the way I wanted it. I'm sure someone here knows exactly how to sort this issue without editing the httpd.conf. What am I not understanding? Thanks. tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
tedd wrote: Hi (please insert your preference): This should be simple, but I'm having problems. I have a program that uploads an image file and then tries to set the permissions for the image (to be altered later). However, I get a Warning: chmod(): Operation not permitted error when trying to set the permission, what gives? If my program created the file, shouldn't it have permission to set the files permissions? What am I not understanding? Without seeing code, permissions of the directories, what sticky bits might or might not be set, etc., you could not be understanding many thingsor just onewho knows. http://www.google.com/search?q=php+%22Warning%3A+chmod%28%29%3A+Operation+not+permitted%22btnG=Search -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: chmod(): Operation not permitted ?
At 11:18 AM -0400 5/17/06, John Nichel wrote: tedd wrote: Hi (please insert your preference): This should be simple, but I'm having problems. I have a program that uploads an image file and then tries to set the permissions for the image (to be altered later). However, I get a Warning: chmod(): Operation not permitted error when trying to set the permission, what gives? If my program created the file, shouldn't it have permission to set the files permissions? What am I not understanding? Without seeing code, permissions of the directories, what sticky bits might or might not be set, etc., you could not be understanding many thingsor just onewho knows. I read all of your Google links, but no help. Just another example of how Google is not the answer. In any event, my code is pretty simple, just: chmod($url, 0755); //where $url is the file I want to change. The error I receive is noted above in the subject line. The permissions of the directories vary, but the folder that has the file I want to change permissions is currently set at 0777. In doing a lstat() of both the parent program that created the file and the child file shows that they both have the identical uid and gid (i.e., the same user and group id's). Now, everything I've read, says: chmod() changes the permission of the specified file with the following caveat. chmod() can only change the permissions of files that are owned by the user running the command. In most cases, this is the user that the web server runs on. That confuses me, because who's the user here? Is it just the system administrator or the application? And if it is just the system administrator, then can't the system admin change anything he/she wants anyway? What's the point of having uid and gid's if a program can't change the permissions of a sibling file? I have tons of references as to what php filesystem functions are available, but I need a good reference as to what permissions are and how they actually can be changed in php -- does anyone have one a good reference OR care to explain? As it is now, I know how ride the horse, but I can't get the gate open. Thanks. tedd -- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: chmod(): Operation not permitted ?
chmod() can only change the permissions of files that are owned by the user running the command. In most cases, this is the user that the web server runs on. That confuses me, because who's the user here? Is it just the system administrator or the application? This is the user that Apache (or whatever webserver) is running as. If you're using Apache, look at your httpd.conf file to find out who that user is. If you're creating files successfully, you can just look at the owner of that file to find out who it is. Is safe_mode enabled? From the manual (http://us3.php.net/chmod): Note: When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. So, if you're running in safe mode, the php file, and the files that you need to modify have to be owned by the same user. Say you have process.php which is operating on the uploaded files, and it is owned by the jondoe user. The files that you wanted to chmod() would also have to be owned by jondoe, which is probably not the case. Apache is often run under the apache, www, or nobody user. HTH, Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Missing argument 7 calling a function
On 09 January 2006 16:14, enediel gonzalez wrote: thanks everybody who answered me, the segment bellow is the code that gave me problems, the $app_name was the 7th parameter neccesary for me to call the GetCommandDeclaration function, the solution I had for a while was to declare the variable global. :( Um -- the code you have posted contains a declaration for function GetCommandDeclaration(), but no call of it -- only one to GetProcedureDeclaration(). And in answer to you original question, you could always make the 7th parameter optional: function GetCommandDeclaration($RPM, $var2, $RFactor, $minimum, $maximum, $sport, $app_name='default') { $app_name = ; function GetCommandDeclaration($RPM, $var2, $RFactor, $minimum, $maximum, $sport){ global $app_name; //code here } function Process(){ global $db, $app_name; $query = get_query_declaration(); $result = mysql_query($query, $db); $rowCount = mysql_num_rows($result); $myCounter = 0; while ($myCounter $rowCount){ mysql_data_seek($result, $myCounter); $row = mysql_fetch_assoc($result); $RPM = $row['RPM']; $var2 = $row['var2']; $RFactor = $row['RFactor']; $minimum = $row['minimum']; $maximum = $row['maximum']; $sport = $row['$sport']; $app_name = $row['app_name']; $str_command_declaration = GetProcedureDeclaration($RPM, $var2, $RFactor, $minimum, $maximum, $sport); //code here } } Linux user 300141 Debian GNU/Linux Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Missing argument 7 calling a function
thanks everybody who answered me, the segment bellow is the code that gave me problems, the $app_name was the 7th parameter neccesary for me to call the GetCommandDeclaration function, the solution I had for a while was to declare the variable global. :( As you can see , the rest of variables got their values from a simple mysql request. Thanks in advance for any answer Regards Enediel $app_name = ; function GetCommandDeclaration($RPM, $var2, $RFactor, $minimum, $maximum, $sport){ global $app_name; //code here } function Process(){ global $db, $app_name; $query = get_query_declaration(); $result = mysql_query($query, $db); $rowCount = mysql_num_rows($result); $myCounter = 0; while ($myCounter $rowCount){ mysql_data_seek($result, $myCounter); $row = mysql_fetch_assoc($result); $RPM = $row['RPM']; $var2 = $row['var2']; $RFactor = $row['RFactor']; $minimum = $row['minimum']; $maximum = $row['maximum']; $sport = $row['$sport']; $app_name = $row['app_name']; $str_command_declaration = GetProcedureDeclaration($RPM, $var2, $RFactor, $minimum, $maximum, $sport); //code here } } Linux user 300141 Debian GNU/Linux -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Missing argument 7 calling a function
This should work; however, it sounds like you may want to think about using an array or creating an object. -Original Message- From: enediel gonzalez [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 3:58 PM To: php-general@lists.php.net Subject: [PHP] Warning: Missing argument 7 calling a function Hello I've a function with 6 arguments that works properly. Trying to add a 7th argument an being sure that calling the function I pass that one I received the following message (several times) on my web page Warning: Missing argument 7 for getcommanddeclaration() in /var/www/cp/apply.php on line 56 It's only one place where this function is called Thanks in advance for any help Enediel Linux user 398956 Debian GNU/Linux -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Missing argument 7 calling a function
Thanks for the answer, but I can not understand the origin of this error, seven values passed, seven variables to receive those values,none of them is an array, nothing more. for a while, just to continue working, the 7th variable was removed and I declared a global one, but this is something I don't enjoy to do it. best regards Enediel Linux user 398956 Debian GNU/Linux From: Programmer [EMAIL PROTECTED] To: 'enediel gonzalez' [EMAIL PROTECTED], php-general@lists.php.net Subject: RE: [PHP] Warning: Missing argument 7 calling a function Date: Fri, 6 Jan 2006 16:05:17 -0600 This should work; however, it sounds like you may want to think about using an array or creating an object. -Original Message- From: enediel gonzalez [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 3:58 PM To: php-general@lists.php.net Subject: [PHP] Warning: Missing argument 7 calling a function Hello I've a function with 6 arguments that works properly. Trying to add a 7th argument an being sure that calling the function I pass that one I received the following message (several times) on my web page Warning: Missing argument 7 for getcommanddeclaration() in /var/www/cp/apply.php on line 56 It's only one place where this function is called Thanks in advance for any help Enediel Linux user 398956 Debian GNU/Linux -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: Missing argument 7 calling a function
On Fri, 2006-01-06 at 20:27, enediel gonzalez wrote: Thanks for the answer, but I can not understand the origin of this error, seven values passed, seven variables to receive those values,none of them is an array, nothing more. for a while, just to continue working, the 7th variable was removed and I declared a global one, but this is something I don't enjoy to do it. Are you using any kind of compile cache? (apc, turckmm, phpa, zend) These are notorious (in my experience with phpa and zend anyways) of occasionally (not always though which is wierd) not noticing a source file has changed. If so, try flushing the cache directory, and restarting your webserver. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Missing argument 7 calling a function
Why not send us the Call and the Function for arguments sake (pun intended). Aaron On 1/6/06, enediel gonzalez [EMAIL PROTECTED] wrote: Hello I've a function with 6 arguments that works properly. Trying to add a 7th argument an being sure that calling the function I pass that one I received the following message (several times) on my web page Warning: Missing argument 7 for getcommanddeclaration() in /var/www/cp/apply.php on line 56 It's only one place where this function is called Thanks in advance for any help Enediel Linux user 398956 Debian GNU/Linux -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Missing argument 7 calling a function
On Fri, 2006-01-06 at 23:13, Aaron Koning wrote: Why not send us the Call and the Function for arguments sake (pun intended). Yeah, it might help up to track down the source (pun also intended ;) of the problem. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot send session cookie
John Taylor-Johnston wrote: Any idea why I'm getting this error, and only on this page? I have the same header on every other page? http://testesp.flsh.usherb.ca/thingstodo.html The page contains a \n before I start my ?php. Is this doing it? Most likely, yes. Why didn't you try removing it before posting to the list? Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html2/thingstodo.html:2) in /var/www/html2/thingstodo.html on line 4 Warning: Cannot send session cache limiter - headers already sent -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: Cannot send session cookie
Michael Crute wrote: The page contains a \n before I start my ?php. Is this doing it? That \n is it. You can't send ANYTHING to the browser before you send the headers and cookies are part of the headers. Take out the \n and all should be well. Thanks. Dreamweaver screwed me over ;)
Re: [PHP] Warning: Cannot send session cookie
On Tuesday 04 October 2005 08:15 pm, John Taylor-Johnston wrote: Any idea why I'm getting this error, and only on this page? I have the same header on every other page? http://testesp.flsh.usherb.ca/thingstodo.html The page contains a \n before I start my ?php. Is this doing it? yup ?php session_name( 'CCLTrolley' ); session_start(); // Initialize the trolley. if( !isset( $_SESSION['TrolleyContents'] ) ) { $_SESSION['TrolleyContents'] = array(); } ? Warning: Cannot send session cookie - headers already sent by (output started at /var/www/html2/thingstodo.html:2) in /var/www/html2/thingstodo.html on line 4 Warning: Cannot send session cache limiter - headers already sent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: imap_open(): Couldn't open stream
Joachim Person wrote: What could be the cause of the error Warning: imap_open(): Couldn't open stream ? I have got the address and the port to the imap server right, but I think that the imap server requires some sort of secure login. Could this be the problem? If yes, how can it be solved? If no, what other causes could it be? http://www.google.com/search?q=%22Warning%3A+imap_open%28%29%3A+Couldn%27t+open+stream%22 -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Warning: filemtime() (errno=75 - Value too large for defined data type)
-Original Message- From: Andrew Brampton [mailto:[EMAIL PROTECTED] Sent: Sunday, May 29, 2005 7:36 PM Hi, I'm receiving the following warning: Warning: filemtime(): Stat failed for master.log (errno=75 - Value too large for defined data type) in test.php on line 5 when I do the following line of code: filemtime ('master.log'); The file in question is over 2GB, but I'm not interested in its size, I just want to know the time it was last modified. 2 gigs? Ever considered rotating the logfile? I presume filemtime is just doing a stat which is failing when it tries to read the size field. Whatever the cause filemtime is returning false and displaying that warning. Does anyone know a work around for this warning (which does not involve shelling out a command line app)? Rotate the logfile for instance once a month, Tar it up and move it to a proper place My code was working fine until the file reached 2GB. P.S I'm running PHP 4.3.10-13 on a Debian distro. On some older systems there´s a 2gb limit: http://archives.neohapsis.com/archives/sf/forensics/2002-q2/0031.html Let me guess. The file is 2GB? If so, this is simply because your file utilities are not compiled with large file (64 bit) support. Here are some notes I have on fixing things for Linux: Updates to Red Hat 7.1 system required to deal with large (2GB) partition image files with The Coroner's Toolkit and TCTutils/autopsy. I think that´s the problem. Rotating the logfile is a nice and simple solution. -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/Systemdeveloper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php