GET vs SUBMIT Button to show sections on one index.php page?
Posted on
16th Feb 2014 07:03 pm by
admin
Just curious if one of these ways is better (i.e. more efficient) than the other.
I have an index.php page where there is a menu across the top with 5 choices. For example, HOME | MONKEYS | CATS | DOGS | KANGAROOS.
I have ALL the code for those 5 pages on that single index.php file. Now is it better to...
1. Use FORM SUBMIT BUTTONS for each menu option. So I'd have the action of the form be "index.php" and then code like this for the menu...
Code: <input type='submit' name='submit' value='HOME' ><input type='submit' name='submit' value='MONKEYS' >
And then I would have IF statements to see which Submit button was clicked and show the right info accordingly.
OR
2. Use appended URLs and then use GET to see which info should show, as in...
Code: <a href="index.php?page=home">HOME</a>|<a href="index.php?page=monkeys">MONKEYS</a> (etc, etc)
And then have IF statements using GET to check the URL and show the right info accordingly.
I'm not sure one way is better than the other, but just curious if anyone has any thoughts. Like maybe one of these processes in more server intensive than the other??
NOTE: If I use Google Analytics, I guess might help to see appended URLs to know which page got more hits, rather than just seeing info for index.php without knowing if they visited MONKEYS, or CATS or whatever. But please answer the question as if Google Analytics was not relevant.
Thanks
No comments posted yet
Your Answer:
Login to answer
316
33
Other forums
Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
Hello Experts,
In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.
turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f
Strange PHP/mySQL error ... am I just tired?
Code: <?
## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostNam
Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t
C++ API to Oracle dB
I need to perform a select command to the Oracle dB to obtain information from a table.
What libr
article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on
IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with
problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin
need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style
want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea o