emediastudios Posted May 27, 2008 Share Posted May 27, 2008 Im a bit of a NOOBIE when it comes to php, but i have managed to alter this form to do as i wish, Just one problem. I wanted to move all the fields over to the left as they are sitting in the middle of the table. How would i go about this. This is the code <?php include_once('includes/include.php'); $pageTitle = "Join Our Team"; $upload_dir = "upload/"; //Experinced Users only Beyond this point except for formatting which will be commented $form = '<form enctype="multipart/form-data" action="upload_resume.php?submit=2" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="10240000" /> <input type="hidden" name="email" value="'.$_POST[email].'" /> Files must be of PDF format.<br>Max file size, one meg.<br><br>Attach Resume: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form>'; //FORMAT HERE //VERY IMPORTANT: make sure that you use " if the entire string is surrounded by ' and vice versa //otherwise you'll fuck yourself over //the table goes here $content3 .= '<table width="950" border="1" class="contact">'; $content3 .= '<form method="post" action="upload_resume.php?submit=1">'; $content3 .= '<tr><td width="150"><span class="contactdetails">Name:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="name" value="'.$_POST[name].'" /></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">Email Address:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="email" value="'.$_POST[email].'" /></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">Contact Number:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="contact" value="'.$_POST[contact].'"/></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">Mobile Number:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="mobile" value="'.$_POST[mobile].'"/></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">Address Line 1:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="ad1" value="'.$_POST[ad1].'"/></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">Address Line 2:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="ad2" value="'.$_POST[ad2].'"/></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">City:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="city" value="'.$_POST[city].'"/></td></tr>'; $content3 .= '<tr><td width="150"><span class="contactdetails">State:</span> </td><td width="150" class="smalltext">'; $content3 .= '<select name="state" style="width:120px" class="smalltext"> <option value="">Please Select</option> <option value="NSW"'; if($_POST[state] == "NSW") $content3 .= " selected='selected'"; $content3 .= '>New South Wales</option> <option value="NT"'; if($_POST[state] == "NT") $content3 .= " selected='selected'"; $content3 .= '>Northern Territory</option> <option value="QLD'; if($_POST[state] == "QLD") $content3 .= " selected='selected'"; $content3 .= '">Queensland</option> <option value="SA"'; if($_POST[state] == "SA") $content3 .= " selected='selected'"; $content3 .= '>South Australia</option> <option value="TAS"'; if($_POST[state] == "TAS") $content3 .= " selected='selected'"; $content3 .= '>Tasmania</option> <option value="VIC"'; if($_POST[state] == "VIC") $content3 .= " selected='selected'"; $content3 .= '>Victoria</option> <option value="WA"'; if($_POST[state] == "WA") $content3 .= " selected='selected'"; $content3 .= '>Western Australia</option> </select></td></tr> '; $content3 .= '<tr><td width="150"><span class="contactdetails">Zip Code:</span> </td><td width="150"><input type="text" style="width:120px" class="smalltext" name="post" value="'.$_POST[post].'" /></td></tr>'; $content3 .= '<tr><td colspan="2" align="left"><input type="submit" class="smalltext" value="Next"/></td></tr></form></table>'; if($_GET['submit'] == ""){ $content .= $content3; } else if($_GET[submit] == '1'){ //the mysql goes here if(!EmailChk($_POST[email])){$kill=1; $content2 .= "Invalid Email Address<br>";} if(!EmailCheck($_POST[email])){$kill=1; $content2 .= "Duplicate Email Address<br>";} if($_POST[contact] == ""){$kill=1; $content2 .= "Enter a Phone Number (Normal)<br>";} if($_POST[mobile] == ""){$kill=1; $content2 .= "Enter a Phone Number (Mobile)<br>";} if($_POST[state] == ""){$kill=1; $content2 .= "Enter a State<br>";} if($_POST[name] == ""){$kill=1; $content2 .= "Enter a Name<br>";} if($_POST[city] == ""){$kill=1; $content2 .= "Enter a City<br>";} if($_POST[ad1] == ""){$kill=1; $content2 .= "Enter an Address<br>";} if($_POST[post] == ""){$kill=1; $content2 .= "Enter a Postal Code<br>";} if($kill != 1){ $_POST[address] = $_POST[ad1] . "\n" . $_POST[ad2]; $_POST[ad1] = ""; $_POST[ad2] = ""; $q = "INSERT INTO resume(name,address,city,state,post,contact,mobile,email,file) VALUES ('".$_POST[name]."','".$_POST[address]."','".$_POST[city]."','".$_POST[state]."','".$_POST[post]."','".$_POST[contact]."','".$_POST[mobile]."','".$_POST[email]."','')"; if(!mysql_query($q)) $content .= "failed to insert user data"; else{ $content .= $form; } } else $content.= $content2 . "<br><br><br>" . $content3; } else if($_GET[submit] == '2'){ $target_path = $upload_dir; while(file_exists($target_path)){ $random3 = (rand()%999999); $target_path = $target_path . $random3 . basename( $_FILES['uploadedfile']['name']); } if(strtolower($_FILES['uploadedfile']['name']) != str_replace(".pdf", "", strtolower($_FILES['uploadedfile']['name']))){ if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { $content .= "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded for email address:<br> ". $_POST[email]; mysql_query("UPDATE resume SET file = '".$target_path."' WHERE email='".$_POST[email]."'"); mail("[email protected]","New Employment Application at your website", "Please go to your website to see the application", "From: [email protected]"); } else{ $content .= 'There was an error uploading the file, please try again!<br>'; $content .= $form; } } else{ $content .= 'Must Be A .pdf File<br>'; $content .= $form; } } $pageTitle = "Join Our Team"; include('employment.php'); ?> Link to comment https://forums.phpfreaks.com/topic/107541-solved-table-format/ Share on other sites More sharing options...
Cory94bailly Posted May 27, 2008 Share Posted May 27, 2008 <span align="left"> Also, I noticed that you defined $pagetitle twice.. Once at top and another at bottom. Link to comment https://forums.phpfreaks.com/topic/107541-solved-table-format/#findComment-551240 Share on other sites More sharing options...
emediastudios Posted May 27, 2008 Author Share Posted May 27, 2008 Thanks man Link to comment https://forums.phpfreaks.com/topic/107541-solved-table-format/#findComment-551241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.