Solved

PHP Code Error with E-mail

Posted on 2008-10-27
6
261 Views
Last Modified: 2012-05-05
Hello,

We have been having an issue where our script works just fine, but only the "submitapply" section from the Apply From A Position has not been allowing e-mail attachments like the other pages do. Every other form page works correctly as is now.

If anyone see any issue that could be causing this problem please let me know.

Thanks in advance.

Best,

Justin
<?php
 

session_start();
 

$position = $_SESSION['position_group'];

$search_url = $_SESSION["PositionsSearchURL"];
 

if ($position == "") {

	$position == "none";

}
 

include 'config.php';

include 'opendb.php';

$groupstop  = "SELECT id, groupname, status FROM groups WHERE status = 1 ORDER BY groupname ASC";

$resulttop = mysql_query($groupstop);

$groups  = "SELECT id, groupname, email, status FROM groups WHERE groupname = '$position' AND status = 1";

$result1 = mysql_query($groups);

$industries  = "SELECT id, name, short, status FROM industries WHERE status = 1";

$result2 = mysql_query($industries);

$locations  = "SELECT id, city, state, status FROM locations WHERE status = 1";

$result3 = mysql_query($locations);
 

$rowgroup = mysql_fetch_array($result1);
 

$emailsend = "abacusweb@abacusnyc.com";  //This email will be abacusweb@abacusnyc.com
 

if(mysql_num_rows($result1) == 1) {

	$emailsend = $rowgroup["email"];

}
 

if (isset($_REQUEST['employers'])){

	$pagename = "Page: Employer Page" . "\r\n";

	$subject="Request To Talk To A Representative";

}
 

if (isset($_REQUEST['contact'])){

	$pagename = "Page: Contact Us Page" . "\r\n";

	$subject="Request To Talk To A Representative";

}
 

if (isset($_REQUEST['submit'])){

	$pagename = "Page: Submit Position Page" . "\r\n";

	$subject="Request To Talk To A Representative";

}
 

if (isset($_REQUEST['submitposition'])){

	$pagename = "Page: Submit Position Page" . "\r\n";

	$subject="Position Submittal";

}
 

if (isset($_REQUEST['submitresume'])){

	$pagename = "Page: Submit Resume Page" . "\r\n";

	$subject="Resume Submittal";

	$emailsend = "abacusweb@abacusnyc.com"; //This email will be resumes@abacusnyc.com

}
 

if (isset($_REQUEST['submitapply'])){

	$pagename = "Page: Apply For Position Page" . "\r\n";

	$subject="Application For Position \n\n";

	$search_flag = 1;
 

	$positionhead = "Position Applied For:\r\n";

	$email_title = "Title: " . $_SESSION["title"] . "\r\n";

	$email_date = "Date: " . $_SESSION["date"] . "\r\n";

	$email_industry = "Industry: " .  $_SESSION["industry"] . "\r\n";

	$email_term = "Term: " . $_SESSION["term"] . "\r\n";

	

	if ($_SESSION["category"] == 1) {

	$email_salarylow = "Salary Low: " . $_SESSION["salary_low"]."K". "\r\n";

	$email_salaryhigh = "Salary High: " . $_SESSION["salary_high"]."K". "\r\n";

	$email_bonus = "Bonus Eligible: " . $_SESSION["bonus"] . "\r\n";	

	}

	else {

	$email_salarylow = "";

	$email_salaryhigh = "";

	$email_bonus = "";

	}

	

	if ($_SESSION["category"] == 2) {

	$email_hourlylow = "Hourly Rate Low: " . $_SESSION["hourly_low"]."\HR"."\r\n";

	$email_hourlyhigh = "Hourly Rate High: " . $_SESSION["hourly_high"]. "\HR"."\r\n";

	}

	else {

	$email_hourlylow = "";

	$email_hourlyhigh = "";

	}
 

	$email_city = "City: " . $_SESSION["city"] . "\r\n";

	$email_state = "State: " . $_SESSION["state"] . "\r\n";

	$email_group = "Position Group: " . $_SESSION["position_group"] . "\r\n";
 

}
 

if (!($_REQUEST['name'] == "")){

$name=$_REQUEST['name'];

$nameprint="Name: $name" . "\r\n";

}

else {

$nameprint="";

}
 

if (!($_REQUEST['contactname'] == "")){

$contactname=$_REQUEST['contactname'];

$contactnameprint="Contact Name: $contactname" . "\r\n";

}

