squiblo Posted July 27, 2009 Share Posted July 27, 2009 i think that i have my thinking all wrong: <?php echo '<div id="copyright" style="position:absolute;left:55px;width:150px;height:44px;z-index:32">'; if(isset($_SESSION['myusername'])) { echo 'top:628px;'; } else { echo 'top:588px;'; } echo '" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009</font></div>'; ?> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <?php if(isset($_SESSION['myusername'])) echo '<font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009>'; ?> </font></div> Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/ Share on other sites More sharing options...
Philip Posted July 27, 2009 Share Posted July 27, 2009 You used a double quote instead of a single quote on the first echo... <?php echo '<div id="copyright" style="position:absolute;left:55px;width:150px;height:44px;z-index:32'; if(isset($_SESSION['myusername'])) { echo 'top:628px;'; } else { echo 'top:588px;'; } echo '" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009</font></div>'; ?> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <?php if(isset($_SESSION['myusername'])) echo '<font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009>'; ?> </font></div> Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884268 Share on other sites More sharing options...
squiblo Posted July 27, 2009 Author Share Posted July 27, 2009 now the script doesnt have any errors but does not do what i want, i want to move the text 30px from the top when logged in Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884275 Share on other sites More sharing options...
gevans Posted July 27, 2009 Share Posted July 27, 2009 your not running session_start() Both divs are absolute aligned, so one will not affect the other. The random copyright notice (I thgink that's what it is) will probably just sit at the top left of the page (with only that script). Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884280 Share on other sites More sharing options...
squiblo Posted July 27, 2009 Author Share Posted July 27, 2009 i have session_start(); at the top of the page but i dont know how to correct what i have done Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884283 Share on other sites More sharing options...
squiblo Posted July 27, 2009 Author Share Posted July 27, 2009 basically i wont to move this text 30px from top if logged in: <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <font style="font-size:13px" color="#000000" face="Arial">Squiblo © 2009</font></div> Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884296 Share on other sites More sharing options...
squiblo Posted July 27, 2009 Author Share Posted July 27, 2009 <?php echo '<div id="wb_Shape2" style="position:absolute;left:54px;width:793px;height:412px;z-index:10;'; if(isset($_SESSION['myusername'])) { echo 'top:200px;'; } else { echo 'top:170px;'; } echo '" align="center"> <img src="/Images/body_img.jpg" id="Shape2" align="top" alt="" title="" border="0" width="793" height="412"></div>'; ?> <div id="menubar" style="position:absolute;left:54px;top:168px;width:793px;height:30px;z-index:13" align="center"> <?php if(isset($_SESSION['myusername'])) echo '<img src="/Images/header_img.jpg" id="menubar" align="top" alt="" title="" border="0" width="793" height="30">'; ?> </div> Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884305 Share on other sites More sharing options...
waynew Posted July 27, 2009 Share Posted July 27, 2009 Whenever I'm creating an app that changes appearance in accordance with whether the user is logged in or not, I check whether they are logged in at the beginning of the code, in order to male things easier: $logged_in = false; //IF statement determining whether user is logged in or not - assigning true or false Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884312 Share on other sites More sharing options...
squiblo Posted July 27, 2009 Author Share Posted July 27, 2009 i tried something different but there is an error i cant seem to do this with text: <div id="copyright" style="position:absolute;left:55px;top:628px;width:150px;height:44px;z-index:32" align="left"> <?php if(isset($_SESSION['myusername'])) echo '<font style="font-size:13px" color="#000000" face="Arial">Squiblo &#169; 2009'; ?> </font></div> <div id="copyright" style="position:absolute;left:55px;top:588px;width:150px;height:44px;z-index:32" align="left"> <?php { else } ?> echo '<font style="font-size:13px" color="#000000" face="Arial">Squiblo &#169; 2009'; </font></div> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/167672-what-is-wrong/#findComment-884317 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.