chrisjunkie Posted March 22, 2006 Share Posted March 22, 2006 I didnt know what to search for but i want to change [a href=\"http://sitename/content/womd/index.html\" target=\"_blank\"]http://sitename/content/womd/index.html[/a] to [a href=\"http://sitename/content.php?=womd\" target=\"_blank\"]http://sitename/content.php?content=womd[/a] but i do not know how!ANY HELP GREATLY APPRECIATED!!! Quote Link to comment Share on other sites More sharing options...
phporcaffeine Posted March 22, 2006 Share Posted March 22, 2006 I assume that you are talking about:User clicks a link and takes them to point A but you want the address bar to read as if it took the user to point B?PHP doesn't have the ability to do this. You would want to look into Apache's mod_rewrite, but I don't know that it would help much since your rerwite needs to rewrite with a populated variable. Quote Link to comment Share on other sites More sharing options...
chrisjunkie Posted March 22, 2006 Author Share Posted March 22, 2006 [!--quoteo(post=357192:date=Mar 22 2006, 03:53 PM:name=phpORcaffine)--][div class=\'quotetop\']QUOTE(phpORcaffine @ Mar 22 2006, 03:53 PM) [snapback]357192[/snapback][/div][div class=\'quotemain\'][!--quotec--]I assume that you are talking about:User clicks a link and takes them to point A but you want the address bar to read as if it took the user to point B?[/quote]Thanks for the reply but i want to do something similar to phpnuke. When you type [a href=\"http://sitename/modules.php?name=downloads\" target=\"_blank\"]http://sitename/modules.php?name=downloads[/a] it takes you to /modules/Downloads/index.php How do i do this?CheersChris Quote Link to comment Share on other sites More sharing options...
Prismatic Posted March 22, 2006 Share Posted March 22, 2006 here, this code will get you going in the right direction..make this content.php[code]<?php$content = $_GET['content'];if($content == "womd"){ include("http://sitename/content/womd/index.html"){}else{ echo "Sorry, unknown content view specified!";}?>[/code]then go to content.php?content=womd to test :) Quote Link to comment Share on other sites More sharing options...
chrisjunkie Posted March 22, 2006 Author Share Posted March 22, 2006 Thanks! but i want multiple content so how would i intergrate the example below[code]$content="content/$name/index.html" [/code]$name might be womd Quote Link to comment Share on other sites More sharing options...
Prismatic Posted March 22, 2006 Share Posted March 22, 2006 Like this:[code]<?php$name = $_GET['name'];$content ="content/$name/index.html"if($name){ include($content){}else{ echo "Sorry, unknown name specified!";}?>[/code]Make that content.php and do this: content.php?name=womd to test Quote Link to comment Share on other sites More sharing options...
chrisjunkie Posted March 22, 2006 Author Share Posted March 22, 2006 Thanks prismatic that is EXACTLY what I was looking for!Thanks again, Chris EDIT: It doesnt work :( WHATS WRONG? :'( Quote Link to comment Share on other sites More sharing options...
Prismatic Posted March 22, 2006 Share Posted March 22, 2006 [!--quoteo(post=357215:date=Mar 22 2006, 02:10 AM:name=chrisjunkie)--][div class=\'quotetop\']QUOTE(chrisjunkie @ Mar 22 2006, 02:10 AM) [snapback]357215[/snapback][/div][div class=\'quotemain\'][!--quotec--]Thanks prismatic that is EXACTLY what I was looking for!Thanks again, Chris EDIT: It doesnt work :( WHATS WRONG? :'([/quote]Oops, forgot a ; at the end of this line >> $content ="content/$name/index.html" 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.