RE: [PHP-DB] passing variables
| From: | Jonathan | Date: | Mon, 09 Dec 2002 15:39:44 +0000 |
| Subject: | RE: [PHP-DB] passing variables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23949@lists.php.net to get a copy of this message | ||
One of many possible things.
Dependent on the version of PHP you are using, you might have
register_globals set to off in your php.ini file, which is preferable.
In which case you'll have to use
If($_REQUEST['variable'])
Or
If(isset($_REQUEST['variable']))
Second possible is:
I've never really used an image within a link to submit a form. What I
usually do is make the image a submit button, e.g.,<input type="image"
src="path to your image" height="XX" width="XX"
border="0"> You could
name it or create a hidden field <input type="hidden" name="register"
value="register">
Then upon form submission (<form action="<? Echo $_SERVER['PHP_SELF']
?>">)
You would look for register
If(isset($_REQUEST['register']))
{
//whatever
}
hope one of them works.
-----Original Message-----
From: Edward Peloke [mailto:epeloke@echoman.com]
Sent: Monday, December 09, 2002 9:33 AM
To: php-db@lists.php.net
Subject: [PHP-DB] passing variables
Hello all,
I have a login/register screen for my php/mysql db. When the page
opens,
the user sees the log in screen but I have a button and reloads the same
page, hopefully with the register screen. I know I can simply check to
see
if a variable is set with
if ($variable){} . This does not seem to work when I give an image a
name
and link it to the same page. The image is named register and it links
back
to the same page, so the page loads, I click on the register image , the
page reloads but the variable is not set.
Any ideas?
Thanks,
Eddie
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php