Jump to content

.php?=content


chrisjunkie

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!!!
Link to comment
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.
Link to comment
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
Link to comment
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 :)
Link to comment
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
Link to comment
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"
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.