I have a Contact form with submit photo and file upload with also paypal payment once submitted, I believe it is nearly there and it seems to be submitting but when I check the database or my ftp server the image is not there like it should be, and also I need a hand with where in the code do I add the paypal code... I want it so that when you check the paypal and click submit the info submits with all and than they go straight to paypal checkout. Any ideas? <table width="663" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="657" class="style10"> <?php if (isset($_POST['submit'])) { $name=$_POST['name']; $date_birth=$_POST['date_birth']; $color_hair=$_POST['color_hair']; $color_eyes=$_POST['color_eyes']; $height=$_POST['height']; $weight=$_POST['weight']; $address=$_POST['address']; $city=$_POST['city']; $state=$_POST['state']; $country=$_POST['country']; $zip=$_POST['zip']; $phone=$_POST['phone']; $email=$_POST['email']; $sex=$_POST['sex']; $reference=$_POST['reference']; $social_security=$_POST['social_security']; $doctor_name=$_POST['doctor_name']; $doctor_address=$_POST['doctor_address']; $award_letter=$_POST['award_letter']; $motor_receipt=$_POST['motor_receipt']; $va_letter=$_POST['va_letter']; $release_packet=$_POST['release_packet']; $20_paypal_photo=$_POST['20_paypal_photo']; $20_paypal=$_POST['20_paypal']; $80_paypal_photo=$_POST['80_paypal_photo']; $80_paypal=$_POST['80_paypal']; $150_paypal_photo=$_POST['150_paypal_photo']; $150_paypal=$_POST['150_paypal']; if ($name=="" || $date_birth=="" || $color_hair=="" || $color_eyes=="" || $height=="" || $weight=="" || $address=="" || $city=="" || $state=="" || $country=="" || $zip=="" || $phone=="" || $email=="" || $sex=="" || $reference=="" || $social_security=="" || $doctor_name=="" || $doctor_address=="" || $award_letter=="" || $motor_receipt=="" || $va_letter=="" || $release_packet=="" || $20_paypal_photo=="" || $20_paypal=="" || $80_paypal_photo=="" || $80_paypal=="" || $150_paypal_photo=="" || $150_paypal=="") { echo "<span class=\"red\">All fields marked with '*' are required to be filled up.</span>"; } elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)) { echo "<span class=\"red\">Email is not validate.</span>"; } else { $title="Mywebsite.com(Contact)"; $youremail="info@myemail.com"; $body="Data:<br><br>Name: $name<br>Color Hair: $color_hair<br>Color Eyes: $color_eyes<br>Height: $height<br>Weight: $weight<br>Email: $email<br>Address: $address<br>Zip: $zip<br>Date of Birth: $date_birth<br>Social Security Number: $social_security<br>Company Name: $company_name<br>Address: $address<br>City: $city<br>State: $state<br>Country: $country<br>Phone: $phone<br>Sex: $sex<br>Disablity Reference Number: $reference<br>Cash for Investment: $cash_for_investment<br>Time Frame: $time_frame<br>Doctor Name: $doctor_name<br>Doctor Address: $doctor_address<br>Award Letter: $award_letter<br>Motor Receipt: $motor_receipt<br>VA Letter: $va_letter<br>Release Packet: $release_packet<br>20 Paypal Photo: $20_paypal_photo<br>20 Paypal: $20_paypal<br>80 Paypal Photo: $80_paypal_photo<br>80 Paypal Photo: $80_paypal_photo<br>150 Paypal Photo: $150_paypal_photo<br>150 Paypal: $150_paypal"; mail($youremail,$title,$body,"From:$email\r\nReply-to: $email\r\nContent-type: text/html; charset=us-ascii") or die("oops! mail is not sent."); echo "Thank you, we will get back to you as soon as possible."; $x5=1; } } ?> <br /> <br /> <br /> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <table width="645" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="86"><span class="style8">Name*:</span></td> <td width="222"><input name="name" type="text" id="name" value="<?php if(!$x5){ echo $name; }?>" size="20" /></td> <td width="135"><span class="style8">Doctor Name *:</span></td> <td width="178"><input name="doctor_name" type="text" id="doctor_name" value="<?php if(!$x5){ echo $doctor_name; }?>" size="20" /></td> </tr> <tr> <td><span class="style8">Date of Birth *:</span></td> <td><input name="date_birth" type="text" id="date_birth" value="<?php if(!$x5){ echo $date_birth; }?>" size="20" /></td> <td><span class="style8">Doctor Address *:</span></td> <td><textarea name="doctor_address" cols="20" rows="2" id="doctor_address"></textarea></td> </tr> <tr> <td><span class="style8">Color Hair *:</span></td> <td><input name="colour_hair" type="text" id="colour_hair" value="<?php if(!$x5){ echo $color_hair; }?>" size="20" /></td> <td colspan="2"><div align="left">Please tick atleast one or more of these check boxes and attach proof below*</div></td> </tr> <tr> <td><span class="style8">Color Eyes *:</span></td> <td><input name="color_eyes" type="text" id="color_eyes" value="<?php if(!$x5){ echo $color_eyes; }?>" size="20" /></td> <td><div align="left">Social Security Medicare Card or insurance award letter</div></td> <td><label> <div align="left"> <input name="award_letter" type="checkbox" id="award_letter" value="award_letter" /> </div> </label></td> </tr> <tr> <td><span class="style8">Height (feet) *:</span></td> <td><input name="height" type="text" id="height" value="<?php if(!$x5){ echo $height; }?>" size="20" /></td> <td><div align="left">Department of Motor Vehicles Disabled Person Placard Identification Card/Receipt</div></td> <td><div align="left"> <input name="motor_receipt" type="checkbox" id="motor_receipt" value="motor_receipt" /> </div></td> </tr> <tr> <td><span class="style8">Weight (lbs) *:</span></td> <td><input name="weight" type="text" id="weight" value="<?php if(!$x5){ echo $weight; }?>" size="20" /></td> <td><div align="left">V.A Letter confirming a disability of 50% or greater</div></td> <td><div align="left"> <input name="va_letter" type="checkbox" id="va_letter" value="va_letter" /> </div></td> </tr> <tr> <td><span class="style8">Address*:</span></td> <td><input name="address" type="text" id="address" size="20" /></td> <td>Medical Disability. Attach Medical release packet provided by your health care professional.</td> <td><input name="release_packet" type="checkbox" id="release_packet" value="release_packet" /></td> </tr> <tr> <td>City*:</td> <td><input name="city" type="text" id="city" size="20" /></td> <td colspan="2"><input type="file" name="imagefile2" /> <br /> <span class="style39">*please attach statement once check box is ticked above </span><br /> <?php if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg"){ //<--- Note the type (check the change below and post the error) move_uploaded_file($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Stored in: " . $_FILES["file"]["files"]; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['type'].")<br>"; //<--Note change from name to type } } ?></td> </tr> <tr> <td><span class="style8">State*:</span></td> <td><input name="state" type="text" id="state" size="20" /></td> <td colspan="2"><span class="style39">Please select type of card you would like to pay for through paypal*; </span></td> </tr> <tr> <td><span class="style8">Country*:</span></td> <td><input type="text" name="country" size="20" /></td> <td><span class="style8">Paypal $20 / 1 year - (Card with photo) </span></td> <td><input name="20_paypal_photo" type="radio" value="20_paypal_photo" /></td> </tr> <tr> <td><span class="style8">Zip*:</span></td> <td><input name="zip" type="text" id="zip" value="<?php if(!$x5){ echo $zip; }?>" size="20" /></td> <td><span class="style8">Paypal $20 / 1 year - (Card no photo) </span></td> <td><input name="20_paypal" type="radio" value="20_paypal" /></td> </tr> <tr> <td><span class="style8">Emergency Phone*:</span></td> <td><input type="text" name="phone" size="20" /></td> <td><span class="style8">Paypal $80 / 5 years - (Card with photo) </span></td> <td><input name="80_paypal_photo" type="radio" value="80_paypal_photo" /></td> </tr> <tr> <td><span class="style8">Email*:</span></td> <td><input type="text" name="email" value="<?php if(!$x5){ echo $email; } ?>" size="20" /></td> <td><span class="style8">Paypal $80 / 5 years - (Card no photo) </span></td> <td><input name="80_paypal" type="radio" value="80_paypal" /></td> </tr> <tr> <td><span class="style8">Sex*: </span></td> <td><span class="style8">Male</span> <input name="sex" type="radio" value="yes" /> Female <input name="sex" type="radio" value="no" checked="checked" /></td> <td><span class="style8">Paypal $150 / 10 years - (Card with photo) </span></td> <td><input name="150_paypal_photo" type="radio" value="150_paypal_photo" /></td> </tr> <tr> <td><span class="style8">Disability Reference Number*:</span></td> <td><input type="text" name="reference" size="20" /></td> <td><span class="style8">Paypal $150 / 10 years - (Card no photo) </span></td> <td><input name="150_paypal" type="radio" value="150_paypal" /></td> </tr> <tr> <td><span class="style8">Social Security Number *:</span></td> <td><input type="text" name="social_security" value="<?php if(!$x5){ echo $social_security; }?>" size="20" /></td> <td> </td> <td> </td> </tr> <tr> <td><span class="style8">Upload Photo*: </span></td> <td><input type="file" name="imagefile" /> <br /> <span class="style39">*photos need to be standard US passport size</span><br /> <?php if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg"){ //<--- Note the type (check the change below and post the error) move_uploaded_file($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Stored in: " . $_FILES["file"]["files"]; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['type'].")<br>"; //<--Note change from name to type } } ?> <?php if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile2']['type'] == "image/jpg" || $_FILES['imagefile2']['type'] == "image/jpeg"){ //<--- Note the type (check the change below and post the error) move_uploaded_file($_FILES['imagefile2']['tmp_name'], "files/".$_FILES['imagefile2']['name'])or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile2']['name'].""; echo "Size: ".$_FILES['imagefile2']['size'].""; echo "Type: ".$_FILES['imagefile2']['type'].""; echo "Stored in: " . $_FILES["file"]["files"]; echo "Copy Done...."; } else { echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile2']['type'].")<br>"; //<--Note change from name to type } } ?></td> <td> </td> <td> </td> </tr> <tr> <td colspan="4"><textarea name="textarea2" cols="120" rows="4" class="style4">The Terms and conditions: I understand that when buying the Disabled Card this card is for personal and private use only and not affiliated with any government or legal agreement. You may use this card for the sole purpose of identifying yourself of being diabled for personal reasons. </textarea></td> </tr> <tr> <td colspan="4"><input name="accept_terms" type="checkbox" id="accept_terms" value="accept_terms" /> By Ticking this box I accept the terms and responsibilities </td> </tr> <tr> <td colspan="4"><div align="left"><span class="style8"><br /> Note: Prior to filling out application ensure you have selected payment method first and all other necessary fields. Your card will be sent out to your nominated address inclusive of costs. <br /> The fields marked with '*' are required to be filled up.</span><br /> <br /> <input name="submit" type="submit" id="submit" value="submit" /> </div></td> </tr> </table> <span class="style8"></span> </form> </td> </tr> <tr> <td class="style10"><img src="../images/mastercard.gif" width="283" height="40" /></td> </tr> </table> PHP: This is the Database fields; CREATE TABLE `application` ( `id` tinyint(8) NOT NULL auto_increment, `name` text NOT NULL, `date_birth` text NOT NULL, `color_hair` text NOT NULL, `color_eyes` text NOT NULL, `height` text NOT NULL, `weight` text NOT NULL, `address` text NOT NULL, `city` text NOT NULL, `state` text NOT NULL, `country` text NOT NULL, `zip` text NOT NULL, `phone` text NOT NULL, `email` text NOT NULL, `sex` tinytext NOT NULL, `reference` text NOT NULL, `social_security` text NOT NULL, `image` varchar(40) default NULL, `doctor_name` text NOT NULL, `doctor_address` longtext NOT NULL, `award_letter` tinytext NOT NULL, `motor_receipt` tinytext NOT NULL, `va_letter` tinytext NOT NULL, `release_packet` tinytext NOT NULL, `image2` varchar(40) default NULL, `20_paypal_photo` tinytext NOT NULL, `20_paypal` tinytext NOT NULL, `80_paypal_photo` tinytext NOT NULL, `80_paypal` tinytext NOT NULL, `150_paypal_photo` tinytext NOT NULL, `150_paypal` tinytext NOT NULL, PRIMARY KEY (`id`) ) PHP:
first try replace isset( $Submit ) with isset( $_POST['submit'] ) then you have identicaly codes if(isset( $Submit )) { //If the Submitbutton was pressed do: if ($_FILES['imagefile']['type'] == "image/jpg" || $_FILES['imagefile']['type'] == "image/jpeg"){ //<--- Note the type (check the change below and post the error) move_uploaded_file($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])or die ("Could not copy"); echo ""; echo "Name: ".$_FILES['imagefile']['name'].""; echo "Size: ".$_FILES['imagefile']['size'].""; echo "Type: ".$_FILES['imagefile']['type'].""; echo "Stored in: " . $_FILES["file"]["files"]; echo "Copy Done....";} else {echo "<br><br>"; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['type'].")<br>"; //<--Note change from name to type}} Code (markup): what for? it would be better to move this code in section with if (isset($_POST['submit'])) {$name=$_POST['name'];
I dont quite understand your suggestion? Also I am now getting error on line 141; Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/disabled/public_html/application/index.php on line 141 Something to do with; $20_paypal_photo=$_POST['20_paypal_photo']; Any ideas?
oh thankyou chopsticks. I have now changed this and now no error, but still have a problem it doesnt seem to be submitting aswell and isnt grabbing all the info I need to collect?