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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.