DaveCuppen
Gebruiker
- Lid geworden
- 11 jan 2008
- Berichten
- 49
Hoi allemaal,
Ik hoop dat er iemand hier is die mij kan helpen....ik heb een formulier aangemaakt, maar deze krijg ik niet werkend
Er zal wel ergens een fout in zitten, maar ik ben niet geheel bekend met php en weet niet precies waar er ergens een fout zou kunnen zitten.
Hierbij hoop ik op jullie hulp
Alvast vriendelijk bedankt!
Vrgr.
Dave
Ik hoop dat er iemand hier is die mij kan helpen....ik heb een formulier aangemaakt, maar deze krijg ik niet werkend

Er zal wel ergens een fout in zitten, maar ik ben niet geheel bekend met php en weet niet precies waar er ergens een fout zou kunnen zitten.
Hierbij hoop ik op jullie hulp

Code:
<?php
$v=($_SERVER['REQUEST_METHOD']=="POST"?true:false);
if($v){
$mailto="dave.cuppen@email.com";
$subject="Title";
$mailtext="Company: ".$_POST['txtCompany']."\n";
$mailtext.="Country: ".$_POST['txtCountry']."\n";
$mailtext.="Attendee: ".$_POST['txtAttendee']."\n";
$mailtext.="Title: ".$_POST['txtTitle']."\n";
$mailtext.="Department: ".$_POST['txtDepartment']."\n";
$mailtext.="Email: ".$_POST['txtEmail']."\n";
$mailtext.="Mobile: ".$_POST['txtMobile']."\n""\n";
$mailtext.="Emergency: ".$_POST['txtEmergency']."\n""\n";
$mailtext.="Tshirt: ".$_POST['Tshirt']."\n";
$mailtext.="Jacket: ".$_POST['Jacket']."\n";
$mailtext.="Meal: ".$_POST['Meal']."\n";
$mailtext.="Othermeal: ".$_POST['Othermeal']."\n""\n";
$mailtext.="ArrivalDate: ".$_POST['txtArrivalDate']."\n";
$mailtext.="ArrivalAirport: ".$_POST['ArrivalAirport']."\n""\n";
$mailtext.="DepartureDate: ".$_POST['txtDepartureDate']."\n";
$mailtext.="DepartureAirport: ".$_POST['DepartureAirport']."\n""\n";
$sender="From: ".$_POST['txtAttendee']." <".$_POST['txtEmail'].">";
$w=mail($mailto, $subject, $Emailtext, $sender);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Registration</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
function check(){
var msg="";
if(document.frmRegistration.txtCompany.value==""){msg=msg+"Company is niet ingevuld.\n";}
if(document.frmRegistration.txtCountry.value==""){msg=msg+"Country is niet ingevuld.\n";}
if(document.frmRegistration.txtAttendee.value==""){msg=msg+"Attendee is niet ingevuld.\n";}
if(document.frmRegistration.txtTitle.value==""){msg=msg+"Title is niet ingevuld.\n";}
if(document.frmRegistration.txtDepartment.value==""){msg=msg+"Department is niet ingevuld.\n";}
if(document.frmRegistration.txtEmail.value==""){msg=msg+"Email is niet ingevuld.\n";}
if(document.frmRegistration.txtMobile.value==""){msg=msg+"Mobile is niet ingevuld.\n";}
if(msg==""){document.frmRegistration.submit();}else{alert(msg);}
}
</script>
<style type="text/css">
<!--
body {
background-color: #E6E6E6;
margin-top: 0px;
}
.style2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #cc0000;
font-weight: bold;
}
.style8 {font-size: 17px}
.style9 {
font-size: 28px;
color: #cc0000;
font-family: Arial, Helvetica, sans-serif;
}
.style12 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.style14 {color: #FFFFFF}
.style15 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body leftmargin="0" marginwidth="0" onLoad="MM_preloadImages('images/01_Welcome_03-2.jpg','images/01_Welcome_05-2.jpg','images/01_Welcome_07-2.jpg','images/01_Welcome_09-2.jpg','images/01_Welcome_11-2.jpg','images/01_Welcome_13-2.jpg','images/01_Welcome_15-2.jpg')">
<div align="center">
<!-- ImageReady Slices (01_Welcome.psd) -->
<table id="Table_01" width="800" height="664" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td colspan="14">
<img src="images/01_Welcome_01.jpg" width="800" height="101" alt=""></td>
</tr>
<tr>
<td colspan="14">
<img src="images/01_Welcome_02.jpg" width="800" height="82" alt=""></td>
</tr>
<tr>
<td width="100"><a href="01_Welcome.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Welcome','','images/01_Welcome_03-2.jpg',1)"><img src="images/01_Welcome_03.jpg" alt="button Welcome" name="btn_Welcome" width="100" height="27" border="0"></a></td>
<td width="1">
<img src="images/01_Welcome_04.jpg" width="1" height="27" alt=""></td>
<td width="117"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Registration','','images/01_Welcome_05-2.jpg',1)"><img src="images/01_Welcome_05-2.jpg" alt="button Registration" name="btn_Registration" width="117" height="27" border="0"></a></td>
<td width="1">
<img src="images/01_Welcome_06.jpg" width="1" height="27" alt=""></td>
<td width="99"><a href="03_Program.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Program','','images/01_Welcome_07-2.jpg',1)"><img src="images/01_Welcome_07.jpg" alt="button Program" name="btn_Program" width="99" height="27" border="0"></a></td>
<td width="1">
<img src="images/01_Welcome_08.jpg" width="1" height="27" alt=""></td>
<td width="145"><a href="04_Evening-Program.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Evening Program','','images/01_Welcome_09-2.jpg',1)"><img src="images/01_Welcome_09.jpg" alt="button Evening Program" name="btn_Evening Program" width="145" height="27" border="0"></a></td>
<td width="1">
<img src="images/01_Welcome_10.jpg" width="1" height="27" alt=""></td>
<td colspan="2"><a href="05_Venue-Travel.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Venue & Travel','','images/01_Welcome_11-2.jpg',1)"><img src="images/01_Welcome_11.jpg" alt="button Venue & Travel" name="btn_Venue & Travel" width="130" height="27" border="0"></a></td>
<td>
<img src="images/01_Welcome_12.jpg" width="1" height="27" alt=""></td>
<td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Delegates','','images/01_Welcome_13-2.jpg',1)"><img src="images/01_Welcome_13.jpg" alt="button Delegates" name="btn_Delegates" width="107" height="27" border="0"></a></td>
<td>
<img src="images/01_Welcome_14.jpg" width="1" height="27" alt=""></td>
<td><a href="07_Contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('btn_Contact','','images/01_Welcome_15-2.jpg',1)"><img src="images/01_Welcome_15.jpg" alt="button Contact" name="btn_Contact" width="96" height="27" border="0"></a></td>
</tr>
<tr>
<td colspan="14">
<img src="images/01_Welcome_16.jpg" width="800" height="196" alt=""></td>
</tr>
<tr>
<td height="210" colspan="14" align="left" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="21" height="965" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="536" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="536" height="72" align="left" valign="top" bgcolor="#FFFFFF"><p><span class="style2"><span class="style8"><br>
</span>
<span class="style9">Registration</span></p></td>
</tr>
<tr>
<td height="893" valign="top">
<form name="frmRegistration" action="02_Registration.php" method="post" id="frmRegistration">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="154" height="20" align="right" class="normaal style12">
<div align="left">Company</div></td>
<td width="306" class="normaal style12">
: <?php
if($w){
echo $_POST['txtCompany'];
}else{
?>
<input name="txtCompany" type="text" id="txtCompany" value="<?php echo $_POST['txtCompany'] ?>" size="40" maxlength="50">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12"><div align="left">Country</div></td>
<td class="normaal style12">
<span class="normaal ">: </span><?php
if($w){
echo $_POST['txtCountry'];
}else{
?>
<input name="txtCountry" type="text" id="txtCountry" value="<?php echo $_POST['txtCountry'] ?>" size="40" maxlength="50">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Name attendee * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtAttendee'];
}else{
?>
<input name="txtAttendee" type="text" id="txtAttendee" value="<?php echo $_POST['txtAttendee'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Title * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtTitle'];
}else{
?>
<input name="txtTitle" type="text" id="txtTitle" value="<?php echo $_POST['txtTitle'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Department * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtDepartment'];
}else{
?>
<input name="txtDepartment" type="text" id="txtDepartment" value="<?php echo $_POST['txtDepartment'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Email address * </div></td>
<td class="normaal style12">:
<?php
if($w){
echo $_POST['txtEmail'];
}else{
?>
<input name="txtEmail" type="text" id="txtEmail" value="<?php echo $_POST['txtEmail'] ?>" size="40" maxlength="60">
<?php
}
?> </td></tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Mobile number * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtMobile'];
}else{
?>
<input name="txtMobile" type="text" id="txtMobile" value="<?php echo $_POST['txtMobile'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Emergency contact details * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtEmergency'];
}else{
?>
<input name="txtEmergency" type="text" id="txtEmergency" value="<?php echo $_POST['txtEmergency'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Size T-shirt * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtTshirt'];
}else{
?>
<select name="Tshirt" id="Tshirt">
<option value="XS">XS</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
<option value="XXL">XXL</option>
</select>
<?php
}
?></td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Size Jacket *</div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtJacket'];
}else{
?>
<select name="Jacket" id="Jacket">
<option value="XS">XS</option>
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL">XL</option>
<option value="XXL">XXL</option>
</select>
<?php
}
?></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Meal preferences * </div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtMeal'];
}else{
?>
<select name="Tshirt" id="Tshirt">
<option value="No fish">No fish</option>
<option value="Vegetarian">Vegetarian</option>
<option value="Special diet">Special diet</option>
<option value="Other">Other</option>
</select>
<?php
}
?>
<br></td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left"></div></td>
<td class="normaal style12"><span class="style14">:</span> <?php
if($w){
echo $_POST['txtOthermeal'];
}else{
?>
<textarea name="txtOthermeal" cols="40" rows="5" id="txtOthermeal"><?php echo $_POST['txtOthermeal'] ?></textarea>
<?php
}
?> </td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><span class="style12">Flight details:<br>
<span class="style15">Arrival</span></span></td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Date / time</div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtArrivalDate'];
}else{
?>
<input name="txtArrivalDate" type="text" id="txtArrivalDate" value="<?php echo $_POST['txtArrivalDate'] ?>" size="40" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Airport</div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtArrivalAirport'];
}else{
?>
<select name="ArrivalAirport" id="ArrivalAirport">
<option value="Ciampino">Ciampino</option>
<option value="Fiumicino">Fiumicino</option>
</select>
<?php
}
?></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><span class="style12"><span class="style15">Departure</span></span></td>
</tr>
<tr>
<td height="20" align="right" class="normaal style12">
<div align="left">Date / time</div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtDepartureDate'];
}else{
?>
<input name="txtDepartureDate" type="text" id="txtDepartureDate" value="<?php echo $_POST['txtDepartureDate'] ?>" size="35" maxlength="60">
<?php
}
?> </td>
</tr>
<tr>
<td height="28" align="right" nowrap class="normaal style12">
<div align="left">Airport</div></td>
<td class="normaal style12">
: <?php
if($w){
echo $_POST['txtDepartureAirport'];
}else{
?>
<select name="DepartureAirport" id="DepartureAirport">
<option value="Ciampino">Ciampino</option>
<option value="Fiumicino">Fiumicino</option>
</select>
<?php
}
?></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="36" colspan="2" valign="top" bgcolor="#FFFFFF"><span class="style12"><br>
Office Depot will book your accommodation at the Rome Cavalieri hotel for<br>
Friday, March 6th and Saturday, March 7th.<br>
</span></td>
</tr>
<?php
if($w){
?>
<tr>
<td align="center" colspan="2" height="40" valign="top">
<div align="right"><br>
<input type="reset" name="reset" value="Clear fields" class="c1">
<input type="button" name="submit" value="Send" class="c1" onClick="check();" id="Submit">
<span class="style12"><br>
<br>
<br>
</span> </div></td>
</tr>
<?php
}
?>
</table></form>
<script type="text/javascript">
alert("<?php echo $msg; ?>");
</script>
<?php
}
?> </td>
</tr>
</table>
</td>
<td width="21" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="222" valign="bottom" bgcolor="#FFFFFF">
<img src="images/01_Welcome_18.jpg" width="220" height="210" alt=""></td>
</tr>
</table> </td>
</tr>
<tr>
<td colspan="14">
<img src="images/01_Welcome_19.jpg" width="800" height="47" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="100" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="117" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="99" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="145" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td width="115">
<img src="images/spacer.gif" width="115" height="1" alt=""></td>
<td width="15">
<img src="images/spacer.gif" width="15" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="107" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="96" height="1" alt=""></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</div>
</body>
</html>
Alvast vriendelijk bedankt!
Vrgr.
Dave
Laatst bewerkt: