Jump to content

[SOLVED] IF Statement


kyleldi

Recommended Posts

I've got an IF Statement that echo's some html/php if the statement is true, but I keep getting an error "Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' " so I know i'm missing some syntax somewhere in the string, but I can't find where.  Did I do this right?

 

Here's my code:

 

<?php if ($row_rs_positions['active']=='Yes')
{
echo 'do { <div class="displayjobs"><div class="jobheading"><p><a href="careers.php?positionid= .  ucwords($row_rs_positions['positionid']) ."> .  ucwords($row_rs_positions['title']) .</a><strong> - <span class="style5">Added  .  ucwords($row_rs_positions['date']) .</span></strong></p></div><div class="jobdesc"><p> .  ucwords($row_rs_positions['summary']) .... <a href="careers.php?positionid= .  ucwords($row_rs_positions['positionid']) .">View Position</a></p></div></div> } while ($row_rs_positions = mysql_fetch_assoc($rs_positions))';
}
else
{
echo '<div class="jobopenings"><p align="center">Thank you for your interest in Laser Dynamics. Currently we do not have any job openings within The Company. We are, however, always accepting resumes and applications. If you would like to be considered for a future position here at Laser Dynamics, please submit a resume and application <a href="submitapp.php">here</a>.</p></div>';
}?>

 

Thank You!

Link to comment
https://forums.phpfreaks.com/topic/148803-solved-if-statement/
Share on other sites

miles off. you have code within your echo statement.

 

<?php 
if ($row_rs_positions['active'] == 'Yes') {
do { 
	echo '<div class="displayjobs">
			<div class="jobheading">
				<p><a href="careers.php?positionid='.ucwords($row_rs_positions['positionid']).'">'.ucwords($row_rs_positions['title']).'</a><strong> - 
				<span class="style5">Added'.ucwords($row_rs_positions['date']).'</span></strong></p>
			</div>
			<div class="jobdesc">
			<p>'.ucwords($row_rs_positions['summary']).'.... <a href="careers.php?positionid='.ucwords($row_rs_positions['positionid']).'">View Position</a></p>
			</div>
		</div>';
 } 
 while($row_rs_positions = mysql_fetch_assoc($rs_positions));
}
else{
echo '<div class="jobopenings"><p align="center">Thank you for your interest in Laser Dynamics. Currently we do not have any job openings within The Company. We are, however, always accepting resumes and applications. If you would like to be considered for a future position here at Laser Dynamics, please submit a resume and application <a href="submitapp.php">here</a>.</p></div>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/148803-solved-if-statement/#findComment-781393
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.