PHP code intergration

Hey everyone i just developed this code. But i am having problems figuring out how to use it in my site easily.

Here is what i have
Part 1
[php]<?php require_once('conn.php'); ?>

<? if($mode=="edit" && $bypas=="kadmin"){ echo "Your site is in edit mode, You have access to see it though"; } elseif($mode=="edit"){ echo "Im Sorry Our Site Is Under Construction Please Check Back Soon"; } else{ echo"This is your live site"; } ?>

[/php]

Part 2
at some point i will have this connect to a MYSQL DB and get data regarding the above script

[php]

<? $mode="noedit"; ?> <? $bypas=$_GET['or']; ?>

[/php]

Here is the problem i am having i want to add this to all my pages so that if i want to put the site under construction i can do so with out my clients seeing what i am doing or more importantly messing up.
as you can see in the script i have a over ride so that i can view the page that im working on with out the whole world seeing it. and the final part is that if the site is not under construction it will show everyone the site.

my sites have php, jquerry, java script, css and HTML

Here is a quick little snip it

a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } -->
<?php require_once('../ssi/header2.php'); ?>
<?php require_once('../ssi/marquee.php'); ?>

Poll

<?php require_once('../ssi/poll.php'); ?>
    <h2>Bulletins...</h2>

How do i add the to my site with out having to do a lot of recoding?

Hi there,

What you would do is put the code that you have above and place it in a file let’s say precheck.php. Then in all pages just include_once that script and all of your pages will include that script at the beginning so you may check all of your pages.

Hope that helps.

OpzMaster
Thank you for the response, that will work but the next problem I’m having I have the option to show the site in two places in my code how do get it to show me everything inside of the body tags if A it has the right username to over right the site construction or B it is not under construction?

.

Sponsor our Newsletter | Privacy Policy | Terms of Service