+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: PHP Website Offline

  1. #1
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    PHP Website Offline

    Code:
    PHP Code:
    <?phprequire('config.php');if($maintenance_mode == "1"){  include('maintenance.php');  exit();} else {  if($construction_mode == "1"){    include('construction.php');    exit();  } else {?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>trial1 - anasianscreations</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="style.css" media="screen"/> </head> <body> <!--ContentHere--> </body> </html>
    PHP Code:
    <?php  }}?>

    I want to have this part in a file called: 'check.php'
    PHP Code:
    <?php
    require('config.php');

    if(
    $maintenance_mode == "1"){
      include(
    'maintenance.php');
      exit();
    } else {
      if(
    $construction_mode == "1"){
        include(
    'construction.php');
        exit();
      } else {
    ?>
    but when I do an include, it gives me an error that an unexpected end, since I thinks I didn't finish the end brackets; what can I do to fix this?

  2. #2
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP Website Offline

    PHP Code:
    } else {
    ?> 
    Gonna have anything after that?

  3. #3
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: PHP Website Offline

    the code basically goes like this:

    look into config.php if $variable_1 is 1, then include link1 and exit page; else look for $variable_2 if 1, then include link2 and exit page, else display the rest of the contents on that page(HTML)

    at the end I end the brackets }}

  4. #4
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP Website Offline

    So you gonna do like:

    PHP Code:
    <?php
    require('config.php');

    if(
    $maintenance_mode == "1"){
      include(
    'maintenance.php');
      exit();
    } else {
      if(
    $construction_mode == "1"){
        include(
    'construction.php');
        exit();
      } else {
    ?>
    html code
    <?php }} ?>
    ?

    I suggest this:

    PHP Code:
    <?php
    require('config.php');

    if(
    $maintenance_mode == "1"){
      include(
    'maintenance.php');
      exit();
    } elseif(
    $construction_mode == "1") {
        include(
    'construction.php');
        exit();
      } else {
    ?>
    html code
    <?php ?>
    Last edited by galaxyAbstractor; 11-10-2008 at 03:34 PM.

  5. #5
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: PHP Website Offline

    yeah like that but I want to place the PHP code is a seperate file(check.php, check_end.php) so if I change them I don't have to manually do everypage

    but when I tried that it ended up in an unexpected END error

  6. #6
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP Website Offline

    Quote Originally Posted by diabolo View Post
    yeah like that but I want to place the PHP code is a seperate file(check.php, check_end.php) so if I change them I don't have to manually do everypage

    but when I tried that it ended up in an unexpected END error
    Did you try the code I suggested?

  7. #7
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: PHP Website Offline

    I tried what you suggested, it works when I hardcode it in, but I also tried it using:
    Code:
    <?php include('check.php');?>
    <html>
    <?php include('check_end.php'); ?>
    and that came up with
    Code:
    Parse error: syntax error, unexpected $end in C:\xampp\htdocs\aac\check.php on line 11

  8. #8
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP Website Offline

    Quote Originally Posted by diabolo View Post
    I tried what you suggested, it works when I hardcode it in, but I also tried it using:
    Code:
    <?php include('check.php');?>
    <html>
    <?php include('check_end.php'); ?>
    and that came up with
    Code:
    Parse error: syntax error, unexpected $end in C:\xampp\htdocs\aac\check.php on line 11
    Could you post line 11 please?

  9. #9
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: PHP Website Offline

    10: } else {
    11: ?>

  10. #10
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: PHP Website Offline

    hmmmm, try deleting the php tags from the files included.

    Because wouldn't

    <?php
    include('somefile.php');
    ?>

    become:

    <?php
    <?php
    Content of somefile.php
    ?>
    ?>

    ?

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Advertise your website!
    By Scott B in forum The Marketplace
    Replies: 10
    Last Post: 02-29-2008, 08:43 PM
  2. My Website is Offline
    By cgrim29588 in forum Free Hosting
    Replies: 3
    Last Post: 02-26-2008, 02:52 PM
  3. Website design XML? PHP?
    By epoclaen in forum Graphics & Webdesign
    Replies: 6
    Last Post: 12-13-2007, 02:50 AM
  4. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  5. PHP WEbsite problem.
    By Darthvader in forum Free Hosting
    Replies: 2
    Last Post: 10-07-2007, 08:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers