Jump to content


Problem with php link

  • Please log in to reply
1 reply to this topic

#1 Perad

  • Members
  • PipPipPip
  • Advanced Member
  • 287 posts

Posted 19 October 2006 - 10:01 AM

I have the code below... it doesn't work and the link is blank. When i click on View>>Source it shows the php echo in pink instead of processing it.

Is this code wrong?

If so could you help me fix it... if not could it be a problem with my apache/php installation?

PHP Code
echo('Welcome back '.$userdata['username'] . '<br />
<a href="/forums/privmsg.php?folder=inbox"> <?php echo $l_privmsgs_text ?></a><br />');

HTML code
<a href="/forums/privmsg.php?folder=inbox"><?php echo $l_privmsgs_text ?></a>

#2 Orio

  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 19 October 2006 - 10:16 AM

Because you've put "<?php echo $l_privmsgs_text ?>" inside an echo.

echo('Welcome back '.$userdata['username'] . '<br /><a href="/forums/privmsg.php?folder=inbox"> <?php echo $l_privmsgs_text ?></a><br />');

Should be-
echo('Welcome back '.$userdata['username'] . '<br /><a href="/forums/privmsg.php?folder=inbox">'.echo $l_privmsgs_text.'</a><br />');

Think you're smarty?

(Gone until 20 to November)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users