#1  
Old 13th May 2005, 17:39
uli uli is offline
Junior Member
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems after PHP update

I've updated my PHP installation on my server, but now most of my PHP scripts don't work anymore. For example, I have a login form like this:

Code:
<form action="login.php" method="post">
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" name="submit" value="Login" />
</form>
Now, if I do a
PHP Code:
echo $username
in login.php, it shows nothing...

Uli
Reply With Quote
  #2  
Old 14th May 2005, 22:48
joe joe is offline
Junior Member
 
Join Date: Apr 2005
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

It might have done something to your global variables. Try

Code:
echo $_POST[username]
does that work?
__________________
Joe Topjian
email: joe@adminspotting.net
web: http://adminspotting.net
Reply With Quote
  #3  
Old 17th May 2005, 13:35
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
Default

I think it's because register_globals went from on to off in your new PHP version. This is explained here: http://de3.php.net/manual/en/languag...predefined.php

So you have to change your scripts (e.g. use $_POST['id'] instead of $id) or change register_globals to on in your php.ini (don't forget to restart Apache then).
__________________
Falko
--
Follow me on:
Reply With Quote
  #4  
Old 18th May 2005, 22:00
uli uli is offline
Junior Member
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Joe and Falko! That helped a lot!

I set register_globals to on now in my php.ini, and my scripts are working again.

Uli
Reply With Quote
  #5  
Old 19th May 2005, 01:06
joe joe is offline
Junior Member
 
Join Date: Apr 2005
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Glad it's working

I would recommend using $_POST and $_GET rather than just plain $username. Keeps things more secure so an incident doesn't happen involving $password from GET instead of POST.
__________________
Joe Topjian
email: joe@adminspotting.net
web: http://adminspotting.net
Reply With Quote
  #6  
Old 19th May 2005, 16:33
uli uli is offline
Junior Member
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Right, but I'm rather lazy...

Uli
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:00.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions
Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com

Red Hat Virtual Experience - a free virtual event. Dec. 9th