Hello,
I've built a little site w/ mysql and php, based on 5 if statements & one else statment. Really simple, functional, stuff.
Each of my statements are starting out with 5 lines to connect to my database, how can I make a sort of, global login so I'm not repeating it every single time as I grow and expand the site.
<?php
if (isset($_GET['one'])) {
//5 mysql_connect lines
//some code
}
if (isset($_GET['two'])) {
//5 mysql_connect lines
//some code
}
//etc...
else {
//5 mysql_connect lines
//some code
}
?>
I'm very novice at this so it would mean a lot if you could integrate the answer w/ the code provided.
Thank you in advance,