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.