and I have got a problem in passing variables to one php script from another
i have following code as index.php
Expand|Select|Wrap|Line Numbers
- <?php
- $name=HREEDN
- ?>
- <html>
- <head>
- <title><?php print ("$name")?> in PHP</title>
- <h1><font color=BLUE><center>WELCOME TO HREEDN</center></font></h1>
- </head>
- <body bgcolor=gold>
- <center><table width=80%>
- <tr>
- <td><a href= index.php><center>Home</center></a></td>
- <td><a href= search.php><center>Search Friends</center></a></td>
- <td><a href= images.php><center>View Images</center></a></td>
- <td><a href= contact.php><center>Contact Me</center></a></td>
- </tr>
- </table>
- </center>
- <table width=100%>
- <tr>
- <td width=50%>
- <font size=2 face=arial>
- <br>
- <P>This site is currently being developed by a novice php programmer
- and please help this php programmer by filling the form and commenting.
- </P>
- <P>
- You can send the feedback to [EMAIL REMOVED]<br>
- or just use the link above
- </P>
- </font>
- </td>
- <td width=50%>
- <br/><br/><br/>
- <form action="confirm.php" method="POST">
- <P>
- <b>
- First Name: <input type="text" NAME="fname"><br/>
- Last Name: <input type="text" NAME="lname"><br/>
- Age: <input type="text" NAME="age"><br/>
- Semester: <input type="text" NAME="sem"><br/>
- </b>
- </P>
- <br/>
- <input type=submit value="Done">
- <input type=reset value="Clear">
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>Confirm the data</title>
- <h1><font color=BLUE><center>WELCOME TO HREEDN</center></font></h1>
- </head>
- <body bgcolor=gold>
- <center><table width=80%>
- <tr>
- <td><a href= index.php><center>Home</center></a></td>
- <td><a href= search.php><center>Search Friends</center></a></td>
- <td><a href= images.php><center>View Images</center></a></td>
- <td><a href= contact.php><center>Contact Me</center></a></td>
- </tr>
- </table>
- </center>
- <?php
- printf ("First Name:", $_POST['fname']);
- print ("\n<br/>\n");
- print ("Last Name: $_POST['lname']");
- print ("\n<br/>\n");
- print ("Age: $_POST['age']");
- print ("\n<br/>\n");
- print ("Sem: $_POST['sem']");
- ?>
- </body>
- </html>
it shows a blank page
i don't know the reason
but if i use $variable instead of $_POST['variable']
and use GET method it shows a html page without the values in variable
how can i solve this problem
thanks