Passing parameter to another page

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Passing parameter to another page

Postby miky » 05. May 2006 15:32

Hello friends.
I an new to xampp (switched from php home edition). Is seems great.
Can anyone help with this problem.
I start "index.php" with a form (user and password) and call "login.php"
but in login.php I have no parameters. Thanks forward



<?php INDEX.PHP
//========== ?>
<html><head></head><body>
<form method="get" action="login.php">
User:<br> <input type=text name="uid" size=20> <br>
Pswd:<br> <input type=password name="pwd" size=20>
<br>
<input type=submit name=ok value="LogIn">
</form>
</body></html>

<?php LOGIN.PHP
//========== ?>
<html><head></head><body>
<?echo "Name (uid): ".$uid."<br>"?>
<?echo "Pssw (pwd): ".$pwd."<br>"?>
</body></html>

kysel.miroslav@zoznam.sk
miky
 
Posts: 2
Joined: 05. May 2006 15:10
Location: Slovakia, Banska Bystrica

Postby Wiedmann » 05. May 2006 15:38

Please read the PHP manual about "external variables".
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby miky » 05. May 2006 17:47

Thanks I have set the parameter and it works.
./xampp/apache/bin/php.ini
register_globals=on
miky
miky
 
Posts: 2
Joined: 05. May 2006 15:10
Location: Slovakia, Banska Bystrica

Postby Wiedmann » 05. May 2006 18:53

I have set the parameter and it works.

IMHO that's the wrong way. Why not using the correct syntax to access these values?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby WorldDrknss » 05. May 2006 22:58

Index.php
<html><head></head><body>
<form method="get" action="login.php">
User:<br> <input type=text name="uid" size=20> <br>
Pswd:<br> <input type=password name="pwd" size=20>
<br>
<input type=submit name=ok value="LogIn">
</form>
</body></html>

login.php
<html><head></head><body>
<?php
$uid = $_GET['uid'];
$pwd = $_GET['pwd'];
echo "Name (uid): ".$uid."<br>";
echo "Pssw (pwd): ".$pwd."<br>";
?>
</body></html>
http://wdguides.org - XAMPP Tutorials & MORE!!!!
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 50 guests