Δημοσιεύτηκε: 23 Ιουν 2011, 11:06
από linuxs
Λοιπόν,

ξέρω html και προσπαθώ για την PHP...αυτό που έχω κάνει είναι, 2 αρχεία index.php & welcome.php
index
Κώδικας: Επιλογή όλων
<html>
<body>

</body>
<?php
/*
Comments in PHP are the same as in C!
*/

//Starting loving PHP programming...


echo "Just testing the commnad 'echo'. See? Hello world!";
$myname="Vasilis";
$myage=21;
?> <br />
<?php
echo "My name is: ";
?>
<?php
echo $myname." and my age is: ".$myage;
?>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>

</html>

welcome
Κώδικας: Επιλογή όλων
<html>
<body>
Welcome <?php echo $_GET["fname"]; ?>.<br />
You are <?php echo $_GET["age"]; ?> years old!
</body>
</html>


Με το που συμπληρώνω τα στοιχεία μου πετάει το εξής:
Κώδικας: Επιλογή όλων
Welcome
Notice: Undefined index: fname in C:\xampp\htdocs\webtest\welcome.php on line 3
.
You are
Notice: Undefined index: age in C:\xampp\htdocs\webtest\welcome.php on line 4
years old!

:/ :/ :/ ???