Okay, I'm stumped.
Background info: I'm building a website with three types of users - Physicians, EMployers, Recruiters. The relevant tables are - Physicians and Jobs
Problem lays: When a logged in physician responds to a practice opportunity I need the script to retain the physician's personal information and the displayed opportunity information. The problem is that it isn't passing the opportunity information.
Here is my script as it is now:
ShowDetails.php:
PHP Code:
<?php
include("misc.inc");
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
/* Select opportunities of the given Specialty */
$query_text = "select * from Jobs where ID='$ID'"; // 25
$query = mysql_query($query_text);
$result = mysql_fetch_array($query);
$OppSpecialty = $result['Specialty'] ;
$OppState = $result['State'] ;
$Oppid = $result['id'] ;
$OppLocation = $result['Location'] ;
$OppContact = $result['Contact'] ;
$OppContactEmail = $result['Contact_Email'] ;
echo "$Oppid, $OppSpecialty, $OppContact";
echo
"<a href=http://{$result['CoWebsite']} target=_blank><img border='0' src=\"{$result['CoBanner']}\" width='120' height='120'></a>
<p>
<b>Specialty:</b> $OppSpecialty<br>\n
<b>Location:</b> $OppLocation<br>\n
<b>State:</b> $OppState<p>\n
<b>Company:</b> {$result['Company']}<br>\n
<b>Company Website:</b> <a href=http://{$result['CoWebsite']} target=_blank>{$result['CoWebsite']}</a><p>\n
<b>Contact:</b> $OppContact<br>\n
<b>Email:</b><a href=\"mailto:$OppContactEmail\"> {$result['Contact_Email']}</a><br>\n
<b>Phone:</b> {$result['Contact_Phone']}<br>\n
<b>Fax:</b> {$result['Contact_Fax']}<p>\n
<b>Practice Type:</b> {$result['Practice_Type']}<br>\n
<b>Call:</b> {$result['Call']}<p>\n
<b>Description:</b> <p>{$result['Description']}<br><p><p>
<b>Company Profile:</b> {$result['CoProfile']}<p>";
echo "<form action='Respond.php?Oppid=Oppid' method='POST'>";
echo "<input type='submit' value='Respond to this opportunity' width='10' height='8'></td></form><tr><p>\n";
echo "</table>\n";
echo "<center><a href='javascript:history.go(-1)'>Go back to Search Results</a><p>\n";
echo "<center><div align='center'>
<a href='Search.php'><b>Search for more Opportunities</b></a></div>"
?>
Respond.php:
PHP Code:
<?php
include("misc.inc");
include("PhysInfo.inc");
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database".mysql_error());
if ($_SESSION['loggedinuser'] = ''
)
{header ("Location:PhyaicianLogin");
echo "Please login before responding to an opportunity.If you are not yet registered, please go to the <a href='PhysicianWelcome.php'>Physician Welcome page</a> to register.";}
else
$query_text = "select * from Jobs where id='$Oppid'"; // 25
$query = mysql_query($query_text);
$result = mysql_fetch_array($query);
$yourwebsite = 'www.MDPracticelist.com';
$subject="MDPractice List Response-Dr. $Last_Name, $OppSpecialty-$OppState, $Oppid"; // The subject of the mail thats being sent
$recipient_email=$OppContactEmail; // the recipient
/*
The headers for the e-mail, no need to change it unless you know what you're doing
*/
$header = "From: Dr. $Last_Name <$Email>\r\n";;
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$content= "Dear $OppContact,
Dr. $Last_Name has responded to your posting for $Specialty, MDPractice List id # $id.
Dr. $Last_Name has provided the following information to aid in your consideration for the opportunity:
<p><p align='center'><b><font size='3' font color='000000'>$First_Name $Last_Name<br> $Street1<br>$HomeCity, $HomeState $HomeZip<br>Home Phone: $HomePhone<br>Cell Phone: $CellPhone<br>Business Phone: $BusPhone<br>Pager: $Pager<br>Fax Number: $FaxNum<br>Email: $Email</b></p>
<p align='left'><font size='3' font color='000000'>
<b><u>Education:</b></u></p>
<p align='left'><font size='3' font color='000000'>
$MedSchoolName<br>
$MedSchoolCity, $MedSchoolState<br>
$MedSchoolYearStart - $MedSchoolYearEnd</p>
<p align='left'><font size='3' font color='000000'>
$InternName<br>
$InternCity, $InternState<br>
$InternYearStart - $InternYearEnd</p>
<p align='left'><font size='3' font color='000000'>
$ResName<br>
$ResCity, $ResState<br>
$ResYearStart - $ResYearEnd</p>
<p align='left'><font size='3' font color='000000'>
<p>
<p align='left'><font size='3' font color='000000'><b><u>Fellowship Program: </b></u></p>
<p align='left'><font size='2' font color='000000'> $FellowName<br>
$FellowCity, $FellowState
$FellowYearStart - $FellowYearEnd
";
mail('myemailfornow', $subject, $content, $header);
echo "<font color=00008B><align=center><b>Thank you $Last_Name! Your interest has been sent to: $OppContactEmail .</b><p>\n";
echo "<center><a href='javascript:history.go(-2)'>Go back to Search Results</a><p>\n";
?>
PhysInfo.inc holds the physician's previously entered info.
The email being sent has all of the physician info, but none of the opportunity info.
I've been struggling with how to get this to work....to no avail.
Your help would be greatly appreciated!!