Author Topic: [SOLVED] unexpected T_STRING Function included  (Read 247 times)

0 Members and 1 Guest are viewing this topic.

Offline gfadminTopic starter

  • Enthusiast
  • Posts: 273
  • Gender: Male
    • View Profile
    • GamingFusion
[SOLVED] unexpected T_STRING Function included
« on: July 04, 2009, 11:46:53 PM »
I have created a simple anchor function that im using. and the function works.

Code: [Select]
<?php
//Anchor Function
function anchor ($link$text='')
{
return '<a href="' $link '">' $text '</a>';
}
?>

but when i use it i get this error

Quote
Parse error:  parse error, unexpected T_STRING in login.php on line 24

heres where i use it

Code: [Select]
<?php
    
echo '<p>' anchor ('index.php?action=forgot'Forgot Password) . ' | ' anchor ('index.php?action=register'Register) . '</p>';
?>


and im not sure whats wrong i have looked and looked but with no luck
« Last Edit: July 04, 2009, 11:47:50 PM by gfadmin »
Papillon Graphics & Design
Canadian Website Design Firm
http://papillongrafix.com

Offline celsoendo

  • Irregular
  • Posts: 41
  • Gender: Male
    • View Profile
Re: unexpected T_STRING Function included
« Reply #1 on: July 05, 2009, 12:44:41 AM »
The second argument must be passed enclosed with quotes.

Like this:


<?php
    
echo '<p>' anchor ('index.php?action=forgot''Forgot Password') . ' | ' anchor ('index.php?action=register''Register') . '</p>';
?>
Follow me on Twitter: http://twitter.com/celsoendo
<?php exit() or die(); ?>

Offline gfadminTopic starter

  • Enthusiast
  • Posts: 273
  • Gender: Male
    • View Profile
    • GamingFusion
Re: unexpected T_STRING Function included
« Reply #2 on: July 05, 2009, 02:24:22 AM »
thanks man
Papillon Graphics & Design
Canadian Website Design Firm
http://papillongrafix.com