else {

$companynameprint="";

}
 

if (!($_REQUEST['companyname'] == "")){

$companyname=$_REQUEST['companyname'];

$companynameprint="Company Name: $companyname" . "\r\n";

}

else {

$companynameprint="";

}
 

if (!($_REQUEST['company'] == "")){

$company=$_REQUEST['company'];

$companyprint="Company: $company" . "\r\n";

}

else {

$companyprint="";

}
 

if (!($_REQUEST['phone'] == "")){

$phone=$_REQUEST['phone'];

$phoneprint="Phone: $phone" . "\r\n";

}

else {

$phoneprint="";

}
 

if (!($_REQUEST['phone1'] == "")){

$phone=$_REQUEST['phone1'];

$phoneprint="Phone: $phone" . "\r\n";

}

else {

$phoneprint="";

}
 

if (!($_REQUEST['email'] == "")){

$email=$_REQUEST['email'];

$emailprint="Email: $email" . "\r\n";

}

else {

$emailprint="";

}
 

if (!($_REQUEST['position_group'] == "")){

$position=$_REQUEST['position_group'];

$positionprint="Position: $position" . "\r\n";

}

else {

$positionprint="";

}
 

if (!($_REQUEST['industry'] == "")){

$industry=$_REQUEST['industry'];

$industryprint="Industry: $industry" . "\r\n";

}

else {

$industryprint="";

}
 

if (!($_REQUEST['permanent'] == "") OR !($_REQUEST['temporary'] == "")){

$permanent=$_REQUEST['permanent'];

$temporary=$_REQUEST['temporary'];

$type="$permanent $temporary";

$typeprint="Type: $type" . "\r\n";

}

else {

$typeprint="";

}
 

if (!($_REQUEST['candidate_employer'] == "")){

$candidate_employer=$_REQUEST['candidate_employer'];

$candidate_employerprint="Candidate or Employer: $candidate_employer" . "\r\n";

}

else {

$candidate_employerprint="";

}
 

if (!($_REQUEST['assist'] == "")){

$assist=$_REQUEST['assist'];

$assistprint="How can we assist you: $assist" . "\r\n";

}

else {

$assistprint="";

}
 

if (!($_REQUEST['anythingelse'] == "")){

$anythingelse=$_REQUEST['anythingelse'];

$anythingelseprint="Anything Else: $anythingelse" . "\r\n";

}

else {

$anythingelseprint="";

}
 

if (!($_REQUEST['position_title'] == "")){

$position_title=$_REQUEST['position_title'];

$position_titleprint="Position Title: $position_title" . "\r\n";

}

else {

$position_titleprint="";

}
 

if (!($_REQUEST['salary_range'] == "")){

$salary_range=$_REQUEST['salary_range'];

$salary_rangeprint="Salary Range: $salary_range" . "\r\n";

}

else {

$salary_rangeprint="";

}
 

if (!($_REQUEST['hourly_range'] == "")){

$hourly_range=$_REQUEST['hourly_range'];

$hourly_rangeprint="Hourly Range: $hourly_range" . "\r\n";

}

else {

$hourly_rangeprint="";

}
 

if (!($_REQUEST['describe_position'] == "")){

$describe_position=$_REQUEST['describe_position'];

$describe_positionprint="Describe Position: $describe_position" . "\r\n";

}

else {

$describe_positionprint="";

}
 

if (!($_REQUEST['comments'] == "")){

$comments=$_REQUEST['comments'];

$commentsprint="Comments/Messages: $comments" . "\r\n";

}

else {

$commentsprint="";

}
 
 

