I had my code working earlier today, with first asks for your name with html and then generated a “Hello -username- -surname-” message with php. I was trying to adjust the indentation and i think i must have erased something that now makes it simply display the code… Thanks for the help!
The html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>form 11 29</title> </head>
<body>
<form method="post" action="process1.php" name="form1">
Name : <input name="firstname" value=""><br>
Surname : <input name="surname">
<input name="s1" value="Submit LoL !" type="submit"><br>
<br>
<br>
</form>
<br>
</body>
</html>
The php page:
<?php
$name = $_POST[firstname];
$surname = $_POST[surname];
echo "Hello ";
echo $name;
echo " ";
echo $surname;
echo "<br />";
?>
It work for me (sort of). It gives this output
Because you forgot to put quotes around the indices to $_POST, which should be
Btw – now you have leanred the value of backups. Use a VCS (or, use Dropbox whch will keep old vesions for you (hmmm, irrc, if you develop in Netbeans it will also keep old versions and let you diff them with the current version))
Udate: are you uploading to a website or runing on your own PC? If your own PC then perhaps your web server (Apache or ISS) stopped runing?
You asked abotu NetBeans: take a look at http://en.wikipedia.org/wiki/NetBeans and http://netbeans.org/features/php/ Netbeans is an excellent free IDE (partly developed and supported by Sun) which is my developmnent platform of choice as a professional PHP developer (and I am not alone). Give it a try; I doubt that you will look back.