Log in

View Full Version : Site open/close



Hayd93
07-01-2008, 06:27 PM
If possible could someone get me a script to open/close a site eg when i click a link saying close it will redirect to another page then when i clcik open it will then go back to my normal home page

+ rep will be givven

Moved by nvrspk4 (Assistant General Manager) from Designing and Development. Please post in the correct forum.

LegendOfNoob
07-01-2008, 07:16 PM
personally i would do ip ban with redirect
where when on it goes to page when on maitence it gives edited bann screen to blank then redirects to a maitence page you set in another directory

this should help if your looking for another way
http://www.webmasterworld.com/forum92/3204.htm

php.net
07-01-2008, 07:31 PM
personally i would do ip ban with redirect
where when on it goes to page when on maitence it gives edited bann screen to blank then redirects to a maitence page you set in another directory

this should help if your looking for another way
http://www.webmasterworld.com/forum92/3204.htm

Why would you do an IP Ban to put a site on maintenance, lol? I think you don't understand what he means.

Just a basic database with 'closed'. Then make a script and if it's 'closed', you direct to a maintenance page else (nothing lol).

Then put a drop-down on a button on a password protected page called Close / Unclose for example and it would just update your database.

I would write something out but I'm a bit busy atm, sorry.

[Oli]
07-01-2008, 08:37 PM
In my TemplateNation system, I've got a maintenance option (well admins have).

And basicly it uses mysql so i have a db called maintenance, in which I've got a record set to 'no' and a form to set to yes/no etc etc.

Then on my index.php I've got the ?page= navigation so I did this:




if($sql["maintenance"] == "no"){
//php nav system
}else{
//display maintenance page
}



(I also added something so that maintenance doesn't affect admins)

If thats what's you want, pm me ;)

Hayd93
07-01-2008, 09:11 PM
;4336361']In my TemplateNation system, I've got a maintenance option (well admins have).

And basicly it uses mysql so i have a db called maintenance, in which I've got a record set to 'no' and a form to set to yes/no etc etc.

Then on my index.php I've got the ?page= navigation so I did this:




if($sql["maintenance"] == "no"){
//php nav system
}else{
//display maintenance page
}



(I also added something so that maintenance doesn't affect admins)

If thats what's you want, pm me ;)

yep got it exacly i will pm

Hypertext
08-01-2008, 03:34 AM
Providing you know PHP, i've always done $siteoffline = yes/no; in globals.php or settings.php or whatever, and then had in your header.php file and if statement regarding wether it is a yes, if so kill ur script with die() or kill() both the same I believe, and something like kill(Site is offline) die(Site is offline)
Now i'm not an amazing php'r so umm verify this with someone better first.

Mr Macro
14-01-2008, 08:52 PM
<?php

if (isset($_POST['site'])){

$site = $_POST['site'];
if ($site == 'on'){
}else{
die('Sorry the webpage is closed.');
}
}else{

echo("<form>
<option value='on' name='on' /><br />
<option value-'off' name='off' /><br />
<input type='submit' name='site' value='Choose' /></form>");
}
?>
That should work, not tested.

lolwut
16-01-2008, 06:45 PM
I think there's something like this in the Web Tutorials.
If there isn't, PM me and I'd be more than happy to make something for you.

Jme
16-01-2008, 07:27 PM
<?php

if (isset($_POST['site'])){

$site = $_POST['site'];
if ($site == 'on'){
}else{
die('Sorry the webpage is closed.');
}
}else{

echo("<form>
<option value='on' name='on' /><br />
<option value-'off' name='off' /><br />
<input type='submit' name='site' value='Choose' /></form>");
}
?>
That should work, not tested.

LOL? that will only display the message for that instance, when the form is submitted, you need to use mysql to insert a value into the database and call the value to see if it's open/closed and then display the site or maintainence page. I posted a tutorial about this on chf, but it doens't let me post tutorials on here for some wierd reason so i can't post it on here.

Mr Macro
17-01-2008, 10:54 AM
Oh yeah, i just though ot that Lmao made my self look a bit of a **** there i think lol.

Want to hide these adverts? Register an account for free!