Jump to content


Photo

Multi functions in one form


  • Please log in to reply
1 reply to this topic

#1 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 15 August 2006 - 09:14 PM

I am trying to make the basic form as shown below:

<form method="post" name="signup" action="code/subscribe.php" style="margin-top: 0px; margin-bottom: 0px;">
	<tr valign="top">
		<td colspan="2">
			<img src="images/index_26.gif" width="45" height="17" alt=""></td>
		<td colspan="6" valign="top">
		<input name="email" type="text" style="background-image:images/index_27.gif; width:139px; height:17px; border:none; margin-top: 0px; margin-bottom: 0px;" border="0" align="top" height="16" width="139">
		</td>
		<td colspan="2">
			<img src="images/index_28.gif" width="10" height="17" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="17" alt=""></td>
	</tr>
	<tr>
		<td colspan="10">
			<img src="images/index_29.gif" width="194" height="5" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="5" alt=""></td>
	</tr>
	<tr>
		<td colspan="3">
			<img src="images/index_30.gif" width="50" height="16" alt=""></td>
		<td valign="top">
		<input type="button" align="top" vspace="0" border="0" style="background:url(images/index_31.gif); width:67px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="67" height="16">
			</td>
		<td>
			<img src="images/index_32.gif" width="6" height="16" alt=""></td>
		<td colspan="2" valign="top">
		<input type="button" align="top" vspace="0" border="0" style="background:url(images/index_33.gif); width:58px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="58" height="16">
		</td>
		<td colspan="3">
			<img src="images/index_34.gif" width="13" height="16" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="1" height="16" alt=""></td>
	</tr>
	</form>

I want one of the inputs to grab the information from the email input and add it to my mysql database. I want the other to delete the email from my database. I have the PHP side of things done but dont know how to add this to multi-function to my HTML form. Any help would be great.

#2 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 15 August 2006 - 11:28 PM

I assumed these are the 2 buttons for the functions?
<input type="button" align="top" vspace="0" border="0" style="background:url(images/index_31.gif); width:67px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="67" height="16">

<input type="button" align="top" vspace="0" border="0" style="background:url(images/index_33.gif); width:58px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="58" height="16">

well just change these 2 to something like this:
<input type="submit" name="option1" align="top" vspace="0" border="0" style="background:url(images/index_31.gif); width:67px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="67" height="16">

<input type="submit" name="option2" align="top" vspace="0" border="0" style="background:url(images/index_33.gif); width:58px; height:16px; border:0px; margin-top: 0px; margin-bottom: 0px;" width="58" height="16">
then put this at the start of the php stuff

if(isset($_POST['option1'])){
    // OPTION 1 - DO THIS
} else if(isset($_POST['option2'])){
    // OPTION 2 - DO THIS
}




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users