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 Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/ 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. Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/#findComment-157548 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 Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/#findComment-157561 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 Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/#findComment-157565 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? Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/#findComment-157575 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 Link to comment https://forums.phpfreaks.com/topic/33628-using-include-with-anchor-tag/#findComment-157582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.