Page 1 of 1

how to write Form inside php code ??

Posted: Sat Dec 05, 2009 7:54 pm
by mianmajidali
hi to all,
i m giving my form code here, please tell me to write this inside php code. means inside <?php.. form table should be here..?>
thanks alot.
---------------------------------------------
<table align="center" width="100%" align="center">
<form action="selected.php" method="post">
<tr>

<td>Start Date:</td>
<td>&nbsp;</td>
<td><input type="text"/ name="s_date"></td>
</tr>
<tr>
<td>End Date:</td>
<td>&nbsp;</td>
<td><input type="text"/ name="e_date"></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" value="Submit Query" name="selected"/>&nbsp;OR&nbsp;<input type="submit" value="View All" name="all"/>
</td>
</tr>
</form>

</table>

Re: how to write Form inside php code ??

Posted: Sat Dec 05, 2009 8:44 pm
by Robert07
Why do you want to do this? If it were me, I would either put the whole form code into a string and echo it (if there were calculations or modifications needed from php in order to determine what to print), or I would just leave it outside my php tags (close them before and open them after) if this is to be inside a php file...