Jump to content

Probably a STUPID question...


Halyard

Recommended Posts

OK I am playing around with some very basic PHP, and have come across something that I just can't figure out; the code is as follows:-

 

The HTML

 

<form action="welcome7.php" method="post">

<label>First Name
<input type="text" name="firstname" />
</label><br />

<label>Last Name
<input type="text" name="lastname" />
</label><br />

<input type="submit" value="Go!" />

</form>

The PHP

 

<?php
$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];
if ($firstname == 'Alf' and $lastname == 'Idiot') {
  echo 'Welcome, oh glorious leader!';
}
else {
  echo "Welcome to our Web site, $firstname $lastname!";
}
?>

 

Now in theory the URL showing int the address bar of Firefox should be "http://localhost/php/welcome7.php", at least that is what I would be expecting to appear, however what actually appears is "http://localhost/php/welcome5.php"! Is there something that I am just not seeing?

 

(edited by kenrbnsn to add


tags)

 

 

Link to comment
https://forums.phpfreaks.com/topic/127373-probably-a-stupid-question/
Share on other sites

You're after placing a file somewhere you shouldn't have. Take a look through your file system and see if you saved a file in the wrong folder or something.

 

That was the first thing I thought of waynewex - both of the relevant files are sitting one above the other in the correct folder - it sort of freaks me when things just don't do what they are supposed to for no apparent reason... Had I made a simple and obvious mistake it wouldn't be so bad!

Archived

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

×
×
  • 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.