wmguk Posted September 5, 2008 Share Posted September 5, 2008 hey, I've found a message book script, and im trying to get it to input the various details... $email and $name are set in sessions but I cannot get it to pull the info out... function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$error='') { global $settings, $myfield, $lang; $url=$url ? $url : 'http://'; ?> I tried function printSign($name='',$from='',$email=' . $_SESSION['email'] . ',$url='',$comments='',$nosmileys='',$isprivate='',$error='') { but I just get Parse error: syntax error, unexpected '.' in /var/www/vhosts/bnidereham.co.uk/httpdocs/forum/gbook.php on line 958 Link to comment https://forums.phpfreaks.com/topic/122893-odd-session-issue/ Share on other sites More sharing options...
revraz Posted September 5, 2008 Share Posted September 5, 2008 Because you are using just single quotes around your session variable. Link to comment https://forums.phpfreaks.com/topic/122893-odd-session-issue/#findComment-634722 Share on other sites More sharing options...
wmguk Posted September 5, 2008 Author Share Posted September 5, 2008 Hmmm ok, I tried: I did this function printSign($name='',$from='',$email=' . $_SESSION["email"] . ',$url='',$comments='',$nosmileys='',$isprivate='',$error='') { and the email variable shows . $_SESSION[ I did this function printSign($name=',$from='',$email=" . $_SESSION['email] . ",$url='',$comments='',$nosmileys='',$isprivate='',$error='') { and i got this error Parse error: syntax error, unexpected '"' in /var/www/vhosts/bnidereham.co.uk/httpdocs/forum/gbook.php on line 958 Can you point out where I am missing the quotes etc please? Link to comment https://forums.phpfreaks.com/topic/122893-odd-session-issue/#findComment-634731 Share on other sites More sharing options...
discomatt Posted September 5, 2008 Share Posted September 5, 2008 I think you need to read more on how user defined functions work http://php.net/manual/en/language.functions.php Link to comment https://forums.phpfreaks.com/topic/122893-odd-session-issue/#findComment-634819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.