eleven0 Posted November 28, 2007 Share Posted November 28, 2007 I'm a newbie in php, i'm trying to process text... here is my index.php <html> <head> <title> DPG </title> </head> <body> <form name="discharge" action="index2.php" method="post"> <table border="1" bgcolor="red" cellpadding="2" cellspacing="3"> <tr><td>D Type: <select name="ds"> <option value="1">GD</option> <option value="2">DD</option> <option value="3">HD</option> <tr><td>Name: <input type="text" name="disname" <tr><td>Last Name: <input type="text" name="dislastname" <tr><td>Todays Date: <input type="text" name="tdysdate" </tr> </tr> </td> <td> <input type="submit" value="send"> </table> </body> </html> here is my index2.php <html> <head> <title> DPG </title> </head> <body> <textarea rows="30" cols="100"><quote> <b><u>Subject:</u></b> <?php $ds=$_POST["ds"]; if($ds == 1){ $ds='GD';} else if($ds == 2){ $ds='DD';} else if($ds == 3){ $ds='HD';} echo $_POST["ds"] ?> <b><u>Name:</u></b> <?php echo $_POST["disname"] ?> <b><u>Last Name:</u></b> <?php echo $_POST["dislastname"] ?> </quote> </textarea> </body> </html> I'm having problem getting the text from selection box, I have three values. Lets say i pick the second one, it won't show up in index2.php when i echo it. What is incorrect? Thank you... edit: it doesn't give me any error but it won't show up. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted November 28, 2007 Share Posted November 28, 2007 in your index2.php echo $_POST["ds"] should be echo $ds; when you echo POST value it will print that option value which is number Quote Link to comment Share on other sites More sharing options...
eleven0 Posted November 28, 2007 Author Share Posted November 28, 2007 that was quick, thank you.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.