php code not working

Alles, was PHP betrifft, kann hier besprochen werden.

php code not working

Postby arjita » 23. July 2007 19:18

I have created 2 very simple files ..but when i click on the submit button ,the second php file is not being referenced...

here's my code for the first file basic2Form.php

<html>
<head>
<title>A BASIC HTML FORM</title>
</head>
<body>

<Form name ="form1" Method ="POST" Action ="submitForm.php">

<INPUT TYPE = "TEXT" VALUE ="username" Name ="username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">

</FORM>
</body>
</html>

and the second one :

<?PHP

$username = $_POST['username'];

if ($username = = "letmein") {
print ("Welcome back, friend!");
}
else {
print ("You're not a member of this site");
}

?>

I am not sure why does it say "The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error."

Please help :(
arjita
 
Posts: 6
Joined: 17. July 2007 20:35

Postby Wiedmann » 23. July 2007 22:09

but when i click on the submit button ,the second php file is not being referenced...

"error.log" entry from this request?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mätes » 26. July 2007 12:13

whats the EXACT name of the second script?

submitForm.php
or
submitform.php

???

or
submitForm.php4

is it in the same folder, are both in root?

ma
User avatar
Mätes
 
Posts: 142
Joined: 13. April 2006 09:34
Location: kölle

Postby sari42 » 02. August 2007 18:47

>if ($username = = "letmein") {
try
if ($username == "letmein") {
sari42
 
Posts: 800
Joined: 27. November 2005 18:28

Postby zanner » 13. September 2007 02:57

Hire are some error's:

1. It may that index 'username' at $_POST dosn't exists! and you have no check!

2. $username = = "letmein", sari42 has already noted!

3. If your second script fine hasn't name "submitForm.php" or it path isn't same with "basic2Form.php" you'll get error: "The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error."

:)
zanner
 
Posts: 1
Joined: 13. September 2007 02:43


Return to PHP

Who is online

Users browsing this forum: No registered users and 8 guests