papillonstudios Posted July 5, 2009 Share Posted July 5, 2009 I have created a simple anchor function that im using. and the function works. <?php //Anchor Function function anchor ($link, $text='') { return '<a href="' . $link . '">' . $text . '</a>'; } ?> but when i use it i get this error Parse error: parse error, unexpected T_STRING in login.php on line 24 heres where i use it <?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 Link to comment https://forums.phpfreaks.com/topic/164809-solved-unexpected-t_string-function-included/ Share on other sites More sharing options...
celsoendo Posted July 5, 2009 Share Posted July 5, 2009 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>'; ?> Link to comment https://forums.phpfreaks.com/topic/164809-solved-unexpected-t_string-function-included/#findComment-869072 Share on other sites More sharing options...
papillonstudios Posted July 5, 2009 Author Share Posted July 5, 2009 thanks man Link to comment https://forums.phpfreaks.com/topic/164809-solved-unexpected-t_string-function-included/#findComment-869080 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.