I'm a newbie to PHP and HTML in general, I'm trying to do a login-page where i use HTML form with POST to grab user and password and send it back to the same page so that I can check it with my MySQL database. PHP variables doesn't seem to hold my user/pass variables.
I've done some "if's" that should return some error messages to screen if user and password does'nt match.
When I type user and pass in login.php page it only blibs and doesn't give me any result printed on on screen back to me.
I've tried breaking out just the the connection to MySQL with static varables in a standalone script and this seems to work fine, but when i use the combined HTML form with POST and PHP it doesn't work.
Do i have to use the PHP - session_start()/sessio_register function to save the input in my PHP-variables?
Anyone got an idea what I'm doing wrong here?
I could post my code here later if that would help (don't have it here right now).
have you checked the PHP ini file to make the variables vivisble to the code, otherwise I think you have to explicitly define which object you waant to access. I think the ini line is somehting like "global variables", or the alternative is to search on this forum where someone else has had this problem within the last 2.3 weeks
ah oki, i'll check that, thanks
Saw another post here on some problems with firewall (Zone alarm) and windows XP. I'm using winXP and I have Norton internet security as FW, maybe that has some effect on this.
<? //login.php ?>
<form action="login.php" method="post" target="_self">
Username: <input type="text" name="username"> <br>
Password: <input type="password" name="password"> <br>
<input type="submit" value="go!">
//here you can connect to you DB to fetch your $password and $username
if ($_POST['username']==$username && $_POST['password']==$password)
//display your page