if (isset($_FILES["file1"]["name"]) AND !($_FILES["file1"]["name"] == "")){  //IF A FILES IS SUBMITTED THROUGH THE FORM THEN SEND WITH THIS

	

			if ((($_FILES["file1"]["type"] == "application/msword")

			|| ($_FILES["file1"]["type"] == "application/rtf")

			|| ($_FILES["file1"]["type"] == "application/pdf")

			|| ($_FILES["file1"]["type"] == "text/plain"))

			&& ($_FILES["file1"]["size"] < 100000))

			  {

			  if ($_FILES["file1"]["error"] > 0)

				{

				echo "Error: " . $_FILES["file1"]["error"] . "<br />";

				}

			  else

				{

				#$att_server = "attachment/".$_FILES["file1"]["name"];  

				#move_uploaded_file($_FILES["file1"]["tmp_name"], $att_server);

					

				$from = "info@abacusnyc.com";

				$to =  "$emailsend"; 

				$subject = "$subject";

				$message1="$pagename$nameprint$contactnameprint$companyprint$companynameprint$phoneprint$emailprint$positionprint$industryprint$typeprint$candidate_employerprint$assistprint$anythingelseprint$position_titleprint$salary_rangeprint$hourly_rangeprint$describe_positionprint$commentsprint$positionhead$email_title$email_date$email_industry$email_term$email_salarylow$email_salaryhigh$email_bonus$email_hourlylow$email_hourlyhigh$email_city$email_state$email_group";

				#$attachment = "attachment/".$_FILES["file1"]["name"];

				#$fileatt = $attachment; // Path to the file                  

				#$attachment_type = $_FILES["file1"]["type"]; // File Type 

				#$start=	0;

				#$attachment_name = substr(substr($attachment, 11), $start, strlen($attachment)); // Filename that will be used for the file as the 	attachment 
 

				$email_from = $from; // Who the email is from 

				$email_subject =  $subject; // The Subject of the email 

				$email_to = $to; // Who the email is to

 

				

 	// newly added section start-----------------------

				

$attachment = $_FILES['file1']['tmp_name'];

$attachment_name = $_FILES['file1']['name']; 

if (is_uploaded_file($attachment)) { // have a file uploaded?

$fp = fopen($attachment, "rb"); //Open it

$data = fread($fp, filesize($attachment)); //Read it

$data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed

fclose($fp);

}
 

$headers  = "From: ABACUS GROUP<info@abacusnyc.com>\r\n";  

$headers .= "MIME-Version: 1.0\n";

$headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; 

$headers .= "This is a multi-part message in MIME format.\n";

$headers .= "------=MIME_BOUNDRY_main_message \n"; 

$headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; 

$message = "------=MIME_BOUNDRY_message_parts\n";

$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; 

$message .= "Content-Transfer-Encoding: quoted-printable\n"; 

$message .= "\n"; 

$message .="".$message1."\n";

$message .= "\n"; 

$message .= "------=MIME_BOUNDRY_message_parts--\n"; 

$message .= "\n"; 

$message .= "------=MIME_BOUNDRY_main_message\n"; 

$message .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n";

$message .= "Content-Transfer-Encoding: base64\n";

$message .= "Content-Disposition: attachment;\n\tfilename=\"" . $attachment_name . "\"\n\n";

$message .= $data; 

$message .= "\n"; 

$message .= "------=MIME_BOUNDRY_main_message--\n"; 
 

	   

	    // newly added section finish----------------------                        

	

				$ok = @mail($email_to, $email_subject, $message, $headers); 

				if($ok) { 

				} 

				else { 

					die("Sorry but the email could not be sent. Please go back and try again!"); 

					} 

				

				$sentfile = "attachment/".$_FILES["file1"]["name"];

				unlink($att_server);

				}

			  }

			else

			  {

			  echo "Invalid file";

			  }

} // END OF EMAIL FUNCTION IF
 

else { //IF NO ATTACHMENT FILE THEN USE THIS EMAIL SEND

			$to = "$emailsend"; 

			$subject = "$subject"; 

			$message1="$pagename$nameprint$contactnameprint$companyprint$companynameprint$phoneprint$emailprint$positionprint$industryprint$typeprint$candidate_employerprint$assistprint$anythingelseprint$position_titleprint$salary_rangeprint$hourly_rangeprint$describe_positionprint$commentsprint$positionhead$email_title$email_date$email_industry$email_term$email_salarylow$email_salaryhigh$email_hourlylow$email_hourlyhigh$email_bonus$email_city$email_state$email_group"; 

			$headers = "From: info@abacusnyc.com" . "\r\n" .

				"Reply-To: $email"; 

			$sent = mail($to, $subject, $message1, $headers) ; 

}
 

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>The Abacus Group &#150; Confirmation Page</title>

<!-- <script src="rollovers.js" type="text/javascript"></script> -->

<link rel="stylesheet" href="main.css" type="text/css">

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAhqj6P2utshbr5ukWrtWfphRPlMQrS4dKyplm8TdAOpAWA7pxfBSEw78KLfAxQWS6pk7ZFSfzyL3v5Q"

      type="text/javascript"></script>

    <script type="text/javascript">

    //<![CDATA[

    function load() {

      if (GBrowserIsCompatible()) {

        var map = new GMap2(document.getElementById("map"));

        map.setCenter(new GLatLng(40.751613,-73.99204), 15);

		map.addOverlay(new GMarker(new GLatLng(40.751613,-73.99204)));

      }

    }

    //]]>

