We help IT Professionals succeed at work.

PHP with MySQL Code block error

SeanNij
SeanNij asked
on
Hi.

I have a php website hosted on Windows Server 2k8 and having a problem with my MySQL class on one page. Not sure if it's my code or something to do with my database query. The problem is my php page shows code instead of the actual variables. (http://www.supportsolutions.co.za/job.php?job_id=482) Here is where my problem lies.


I've supplied my job.class.php and job.php

<?php

class jobs
{ 
	// class variable declarations
	var $mysql;
	var $job_id;
	var $job_position;
	var $job_desc;
	var $job_area;
	var $job_ref;
	var $job_salary;
	var $job_availability;
	var $job_consultant;
	var $job_closing;
	var $job_division;
	var $job_benefits;
	var $job_hrs;
	var $job_bonus;	
	var $job_consultemail;	
	
	// constructor
	function jobs() {
		global $mysql;		
		$this->mysql =& $mysql;
	}
	
	// Populate User Details from either user_name or user_id
	function populate($job_id=false) {
		if (!$job_id){return;}
		
		$job_array=$this->mysql->select("SELECT * FROM jobs WHERE job_id=".$job_id);
		if ($job_array){ 
			$this->job_id=$job_array[0][0];
			$this->job_position=$job_array[0][1];
			$this->job_desc=$job_array[0][2];	
			$this->job_area=$job_array[0][3];
			$this->job_closing=$job_array[0][4];	
			$this->job_division=$job_array[0][5];	
			$this->job_ref=$job_array[0][6];	
			$this->job_salary=$job_array[0][7];	
			$this->job_availability=$job_array[0][8];	
			$this->job_consultant=$job_array[0][9];	
			$this->job_benefits=$job_array[0][10];
			$this->job_hrs=$job_array[0][11];
			$this->job_bonus=$job_array[0][12];
			$this->job_consultemail=$job_array[0][13];
		}		
	}

	// Basic add, edit, delete functions

	function insert_job($job_id, $job_position, $job_desc, $job_area, $job_closing, $job_division, $job_ref, $job_salary, $job_availability, $job_consultant, $job_benefits, $job_hrs, $job_bonus, $job_consultemail) {
		if (!$job_id){return false;}
		//$job_desc = addslashes($job_desc);
		
		$sql="INSERT INTO jobs (job_id, job_position, job_desc, job_area, job_closing, job_division, job_ref, job_salary, job_availability, job_consultant, job_benefits, job_hrs, job_bonus, job_consultemail) ";
		$sql.= "VALUES ('$job_id', '$job_position', '$job_desc', '$job_area', '$job_closing', '$job_division', '$job_ref', '$job_salary', '$job_availability', '$job_consultant', '$job_benefits', '$job_hrs', '$job_bonus', '$job_consultemail')";
		$insert_array=$this->mysql->select($sql);
		if ($insert_array){return true;}
	}

	function update_job($job_id, $job_position, $job_desc, $job_area, $job_closing, $job_division, $job_ref, $job_salary, $job_availability, $job_consultant, $job_benefits, $job_hrs, $job_bonus, $job_consultemail) {
		if (!$job_id){return false;}
		//$job_desc = addslashes($job_desc);
		
		$sql= "UPDATE jobs SET 
		job_id=$job_id, 
		job_position='$job_position', 
		job_desc='$job_desc', 
		job_area='$job_area', 	
		job_closing='$job_closing', 
		job_division='$job_division',
		job_ref='$job_ref',
		job_salary='$job_salary',
		job_availability='$job_availability',
		job_consultant='$job_consultant',
		job_benefits='$job_benefits',
		job_hrs='$job_hrs',
		job_bonus='$job_bonus',
		job_consultemail='$job_consultemail'
		WHERE ";
		$sql.="job_id=$job_id";		
		$update_array=$this->mysql->select($sql);
		if ($update_array){return true;}
	}

	function delete_job($job_id, $permanent=false) {
		if (!$job_id){return false;}
		$sql="DELETE FROM jobs WHERE job_id=$job_id";
		$delete_array=$this->mysql->select($sql);
		return $delete_array;
	}

