...

View Full Version : PHP Error



2Pacalypse
08-03-2008, 08:47 PM
if($ir['user_level'] > 1)
{
print "<br />
"<a href='donator.php'>Donate</a> for game benifits"<br />
;}

Can anyone tell me what is wrong with this?

It isn't the exact finished bit so don't worry about it being wrong... it saying a few things I don't even understand...

croatiankid
08-03-2008, 08:55 PM
You have to escape the quotes like so:

<?php
if($ir['user_level'] > 1)
{
print "<br />
\"<a href='donator.php'>Donate</a> for game benifits\"<br />"
;}

?>

djm0219
08-03-2008, 08:55 PM
The way you've got things in quotes is most of the problem.


if($ir['user_level'] > 1)
{
print '<br /><a href="donator.php">Donate</a> for game benifits<br />';
}

Values for HTML tags have to be enclosed in double quotes not single quotes.

If you want the entire sentence quoted use:


if($ir['user_level'] > 1)
{
print '<br />"<a href="donator.php">Donate</a> for game benifits"<br />';
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum