Jump to content

Kris.thedriftdemon

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Kris.thedriftdemon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok! My next question is how could I implement this with SEO friendly URIs? +Thank you all! I know have a greater understanding of PHP.
  2. Thank you so much ignace! I got it working.
  3. Sorry ignace! I didn't see you comment before I replied.
  4. Ok! Not necessarily the answer I was looking for, but I understand. What I was thinking about was something like this. <a href="index.php?act=$page1"><li>About</li></a> <a href="index.php?act=$page2"><li>Contact</li></a> <?php $page1 = include("includes/about.php") ; $page2 = include("includes/contact.php") ; ?> <?php $choice=$_GET['act']; switch($choice) { case '$page1': if(file_exists('$page1')); break; case '$page2': if(file_exists('$page2')); break; default; include('$page1'); } ?>
  5. Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a switch function to reduce redundancies, and to efficaciously implement the script on to other sites. <?php $choice=$_GET['act']; switch($choice) { case 'about': if(file_exists("includes/about.php")) include("includes/about.php"); break; case 'contact': if(file_exists("includes/contact.php")) include("includes/contact.php"); break; default; include("includes/about.php"); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.