try action="<?php echo $_SERVER['PHP_SELF']; ?>"
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
umm.. I hope you have started apache service and you are executing your script like, http://localhost/yourfilename.php ? When are you getting that error ? After you submit the page ? What is your url ?
PS. Next time you post your code, please wrap it within [ code=php] [ /code] tags.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
No. What I am asking you is, how do you execute your script ? Are you double clicking the file or are you typing the path in the address bar ?
Well, If you want to learn the basics of php, w3schools is the best site to start off.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
hmm. Try this script. Tellme if it works.
<?php
if(isset($_POST['submit'])){
print_r($_POST);
}
?>
<html>
<body>
<form method="post" action="test.php">
<input type="text" name="name">
<input type="text" name="email">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Call this test.php, put it on your server. Tellme if it works.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Yep. You should have an extension .php for your scripts if you want apache to parse php. Can you show us the script you are using ? (because the code example that I gave you shouldn't give this error!)
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
<?php
if(isset($_POST['submit'])){
print_r($_POST);
}
?>
<html>
<body>
<form method="post" action="test.php">
<input type="text" name="name">
<input type="text" name="email">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Click on "toggle plain text" and then copy the code. :) And I meant [ code=php] [ /code] ! < without the whitespace.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Great. That should get you started. Remember, the file extension should be .php for apache to parse it as a php file. And w3schools will help you learn the basics in no time. You can also refer to php.net.
Its 8 am and I should get some sleep now.. Lol..
Cheers,
Naveen
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356