</script>
 

</head>

<body onLoad="load()" onUnload="GUnload()">
 

<!-- START of DIV wrapper to center the whole page -->
 

	<div id="wrapper">  
 

	<!-- START of MainTable, this table holds the drop shadows for the outside of the page -->
 

	<table id="maintable">

	<tr>

		<td class="top" colspan="3"><img src="images/shadow_top.jpg" width="811" height="5" alt=""></td>

	</tr>

	<tr>

		<td class="sideleft"><img src="images/spacer.gif" width="5" height="1" alt=""></td>

		<td class="content">

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- START of HEADER TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<table id="headertable">

	<tr>

		<td class="left"><img src="images/logo.jpg" width="580" height="66" alt="Abacus Group Logo"></td>

		<td class="right"><form action="positions.php" method="POST" name="form1"><img src="images/spacer.gif" width="1" height="20" alt=""><br />SEARCH JOBS<br /><img src="images/spacer.gif" width="1" height="3" alt=""><br />

						<select name="top_position_group" class="topsearch">

						<option value="" selected>Select a position/title</option>";

					<?php

					while($row = mysql_fetch_array($resulttop))	{

						echo"<option value=\"$row[id]\">$row[groupname]</option>";

						}  ?>

						</select><input type=image align=middle SRC="images/go.gif"><br />&nbsp;<br />

						<a href="submit_position.php" class="topright">SUBMIT POSITION</a>&nbsp;&nbsp;<a href="submit_resume.php" class="topright">SUBMIT RESUME</a></form></td>

	</tr>

	</table>

	<table id="navtable">

	<tr>

		<td class="top"><img src="images/spacer.gif" width="1" height="1" alt=""></td>

	</tr>

	<tr>

		<td class="mid"><a href="index.php"><img src="images/nav/nav_01.jpg" width="93" height="33" border="0" alt="Home"></a><a href="about.php"><img src="images/nav/nav_02.jpg" width="114" height="33" border="0" alt="About Us"></a><a href="employers.php"><img src="images/nav/nav_03.jpg" width="124" height="33" border="0" alt="Employers"></a><a href="candidates.php"><img src="images/nav/nav_04.jpg" width="131" height="33" border="0" alt="candidates"></a><a href="positions.php"><img src="images/nav/nav_05.jpg" width="195" height="33" border="0" alt="Current Positions"></a><a href="contact.php"><img src="images/nav/nav_06.jpg" width="144" height="33" border="0" alt="Contact Us"></a></td>

	</tr>

	<tr>

		<td class="bottom"><img src="images/spacer.gif" width="1" height="3" alt=""></td>

	</tr>

	</table>

	<table id="bannertable">

	<?php 

	if (isset($_REQUEST['submitposition'])){

		echo "<tr><td class=\"top\"><img src=\"images/submit/submit_pic.jpg\" width=\"801\" height=\"90\" alt=\"Submit Position Pic\"></td></tr><tr><td class=\"mid\"><img src=\"images/submit/submit_title.jpg\" width=\"801\" height=\"35\" alt=\"Submit Position Title\"></td></tr>";

		$background = "images/submit/submit_desc_bg.jpg";

	}

	elseif (isset($_REQUEST['submitresume'])){

		echo "<tr><td class=\"top\"><img src=\"images/resume/submit_pic.jpg\" width=\"801\" height=\"90\" alt=\"Submit Resume Pic\"></td></tr><tr><td class=\"mid\"><img src=\"images/resume/submit_title.jpg\" width=\"801\" height=\"35\" alt=\"Submit Resume\"></td></tr>";

		$background = "images/resume/submit_desc_bg.jpg";

	}

	elseif (isset($_REQUEST['submitapply'])){

		echo "<tr><td class=\"top\"><img src=\"images/apply/submit_pic.jpg\" width=\"801\" height=\"90\" alt=\"Apply Pic\"></td></tr><tr><td class=\"mid\"><img src=\"images/apply/apply_title.jpg\" width=\"801\" height=\"35\" alt=\"Apply Title\"></td></tr>";

		$background = "images/resume/submit_desc_bg.jpg";

	}

	else {

		echo "<tr><td class=\"top\"><img src=\"images/contact/contact_pic.jpg\" width=\"801\" height=\"90\" alt=\"Contact Pic\"></td></tr><tr><td class=\"mid\"><img src=\"images/contact/contact_title.jpg\" width=\"801\" height=\"35\" alt=\"Contact Title\"></td></tr>";

		$background = "images/contact/contact_desc_bg.jpg";

	}

	?>

	

	<tr>	

		<td class="bottom" height="107" style="background: url(<?php echo "$background"; ?>);"><p>Please feel free to contact one of our consultants about your career search or staffing needs. </p></td>

	</tr>

	</table>

	<!-- START of the main CONTENT TABLE, this table holds the smaller tables that make up the main content window -->

	<table id="contenttable">

	<tr>

		<!-- START the LEFT content the td holds all the stuff in the left column -->

		<td class="left">

			<div> <!--  DIV tag For IE to center the TD Cell --->

			<!-- This table is a smaller table used to hold the boxed info for this column in here are the drop shaddows for this box -->

			<p class="contact">

             <span class="abacus">THE ABACUS GROUP</span><br />

			 14 Penn Plaza, Suite 1600<br />

			 New York, NY 10122<br />

			 &nbsp;<br />

			 <b>phone </b>212.812.8444<br />

			 <b>fax </b>212.812.8448<br />

			 <b>e-mail </b><a href="mailto:info@abacusnyc.com" class="contact">info@abacusnyc.com</a></p>

			 <div id="map" style="width: 211px; height: 145px; margin: 0 38px 0 38px;"></div>

			 <p class="map"><a href="http://maps.google.com/maps?q=14+Penn+Plaza,+New+York,+NY+10001,+USA&sa=X&oi=map&ct=title" target="_blank" class="map">Map & Driving Directions</a></p>

			

			<!-- End of this smallbox -->

			</div>

		</td>

		<!-- START of the content that goes on the LEFT side of the main content window -->

		<td class="right">

		<h1>THANK YOU</h1>

		<p class="text">

		<?php 

		if($sent OR $ok) 

			{print "Your email was sent successfully"; }

		else 

			{print "We encountered an error sending your mail"; }

		?>

		<?php if($search_flag == 1){ 

		echo "<br />&nbsp;<br />";

		echo "<a href=\"$search_url\" class=\"positionheader\">back to search results &#62;&#62;</a>";

		}?>

		</p>

		</td>

		<!-- End of the LEFT side content -->

	</tr>	

	</table>

	<!-- End of the CONTENT TABLE -->

	<br />

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- START of FOOTER TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<table id="footertable">

	<tr>

		<td class="top" colspan="2"><img src="images/count_on_us.jpg" width="79" height="13" alt="count on us"></td>

	</tr>

	<tr>

		<td class="mid" colspan="2"><hr></td>

	</tr>

	<tr>	

		<td class="bottomleft"><img src="images/spacer.gif" width="1" height="1" alt=""><br /><a href="privacy.html" class="footer">privacy policy</a><img src="images/dots.gif" width="23" height="18" alt="dots" align="middle"><a href="sitemap.html" class="footer">site map</a></td>

		<td class="bottomright"><p>14 penn plaza, suite 1600, new york, new york 10122<br />

		<b><i>telephone</i></b> 212.812.8444 &#149; <b><i>fax</i></b> 212.812.8448 &#149; <a href="mailto:info@abacusnyc.com" class="email">info@abacusnyc.com</a></p></td>

	</tr>

	</table>

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- END of CONTENT TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
 

	<br />

	</td>

	<td class="sideright"></td>

	</tr>

	<tr>

		<td class="top" colspan="3"><img src="images/shadow_bottom.jpg" width="811" height="5" alt=""></td>

	</tr>

	</table>

	<!-- END of MAIN TABLE -->

	</div>

	<!-- END of DIV for wrapper -->	
 
 

