Using double ? in php statement
Posted: Fri Aug 13, 2004 5:27 pm
I am working on code that pulls other php pages into it according to what link you click. With simple pages, it is no problem. Just so you get the whole picture, it goes like this:
Then there is an if, else if statement that uses the include statement to add the different pages into the template according to which link you click.
Ex.
original= login.php
replaced with index.php?x=1
The problem comes when forms or links that exist on the internal pages are clicked. Some have the PHP_SELF command and once the pages are parsed, if they refer to themselves, they 'break out' of the template. I replaced the php_self and references to the pages themselves with the above code and it worked fine, as long as the links or forms don't have ? in them already.
So, if I have a form action that is like login.php?action=blahblahblah
I can't replace the login.php with index.php?x=1. Does anyone have any ideas on how I can accomplish my goal, which is to have a template page that pulls in other pages in php, and have those pages work within the template?
Code: Select all
<a href=index.php?x=1>click her</a>Ex.
original= login.php
replaced with index.php?x=1
The problem comes when forms or links that exist on the internal pages are clicked. Some have the PHP_SELF command and once the pages are parsed, if they refer to themselves, they 'break out' of the template. I replaced the php_self and references to the pages themselves with the above code and it worked fine, as long as the links or forms don't have ? in them already.
So, if I have a form action that is like login.php?action=blahblahblah
I can't replace the login.php with index.php?x=1. Does anyone have any ideas on how I can accomplish my goal, which is to have a template page that pulls in other pages in php, and have those pages work within the template?