Jump to content

Archived

This topic is now archived and is closed to further replies.

chrisjunkie

.php?=content

Recommended Posts

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!!!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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?

Cheers
Chris

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Thanks prismatic that is EXACTLY what I was looking for!
Thanks again, Chris

EDIT: It doesnt work :( WHATS WRONG? :'(

Share this post


Link to post
Share on other sites
[!--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"

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.