No input file specified ?

No input file specified ?

Posted by: getmodern
Posted on: 2005-07-07 20:14:00

When I click submit on a form, the following code is run, but I end up with a "No input file specified?" error.
And yes, the file "loggedin.php" does exist where it should.
Any clues, help, or ideas, please.
===

case "validate":
$validate = mysql_query("SELECT * FROM members
WHERE username='{$_POST['username']}'
AND password = md5('{$_POST['password']}')
AND verified='1'
") or die (mysql_error());

if(mysql_num_rows($validate) == 1){
while($row = mysql_fetch_assoc($validate)){
$_SESSION['login'] = true;
$_SESSION['userid'] = $row['id'];
$_SESSION['first_name'] = $row['first_name'];
$_SESSION['last_name'] = $row['last_name'];
$_SESSION['email_address'] = $row['email_address'];

$login_time = mysql_query("UPDATE members
SET last_login=now()
WHERE id='{$row['id']}'");
}
header("Location: /loggedin.php");
} else {
myheader("Login Failed!");
echo '<p align="center">Login Failed</p>';
echo '<p align="center">If you have already joined '.
'our website, you may need to validate your email '.
'address. Please check your email for instructions.';
footer();
}
break;


Re: No input file specified ?

Posted by: Atropos7
Posted on: 2005-07-07 20:27:00

Have you read the documentation on header()?

"Note: HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. "

See the documentation for an example of how to do this correctly:
http://www.php.net/header

cool Perl / MySQL / HTML+CSS

Re: No input file specified ?

Posted by: getmodern
Posted on: 2005-07-08 20:44:00

FYI -- The solution to my problem:
There was nothing wrong with the code posted in my initial post.
The problem was in the called "login_form.html" doc, which had the following code:

<div align="center"><strong><font size="4" face="Verdana, Arial, Helvetica, sans-serif">Palun
Logi sisse</font></strong></div>
<form action="/login.php" method="post">
<table width="30%" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="19%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Kasutajanimi:</strong></font></td>
<td width="81%"><input name="username" type="text" id="username" value="<?=$_POST['username'];?>"></td>
</tr>
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Salasõna:</strong></font></td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td> </td>
<td><div align="center">
<input type="hidden" name="req" value="validate">
<input type="submit" name="submit" value="Saada">
</div></td>
</tr>
</table>
</form>

Note that I had a leading dash on the form action POST to "/login.php"
This doesn't work! I removed the backslash and I was in business!

Thanks for the help anyway. I did hardcode the absolute URI in on the header() just to be sure, and that works fine.

I really have to stop working on this stuff at midnight (^_^)



Re: No input file specified ?

Posted by: VxJasonxV
Posted on: 2005-07-11 03:34:00

Absolute URI?
Snap, I should change that.

This was even helpful to me!
Thanks.

Tags: email addressmysql querymysql errorinput filephpusername and passwordmembersmd5fetchverifiedecho