how to write Form inside php code ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mianmajidali
Forum Commoner
Posts: 30
Joined: Tue Dec 01, 2009 8:05 pm

how to write Form inside php code ??

Post 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>
User avatar
Robert07
Forum Contributor
Posts: 113
Joined: Tue Jun 17, 2008 1:41 pm

Re: how to write Form inside php code ??

Post 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...
Post Reply