$_GET and $_POST
Posted: Tue Aug 23, 2005 10:55 am
hi all,
i've been having some major problems getting this to work. my server has php 4.3, but has register-globals turned on. I was trying to use $_GET, and $_POST, but instead, had to use $HTTP_GET_VARS etc. but now, i'm trying to use $_SERVER['PHP_SELF'] (i've also tried $HTTP_SERVER_VARS['php_self']). my forms return no info.
here's the code:
if there's a dumb error in this, you can point it out, but this is only the latest incarnation of a lot of tries, i'm pretty sure the error is something important that I'm just not getting.
Also, I want to use the most secure way possible to do this, although it seems to me that sending the form data to itself is quite secure? yes, no ?
feyd | Please use
i've been having some major problems getting this to work. my server has php 4.3, but has register-globals turned on. I was trying to use $_GET, and $_POST, but instead, had to use $HTTP_GET_VARS etc. but now, i'm trying to use $_SERVER['PHP_SELF'] (i've also tried $HTTP_SERVER_VARS['php_self']). my forms return no info.
here's the code:
Code: Select all
<?php
if (isset($_POST['submit'])) {
if (strlen($_POST['first']) > 0) {
echo "Thanks {$_POST['first']}";
} else { // The source is not right.
echo "<p><b>please enter a name</b></p>";
}
} else {
?>
<form action="<?php echo $_SERVER['license.php']; ?>"
method="POST">first name<input type="first" name="$first">
<input type="submit" name="submit" value="thanks"></form>
<?php
}
?>Also, I want to use the most secure way possible to do this, although it seems to me that sending the form data to itself is quite secure? yes, no ?
feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]