Php Url adjustment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manels11
Forum Newbie
Posts: 3
Joined: Wed Aug 20, 2008 10:23 am

Php Url adjustment

Post by manels11 »

Hi I'm very noob with php but here's what I'm trying to do.

I have a webpage that contains an article called http://www.mytest.com/article1.txt.

When someone loads this page they are actually loading this code.

Code: Select all

<?php
if ($_REQUEST['showComments'] == true){
    echo '[include:/inc/header.php]';
}else{
    echo '[include:/inc/regular.php]';
}
?>
Which basically I have a two separate pages that load. One with comments on the article which is header.php and one without which is regular.php that has a link that looks like this.

Code: Select all

<a href="<?php echo $_SERVER['PHP_SELF']; ?>?showComments=true">Post/Read Comments</a>
So if a user loads the page for the first time they will be directed to regular.php. Which then if they want to read the comments they click the link above which sends them back through the initial page that then redirects them to header.php.

My delima is I'm is the link. I need the link they click to actually show

Code: Select all

<a href="<?php echo $_SERVER['PHP_SELF']; ?>?keepThis=true&TB_iframe=true&height=650&width=980">Post/Read Comments</a>
However I still want it to load up the header.php file because they have clicked the link to see the comments.

I hope this makes sense can anyone point me in the right direction?

Thanks in advance,

Josh
Last edited by manels11 on Wed Aug 20, 2008 10:36 am, edited 1 time in total.
manels11
Forum Newbie
Posts: 3
Joined: Wed Aug 20, 2008 10:23 am

Re: Php Url adjustment

Post by manels11 »

Forgot to mention this code [include:/inc/header.php] is a token from our content manegment system that basically just goes and grabs header.php and displays it.
manels11
Forum Newbie
Posts: 3
Joined: Wed Aug 20, 2008 10:23 am

Re: Php Url adjustment

Post by manels11 »

Bump... Is it possible to do what I'm trying to do? or alot of coding?
Post Reply