j05hr Posted November 2, 2009 Share Posted November 2, 2009 I'm not sure how to explain this, I'm following this tutorial on how to make a CMS but with the code I'm following they have a navigation bar but I don't, for my page I want to be able to click a button inside the content and then the content reloads with nothing in it. How can I do this? Here is my code... <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php if (isset($_GET['subj'])) { $sel_subj = $_GET['subj']; $sel_page = ""; } elseif (isset($_GET['page'])) { $sel_subj= ""; $sel_page = $_GET['page']; } else { $sel_subj = ""; $sel_page = ""; } ?> <?php include("includes/header.php"); ?> <div id="content"> <h2> Buying Page</h2> <?php $subject_set = get_all_subjects(); // 5. Use returned data while ($subject = mysql_fetch_array($subject_set)) { ?> <div class="menu-name"> <?php echo "<a href=\"content.php?page=" . urlencode($subject["id"]) . "\">{$subject["menu_name"]}</a>"; ?> </div> <div class="buying-text"> <?php echo "{$subject["content"]}"; ?> </div> <div class="image"> <?php echo "{$subject["image"]}"; ?> </div> <?php } ?> </div> <?php require("includes/footer.php"); ?> So when they click on the button in the menu-class div I want it to reset the page if that makes sense? Thanks, Josh Quote Link to comment Share on other sites More sharing options...
j05hr Posted November 2, 2009 Author Share Posted November 2, 2009 Anyone? Quote Link to comment Share on other sites More sharing options...
ILMV Posted November 2, 2009 Share Posted November 2, 2009 Hmmm, need more clarification as I do not fully understand your problem. Quote Link to comment Share on other sites More sharing options...
j05hr Posted November 2, 2009 Author Share Posted November 2, 2009 Well what happens is, the divs are collecting properties information from the database, when you click on the link, I want it to take you to the specific property you clicked on. But I'm not sure what code I need to make this happen. Quote Link to comment Share on other sites More sharing options...
dreamwest Posted November 2, 2009 Share Posted November 2, 2009 function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect('/'); //path to redirect to Quote Link to comment 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.