>> that is not currently working.
elaborate.
Main Topics
Browse All TopicsHello,
We now have only one e-mail PHP based form on our site that is not currently working. It contains two forms and we also will post the e-mail script that is working for every other page on our site.
I have attached the entire form below.
Thanks in advance for any help that can be provided.
Best,
Justin
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
<?php
session_start();
$position = $_SESSION['position_group'
$search_url = $_SESSION["PositionsSearch
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";
if(mysql_num_rows($result1
$emailsend = $rowgroup["email"];
}
if (isset($_REQUEST['employer
$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['submitpo
$pagename = "Page: Submit Position Page" . "\r\n";
$subject="Position Submittal";
}
if (isset($_REQUEST['submitre
$pagename = "Page: Submit Resume Page" . "\r\n";
$subject="Resume Submittal";
$emailsend = "abacusweb@abacusnyc.com";
}
if (isset($_REQUEST['submitap
$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
$email_salaryhigh = "Salary High: " . $_SESSION["salary_high"]."
$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"]."\
$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"
}
if (!($_REQUEST['name'] == "")){
$name=$_REQUEST['name'];
$nameprint="Name: $name" . "\r\n";
}
else {
$nameprint="";
}
if (!($_REQUEST['contactname'
$contactname=$_REQUEST['co
$contactnameprint="Contact
}
else {
$contactnameprint="";
}
if (!($_REQUEST['companyname'
$companyname=$_REQUEST['co
$companynameprint="Company
}
else {
$companynameprint="";
}
if (!($_REQUEST['company'] == "")){
$company=$_REQUEST['compan
$companyprint="Company: $company" . "\r\n";
}
else {
$companyprint="";
}
if (!($_REQUEST['phone'] == "")){
$phone=$_REQUEST['phone'];
$phoneprint="Phone: $phone" . "\r\n";
}
elseif (!($_REQUEST['phone1'] == "")){
$phone=$_REQUEST['phone1']
$phoneprint="Phone: $phone" . "\r\n";
}
else {
$phoneprint="";
}
if (!($_REQUEST['email'] == "")){
$email=$_REQUEST['email'];
$emailprint="Email: $email" . "\r\n";
}
elseif (!($_REQUEST['email1'] == "")){
$email=$_REQUEST['email1']
$emailprint="Email: $email" . "\r\n";
}
else {
$emailprint="";
}
if (!($_REQUEST['position_gro
$position=$_REQUEST['posit
$positionprint="Position: $position" . "\r\n";
}
else {
$positionprint="";
}
if (!($_REQUEST['industry'] == "")){
$industry=$_REQUEST['indus
$industryprint="Industry: $industry" . "\r\n";
}
else {
$industryprint="";
}
if (!($_REQUEST['permanent'] == "") OR !($_REQUEST['temporary'] == "")){
$permanent=$_REQUEST['perm
$temporary=$_REQUEST['temp
$type="$permanent $temporary";
$typeprint="Type: $type" . "\r\n";
}
else {
$typeprint="";
}
if (!($_REQUEST['candidate_em
$candidate_employer=$_REQU
$candidate_employerprint="
}
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['a
$anythingelseprint="Anythi
}
else {
$anythingelseprint="";
}
if (!($_REQUEST['position_tit
$position_title=$_REQUEST[
$position_titleprint="Posi
}
else {
$position_titleprint="";
}
if (!($_REQUEST['salary_range
$salary_range=$_REQUEST['s
$salary_rangeprint="Salary
}
else {
$salary_rangeprint="";
}
if (!($_REQUEST['hourly_range
$hourly_range=$_REQUEST['h
$hourly_rangeprint="Hourly
}
else {
$hourly_rangeprint="";
}
if (!($_REQUEST['describe_pos
$describe_position=$_REQUE
$describe_positionprint="D
}
else {
$describe_positionprint=""
}
if (!($_REQUEST['comments'] == "")){
$comments=$_REQUEST['comme
$commentsprint="Comments/M
}
else {
$commentsprint="";
}
if (isset($_FILES["file1"]["n
if ((($_FILES["file1"]["type"
|| ($_FILES["file1"]["type"] == "application/rtf")
|| ($_FILES["file1"]["type"] == "application/pdf")
|| ($_FILES["file1"]["type"] == "text/plain"))
&& ($_FILES["file1"]["size"] < 100000))
{
if ($_FILES["file1"]["error"]
{
echo "Error: " . $_FILES["file1"]["error"] . "<br />";
}
else
{
#$att_server = "attachment/".$_FILES["fil
#move_uploaded_file($_FILE
$from = "info@abacusnyc.com";
$to = "$emailsend";
$subject = "$subject";
$message1="$pagename$namep
#$attachment = "attachment/".$_FILES["fil
#$fileatt = $attachment; // Path to the file
#$attachment_type = $_FILES["file1"]["type"]; // File Type
#$start= 0;
#$attachment_name = substr(substr($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($attachm
$fp = fopen($attachment, "rb"); //Open it
$data = fread($fp, filesize($attachment)); //Read it
$data = chunk_split(base64_encode(
fclose($fp);
}
$headers = "From: ABACUS GROUP<info@abacusnyc.com>\r\
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/related; type=\"multipart/alternati
$headers .= "This is a multi-part message in MIME format.\n";
$headers .= "------=MIME_BOUNDRY_main_
$headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUND
$message = "------=MIME_BOUNDRY_messa
$message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding
$message .= "\n";
$message .="".$message1."\n";
$message .= "\n";
$message .= "------=MIME_BOUNDRY_messa
$message .= "\n";
$message .= "------=MIME_BOUNDRY_main_
$message .= "Content-Type: application/octet-stream;\
$message .= "Content-Transfer-Encoding
$message .= "Content-Disposition: attachment;\n\tfilename=\"
$message .= $data;
$message .= "\n";
$message .= "------=MIME_BOUNDRY_main_
// 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["fil
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$namep
$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 – Confirmation Page</title>
<!-- <script src="rollovers.js" type="text/javascript"></scr
<link rel="stylesheet" href="main.css" type="text/css">
<script src="http://maps.google.co
type="text/javascript"></scr
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementB
map.setCenter(new GLatLng(40.751613,-73.9920
map.addOverlay(new GMarker(new GLatLng(40.751613,-73.9920
}
}
//]]>
</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
</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($resultt
echo"<option value=\"$row[id]\">$row[gro
} ?>
</select><input type=image align=middle SRC="images/go.gif"><br /> <br />
<a href="submit_position.php"
</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
</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['submitpo
echo "<tr><td class=\"top\"><img src=\"images/submit/submit
$background = "images/submit/submit_desc
}
elseif (isset($_REQUEST['submitre
echo "<tr><td class=\"top\"><img src=\"images/resume/submit
$background = "images/resume/submit_desc
}
elseif (isset($_REQUEST['submitap
echo "<tr><td class=\"top\"><img src=\"images/apply/submit_
$background = "images/resume/submit_desc
}
else {
echo "<tr><td class=\"top\"><img src=\"images/contact/conta
$background = "images/contact/contact_de
}
?>
<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 />
<br />
<b>phone </b>212.812.8444<br />
<b>fax </b>212.812.8448<br />
<b>e-mail </b><a href="mailto:info@abacusny
<div id="map" style="width: 211px; height: 145px; margin: 0 38px 0 38px;"></div>
<p class="map"><a href="http://maps.google.c
<!-- 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 /> <br />";
echo "<a href=\"$search_url\" class=\"positionheader\">ba
}?>
</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.jp
</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 • <b><i>fax</i></b> 212.812.8448 • <a href="mailto:info@abacusny
</tr>
</table>
<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\
<!-- END of CONTENT TABLE -->
<!-- \\\\\\\\\\\\\\\\\\\\\\\\\\
<br />
</td>
<td class="sideright"></td>
</tr>
<tr>
<td class="top" colspan="3"><img src="images/shadow_bottom.
</tr>
</table>
<!-- END of MAIN TABLE -->
</div>
<!-- END of DIV for wrapper -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol
document.write(unescape("%
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-58219
pageTracker._trackPageview
</script></BODY>
</HTML>
<?php
include 'closedb.php';
?>
Business Accounts
Answer for Membership
by: jsuissaPosted on 2008-11-05 at 09:37:02ID: 22887744
Below I also posted out actual e-mail script to help diagnose the issue.
Select allOpen in new window