Jump to content

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


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

 

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.