I write the basic code for an PHP page.It is as:
<html>
<head>
<title>My Form</title>
</head>
<body>
<form action="bad_words.php" method=post>
My name is:
<br> <input type="text" name="YourName">
<p> My favorite dirty word is:
<br> <input type="text" name="FavoriteWord">
<p>
<input type="submit" name="submit" value="Enter My Data!">
</form>
</body>
</html>
and saved it as test.php
Then I write the code for bad_words.php as follows:
<html>
<head>
<title>Perv!</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
Hi <?php print $YourName; ?>
<p>
You like the word <b> <?php print $FavoriteWord; ?> !?! </b>
<p>You oughta be ashamed of yourself!
</body>
</html>
But in output I get:
Hi
You like the word !?!
You oughta be ashamed of yourself!
But not the variable values.I had given Harbinder in name text field and xyz in the favourite dirty word text field.I know that the values got stored in the variables at YourName and FavoriteWord.But why they not got printed in the bad_words.php pages output?