Hey all,
I'm new to PHP (it rocks btw), and I've set up a script to submit a new piece of news when a registered user uses it. The problem is, the next script seems to not read the query string. No matter what I do I can't make it work.
Here's the scripts:
http://geocities.com/benwhitear2000/phpprob.zip
You'll probably have to copy and paste that. Anyway open up submitnews.php and type "Ben" (in that case minus quotes) into the username box. Then submit and see.
Cheers for any help,
Ben[/url]
Problem with the query string
Moderator: General Moderators
Well without opening up the zip files at all, I'd guess that you're having the register_globals problem. There's a sticky thread about that, but basically what you need to do is put a declaration of all of your variables in the processing page, like this.
FORM PAGE
There's a text input named 'zip'
PROCESSING PAGE
include this before the variables are used:
$_POST["zip"]
(assuming your form POSTS, if not, use $_GET instead.)
FORM PAGE
There's a text input named 'zip'
PROCESSING PAGE
include this before the variables are used:
$_POST["zip"]
(assuming your form POSTS, if not, use $_GET instead.)
- mcsleazycrisps
- Forum Newbie
- Posts: 6
- Joined: Mon Aug 25, 2003 7:12 am
- Location: UK
use:
not
Uppercase the "GET"
Code: Select all
$username = $_GETї'username'];Code: Select all
$username = $_getї'username'];