Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

[SOLVED] what could be the problem?

Recommended Posts

my problem here is that if the user puts the wrong name or leaves it blank.. once they enter it again the form takes the user to another sub-directory..

lets say the register was under scripts folder..

the original url would be

scripts/checkuser.php..

but if the user is sent to a error in checkuserphp and submits it again it sends the users to

scripts/scripts/checkuser.php...

and since no such directory excist it sends the user to a error 404 page..

why this happens?

form.html
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<form id="form1" name="form1" method="post" action="../scripts/check_user.php">
<table width="0%" border="0">
<tr>
<td><p>User name :<br>
<input name="username" type="text" id="username" size="12" />
</p> </td>

</tr>
<tr>
<td><p>Password:<br>
<input name="password" type="password" id="password" size="12" />
</p> </td>
</tr>
<tr>
<td><span class="style3"><a href="signup.php">
<input type="submit" name="Submit" value="Submit">
<br>
</a>or <a href="signup.php">signup </a></span></td>
</tr>
</table>
</form>
</body>
</html>
[/quote]


check.php
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?
/* Check User */
session_start(); // Start Session

include 'db.php';
// Conver to simple variables
$username = $_POST['username'];
$password = $_POST['password'];

if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'login_form.html';
exit();
}
?>[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.