Jump to content

My URL variable isn't passed in this statement - any ideas why?


austrainer

Recommended Posts

Hi the code is

 

<td height="25" colspan="3" align="center"><div align="left">Your 
                referral link is - <a href="<?php echo $site_url; ?>index.php?refId=<?php echo $_COOKIE['userId']; ?>" target=_blank><?php echo $site_url; ?>index.php?refId=<?php echo $_COOKIE['userId']; ?></a></div></td>

 

The results are if you move your cursor over the result you see a full correct link eg: http://mydomain.com/index.php?refid=1

However the text reference on screen is "index.php?refid=1" without the ""

 

I want the text reference on screen to read the full correct link.

 

Can anyone help with any suggestions?

 

Thanks

Scott

 

(edited to put in the


tags)

Why don't you put everything you want to display in a temporary variable and display that?

<?php
$tmp = $site_url . 'index.php?refId=' . $_COOKIE['userid'];
?>
<td height="25" colspan="3" align="center">
     <div align="left">Your referral link is - <a href="<?php echo $tmp ?>" target=_blank><?php echo $tmp ?></a>
     </div>
</td>

 

This way you're sure you're echoing the same information.

 

Ken

Why don't you put everything you want to display in a temporary variable and display that?

<?php
$tmp = $site_url . 'index.php?refId=' . $_COOKIE['userid'];
?>
<td height="25" colspan="3" align="center">
     <div align="left">Your referral link is - <a href="<?php echo $tmp ?>" target=_blank><?php echo $tmp ?></a>
     </div>
</td>

 

This way you're sure you're echoing the same information.

 

Ken

 

Hi Ken

 

Thanks - I tried that and got the exact same result - the $site_url variable and the $tmp variables are still not being echoed to screen. They are there in the url if you mouse over the link but won't display.  the  'index.php?refId=' displays with the hyperlink active on it. I wonder if there is something else going wrong?

 

Cheers

Scott

 

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.