PcGeniusProductions 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. Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/ Share on other sites More sharing options...
Silverado_NL 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) Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784545 Share on other sites More sharing options...
PcGeniusProductions 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. Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784546 Share on other sites More sharing options...
PcGeniusProductions Posted March 14, 2009 Author Share Posted March 14, 2009 Hmm, the error report returned nothing. Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784549 Share on other sites More sharing options...
PcGeniusProductions 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 Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784550 Share on other sites More sharing options...
Silverado_NL Posted March 14, 2009 Share Posted March 14, 2009 cool:P Link to comment https://forums.phpfreaks.com/topic/149381-solved-php-error/#findComment-784552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.