Jump to content

A script to change content for a variable


zbrahead

Recommended Posts

[code]<?php
#Set Variables to content for tables depending on $page variable.
if($page = home )
    {$headid1 = "Welcome to our home-page This is your gateway to the rest of the site";
    $msgid1 = "Welcome to Era-Games Homepage, we hope you find many things to do here,our demos our currently locked down because of the people exploiting this generous service";
    $headid2 = "An Apology";
    $msgid2 = "We apologize for the adverts on this screen and as soon as possible we are working to remove these.";
    $headbelow1 = "";
    $msgbelow1 = "";
    $headbelow2 = "";
    $msgbelow2 = "";}
else
if($page = about )
    {$headid1 = "Welcome to the about us page";
    $msgid1 = "";
    $headid2 = "";
    $headbelow1 = "";
    $msgbelow1 = "";
    $headbelow2 = "";
    $msgbelow2 = "";}
else
if( $page = forum )
    { header( "location:http://eragames2.byethost7.com/forum/"); exit();
    }
else
if( $page = news )
    { header( "location:http://eragames2.byethost7.com/news/"); exit();
    }
else
if( $page = contact )
    {$headid1 = "Welcome to the Contact Us page";
    $msgid1 = "";
    $msgid2 = ""
    $headid2 = "";
    $headbelow1 = "";
    $msgbelow1 = "";
    $headbelow2 = "";
    $msgbelow2 = "";}
?> [/code]

$page is ascertained by an extensionj onto the url in ?page=home etc.

please help!!!!
Link to comment
Share on other sites

The comparison operator is the double equal sign "==", you have a single equal sign in all of your "if" statements. Change it to a double equal.

You're also assuming that register_globals is enabled. You should use $_GET['page'] instead.

Ken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.