Simple php question

I was wondering if anyone from here could help…

I’m building a secure area that lets me manage some user submissions to my website, the thing is it’s pretty basic at the moment and i’d like to tweak it a bit.

Currently i have two seperate files to list old submissions and new submissions. The only difference between them is the title and the sql query.

Rather than have a seperate file, i’d like to change the links to the files in my navigation template to submissions.php?query=old and submissions.php?query=new.

I’m guessing if i do this all i need to do is set a few variables in the submissions.php file that change depending on which of the links is clicked?

Which brings me to my next question, how would i set two variables within a single if statement? I need to set a variable to change the title of the page and the variable to change the query and rather than have 2 if statements i’d like to get it done in one…

Any ideas, thanks.
Andrew

I am a little confused on what you are trying to ask, but I think you are wondering something like this??

submissions.php?query=old&title=blahblah

[php]<?
$query = $_GET[‘query’];
$title = $_GET[‘title’];

if($query = “old” && and title=“blahblaH”)
{
//code
}
else
{
//code
}
?>[/php]
Does that help at all??
If not please try to clarify what you are asking. Thanks.

That’s exactly what i want.

Thanks ;D

Sponsor our Newsletter | Privacy Policy | Terms of Service