Forum Moderators: coopster
Im using the php include to get that $PAGE in the url.
So Far its workign well, but for some reason its only catching "index.php?PAGE=news.php?article=1" and everything after the "&" is being cut off, any ideas?
That system sounds very awkward and clunky. Can you do something like "index.php?page=news&article=1&comments=1"? This would make your system more secure (make sure to error on or strip out any characters such as "." and "/" in your page variable, otherwise you're just begging for someone to try hacking your site). This should also solve the problem you're having with the second? in the URL.
But, everything works fine... I used the full word variable to give you an example, but yea im using the index.php as a basic template and Im using php Include to include the other pages ie.. news.php , archives.php.. etc... So it all works well but the variables after the & keep getting cut off and I have no clue why.
So when I have a link thats directed to
index.php?page=news.php?id=1&comment=0
Its only coming out as
index.php?page=news.php?id=1
So its reading the first variable but everything after that & is just getting cut off :S
The reason $page isnt picking up the entire "index.php?PAGE=news.php?article=1&comment=1" is because the original index.php?Page is picking up "news.php?aritcle=1" and since it hits the & its recognizing it as another variable.
Anyway i can have the page variable pick up the entire line
You will need to split that up into whatever bits you want. The other option is change it so you have everything in $_GET variables i.e.
index.php?PAGE=news.php change? for & article=1&comments=1
Then everything is available in $_GET
I figured out that I can get that stored variables thats passed through the link the & over? did work, now the only problem im having now is that the Included file cant get those variables... I can get them to come up onthe document holding the php include, but not the included file
$_GET['PAGE'] = $page;
It all depends on what is in the included file and how you are using that included file i.e. if your included file is just there to provide output, but doesn't take any input then you cant pass the variables over. If your included file takes input then you can pass variables back to it the same way you would pass anything back to that script.
http://example.com/index.php4?pa=home.php
http://example.com/index.php4?pa=news.php?s=1&c=1&page=17
[edited by: coopster at 10:18 pm (utc) on Oct. 15, 2007]
[edit reason] examplified, no personal urls please [/edit]
I've noticed some weird things, with in these pages I have a news system I developed...
both the news.php and home.php page,,, Now my news system works and all, now in one of hte "articles" to test i made a while ($t<100) script , on the home.php it works and echos 1-100; but on the news.php page it comes up as >> "; }?> << with out hte <<>>'s im really stumped now... its the same mysql/php display code too