<script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

</script>

<script type="text/javascript">

var pageTracker = _gat._getTracker("UA-5821975-1");

pageTracker._trackPageview();

</script></BODY>

</HTML>

<?php

include 'closedb.php';

?>

Open in new window

0
Comment
Question by:jsuissa
  • 3
  • 2
6 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 250 total points
Comment Utility
First acouple of bugs not related to attachments:

Line 107 should probably be:

$contactnameprint="";

The 'phone' field is overwritten by the 'phone1' field. (Lines 126-140)

Now to the attachment: Email headers should be separated with \r\n, some of the headers (lines 284-304) are separated with only \n. Some headers (lines 290-304) are placed in the message part of the email.

You say the script is "not allowing" attachments. Does it try? Is the attachment part of the script running (lines 241-324), but the attachement is not attached, or is the no-attachment part of the script (lines 326-333) allways executed, even if there should be an attachment?
0
 
LVL 16

Expert Comment

by:alain34
Comment Utility
Hello jsuissa,

Could you comfirm that the form that is used to submit the file include the correct enctype as follow?

<form method='post' action='YourPhp.php' id='YourForm' enctype='multipart/form-data'>

Regards,

alain34
0
 

Author Comment

by:jsuissa
Comment Utility
Yes, it is...and all the other forms that are working do so as well. Thanks.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:jsuissa
Comment Utility
For almost all the other forms using that same script we get a full e-mail with the form field results and an attachment.

