Hiro Posted June 18, 2009 Share Posted June 18, 2009 I've been messing around with MySQL and PHP, and installed a login system (http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/) for my site. I will need to tweak this code later for my own uses, but for now I'm having problems. I use iframes on my site, and need the login system links to display in my frames. However once I log in, the logout buttons give a 404, and the PHP script won't work with iframes. <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ echo "<h1>Logged In</h1>"; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"php\userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"php\useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"php\admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"php\process.php\">Logout</a>]"; } else{ ?> That's the code for the user CP once you're logged in. I need the links to points to the frame "content", so I tried to add target="content in the logout link like this: echo "[<a href=\"php\process.php\" target="content">Logout</a>]"; but it gave me this error "Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/www/site/index.html on line 96" How can I use iframes with PHP? Also - I logged in with Google Chrome (I usually use firefox), and hovered over the logout link, and the link was "http://musevox.awardspace.biz/php/process.php". In firefox, it reads "http://musevox.awardspace.biz/php\process.php". It will function correctly in Chrome, but will 404 on Firefox. Link to comment https://forums.phpfreaks.com/topic/162718-solved-problems-with-login-system-and-iframes/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 18, 2009 Share Posted June 18, 2009 \ is a Windows specific file system path separator. / is a path separator in a URL. You should only be using / in a link. Link to comment https://forums.phpfreaks.com/topic/162718-solved-problems-with-login-system-and-iframes/#findComment-858708 Share on other sites More sharing options...
Hiro Posted June 21, 2009 Author Share Posted June 21, 2009 Thanks PFMaBiSmAd, I replaced the parts in the url that were \ with /, but left everything else the same. echo "[<a href=\"php/process.php\">Logout</a>]"; works. Link to comment https://forums.phpfreaks.com/topic/162718-solved-problems-with-login-system-and-iframes/#findComment-860526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.