please help me fix a php sign in form?
-
how can I fix a php sign in broken after an upgrade to PHP 5.x? I maintain a website on dreamhost (which recently ungraded their PHP to 5 something.) Our site (which is old and will be replaced) is written in a previous version of PHP. Now the signin form no longer works, when people login, they get Could not sign in as "" - so clearly it isn't transmitting whatever they type in the form signin and password boxes. Unfortunately, I don't know PHP and while I was able to google a solution to another post-conversion problem (having to use 'script_filename' instead of something else for setting a base path), I'd like to get this fixed as quickly as possible. I'm sure it's probably something really simple, but I don't know where to start looking other than on the signin form itself. Help?
-
Answer:
Minor addendum: if you grep the script for '_GET' or '_POST' and come up empty, it is almost certainly the historic use of the register_globals setting now being deprecated.
canine epigram at Ask.Metafilter.Com Visit the source
Other answers
It sounds like you were either using long arrays, which have been disabled by the upgrade (http://www.php.net/manual/en/ini.core.php#ini.register-long-arrays), or your script was relying upon http://php.net/manual/en/security.globals.php. To fix it (were it one of those issues), you'd need to migrate your code to use one of the http://www.php.net/manual/en/reserved.variables.php, depending on whether your form is using GET or POST.
Smoosh Faced Lion
I think you would need to understand the script to be able to fix it, sorry. A common thing would be that the way the script, which checks access, tries to get the users input does so in an old-fashioned way (what Smoosh Faced Lion has described). Can you post the scripts (1) generating the login page and (2) checking the input e.g. using http://www.friendpaste.com/? If you do, please check whether it includes e.g. a password to a database or other secret information. And of course in general providing source-code of a script allows others to find vulnerabilities.
oxit
I'm thinking it's related to Register Globals being depreciated (or disabled in php.ini). If it is you have two options:Update the script to reference variables properly. If the script references the username variable like $username and not like $_GET['username'] or $_POST['username'] change it to the appropriate $_GET or $_POST.You can enable the setting in php.ini (NOT RECOMMENDED)
axismundi
Here's a http://friendpaste.com/59JoSblxHX5yadkg5jVKTd. Smoosh, if you'd be willing to look at it, I'll mefimail you the password (to the paste. Oxit, I mefi-mailed you. I really appreciate any help - this is a non-profit volunteer driven group and they don't have any programmers (any more). Just me. This is why we're getting the site re-designed.
canine epigram
The script tries to access username and password using the variable $HTTP_POST_VARS, which is http://php.net/manual/en/reserved.variables.post.php. Check line 143 and 145 of your Friendpaste script. Axismundi's comment is thus correct. However it most probably will not be enough to just change those two lines, because this way of accessing form input will be have been used throughout the application and in other files two. The code thus needs re-programming (refactoring) to be compatible with PHP5's standard settings. Alternatively, as axismundi's said, you can enable backwards-compatibility, which is http://www.php.net/manual/en/security.globals.php. Since your application will be replaced soon and if it does not contain sensitive information you might be ok to accept this risk. (Additional errors may still occur, I've only analysed up to this part).
oxit
Hi! Well, that form is working now - thanks so much! By looking at the deprecation info for $HTTP_POST_VARS I was able to replace the offending variables. If I run into the error elsewhere, at least now I'll know what to do. Thanks for the help - seriously, this was huge (because yes it will be replaced...eventually.)
canine epigram
Related Q & A:
- Can you please help me sign in to my Yahoo Messenger?Best solution by Yahoo! Answers
- Could anyone please help me make a good msn name :D?Best solution by Yahoo! Answers
- Can you please help me write a poem?Best solution by wikihow.com
- Please help me choose a decent camcorder?Best solution by Yahoo! Answers
- Can some one please help me with a facebook group?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.