Please Any One Help Me ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saqib389
Forum Commoner
Posts: 44
Joined: Wed Nov 30, 2005 2:13 am

Please Any One Help Me ?

Post 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
wh33t
Forum Newbie
Posts: 12
Joined: Wed Nov 30, 2005 2:09 am

Post 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.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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!)
wh33t
Forum Newbie
Posts: 12
Joined: Wed Nov 30, 2005 2:09 am

Post by wh33t »

Yee, so use $_POST then if your dealing with usernames and passwords and stuff you dont want people to see easily.
saqib389
Forum Commoner
Posts: 44
Joined: Wed Nov 30, 2005 2:13 am

Post 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
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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 :)
saqib389
Forum Commoner
Posts: 44
Joined: Wed Nov 30, 2005 2:13 am

Post by saqib389 »

Thnx Guyz For Solving This Issue..

i Hope you guyz will help me in Future......

:) SaQib
Post Reply