missing keys in $_POST - php

I am trying to get some form data from POST method.
Here's the code of form -
<form action="" method="post" name="form1" id="form1">
<input type="hidden" value="15" name="ad_id">
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="block">
<tbody><tr>
<td valign="top"> </td>
<td align="right">all fields are required</td>
</tr>
<tr>
<td valign="top"> </td>
<td align="center"></td>
</tr>
<tr>
<td valign="top" width="150"><label for="name">Advertisement Name</label>
*</td>
<td><input type="text" size="45" value="Banner" id="name" name="name">
e.g Home Banner</td>
</tr>
<tr>
<td valign="top"><label for="placement">Advertisement Placement</label></td>
<td><select id="placement" name="placement">
Wide Skyscrapper 160 x 600
</tr>
<tr>
<td valign="top"><label for="code">Advertisement Code</label></td>
<td><textarea rows="5" cols="45" id="code" name="code"></textarea></td>
</tr>
<tr>
<td>Status</td>
<td><label>
<input type="radio" checked="checked" value="1" name="status">
Active</label>
<label>
<input type="radio" value="0" name="status">
Inactive</label></td>
</tr>
<input type="hidden" value="1" name="banner_uploaded" id="banner_uploaded">
<tr>
<td>For Country - </td>
<td>
<select id="country" name="country">
<option>Not posting all the names of country</option>
</select>
</td>
</tr>
<tr>
<td><label for="Scheduling">Valid From </label></td>
<td><input type="text" value="" id="date-from" name="date-from"> Format : dd/mm/yyyy:hh/mm</td>
</tr>
<tr>
<td><label for="Scheduling">Valid Till </label></td>
<td><input type="text" value="" id="date-to" name="date-to"> Format : dd/mm/yyyy:hh/mm</td>
</tr>
<tr>
<td> </td>
<td align="right"><input type="submit" onclick="return validate_ad_form(add_adv)" value="Update Advertisement" class="button" name="update"></td>
</tr>
</tbody></table>
</form>
But I am getting $_POST['code'] empty when I am passing HTML code through it.
When I pass plain text, it works fine.
When I printed $_POST [i.e. used - print_r($_POST) ], I got the following output -
Array ( [ad_id] => 15 [name] => Banner [placement] => ad_468x60 [code] => [status] => 1 [banner_uploaded] => 1 [country] => IN [date-from] => [date-to] => [update] => Update Advertisement )
Please be known, I haven't entered the 'date-from','date-to' fields.
I have entered on purpose as StackOverflow don't allow me to post images!
People,any help will be highly appreciated.

The problem is you're print_r() is being displayed in a brower. If you've got HTML in your POST data, those tags will be interested as HTML when you dump the data back out. You'll have to force the output into plaintext mode (header('Content-type: text/plain);), or run the fields which can have HTML in them through htmlspecialchars() to escape the < and > characters.
If you view the source of the page you're doing the print_r() on, I suspect you'll see the HTML tags there. If you've only tested with that example.jpg image, you wouldn't see anything, because that image most likely doesn't exist, so it won't render, and then the <a> tag has nothing to underline and won't show up either.

Related

Preserve form values from page to page

