How to create form thet will post datas from web to email ad

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
kujtim
Forum Commoner
Posts: 35
Joined: Sat Oct 25, 2003 4:00 am
Location: kosovo
Contact:

How to create form thet will post datas from web to email ad

Post by kujtim »

How to create form thet will post datas from web to email address
i have tyed in someny ways but i couldn't do thet

heare is my html form:


<html>
<body>

<form action="formmail.php" method="post">
<dl>
<dt>
<center>
<center>
<input name="recipient" type="hidden" value="reservation@hotel-victory.com">
<input name="subject" type="hidden" value="Hotel-VICTORY [reservation]">
<table
width="347" height="0" border=0>
<tbody>
<tr valign="top">
<td height="0" colspan="4"> <div align="right">
<dl>
<dt><b><b>*Rooms:</b>
<select name="Rooms" size=1 class="bu">
<option selected>your room?</option>
<option>Single room</option>
<option>Double room</option>
<option>Twin bed room</option>
<option>Suite</option>
</select>
<br>
</b></dt>
</dl>
</div></td>
</tr>
<tr valign="top">
<td width="130" height="0"> <div align="right"><b>*Arrival
Date: </b></div></td>
<td width="53" height="0"> <div align="right"><b>
<select name="Arrival_day" size=1 class="bu">
<option selected>Day</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
</b></div></td>
<td width="87" height="0"><b>
<select name="Arrival_month" size=1 class="bu">
<option selected>Month</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
</b></td>
<td width="59" height="0"> <div align="right"><b>
<select name="Arrival_year" size=1 class="bu">
<option selected>Year</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select>
</b></div></td>
</tr>
<tr valign="top">
<td width="130" height="0"> <div align="right"><b>*Departure
Date: </b></div></td>
<td width="53" height="0"> <div align="right"><b>
<select name="Departure_day" size=1 class="bu">
<option selected>Day</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
</select>
</b></div></td>
<td width="87" height="0"><b>
<select name="Departure_month" size=1 class="bu"">
<option selected>Month</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
</b></td>
<td width="59" height="0"> <div align="right"><b>
<select name="Departure_year" size=1 class="bu">
<option selected>Year</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select>
</b></div></td>
</tr>
<tr valign="top">
<td height="23" colspan="4"> <div align="right">
<hr>
</div></td>
</tr>
<tr valign="top">
<td width="130" height="0"> <div align="right"></div></td>
<td height="0" colspan="3"> <div align="right"><b>
</b> <b><strong>*Adults:</strong>
<select name="Adults" size=1 class="bu">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>more</option>
</select>
<strong></strong> </b></div></td>
</tr>
<tr valign="top">
<td width="130" height="0"> <div align="right"></div></td>
<td height="0" colspan="3"><div align="right"><b><strong>
Childrens:</strong>
<select name="Childrens" size=1 class="bu">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>more</option>
</select>
</b></div></td>
</tr>
<tr valign="top">
<td height="187" colspan="4"> <div align=right>
<hr>
<b> </b> <b><br>
&nbsp;&nbsp; *First name:
<input maxlength=30 name="First_name" size=25 class="bu">
</b> </div>
<div align=right>
<dt><b>*Last name:
<input name="Last_name" class="bu" size=25
maxlength=30>
</b></dt>
</div>
<div align=right>
<dt><b>*Address:
<input name="Address" size=25 class="bu">
</b></dt>
</div>
<div align=right>
<dt><b> *Zip:
<input maxlength=5 name="Zip" size=5 leght="6" class="bu">
*City:
<input
maxlength=30 name="City" size=10 class="bu">
</b></dt>
</div>
<div align=right>
<dt>
<dt><b>Tel:
<input
maxlength=15 name="Tel" size=25 leght="40" class="bu">
</b></dt>
</div>
<div align=right>
<dt><b>&nbsp;&nbsp;*E-mail:
<input name="E-mail" size=25 leght="40" class="bu">
</b></dt>
</div>
<div align=right>
<dt>&nbsp;</dt>
<dt>&nbsp;</dt>
<dt><b>&nbsp;&nbsp;</b><b>
<input type="submit" value="SEND" onClick="MM_validateForm('First_name','','R','Last_name','','R','Address','','R','Zip','','R','Zip','','NisNum','City','','R','Tel','','NisNum','E-mail','','R','E-mail','','NisEmail');return document.MM_returnValue" name="submit" class="bu">
<input type="reset" value="REFRESH" name="reset" class="bu">
</b><b> </b></dt>
</div></td>
</tr>
</tbody>
</table>
</center>
</center>
</dt>
</dl>
</form></td>
</tr>
</table></td>
<!-- InstanceEndEditable --></tr>
<tr>
<td height="36" colspan="2"> <table width="100%" height="0" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="95%" height="40">&nbsp;</td>
<td width="0" height="0" rowspan="2" valign="bottom"> <div align="right"><img src="dizajni/4.jpg" width="35" height="56"></div></td>
</tr>
<tr>
<td height="17" bgcolor="#000000"><span class="miniatur">Hosting &
Design by</span> <a href="http://www.albamatrix.com" target="_blank"><img src="ax-logo.gif" width="73" height="11" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>
</body>

</html>
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Um...

Post by William »

OK, So you wabnt that info to e-mail? to you or the person who did form or both?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

mail() is used to send mail. Look at the usercomments on that page to get more ideas on how you can make it work for you.
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

Can you post the code from the "formmail.php" here so we can have a look at it?
kta
Forum Newbie
Posts: 12
Joined: Fri Oct 24, 2003 5:35 pm

Post by kta »

<form action="mailto:youraddress@somewhere.com" method="post">
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

Just on the note, you might want to have a name for the form and also use onSubmit rather than have onClick on the submit button.

And like Derfel said, can we see formmail.php - since I'm sure you want help with the PHP script, not the form itself.

-Nay
kujtim
Forum Commoner
Posts: 35
Joined: Sat Oct 25, 2003 4:00 am
Location: kosovo
Contact:

Post by kujtim »

this is a formmail page

can you tel my what else should i add to this script
please help my to finish this cause is very inportant to me

<head>
<title></title>
</head>

<body>



<?php
mail("kujtim009@hotmail.com", "subject", "message");

$romms;
$Arrival_day;
$Arrival_month;
$Arrival_year;
$Departure_day;
$Departure_month;
$Departure_year;
$Adults;
$Childrens;
$First_name;
$Last_name;
$Address;
$Zip;
$E-mail;

?>


</body>

</html>
Post Reply