Jump to content

[SOLVED] Syntax Error Help Pls.


teramera

Recommended Posts

Hi! I am getting an Syntax error with the following code. Coul someone pls hep correct it. Also can you point me where I can read up about writing correct sytax for php, its about time that i get to lern this now. Thanks for your help and time.

 

<?
if ($_SESSION['Name'] !=""){
<a href="contact_now.php?BuyerID=<?=$_REQUEST['BuyerID']?>"><img src="../images/inquire_now.gif" border="0"></a><br><br>
<img src="../images/view_contact.gif" border="0" align="absmiddle"> <a href="view_contact_details.php?BuyerID=<?=$_REQUEST['BuyerID']?>" class="contactus">View Contact Details</a>;
}
else
{
<a href="signmeup.php>"><img src="../images/signmeup.gif" border="0"></a> Sign up or Register to be able to contact us.<br><br>;
?>

Link to comment
Share on other sites

<?php
if ($_SESSION['Name'] !=""){
?>
<a href="contact_now.php?BuyerID=<?php echo $_REQUEST['BuyerID']?>"><img src="../images/inquire_now.gif" border="0"></a><br><br>
<img src="../images/view_contact.gif" border="0" align="absmiddle"> <a href="view_contact_details.php?BuyerID=<?php echo $_REQUEST['BuyerID']?>" class="contactus">View Contact Details</a>;
<?php
}
else
{
?>
<a href="signmeup.php>"><img src="../images/signmeup.gif" border="0"></a> Sign up or Register to be able to contact us.<br><br>;
<?php 
}
?>

 

You can't just type HTML and expect it to be displayed. You have to echo it, or close php tag ?> first

 

The best source ever: php.net

Link to comment
Share on other sites

Try this:

 

<?
if ($_SESSION['Name'] !=""){
   echo '<a href="contact_now.php?BuyerID='.$_REQUEST['BuyerID'].'"><img src="../images/inquire_now.gif" border="0"></a><br><br><img src="../images/view_contact.gif" border="0" align="absmiddle"> <a href="view_contact_details.php?BuyerID='.$_REQUEST['BuyerID'].'" class="contactus">View Contact Details</a>';
}
else
{
   echo '<a href="signmeup.php>"><img src="../images/signmeup.gif" border="0"></a> Sign up or Register to be able to contact us.<br><br>';
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.