	// Get jobs	
	function get_jobs($job_id=false) {
		if ($job_id){$specific=" WHERE job_id=$job_id ";
		} else { $specific=""; }
		
		$job_array=$this->mysql->select("SELECT * FROM jobs $specific ORDER BY job_availability DESC, substring(job_ref,5) DESC");
		if ($job_array){ return $job_array; }
	}
	
	function get_jobs_indivision($job_division=false) {
		$job_array=$this->mysql->select("SELECT * FROM jobs WHERE job_division=$job_division ORDER BY job_consultant, substring(job_ref,5) DESC");
		//$job_array=$this->mysql->select("SELECT * FROM jobs WHERE job_availability='Available' ORDER BY job_position");
		if ($job_array){ return $job_array; }
	}	
}
?>

Top of Job.php:
include_once('global9.php'); // Include global class
include_once('jobs.class.php');
$jobs= new jobs();


$job_id=$_GET['job_id'];
$jobs->populate($job_id); //Happens here!!!

?>

Middle of job.php
			<tr>
				<td bgcolor="#800000" width="80px">Position</td>
				<td><?=$jobs->job_position?></td> <!-- AND HERE -->
			</tr>

Open in new window

Comment
Watch Question

HI,

Replace it with:

Middle of job.php
                  <tr>
                        <td bgcolor="#800000" width="80px">Position</td>
                        <td><?php echo $jobs->job_position;?></td> <!-- AND HERE -->
                  </tr>
Hi,

Can you give me the code for job.php?

Author

Commented:
Hi,

I've changed the code to look like you said, but still not working. It's now showing nothing on that field.


Supplied job.php
<?
include_once('global9.php'); // Include global class
include_once('jobs.class.php');
$jobs= new jobs();


$job_id=$_GET['job_id'];
$jobs->populate($job_id);

?>

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Support Solutions</title>
<link rel="stylesheet" href="default.css" type="text/css">
<!-- Permission granted to SimplytheBest.net to feature the script in the DHTML script collection at http://simplythebest.net/scripts/ -->
<!-- Rollover buttons function was modified by SimplytheBest.net -->
<SCRIPT language=javascript src="menu_script/ypSlideOutMenus.js"></SCRIPT>

<SCRIPT language=JavaScript type=text/javascript>
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!--
function swapImgRestore() { 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preloadImages() { 
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function swapImage() { 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function showHideLayers() {
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style	; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</SCRIPT>
<STYLE type=text/css>
.rollmenu {border-right: #cccccc 1px solid; padding-right: 2px; border-top: #cccccc 1px solid; display: block; padding-left: 2px; font-size: 11px; padding-bottom: 2px; border-left: #cccccc 1px solid; color: #eee; line-height: normal; padding-top: 2px; border-bottom: #FFFFFF 1px solid; font-family: "Arial", "Helvetica", "sans-serif"; background-color: #656565; text-decoration: none}
.rollmenu:hover {	background-color: #999999; text-decoration: none}
.menuhead {font-weight: bold; font-size: 12px; color: #ffffff; background-color: transparent}
#menu1 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu2 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu3 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu4 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
</STYLE>

</head>

<body bgcolor="#656565" onResize="window.location.href = window.location.href;" topmargin="0" leftmargin="0">

<SCRIPT language=JavaScript type=text/javascript>
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth-20;
  winH = document.body.offsetHeight-20;
 }
}
<!--
	  var yPosition = 251;
	  var xPosition = winW / 2;
	  
	//new ypSlideOutMenu("number menu", "slide position", left, top, width, height)
		//new ypSlideOutMenu("menu1", "right", 265, yPosition, 146, 230)
		//new ypSlideOutMenu("menu11", "right", 408, yPosition + 81, 146, 160)
		//new ypSlideOutMenu("menu12", "right", 408, yPosition + 181, 146, 160)
		new ypSlideOutMenu("menu2", "right", 172, 146, 150, 180)
		//new ypSlideOutMenu("menu21", "right", 408, yPosition + 63, 146, 80)
		new ypSlideOutMenu("menu3", "right", 172, 170, 150, 120)
		new ypSlideOutMenu("menu5", "right", 172, 218, 150, 120)
		new ypSlideOutMenu("menu6", "right", 172, 242, 150, 205)
	//-->

</SCRIPT>

<!-- Menu start -->
<!-- Begin SubMenu1 -->
<DIV id=menu2Container>
<DIV id=menu2Content>
<TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about.htm"> Mission and Vision Statement</A></TD></TR>    
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-values.htm"> Values</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-manage.htm"> Management Experience</A></TD></TR>
  <!-- <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-team.php"> Our Team</A></TD></TR> -->
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-partners.htm"> Our Partners</A></TD></TR>
  <!-- <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-structure.htm"> Company Structure</A>
    </TD>
  </TR> -->
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu1 -->

<!-- Begin SubMenu3 -->
<DIV id=menu3Container>
<DIV id=menu3Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu3')" onmouseout="ypSlideOutMenu.hideMenu('menu3')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="services-recruitment.htm"> Permanent Recruitment</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu3')" onmouseout="ypSlideOutMenu.hideMenu('menu3')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="services-special.htm"> Our Specialisation</A>
    </TD>
  </TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu3 -->

<!-- Begin SubMenu4 -->
<DIV id=menu5Container>
<DIV id=menu5Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu5')" onmouseout="ypSlideOutMenu.hideMenu('menu5')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="careers1.php?job_division=1"> Open for Application</A></TD></TR>
    <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu5')" onmouseout="ypSlideOutMenu.hideMenu('menu5')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="careers1.php?job_division=2"> Closed for Application</A></TD></TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu4 -->
<!-- End Menu -->

<!-- Begin SubMenu5 -->
<DIV id=menu6Container>
<DIV id=menu6Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu6')" onmouseout="ypSlideOutMenu.hideMenu('menu6')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="contact.htm"> Contact Details</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu6')" onmouseout="ypSlideOutMenu.hideMenu('menu6')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="contact-map.htm"> Map & Directions</A></TD></TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu5 -->
<!-- End Menu -->


<center>

		<table width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="white">
		<tr>
		<td width="167" height="122" valign="top" rowspan="2" class="brder2"><img src="images/logo.jpg" vspace="6"></td>
		<td height="100" align="left" valign="top"><img src="images/slogan.gif"></td>
		<td height="100" align="right"><p style="margin-right: 10px;"><font color="#656565" size="6">Careers</font></p></td>
		</tr>
		<tr>
		<td bgcolor="#656565" height="22" colspan="2">&nbsp; DETAILED JOB DESCRIPTION</td>
		</tr>
		<tr>
		<td valign="top" class="brder2" height="100%">
			<table width="100%" height="100%" cellpadding="0" cellspacing="1" border="0">
			<tr height="23">
			<td bgcolor="#656565"><center><A href="index.htm">HOME</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu2');" onmouseout="ypSlideOutMenu.hideMenu('menu2');" href="#">ABOUT US</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu3');" onmouseout="ypSlideOutMenu.hideMenu('menu3');" href="#">OUR SERVICES</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A href="bee.htm">BEE STATUS</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu5');" onmouseout="ypSlideOutMenu.hideMenu('menu5');" href="#">CAREERS</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu6');" onmouseout="ypSlideOutMenu.hideMenu('menu6');" href="#">CONTACT US</A></center></td>
			</tr>
			<tr>
			<td valign="top" bgcolor="#C0C0C0" class="CONTACT">
				<img src="images/anim.gif">
				<br>
				&nbsp;<b>Cape Town:</b><br>
				&nbsp;Tel: 021 466 8930<br>
				&nbsp;Fax: 021 465 6312<p><b>&nbsp;Gauteng:</b><br>
&nbsp;Tel: 012 683 9440<br>
&nbsp;Fax: 0066 960 272</p>
				<p>&nbsp;<b>E-Mail Enquiries:&nbsp; </b><br>
				&nbsp;<a href="mailto:info@supportsolutions.co.za" class="contactlink">info@supportsolutions.co.za</a><br>
				<br>

			</td>
			</tr>	
			</table>
		</td>
		<td background="images/back1.jpg" valign="top" colspan="2" style="line-height: 150%;"><br>
		<blockquote style="margin-left: 10px; margin-right: 10px;">
			
		
		<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">
			<tr>
				<td bgcolor="#800000" width="80px">Position</td>
				<td><?php echo $jobs->job_position;?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Reference</td>
				<td><?=strtoupper($jobs->job_ref)?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Area</td>
				<td><?=$jobs->job_area?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Salary</td>
				<td><?=$jobs->job_salary?></td>
			</tr>											
		</table>
<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">	
			<tr>
				<td bgcolor="#800000" width="80px">Benefits</td>
				<td><?=$jobs->job_benefits?></td>
			</tr>	
			<tr>
				<td bgcolor="#800000" width="80px">Working Hours</td>
				<td><?=$jobs->job_hrs?></td>
			</tr>	
			<tr>
				<td bgcolor="#800000" width="80px">Bonus</td>
				<td><?=$jobs->job_bonus?></td>
			</tr>										
		</table>
<br>
		<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">		
			<tr>
				<td bgcolor="#C0C0C0" style="color: #5B5B5B;">
				<p align="justify">
		
		
			<?
if ($jobs->job_id){	
	echo nl2br($jobs->job_desc)."\n<BR>";
}else {
	echo "ERROR: Job not found!";
}


if ($jobs->job_division == 1){
echo '<br><center><input type="button" value="  Apply  " onclick="window.location=\'mailto:'.$jobs->job_consultemail.'?subject=Application for: '.$jobs->job_position.', ref: '.$jobs->job_ref.', Consultant: '.$jobs->job_consultant.'\'"></center>';
}
			?>		
				</p>
				</td>
					</tr>																			
				</table>

				<br>
		
						
			<BR /><BR /><B><A href="javascript:history.back()">BACK TO CAREERS</A></B>				
		
		</td>
		</tr>
		</table>
			
			
			
		
		</td>
		</tr>
		</table>
	
</center>
</body>

</html>

Open in new window

HI,

Try this:


<?php
include_once('global9.php'); // Include global class
include_once('jobs.class.php');

$jobs= new jobs();


$job_id=$_GET['job_id'];
$jobs->populate($job_id);

?>

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Support Solutions</title>
<link rel="stylesheet" href="default.css" type="text/css">
<!-- Permission granted to SimplytheBest.net to feature the script in the DHTML script collection at http://simplythebest.net/scripts/ -->
<!-- Rollover buttons function was modified by SimplytheBest.net -->
<SCRIPT language=javascript src="menu_script/ypSlideOutMenus.js"></SCRIPT>

<SCRIPT language=JavaScript type=text/javascript>
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!--
function swapImgRestore() { 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preloadImages() { 
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function swapImage() { 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function showHideLayers() {
  var i,p,v,obj,args=showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style	; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</SCRIPT>
<STYLE type=text/css>
.rollmenu {border-right: #cccccc 1px solid; padding-right: 2px; border-top: #cccccc 1px solid; display: block; padding-left: 2px; font-size: 11px; padding-bottom: 2px; border-left: #cccccc 1px solid; color: #eee; line-height: normal; padding-top: 2px; border-bottom: #FFFFFF 1px solid; font-family: "Arial", "Helvetica", "sans-serif"; background-color: #656565; text-decoration: none}
.rollmenu:hover {	background-color: #999999; text-decoration: none}
.menuhead {font-weight: bold; font-size: 12px; color: #ffffff; background-color: transparent}
#menu1 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu2 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu3 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
#menu4 {left: 1px; visibility: hidden; position: absolute; top: 1px; background-color: transparent}
</STYLE>

</head>

<body bgcolor="#656565" onResize="window.location.href = window.location.href;" topmargin="0" leftmargin="0">

<SCRIPT language=JavaScript type=text/javascript>
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth-20;
  winH = document.body.offsetHeight-20;
 }
}
<!--
	  var yPosition = 251;
	  var xPosition = winW / 2;
	  
	//new ypSlideOutMenu("number menu", "slide position", left, top, width, height)
		//new ypSlideOutMenu("menu1", "right", 265, yPosition, 146, 230)
		//new ypSlideOutMenu("menu11", "right", 408, yPosition + 81, 146, 160)
		//new ypSlideOutMenu("menu12", "right", 408, yPosition + 181, 146, 160)
		new ypSlideOutMenu("menu2", "right", 172, 146, 150, 180)
		//new ypSlideOutMenu("menu21", "right", 408, yPosition + 63, 146, 80)
		new ypSlideOutMenu("menu3", "right", 172, 170, 150, 120)
		new ypSlideOutMenu("menu5", "right", 172, 218, 150, 120)
		new ypSlideOutMenu("menu6", "right", 172, 242, 150, 205)
	//-->

</SCRIPT>

<!-- Menu start -->
<!-- Begin SubMenu1 -->
<DIV id=menu2Container>
<DIV id=menu2Content>
<TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about.htm"> Mission and Vision Statement</A></TD></TR>    
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-values.htm"> Values</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-manage.htm"> Management Experience</A></TD></TR>
  <!-- <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-team.php"> Our Team</A></TD></TR> -->
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-partners.htm"> Our Partners</A></TD></TR>
  <!-- <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu2')" onmouseout="ypSlideOutMenu.hideMenu('menu2')" vAlign=center align=left width=150 height=17>
    <A class=rollmenu href="about-structure.htm"> Company Structure</A>
    </TD>
  </TR> -->
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu1 -->

<!-- Begin SubMenu3 -->
<DIV id=menu3Container>
<DIV id=menu3Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu3')" onmouseout="ypSlideOutMenu.hideMenu('menu3')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="services-recruitment.htm"> Permanent Recruitment</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu3')" onmouseout="ypSlideOutMenu.hideMenu('menu3')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="services-special.htm"> Our Specialisation</A>
    </TD>
  </TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu3 -->

<!-- Begin SubMenu4 -->
<DIV id=menu5Container>
<DIV id=menu5Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu5')" onmouseout="ypSlideOutMenu.hideMenu('menu5')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="careers1.php?job_division=1"> Open for Application</A></TD></TR>
    <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu5')" onmouseout="ypSlideOutMenu.hideMenu('menu5')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="careers1.php?job_division=2"> Closed for Application</A></TD></TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu4 -->
<!-- End Menu -->

<!-- Begin SubMenu5 -->
<DIV id=menu6Container>
<DIV id=menu6Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0>
  <TBODY>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu6')" onmouseout="ypSlideOutMenu.hideMenu('menu6')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="contact.htm"> Contact Details</A></TD></TR>
  <TR>
    <TD onmouseover="ypSlideOutMenu.showMenu('menu6')" onmouseout="ypSlideOutMenu.hideMenu('menu6')" vAlign=center align=left width=142 height=17>
    <A class=rollmenu href="contact-map.htm"> Map & Directions</A></TD></TR>
  </TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu5 -->
<!-- End Menu -->


<center>

		<table width="100%" height="100%" cellpadding="0" cellspacing="0" bgcolor="white">
		<tr>
		<td width="167" height="122" valign="top" rowspan="2" class="brder2"><img src="images/logo.jpg" vspace="6"></td>
		<td height="100" align="left" valign="top"><img src="images/slogan.gif"></td>
		<td height="100" align="right"><p style="margin-right: 10px;"><font color="#656565" size="6">Careers</font></p></td>
		</tr>
		<tr>
		<td bgcolor="#656565" height="22" colspan="2">&nbsp; DETAILED JOB DESCRIPTION</td>
		</tr>
		<tr>
		<td valign="top" class="brder2" height="100%">
			<table width="100%" height="100%" cellpadding="0" cellspacing="1" border="0">
			<tr height="23">
			<td bgcolor="#656565"><center><A href="index.htm">HOME</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu2');" onmouseout="ypSlideOutMenu.hideMenu('menu2');" href="#">ABOUT US</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu3');" onmouseout="ypSlideOutMenu.hideMenu('menu3');" href="#">OUR SERVICES</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A href="bee.htm">BEE STATUS</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu5');" onmouseout="ypSlideOutMenu.hideMenu('menu5');" href="#">CAREERS</A></center></td>
			</tr>	
			<tr height="23">
			<td bgcolor="#656565"><center><A onmouseover="ypSlideOutMenu.showMenu('menu6');" onmouseout="ypSlideOutMenu.hideMenu('menu6');" href="#">CONTACT US</A></center></td>
			</tr>
			<tr>
			<td valign="top" bgcolor="#C0C0C0" class="CONTACT">
				<img src="images/anim.gif">
				<br>
				&nbsp;<b>Cape Town:</b><br>
				&nbsp;Tel: 021 466 8930<br>
				&nbsp;Fax: 021 465 6312<p><b>&nbsp;Gauteng:</b><br>
&nbsp;Tel: 012 683 9440<br>
&nbsp;Fax: 0066 960 272</p>
				<p>&nbsp;<b>E-Mail Enquiries:&nbsp; </b><br>
				&nbsp;<a href="mailto:info@supportsolutions.co.za" class="contactlink">info@supportsolutions.co.za</a><br>
				<br>

			</td>
			</tr>	
			</table>
		</td>
		<td background="images/back1.jpg" valign="top" colspan="2" style="line-height: 150%;"><br>
		<blockquote style="margin-left: 10px; margin-right: 10px;">
			
		
		<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">
			<tr>
				<td bgcolor="#800000" width="80px">Position</td>
				<td><?php echo $jobs->job_position;?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Reference</td>
				<td><?=strtoupper($jobs->job_ref)?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Area</td>
				<td><?=$jobs->job_area?></td>
			</tr>
			<tr>
				<td bgcolor="#800000" width="80px">Salary</td>
				<td><?=$jobs->job_salary?></td>
			</tr>											
		</table>
<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">	
			<tr>
				<td bgcolor="#800000" width="80px">Benefits</td>
				<td><?=$jobs->job_benefits?></td>
			</tr>	
			<tr>
				<td bgcolor="#800000" width="80px">Working Hours</td>
				<td><?=$jobs->job_hrs?></td>
			</tr>	
			<tr>
				<td bgcolor="#800000" width="80px">Bonus</td>
				<td><?=$jobs->job_bonus?></td>
			</tr>										
		</table>
<br>
		<table width="95%" cellpadding="5" bgcolor="" border="1" style="border-collapse: collapse" cellspacing="0">		
			<tr>
				<td bgcolor="#C0C0C0" style="color: #5B5B5B;">
				<p align="justify">
		
		
			<?php
if ($jobs->job_id){	
	echo nl2br($jobs->job_desc)."\n<BR>";
}else {
	echo "ERROR: Job not found!";
}


if ($jobs->job_division == 1){
echo '<br><center><input type="button" value="  Apply  " onclick="window.location=\'mailto:'.$jobs->job_consultemail.'?subject=Application for: '.$jobs->job_position.', ref: '.$jobs->job_ref.', Consultant: '.$jobs->job_consultant.'\'"></center>';
}
			?>		
				</p>
				</td>
					</tr>																			
				</table>

				<br>
		
						
			<BR /><BR /><B><A href="javascript:history.back()">BACK TO CAREERS</A></B>				
		
		</td>
		</tr>
		</table>
			
			
			
		
		</td>
		</tr>
		</table>
	
</center>
</body>

</html>

Open in new window

HI,

Might be your php short open tag is off in the php.ini file:

Edit php.ini file

short_open_tag = On

Otherwise you should use  <?php   instead of just using   <?

Author

Commented:
Thank you for the solution. Worked like a charm.