By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

Problem witch read input string_____

P: n/a
I have php4 on system FreeBSD.I did think that php work very well
(function phpinfo() work), if I didn't probe above script:

<?
if(!isset($name)&&!isset($password))
{
?>
<h1>Please Log In</h1>
This page is secret.
<form method = post action = "secret.php">
<table border = 1>
<tr>
<th> Username </th>
<td> <input type = text name = name> </td>
</tr>
<tr>
<th> Password </th>
<td> <input type = password name = password> </td>
</tr>
<tr>
<td colspan =2 align = center>
<input type = submit value = "Log In">
</td>
</tr>
</form>
<?
}
else if($name=="user"&&$password=="pass")
{
echo "<h1>Here it is!</h1>";
echo "I bet you are glad you can see this secret page.";
}
else
{
echo "<h1>Go Away!</h1>";
echo "You are not authorized to view this resource.";
}
?>

Always is fine but php don't read my input string.$name and $password
always = ""
What the problem?

Sorry for my litle english.
Mioduszaewski Artur.


Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
kliczko wrote:
I have php4 on system FreeBSD.I did think that php work very well
(function phpinfo() work), if I didn't probe above script:

Your register_globals is set to "OFF". That's the new default value.
Add this lines to the begin of your script:

$name = $_REQUEST["name"];
$password = $_REQUEST["password"];

I don't think it's a good idea to turn register_globals on, so use the
$_REQUEST Superglobal instead.

Hope that helps

Sebastian
Jul 16 '05 #2

P: n/a
kliczko wrote:
I don't think it's a good idea to turn register_globals on,


I have a litle knowledge about php, so how turn on the
register_globals.Give me a detailed describe how this doing.(in what
file?)

I forgot the word not in my last posting =)

If you realy want, you may activate it in the php.ini

Hope that helps
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.