For this one script we get no attachment at all.

Hope that helps.

Thanks.

Justin
0
 
LVL 16

Assisted Solution

by:alain34
alain34 earned 250 total points
Comment Utility
Ok,

Could you explain to us where file1 is defined?
Looking at your code snippet, I can not see where this field is defined, either in the form or in the php...

I identified file1 from this line
if (isset($_FILES["file1"]["name"]) AND !($_FILES["file1"]["name"] == "")){  //IF A FILES IS SUBMITTED THROUGH THE FORM THEN SEND WITH THIS

Cheers,

Alain
0
 

Author Comment

by:jsuissa
Comment Utility
Sure I posted that code below for you...
<?php
 

session_start();
 

include 'config.php';

include 'opendb.php';
 

$groupstop  = "SELECT id, groupname, status FROM groups WHERE status = 1  ORDER BY groupname ASC";

$resulttop = mysql_query($groupstop);

$groups  = "SELECT id, groupname, status FROM groups WHERE status = 1  ORDER BY groupname ASC";

$result1 = mysql_query($groups);

$industries  = "SELECT id, name, short, status FROM industries WHERE status = 1";

$result2 = mysql_query($industries);

$locations  = "SELECT id, city, state, status FROM locations WHERE status = 1";

$result3 = mysql_query($locations);

$industries1  = "SELECT id, name, short FROM industries WHERE status = 1";

$result4 = mysql_query($industries1);
 

if ($_SESSION["category"] == 1) {

	$displayrate1 = "block";

	$displayrate2 = "none";

}
 

elseif ($_SESSION["category"] == 2) {

	$displayrate2 = "block";

	$displayrate1 = "none";

}
 
 
 
 
 
 

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>The Abacus Group &#150; Apply For A Position</title>

<!-- <script src="rollovers.js" type="text/javascript"></script> -->

<link rel="stylesheet" href="main.css" type="text/css">

<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>

<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">

</head>

<body>
 

<!-- START of DIV wrapper to center the whole page -->
 

	<div id="wrapper">  
 

	<!-- START of MainTable, this table holds the drop shadows for the outside of the page -->
 

	<table id="maintable">

	<tr>

		<td class="top" colspan="3"><img src="images/shadow_top.jpg" width="811" height="5" alt=""></td>

	</tr>

	<tr>

		<td class="sideleft"><img src="images/spacer.gif" width="5" height="1" alt=""></td>

		<td class="content">

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- START of HEADER TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<table id="headertable">

	<tr>

		<td class="left"><img src="images/logo.jpg" width="580" height="66" alt="Abacus Group Logo"></td>

		<td class="right"><form action="positions.php" method="POST" name="form1"><img src="images/spacer.gif" width="1" height="20" alt=""><br />SEARCH JOBS<br /><img src="images/spacer.gif" width="1" height="3" alt=""><br />

						<select name="top_position_group" class="topsearch">

						<option value="" selected>Select a position group</option>";

					<?php

					while($row = mysql_fetch_array($resulttop))	{

						echo"<option value=\"$row[id]\">$row[groupname]</option>";

						}  ?>

						</select><input type=image align=middle SRC="images/go.gif"><br />&nbsp;<br />

						<a href="submit_position.php" class="topright">SUBMIT POSITION</a>&nbsp;&nbsp;<a href="submit_resume.php" class="topright">SUBMIT RESUME</a></form></td>

	</tr>

	</table>

	<table id="navtable">

	<tr>

		<td class="top"><img src="images/spacer.gif" width="1" height="1" alt=""></td>

	</tr>

	<tr>

		<td class="mid"><a href="index.php"><img src="images/nav/nav_01.jpg" width="93" height="33" border="0" alt="Home"></a><a href="about.php"><img src="images/nav/nav_02.jpg" width="114" height="33" border="0" alt="About Us"></a><a href="employers.php"><img src="images/nav/nav_03.jpg" width="124" height="33" border="0" alt="Employers"></a><a href="candidates.php"><img src="images/nav/nav_04.jpg" width="131" height="33" border="0" alt="candidates"></a><a href="positions.php"><img src="images/nav/nav_05.jpg" width="195" height="33" border="0" alt="Current Positions"></a><a href="contact.php"><img src="images/nav/nav_06.jpg" width="144" height="33" border="0" alt="Contact Us"></a></td>

	</tr>

	<tr>

		<td class="bottom"><img src="images/spacer.gif" width="1" height="3" alt=""></td>

	</tr>

	</table>

	<table id="bannertable">

	<tr>

		<td class="top"><img src="images/apply/submit_pic.jpg" width="801" height="90" alt="Apply Pic"></td>

	</tr>

	<tr>

		<td class="mid"><img src="images/apply/apply_title.jpg" width="801" height="35" alt="Apply Title"></td>

	</tr>

	<tr>	

		<td class="bottom" height="107" style="background: url(images/resume/submit_desc_bg.jpg);"><p>&nbsp;</p></td>

	</tr>

	</table>

	<!-- START of the main CONTENT TABLE, this table holds the smaller tables that make up the main content window -->

	<table id="contenttable">

	<tr>

		<!-- START the LEFT content the td holds all the stuff in the left column -->

		<td class="left">

			<div> <!--  DIV tag For IE to center the TD Cell --->

			<!-- This table is a smaller table used to hold the boxed info for this column in here are the drop shaddows for this box -->

			<table id="smalllefttable">

			<tr>

				<td class="top" colspan="3"><img src="images/apply/position.jpg" width="211" height="27" alt="Position"></td>

			</tr>

			<tr>

				<td class="leftshadow"></td>

				<td class="content">

					<!-- This is the content inside of the shadowed smaller box -->

					<p class="position">

				<b>DATE POSTED</b><br />

				<?php echo $_SESSION["date"]; ?>

				<p/>

				<p class="position">

				<b>INDUSTRY</b><br />

				<?php echo $_SESSION["industry"]; ?>

				<p/>

				<p class="position">

				<b>TERM</b><br />

				<?php echo $_SESSION["term"]; ?>

				<p/>

				<div style="display: <?php echo $displayrate1 ?>";>

				<p class="position">

				<b>BASE SALARY</b><br />

				<?php 

				if ($_SESSION["category"] == 1) {

					if ($_SESSION["salary_high"] == 0 OR $_SESSION["salary_low"] == $_SESSION["salary_high"] OR $_SESSION["salary_high"] == "") {

						$high = "";

					}

					else {

						$high = "-".$_SESSION["salary_high"];

					}

				echo "\$".$_SESSION["salary_low"].$high."K";

				}				

				?>

				<p/>

				<p class="position">

				<b>BONUS ELIGIBLE</b><br />

				<?php echo $_SESSION["bonus"]; ?>

				<p/>

				</div>

				<div style="display: <?php echo $displayrate2 ?>";>

				<p class="position">

				<b>HOURLY RATE</b><br />

				<?php 

				if ($_SESSION["category"] == 2) {

					if ($_SESSION["hourly_high"] == 0 OR $_SESSION["hourly_low"] == $_SESSION["hourly_high"] OR $_SESSION["hourly_high"] == "") {

						$high = "";

					}

					else {

						$high = "-".$_SESSION["hourly_high"];

					}

				echo "\$".$_SESSION["hourly_low"].$high."/HR";

				}

				?>

				<p/>				

				</div>

				<p class="position">

				<b>LOCATION</b><br />

				<?php if ($_SESSION["city"] == "") {

					echo $_SESSION["state"];

					} 

					else {

					echo $_SESSION["city"];

					}

					?>

				<p/>

					<!-- End of this smallbox content -->

				</td>

				<td class="rightshadow"></td>

			</tr>

			<tr>

				<td class="bottomshadow" colspan="3"><img src="images/leftbox_bottomshadow.gif" width="211" height="8" alt=""></td>

			</tr>

			</table>

			<!-- End of this smallbox -->		

		</div>

		<p class="back">

		<a href="<?php echo $_SESSION["PositionsSearchURL"]; ?>" class="positionheader">back to search results &#62;&#62;</a>

		</p>

		</td>

		<!-- START of the content that goes on the RIGHT side of the main content window -->

		<td class="right">

		<div> <!--  DIV tag For IE to center the TD Cell --->

			<table id="submitpositionbox">

			<tr>

				<td class="top" colspan="3"><img src="images/apply/apply_for.jpg" width="342" height="27" alt="Apply For A Position"></td>

			</tr>

			<tr>

				<td class="leftshadow"></td>

				<td class="content">

					<form action="confirmation.php" method="POST" enctype="multipart/form-data" class="position">

					Fill out the form below to apply for the position listed.<br />

					&nbsp;<br />

					Tell us about yourself.<br />

					Name <span id="sprytextfield1"><input type="text" name="contactname" maxlength="50" value="" style="width: 180px;" class="position">

					<span class="textfieldRequiredMsg">Name required.</span></span><br />

					Phone <span id="sprytextfield2"><input type="text" name="phone" maxlength="50" value="" style="width: 227px;" class="position">

					<span class="textfieldRequiredMsg">Phone required.</span></span><br />

					Email&nbsp; <span id="sprytextfield3"><input type="text" name="email" maxlength="50" value="" style="width: 227px; margin-bottom:10px;" class="position">

					<span class="textfieldRequiredMsg">Email required.</span></span><br />

					<img src="images/spacer.gif" width="1" height="10" alt=""><br />

					Upload your resume as a text file or Word doc<br /><span id="sprytextfield4"><input type="file" name="file1" id="file1" value="" style="width: 265px;" class="position" />

					<span class="textfieldRequiredMsg">Resume is required.</span></span><br />

					<img src="images/spacer.gif" width="1" height="10" alt=""><br />

					Comments/Messages

						<textarea name="comments" style="width:270px; height:50px;" class="position"></textarea>

						<img src="images/spacer.gif" width="1" height="10" alt=""><input type="hidden" name="submitapply" value="1"><br />

						<p class="submitright">

						<input type=image src="images/contact/submit.jpg" border="0" >

						</p>

					</form>

				</td>

				<td class="rightshadow"></td>

			</tr>

			<tr>

				<td class="bottomshadow" colspan="3"><img src="images/leftbox_bottomshadow.gif" width="342" height="8" alt=""></td>

			</tr>

			</table>

			</div>

		</td>

		<!-- End of the LEFT side content -->

	</tr>	

	</table>

	<!-- End of the CONTENT TABLE -->

	<br />

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- START of FOOTER TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<table id="footertable">

	<tr>

		<td class="top" colspan="2"><img src="images/count_on_us.jpg" width="79" height="13" alt="count on us"></td>

	</tr>

	<tr>

		<td class="mid" colspan="2"><hr></td>

	</tr>

	<tr>	

		<td class="bottomleft"><img src="images/spacer.gif" width="1" height="1" alt=""><br /><a href="privacy.html" class="footer">privacy policy</a><img src="images/dots.gif" width="23" height="18" alt="dots" align="middle"><a href="sitemap.html" class="footer">site map</a></td>

		<td class="bottomright"><p>14 penn plaza, suite 1600, new york, new york 10122<br />

		<b><i>telephone</i></b> 212.812.8444 &#149; <b><i>fax</i></b> 212.812.8448 &#149; <a href="mailto:info@abacusnyc.com" class="email">info@abacusnyc.com</a></p></td>

	</tr>

	</table>

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->

	<!-- END of CONTENT TABLE -->

	<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -->
 

	<br />

	</td>

	<td class="sideright"></td>

	</tr>

	<tr>

		<td class="top" colspan="3"><img src="images/shadow_bottom.jpg" width="811" height="5" alt=""></td>

	</tr>

	</table>

	<!-- END of MAIN TABLE -->

	</div>

	<!-- END of DIV for wrapper -->	

<script type="text/javascript">

<!--

var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");

var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");

var phone = new Spry.Widget.ValidationTextField("phone", "phone_number", {validateOn:["submit"], useCharacterMasking:true});

var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email");

var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4");

//-->

</script>
 

<script type="text/javascript">

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

</script>

<script type="text/javascript">

var pageTracker = _gat._getTracker("UA-5821975-1");

pageTracker._trackPageview();

</script></BODY>

</HTML>

<?php

include 'closedb.php';

?> 

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now