Hi frndz,
I am trying to develop a login form and after login variables posted to the checkvariables page, where passed variables check the entry in database and if enter details (username and password) match, then it redirect towards user info page otherwise it show wrong username or password.
Now problem is I want to post the value i.e. username on user info page.
Plz help me how I can do this......
I get this error, on using $myusername=$_POST['myusername'];
Notice: Undefined variable: myusername in C:\wamp\www\test\user_info.php on line 28
Notice: Undefined variable:name
Moderator: General Moderators
Re: Notice: Undefined variable:name
Can you post the whole code?
Re: Notice: Undefined variable:name
jackpf wrote:Can you post the whole code?
What code ??
Its like login.php (username, pass) > checklogin.php (If username & pass match, then redirect to user_info.php, and if dont match then an error "wrong username / password"
Problem is that, I am posting username and password to checklogin.php, whereas I want username on user_info.php also.
So, I want to know Is it possible to post the same form on 2 different pages
I am using Welcome <?php $result['myusername']; ?> OR $myusername=$_POST['myusername'];, to show Welcome Nehrav
but it gives me error "variable is not defined". And I know its not defined
tell me hw I tell the page that username is ...., coz form is posted to checklogin.php, not to user_info.php
Re: Notice: Undefined variable:name
The code that's giving you the error. One line is not enough...
And it sounds like you want to look into sessions.
And it sounds like you want to look into sessions.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Notice: Undefined variable:name
If you want to persist the data for multiple requests, as jackpf suggests, your best bet is to use sessions.
Re: Notice: Undefined variable:name
John Cartwright wrote:If you want to persist the data for multiple requests, as jackpf suggests, your best bet is to use sessions.
Thanks both of you for your replies, John and Jack
I was using sessions only earlier also, but I think they were not properly used...
now I solve this prob by adding some code from some other's example......
Thanks guys........