Jump to content

[SOLVED] echo problem


eleven0

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/79216-solved-echo-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.