I have two PHP pages from one I input the year and after submitting year value goes in next page via form input as in image enter image description here
image just after clicking the submit button of first page
code for the first page is
<div class="col-sm-12" style="background-color:lavender;">
<form method="post" action="next.php">
<table id="emi" width="100%">
<tr>
<td width="100%">
<div align="center"><b>
<h3> Enter Fiancial Information:</h3>
</b> </td>
<table width="100%" border="0" id="emi">
<tr>
<td><strong>First Calender Year of DATA! ( i.e. 1999 ) </strong></td>
<td><input type="text" class="form-control" placeholder="Enter the First Assesment Year" name="year" pattern="\d*" maxlength="4"></td>
<td><input type="submit" value="Go" name="submit"class="btn btn-success"></td>
</tr></table>
</table></form>
</table>
I have two PHP pages from one I input the year and after submitting year value goes in next page via form input as in image enter image description here
In next page I have one form input also and after input the values in next page and after clicking compute button the value of year which we call from page one disappear. As shown in image
Image after clicking the compute button on next.php
code for the next.php which is called after the first page is
<?php
error_reporting(0);
$year=$_REQUEST['year'];
$x=$year+1;
$y=$x+1;
?>
<table id="emi"width="100%">
<tr>
<td width="40%"><strong>INCOME STATEMENT
</strong></td>
<td width="20%"><strong> 31-03-<?php echo $year;?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $x?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $y?></strong></td>
</tr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="form-group">
<table id="emi" width="100%">
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a1" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a2" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
</table>
<table id="emi" width="100%">
<tr>
<td colspan="3">
<center>
<input type="submit" value="Compute" name="submit"class="btn btn-success"></center>
</td>
</tr>
</table>
</form>
<?php
error_reporting(0);
if($_SERVER['REQUEST_METHOD']=="POST"){
$a=$_POST['a1'];
$b=$_POST['a2'];
echo $a+$b;
}?>
I have only call the value of year then plus one in it as you see 2000 2001 2002 to next page and when I enter the value of sundry it disappears the value of year and we get only plus means value of year become 0 after clicking the compute button.
When you submit the form on the second page via your "Compute" button $_REQUEST['year'] is no longer set because it was from the previous request.
One way around this would be to add a hidden input field which stores the $_REQUEST['year'] value for the next request.
Something like this should work:
<input type="hidden" name="year" value="<? echo $_REQUEST['year']; ?>">
replace your next.php with this code
<?php
error_reporting(0);
$year=$_REQUEST['year'];
if($year==null){
$year=$_POST['year'];
}
$x=$year+1;
$y=$x+1;
?>
<table id="emi"width="100%">
<tr>
<td width="40%"><strong>INCOME STATEMENT
</strong></td>
<td width="20%"><strong> 31-03-<?php echo $year;?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $x?></strong></td>
<td width="20%"><strong> 31-03-<?php echo $y?></strong></td>
</tr>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<div class="form-group">
<table id="emi" width="100%">
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a1" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
<tr>
<td width="40%"><strong>Sundray Creditors</strong></td>
<td width="20%"><input type="text" name="a2" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="suncre" size="8" class="form-control"></td>
<td width="20%"><input type="text" name="inv" size="8" class="form-control"></td>
</tr>
</table>
<table id="emi" width="100%">
<tr>
<td colspan="3">
<center>
<input type="hidden" id="year" name="year" value="<?php echo($year);?>">
<input type="submit" value="Compute" name="submit"class="btn btn-success"></center>
</td>
</tr>
</table>
</form>
<?php
error_reporting(0);
if($_SERVER['REQUEST_METHOD']=="POST"){
$a=$_POST['a1'];
$b=$_POST['a2'];
echo $a+$b;
}?>

Textarea is empty in mySQL database field PHP

