bmopro Posted January 10, 2007 Share Posted January 10, 2007 Here is what i am trying to do...[code]<?phpif(isset($_POST0['edit_address'])){include 'user_info.php#address';exit():}?>[/code]I want to use drop down menus to keep it clean, and so when people go to edit their account, there isn't a ton of links.When i hit the edit input button i get the error that the page does not exist. How can i use anchor tags in this way?Thanks for the Help!Brian Quote Link to comment Share on other sites More sharing options...
taith Posted January 10, 2007 Share Posted January 10, 2007 the include() attaches files, it doesnt anchor to the webpage itself for that, you'll need to either header() there, or have a link on the page to it. Quote Link to comment Share on other sites More sharing options...
bmopro Posted January 10, 2007 Author Share Posted January 10, 2007 taith thank for the reply!How would i do it with a header?Is there a way to send a session variable, so when the page is includedin the header of that page it would jump to a point in that page depending on that session variable.Hope that makes sense!ThanksBrian Quote Link to comment Share on other sites More sharing options...
bmopro Posted January 10, 2007 Author Share Posted January 10, 2007 Like this?...if($_SESSION['edit'] == 'address'){header("Location: http://www.example.com/user_edit.php#address");}brian Quote Link to comment Share on other sites More sharing options...
taith Posted January 10, 2007 Share Posted January 10, 2007 do yourself a favor... use this... saves SOOO much time ;-)[code]<?function redirect($filename=".?op=main",$delay="0",$die="0"){ if((!headers_sent())&&($delay=="0")) header('Location: '.$filename); elseif($delay=="0"){ echo '<script type="text/javascript">'; echo 'window.location.href="'.$filename.'";'; echo '</script>'; echo '<noscript>'; echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />'; echo '<noscript>'; }else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />'; if($die=="0") exit;}?>[/code][code]if(!empty($_SESSION[edit])) redirect("yourpage.php?op=$_SESSION[edit]#youranchor");[/code]like that? Quote Link to comment Share on other sites More sharing options...
bmopro Posted January 10, 2007 Author Share Posted January 10, 2007 taithThanks so much for the function!!!!!!!This save much time!brian 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.