Page 1 of 1

Using double ? in php statement

Posted: Fri Aug 13, 2004 5:27 pm
by jntcomputers
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:

Code: Select all

<a href=index.php?x=1>click her</a>
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?

Posted: Fri Aug 13, 2004 5:37 pm
by nigma
if you do:

Code: Select all

index.php?x=1&action=blahblah
then include whatever page is associated with x being 1 (login.php you said) and things should work if you reference action correctly.

Posted: Sat Aug 14, 2004 7:12 am
by m3mn0n
And more values can be added with more &'s.

The first variable is ? and the rest are all &.