Re: [PHP] Re: Authentication fails - problem line found
John Swartzentruber wrote: I stripped down my original script until it started receiving POST data, then I kept modifying it until I figured out where the problem was. I found it, but I'm still as clueless as every. To summarize: I have a form that posts to the same script that contains the form. In its original state, when the script is called after I submit the form data, the $_POST[] data is completely empty and the _SERVER variable that indicates the type of data is set to GET. In the script is the following code: if (IsSet($_POST[action])) { //$action = $_POST[action]; } else { $action = $_GET[action]; } Normally the second line is not commented. When I comment out that line, then the $_POST array has all of the data I would expect it to. When it is not commented, then it does not work. Just to make sure that I am really confused, this bit of code is *after* the call to var_dump($_POST), but *before* the code that creates the form. Does anyone have any ideas about why setting this variable has such a large and seemingly unrelated affect? WILD GUESS: Somewhere in your form and/or the logic, you are sending GET data for $action as well as POST data for $action, and you are confusing the two. Show us your stripped-down but still-broken code. -- 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] Re: Authentication fails - problem line found
I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. -phpninja -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Friday, March 04, 2005 11:03 AM To: John Swartzentruber Cc: php-general@lists.php.net Subject: Re: [PHP] Re: Authentication fails - problem line found John Swartzentruber wrote: I stripped down my original script until it started receiving POST data, then I kept modifying it until I figured out where the problem was. I found it, but I'm still as clueless as every. To summarize: I have a form that posts to the same script that contains the form. In its original state, when the script is called after I submit the form data, the $_POST[] data is completely empty and the _SERVER variable that indicates the type of data is set to GET. In the script is the following code: if (IsSet($_POST[action])) { //$action = $_POST[action]; } else { $action = $_GET[action]; } Normally the second line is not commented. When I comment out that line, then the $_POST array has all of the data I would expect it to. When it is not commented, then it does not work. Just to make sure that I am really confused, this bit of code is *after* the call to var_dump($_POST), but *before* the code that creates the form. Does anyone have any ideas about why setting this variable has such a large and seemingly unrelated affect? WILD GUESS: Somewhere in your form and/or the logic, you are sending GET data for $action as well as POST data for $action, and you are confusing the two. Show us your stripped-down but still-broken code. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
phpninja wrote: I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. -phpninja -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Friday, March 04, 2005 11:03 AM To: John Swartzentruber Cc: php-general@lists.php.net Subject: Re: [PHP] Re: Authentication fails - problem line found John Swartzentruber wrote: I stripped down my original script until it started receiving POST data, then I kept modifying it until I figured out where the problem was. I found it, but I'm still as clueless as every. To summarize: I have a form that posts to the same script that contains the form. In its original state, when the script is called after I submit the form data, the $_POST[] data is completely empty and the _SERVER variable that indicates the type of data is set to GET. In the script is the following code: if (IsSet($_POST[action])) { //$action = $_POST[action]; } else { $action = $_GET[action]; } Normally the second line is not commented. When I comment out that line, then the $_POST array has all of the data I would expect it to. When it is not commented, then it does not work. Just to make sure that I am really confused, this bit of code is *after* the call to var_dump($_POST), but *before* the code that creates the form. Does anyone have any ideas about why setting this variable has such a large and seemingly unrelated affect? WILD GUESS: Somewhere in your form and/or the logic, you are sending GET data for $action as well as POST data for $action, and you are confusing the two. Show us your stripped-down but still-broken code. How about using single quotes around all the action phrases: if (IsSet($_POST['action'])) { //$action = $_POST['action']; } else { $action = $_GET['action']; } I'm slowly learning, myself, on the proper placement of quotes. Thanks -dant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
On 3/4/2005 2:23 PM Dan wrote: phpninja wrote: I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. How about using single quotes around all the action phrases: if (IsSet($_POST['action'])) { //$action = $_POST['action']; } else { $action = $_GET['action']; } I'm slowly learning, myself, on the proper placement of quotes. Thanks -dant I tried that. I also doubt that isset would work any better because that condition is being processed correctly. This script is not something that I wrote, it is something I downloaded. I assume that it works correctly for the author on the author's system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
On 3/4/2005 2:02 PM Richard Lynch wrote: John Swartzentruber wrote: I stripped down my original script until it started receiving POST data, then I kept modifying it until I figured out where the problem was. I found it, but I'm still as clueless as every. To summarize: I have a form that posts to the same script that contains the form. In its original state, when the script is called after I submit the form data, the $_POST[] data is completely empty and the _SERVER variable that indicates the type of data is set to GET. In the script is the following code: if (IsSet($_POST[action])) { //$action = $_POST[action]; } else { $action = $_GET[action]; } Normally the second line is not commented. When I comment out that line, then the $_POST array has all of the data I would expect it to. When it is not commented, then it does not work. Just to make sure that I am really confused, this bit of code is *after* the call to var_dump($_POST), but *before* the code that creates the form. Does anyone have any ideas about why setting this variable has such a large and seemingly unrelated affect? WILD GUESS: Somewhere in your form and/or the logic, you are sending GET data for $action as well as POST data for $action, and you are confusing the two. Show us your stripped-down but still-broken code. Thanks for sticking with me. I tried stripping it down again, but then the stripped down version worked (even with the problem line). That means I need to take a couple more passes at it and figure out what else is working with this line that causes the problem. I did determine that it is not the name of the $action variable or the action POST value. If I manually set $action to login, it causes the problem, but if I set it to loginx, then the post values come through correctly. I didn't write this script, and I'm seeing the same problem in phpMyAdmin, so I don't think it is a coding problem unless it is an incompatibility between php4 and php5. I still need to track it down further. I'll let you know what I find. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
John Swartzentruber wrote: On 3/4/2005 2:23 PM Dan wrote: phpninja wrote: I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. How about using single quotes around all the action phrases: if (IsSet($_POST['action'])) { //$action = $_POST['action']; } else { $action = $_GET['action']; } I'm slowly learning, myself, on the proper placement of quotes. Thanks -dant I tried that. I also doubt that isset would work any better because that condition is being processed correctly. This script is not something that I wrote, it is something I downloaded. I assume that it works correctly for the author on the author's system. what I do sometimes is throw in keywords or the like: if (IsSet($_POST['action'])) { //$action = $_POST['action']; echo stage 1; } else { // $action = $_GET['action']; echo stage 2; } That helps me to determine the logical order of execution. I don't think case has anything to do with it, as Chris had asked, but I don't suppose it would hurt. YOu can also use phpinfo('INFO_VARIABLES'); to print all env vars to see if your var is even coming through. However, the above example will pretty much determine this. Hope that helps. -dant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
phpninja wrote: I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. PHP functions are case-INsensitive. PHP variables are case-sensitive. -- 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] Re: Authentication fails - problem line found
Richard Lynch wrote: phpninja wrote: I think all php functions are case sensitive and must be all lowercase. try changing IsSet to isset and give it a run. I im not 100% sure because i always type every function in php lowercase and keep it the same throughout the application so i dont ever have to worry about that. Just a thought. PHP functions are case-INsensitive. PHP variables are case-sensitive. thats not to say it's not blasphemous to write isset() as IsSet() ;-) one a more serious not there are some posts a while back about CS. (Coding Style)...anyhow, I think most people expect php core functions, language-constructs to be written in lowercase, maybe only in my sector? :-). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication fails - problem line found
I stripped down my original script until it started receiving POST data, then I kept modifying it until I figured out where the problem was. I found it, but I'm still as clueless as every. To summarize: I have a form that posts to the same script that contains the form. In its original state, when the script is called after I submit the form data, the $_POST[] data is completely empty and the _SERVER variable that indicates the type of data is set to GET. In the script is the following code: if (IsSet($_POST[action])) { //$action = $_POST[action]; } else { $action = $_GET[action]; } Normally the second line is not commented. When I comment out that line, then the $_POST array has all of the data I would expect it to. When it is not commented, then it does not work. Just to make sure that I am really confused, this bit of code is *after* the call to var_dump($_POST), but *before* the code that creates the form. Does anyone have any ideas about why setting this variable has such a large and seemingly unrelated affect? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php