Jump to content

[SOLVED] what could be the problem?


corillo181

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.