Re: Problems with variables and PHP/HTML

From: Date: Tue, 24 Sep 2002 14:59:04 +0000
Subject: Re: Problems with variables and PHP/HTML
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117423@lists.php.net to get a copy of this message
set register globals to ON in your PHP.ini for this to work, although I'd highly recommend doing what you already are doing... $username = $_POST['username']; It's a LOT more secure. Justin on 25/09/02 12:50 AM, Ed Curtis (ed@homes2see.com) wrote: > I am currently using Apache 1.3.26 and PHP 4.2.3 on a Linux box running > Kernel 2.0.36 > > My trouble is in passing variable from within a form submission or within a > URL. > I can get a From submission to work if I declare the variable and resubmit > it to another variable name. > > I.E. form field name = username passed to readform.php > in readform.php $username = $_POST['username'] > > I can then user $username > > Used to be you could just use $username as a variable if it was passed from > a form to another script. > > Now I have $username defined and useable but if I try to add it to a URL > such as: > > <a href="readform2.php?username=<? echo $username; ?>"> > > It becomes a null value or doesn't get passed at all. > > I thought this might have something to do with track-vars but track vars are > enabled by default in PHP since before my version. When I compiled > everything I compiled PHP as a DSO. Any ideas? > > TIA, > > Ed Curtis > >

« previous php.general (#117423) next »