ArizonaJohn Posted June 10, 2010 Share Posted June 10, 2010 Hello, I'm trying to use the code below to make the <a href='http://www...com/.../footervote.php'>Vote</a> link appear if a user logs in and a user shows up in the function getEditorsList(). The vote link only appears if the browser is refreshed. Any idea how I could make the vote link appear without having to refresh the browser? Thanks in advance, John index.php: <?php require_once "header.php"; //content include "login.php"; // more content require_once "footer.php"; ?> In header.php: <?php error_reporting(0); session_start(); require_once ('db_connect.inc.php'); require_once ("function.inc.php"); $seed="0dAfghRqSTgx"; $domain = "...com"; $editors = getEditorsList(); foreach($editors as $editor) { $editorids[] = $editor['loginid']; } if(in_array($_SESSION['loginid'], $editorids)) { echo "<div class='footervote'><a href='http://www...com/.../footervote.php'>Vote</a></div>"; } ?> login.php: <?php if (!isLoggedIn()) { if (isset($_POST['cmdlogin'])) { if (checkLogin($_POST['username'], $_POST['password'])) { show_userbox(); } else { echo "Incorrect Login information !"; show_loginform(); } } else { show_loginform(); } } else { show_userbox(); } ?> Link to comment https://forums.phpfreaks.com/topic/204375-making-a-function-activated-link-appear-without-having-to-refresh-browser/ Share on other sites More sharing options...
JasonLewis Posted June 10, 2010 Share Posted June 10, 2010 So your login code, is it re-directing the browser after logging the user in? Or if you try and refresh, does the browser alert you to say that you are sending POST data again? You'll need to re-direct the browser to the same page you are on, basically refreshing the page but the user won't notice a thing. Link to comment https://forums.phpfreaks.com/topic/204375-making-a-function-activated-link-appear-without-having-to-refresh-browser/#findComment-1070334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.