i created an HTML form and trying to save the data from its fields to the database. Inputs, drop-down menus and radio button are stored correctly however the textarea is always added to the database as empty field. Here is the code:
HTML:
<head>
<link rel="stylesheet" type="text/css" href="feedback_form_style.css">
</head>
<form name="feedbackform" method="post" class="basic-grey" action="feedback_form_send.php">
<h1>Feedback form
<span>Please answer the questions below.</span>
</h1>
<table width="450px">
</tr>
<tr>
<td valign="top">
<label for="School">School</label>
</td>
<td valign="top">
<input type="text" name="School" placeholder="Name of your school" maxlength="50" size="30" required/> <! required not supported in Safari>
</td>
</tr>
<tr>
<td valign="top">
<label for="Year">Year</label>
</td>
<td valign="top">
<input type="text" name="Year" placeholder="Which year you are" maxlength="50" size="30"/>
</td>
</tr>
<tr>
<td valign="top">
<label for="Gender">Gender</label>
</td>
<td valign="top">
<select name="Gender">
<option value="male"/>Male</option>
<option value="female"/>Female</option>
</select>
</td>
</tr>
</table>
<p></p> <!emptyline>
<table>
<tr>
<td valign="top">
<label for="What do you think and engineer does">What do you think an engineer does? </label>
</td>
</tr>
<tr>
<td valign="top">
<textarea name="What do you think an engineer does" placeholder="Your answer here" maxlength="1000" cols="60" rows="10"/></textarea>
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="What was the most enjoyable part about the visit today?">What was the most enjoyable part about the visit today? </label>
</td>
</tr>
<tr>
<td valign="top">
<textarea name="What was the most enjoyable part about the visit today" placeholder="Your answer here" maxlength="1000" cols="60" rows="10"></textarea>
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Was there anything you did not like?">Was there anything you did not like? </label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="Was there anything you did not like?" value="yes">Yes (plese give details below)
<input type="radio" name="Was there anything you did not like?" value="no">No
</td>
</tr>
<tr>
<td valign="top">
<textarea name="Was there anything you did not like (comment)?" placeholder="Details here" maxlength="1000" cols="60" rows="10"></textarea>
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Would you consider studying Engineering at university?">Would you consider studying Engineering at university? </label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="Would you consider studying Engineering at university?" value="yes">Yes
<input type="radio" name="Would you consider studying Engineering at university?" value="no">No
<input type="radio" name="Would you consider studying Engineering at university?" value="unsure">Unsure
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Has today's session inspired you to consider becoming an engineer?">Has today's session inspired you to consider becoming an engineer? </label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="Has today's session inspired you to consider becoming an engineer?" value="yes">Yes
<input type="radio" name="Has today's session inspired you to consider becoming an engineer?" value="no">No
<input type="radio" name="Has today's session inspired you to consider becoming an engineer?" value="unsure">Unsure
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Before today's session did you know much about engineering?">Before today's session did you know much about engineering? </label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="Before today's session did you know much about engineering?" value="yes">Yes
<input type="radio" name="Before today's session did you know much about engineering?" value="no">No
<input type="radio" name="Before today's session did you know much about engineering?" value="unsure">A little
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Has todays session taught you much about engineering?">Has todays session taught you much about engineering? </label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio" name="Has todays session taught you much about engineering?" value="yes">Yes
<input type="radio" name="Has todays session taught you much about engineering?" value="no">No
<input type="radio" name="Has todays session taught you much about engineering?" value="unsure">A little
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Based on today's session, what do you think an engineer does?">Based on today's session, what do you think an engineer does? </label>
</td>
</tr>
<tr>
<td valign="top">
<textarea name="Based on today's session, what do you think an engineer does?" placeholder="Your answer here" maxlength="1000" cols="60" rows="10"></textarea>
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td valign="top">
<label for="Comments/Suggestions/Questions">Comments/Suggestions/Questions </label>
</td>
</tr>
<tr>
<td valign="top">
<textarea name="Comments/Suggestions/Questions" placeholder="Enter your comments, suggestions and questions here" maxlength="1000" cols="60" rows="10"></textarea>
</td>
</tr>
<tr> <td><p></p></td></tr> <!emptyline>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" class="submit" value="Submit">
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
Thank you for your feedback
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
© Girls in Engineering 2015
</td>
</tr>
</table>
</form>
PHP:
$value = test_input($_POST['School']);
$value2 = test_input($_POST['What do you think an engineer does']);
$sql = "INSERT INTO form1 (input1,input2) VALUES ('$value', '$value2')";
if($_POST){
echo '<pre>';
print_r($_POST);
echo '</pre>';
}
Output from print_r($_POST):
Array
(
[School] => 123
[Year] =>
[Gender] => male
[What_do_you_think_an_engineer_does] => 234
[What_was_the_most_enjoyable_part_about_the_visit_today] =>
[Was_there_anything_you_did_not_like_(comment)?] =>
[Based_on_today's_session,_what_do_you_think_an_engineer_does?] =>
[Comments/Suggestions/Questions] =>
)
Thanks for your help.
use name="Comments" in the textarea. as that is what the $_POST['Comments'] is linked to.
Suppose your code have
<textarea name="What was the most enjoyable part about the visit today" placeholder="Your answer here" maxlength="1000" cols="60" rows="10"></textarea>
your post should be $_POST['What was the most enjoyable part about the visit today']
if you want to pass Comments as an array
<textarea name="Comments[]" placeholder="Your answer here" maxlength="1000" cols="60" rows="10"></textarea>
Hint: Use thed code below for debugging on the page feedback_form_send.php to check what values were sent to it through post on submit;
if($_POST){
echo '<pre>';
print_r($_POST);
echo '</pre>';
}
EDITED
Advice: Your code is vulnerable to Sql injection. use PDO or mysqli instead of mysql
EDITED
my print shows with values
Array
(
[School] => myschool
[Year] => 2018
[Gender] => male
[What_do_you_think_an_engineer_does] => engineer sleeps
[What_was_the_most_enjoyable_part_about_the_visit_today] => it was nice
[Was_there_anything_you_did_not_like?] => yes
[Was_there_anything_you_did_not_like_(comment)?] => too beutiful
[Would_you_consider_studying_Engineering_at_university?] => yes
[Has_today's_session_inspired_you_to_consider_becoming_an_engineer?] => no
[Before_today's_session_did_you_know_much_about_engineering?] => unsure
[Has_todays_session_taught_you_much_about_engineering?] => yes
[Based_on_today's_session,_what_do_you_think_an_engineer_does?] => engineers do hard work
[Comments/Suggestions/Questions] => no comments, i suggest to do things
)
So Your php variables should be assigned something like this. This is just a demonstration to make it understandable. Always do remember to sanitize the input before using
$school=$_POST['School'];
$year=$_POST['Year'];
$gender=$_POST['Gender'];
$whatengineerdoes=$_POST['What_do_you_think_an_engineer_does'];
$enjoyable_part=$_POST['What_was_the_most_enjoyable_part_about_the_visit_today'];
$youdontlike=$_POST['Was_there_anything_you_did_not_like?'];
$didnotlike=$_POST['Was_there_anything_you_did_not_like_(comment)?'];
$wouldyou=$_POST['Would_you_consider_studying_Engineering_at_university?'];
$session_inspired=$_POST["Has_today's_session_inspired_you_to_consider_becoming_an_engineer?"];
$before_session=$_POST["Before_today's_session_did_you_know_much_about_engineering?"];
$has_taught=$_POST['Has_todays_session_taught_you_much_about_engineering?'];
$based_on=$_POST["Based_on_today's_session,_what_do_you_think_an_engineer_does?"];
$comments=$_POST['Comments/Suggestions/Questions'];
EDITED
HERE is example how you can insert the above data into your table
$dbhost = "localhost";
$dbname = "mydatabase";
$dbusername = "root";
$dbpassword = "mypppasss";
$link = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbusername,$dbpassword);
$statement = $link->prepare("INSERT INTO form1(input1,input2,input3,input4,input5,input6,input7,input8,input9,input10,input11,input12,input13)
VALUES(:inp1,:inp2,:inp3,:inp4,:inp5,:inp6,:inp7,:inp8,:inp9,:inp10,:inp11,:inp12,:inp13)");
$statement->execute(array(
inp1=>$school,
inp2=>$year,
inp3=>$gender,
inp4=>$whatengineerdoes,
inp5=>$enjoyable_part,
inp6=>$youdontlike,
inp7=>$didnotlike,
inp8=>$wouldyou,
inp9=>$session_inspired,
inp10=>$before_session,
inp11=>$has_taught,
inp12=>$based_on,
inp13=>$comments
));
$comment = test_input($_POST['Comments']);
$sql = "INSERT INTO form1 (Comment) VALUES ('$comment')";
$res = mysql_query($sql);

Chained Selects with Jquery Ajax

I new to programming, and have just finished the jquery course on CodeAcademy.I'm currently trying to create a chained select using Jquery's AJAX function to call a php page which runs a query on my database and echoes it out to my main html page.
Currently, I am able to load only my first , the second and third selects do not seem to be working, and i do not know what exactly it is that i'm doing wrong.
Jquery Code:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#category").load("AddItemCat.php");
});
$("#category").onchange(function(){
var category=$("#category").val();
$("#subcat").load("AddItemSubCat.php?category="+category);
});
$("#subcat").onchange(function(){
var category=$("#category").val();
var subcat=$("#subcat").val();
$("#subcat").load("AddItemSubCat.php?category="+category+"&subcat="+subcat);
});
My HTML Form:
<form action="<?PHP echo $_SERVER['PHP_SELF'] ?>" name="edititem" enctype="multipart/form-data" method="POST">
<table border='1'>
<tr>
<td colspan="3">
Category:
<select name="category" id="category" ></select>
SubCategory:
<select id="subcat" name="subcat"></select>
Item:
<select id="item" name="item"></select>
</td>
</tr>
<tr>
<td>Item Name</td>
<td><input type="text" name="itemname" size="30" maxlength="50" required="required"></td>
</tr>
<tr>
<td>Item Price</td>
<td><input type="number" name="itemprice" size="30" min="1" required="required"></td>
</tr>
<tr>
<td>Item Info</td>
<td><textarea name="iteminfo" col="40" rows="10" maxlength="300" required="required"></textarea>
</tr>
<tr>
<td>Filename:</td>
<td><input type="file" name="upload[]" /></td>
</tr>
<tr>
<td>Filename:</td>
<td><input type="file" name="upload[]" /></td>
</tr>
<tr>
<td>Filename:</td>
<td><input type="file" name="upload[]" /></td>
</tr>
<tr>
<td>Filename:</td>
<td><input type="file" name="upload[]" /></td>
</tr>
<tr>
<td>Filename:</td>
<td><input type="file" name="upload[]" /></td>
</tr>
<tr>
<td colspan="2"><input type="SUBMIT" name="Button" value="Submit"></td>
</tr>
<tr>
<td colspan="2"><?PHP if(isset($errormsg)){echo"$errormsg";}?></td>
</tr>
<tr>
<td colspan="3"><font color="#FF0000"></font></td>
</tr>
I would really appreciate it if someone could point out my mistake and give me pointers on rectifying it.Thanks!
Way to much code to help you but since you say that the jQuery part does not work:
$("#category").onchange(function(){
This should be
("#category").on("change", function(){
There is no onchange in jQuery 1.10 (or any other version?). A brief look into the console would have shown you the error I guess. Additionally, you shoud put all your other calls inside $(document).ready as well.
try use page url instead of file name. e.g - url to AddItemSubCat.php

Error Placing on same page PHP

some of my code in addUser.php it pure html
addUser.php
<form action="process/addNewUser.php" method="POST" id="userForm">
<table width="79%" border="0" cellspacing="6" cellpadding="1"
class="tabcont">
<tr>
<td width="47%" align="right">Title:</td>
<td width="53%">
<select name="title"><option value='0'>- - select - -</option>
</select>
</td>
</tr>
<tr>
<td width="47%" align="right">
First Name:</td>
<td width="53%"><input type="text" id="firstname" name="firstName" class="required" /></td>
</tr>
<tr>
<td align="right">Middle Name:</td>
<td><input type="text" id="middlename" name="middleName" class="name" /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><input name="password" value="" readonly="readonly"
id="password" class="required" " /></td>
</tr>
<tr>
<td align="right" colspan="2">
<input name="addNewUser" type="submit" class="submit" id="submit" value="Submit" />
</td>
</tr>
</table>
</form>
addNewUser.php
Here i am doing validations and displaying error messages and if it is success sending him to another page.
But i want to show an error message on addUser.php instead of validations page. Please give me a sample code how i can do it.
addNewUser.php
Add the message in the session
$_SESSION["ErrorMsg"]="Name already exists";
And in your addUser.php , you put the following code in the place you need to show the msg :
if($_SESSION["ErrorMsg"])
{
echo $_SESSION["ErrorMsg"];
$_SESSION["ErrorMsg"]="";
}

How to handle multiple actions using a single html form

I hope I can be clear enough in what I need here. What I have is a function that contains some html for an email client app I'm developing. This part of the app uses a common forward, reply and "reply to all" form. Since they are all basically the same, I figured I'd go the lean route and just use a single function to handle this. The only real differences I can see between the 3 actions I mentioned above are that in a reply to all, there will be multiple email addys in the CC part of the form. For a forward, no (cc) and the (to) box should be blank. I need to represent all of this functionality and I'm kind of confused on what the best way to do this is. Can anyone please offer any help? Thanks.
I can certainly post the html is need be, I just wanted to start light.
EDIT:
I almost forgot, there will be POST values when the user submits the form in the event that the form validation fails.
function compose($type,$contents=null)
{
echo'
<tr>
<td>
<tr>
<td valign="top">
<form method="post" action="">
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="reply">
<tr>
<td><h2>'.$type.'</h2></td>
</tr>
<tr>
<td width="1%" valign="top" nowrap><b>To:</b><br><input name="to" id="focus" title="Enter a single system user here" value="" type="text" size="64"></td>
</tr>
<tr>
<td nowrap><b>Cc:</b><br><input name="cc"" value="" type="text" size="64"></td>
</tr>
<tr>
<td nowrap><b>Subject:</b><br><input name="subject" title="Enter your subject here" value="" type="text" size="64" maxlength="30"></td>
</tr>
<tr>
<td valign="top"><b>Message:</b><br><textarea name="message" title="Enter your message here" rows="5" cols="50" wrap="virtual"></textarea></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input type="hidden" name="id" value=""><input type="submit" name="send" value="Send"></td>
</tr>
</table>
</form>
</td>
</tr>
</td>
</tr>';
}
EDIT: Example modification of posted code (I haven't added all the different cases or even changed the output really, just showing the concept - all that's here is a check for a type of Reply and a check for the 'to' POST value.)
function compose($type,$contents=null)
{
$toValue = '';
if(isset($_POST['to']))
{
// Might want to actually validate this to prevent XSS, but this is just a basic example
$toValue = $_POST['to'];
}
echo'
<tr>
<td>
<tr>
<td valign="top">
<form method="post" action="">
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="reply">
<tr>
<td><h2>'.$type.'</h2></td>
</tr>';
if($type == "Reply") {
echo'
<tr>
<td width="1%" valign="top" nowrap><b>To:</b><br><input name="to" id="focus" title="Enter a single system user here" value="' . $toValue . '" type="text" size="64"></td>
</tr>
<tr>
<td nowrap><b>Cc:</b><br><input name="cc"" value="" type="text" size="64"></td>
</tr>';
}
echo'
<tr>
<td nowrap><b>Subject:</b><br><input name="subject" title="Enter your subject here" value="" type="text" size="64" maxlength="30"></td>
</tr>
<tr>
<td valign="top"><b>Message:</b><br><textarea name="message" title="Enter your message here" rows="5" cols="50" wrap="virtual"></textarea></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input type="hidden" name="id" value=""><input type="submit" name="send" value="Send"></td>
</tr>
</table>
</form>
</td>
</tr>
</td>
</tr>';
}
(Original inquiry)
Is this function processing the results of the form, or is it displaying the form in the first place? Your question is a bit unclear about which point in the process you're talking about.

Categories