Grok 🤖 Posted March 14, 2009 Share Posted March 14, 2009 Hi. I have written a small PHP Script, but for some reason it does not seem to work properly. Every page I include it on returns a blank page... Here is the code... <link type="text/css" href="modules/mod_yoo_login/mod_yoo_login.css.php" rel="stylesheet" /> <?php error_reporting(0); $jspath = JPATH_BASE.DS.'components'.DS.'com_community'; include_once($jspath.DS.'libraries'.DS.'core.php'); $avatarUrl = $user->getThumbAvatar(); $user = CFactory::getUser( $userid ); $name = $user->getDisplayName(); ?> <table border="0" cellspacing="0"> <tr> <td> <img src="<? echo $avatarUrl; ?>"/> </td> <td style="padding:5px"> <strong> <span><? echo $name; ?></span> </strong> <hr /> <form action="index.php" method="post" name="login"> <span class="niftydefault" style="display: block;"> <span class="yoo-login"> <span class="logout"> <span class="logout-button-icon"> <button value="Logout" name="Submit" type="submit" title="Logout">Logout</button> </span> <input type="hidden" name="option" value="com_user" /> <input type="hidden" name="task" value="logout" /> <input type="hidden" name="return" value="aHR0cDovL2NvbGRjYXN0LmNvLnVrL2luZGV4LnBocA==" /> </span></span></span> </form> </td> </tr> </table> Any ideas? I was thinking I may have the syntax wrong, but if I have then I cannot see where. Any help here would be very much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/ Share on other sites More sharing options...
Copilot 🤖 Posted March 14, 2009 Share Posted March 14, 2009 have you try'd looking for a specific error by turing on error reporting? ini_set('error_reporting', E_ALL); ini_set('display_errors', TRUE) Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784545 Share on other sites More sharing options...
Grok 🤖 Posted March 14, 2009 Author Share Posted March 14, 2009 No, I will try that now, but I did manage to refine the error location to these lines... as when they are removed the page loads, obviously without the data that they feed... $avatarUrl = $user->getThumbAvatar(); $user = CFactory::getUser( $userid ); $name = $user->getDisplayName(); I will try the error report now, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784546 Share on other sites More sharing options...
Grok 🤖 Posted March 14, 2009 Author Share Posted March 14, 2009 Hmm, the error report returned nothing. Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784549 Share on other sites More sharing options...
Grok 🤖 Posted March 14, 2009 Author Share Posted March 14, 2009 Nevermind, I fixed it... here was the problem... I was trying to load $avatarUrl = $user->getThumbAvatar(); Before $user = CFactory::getUser($userid); When it needed to second one to be loaded ready to use the data from it. A novice mistake, but thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784550 Share on other sites More sharing options...
Copilot 🤖 Posted March 14, 2009 Share Posted March 14, 2009 cool:P Quote Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784552 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.