Reduce redundancies in switch functions?


Posted on 16th Feb 2014 07:03 pm by admin

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.
Code:
<?php

Did you know?Explore Trending and Topic pages for more stories like this.
$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"); }

?>
No comments posted yet

Your Answer:

Login to answer
336 Like 12 Dislike
Previous forums Next forums
Other forums

Delete records not in top 15
Hi,

I'm creating a hall of fame page in my game and the page will only display the top 15 sco

Export hangs
Hi all, please help

I have a Oracle 10.2.0.3.0 database. When I want to query the dba_segmen

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

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

Problems with returning true or false in eval()'d code
Hi guys,

Would appreciate some help with a problem when running eval() on a function that sho

confused between ' ' and " "
there is a php i set:
$begin_date_query = mysql_query( "SELECT SUBDATE(due_date, INTERVAL $d

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash