Page 1 of 1
Please Any One Help Me ?
Posted: Wed Nov 30, 2005 2:15 am
by saqib389
Hello Guyz i m totaly new in php
i m trying to do it any one help me out
i m not using any SQL... i juz want to put my user name in 3rd page...
like i have 3 pages... in ist page i juz enter any dummy user name in LOGIN.PHP... and i sumbit the page then next page comes.. Form.php here i will find the registration page.... when i sumbit the registration page then next page come where i have to print that user name which i have enter in LOGIN.PHP
so plz any one help me out... how it can b.... and how can i use $_REQUEST variable in this prgoram.... plz plz help me out....
waiting for hopefull response
SaQib
Posted: Wed Nov 30, 2005 3:23 am
by wh33t
well you could always set a cookie or a session. Which is pretty basic.
If you want to stick with the form $_POST (is that the same as $_REQUEST) sort of thing you could jsut take the values and stick them into a hidden form element on your validation page, then submit that again with some javascript.
Personally I think your way better off with setting a cookie. Then all you'd have to do is go
print $_COOKIE['username']; on any page you want and it would hold yur username.
You should consider reading up on stateless protocals its pretty fascinating what some people have created with the way the web works.
Posted: Wed Nov 30, 2005 3:44 am
by Maugrim_The_Reaper
$_POST (is that the same as $_REQUEST)
No, $_REQUEST contains both POST and GET. It's considered insecure to use it if you filter your variables based on the request type (also its just very confusing!)
Posted: Wed Nov 30, 2005 3:50 am
by wh33t
Yee, so use $_POST then if your dealing with usernames and passwords and stuff you dont want people to see easily.
Posted: Wed Nov 30, 2005 7:17 am
by saqib389
Guyz thnx for reply...
let me tell u my code. than u can better understand my question
my question was differentttttt i want to work only with $_REQUEST
let me tell u my code
here is the code of LOGIN.PHP
<html>
<body>
<form action = values.php method="post">
User Name:<Br><input name="username" type="text" /><Br>
<input type="submit" name="submit" value="Submit me!" />
</form>
</body>
</html>
NOW Hher is the code of VALUES.PHP
<html>
<body>
<form action = request.php method="post">
Name:<Br><input name="name" type="text" /><Br>
Age:<Br><input name="age" type="text" /><Br>
Location:<Br><input name="loc" type="text" /><Br>
Address:<Br><input name="add" type="text" /><Br>
<input type="submit" name="submit" value="Submit me!" />
</form>
</body>
</html>
NOW I Want when i sumbit values.php page then on request.php where i
find that value which i have enter in LOGIN.PHP
got it ?
so plz help me out
i wanaa display there plz plz
WAITINg for hopefull repsone
SaQib
Posted: Wed Nov 30, 2005 8:28 am
by shiznatix
values.php
Code: Select all
<html>
<body>
<form action = request.php method="post">
<input type="hiden" name="username" value="<?= $_POST['username'] ?>">
Name:<Br><input name="name" type="text" /><Br>
Age:<Br><input name="age" type="text" /><Br>
Location:<Br><input name="loc" type="text" /><Br>
Address:<Br><input name="add" type="text" /><Br>
<input type="submit" name="submit" value="Submit me!" />
</form>
</body>
</html>
then request.php will have $_POST['username'] as the username that was entered at first. but you are not dealing with just request here, this is all POST and you should just use POST if you are only dealing with it, will make your life a heck of a lot easier later on.
ps. please use CODE tags when nessicary. Also, please use complete words and try to spell things at least somewhat correct.
Posted: Wed Nov 30, 2005 8:33 am
by Jenk
Maugrim_The_Reaper wrote:$_POST (is that the same as $_REQUEST)
No, $_REQUEST contains both POST and GET. It's considered insecure to use it if you filter your variables based on the request type (also its just very confusing!)
$_REQUEST also has $_COOKIE

Posted: Wed Nov 30, 2005 10:32 am
by saqib389
Thnx Guyz For Solving This Issue..
i Hope you guyz will help me in Future......

SaQib