Jump to content

Parse error: parse error, unexpected T_REQUIRE in e:\domains\p\prowebdesigns.co


rofl90

Recommended Posts

I had a header error so I used ob_start(), now it's giving me an unexpected require error :S

 

Havn't got a clue.

 

<?php
ob_start()
require("config.php"); //Includes the configuration file we made earlier. 
if(!isset($_POST['login'])){ //If they haven't posted the login form...
    echo("Please enter the password to edit the site status!<br />
    <form method=\"post\">
    Password: <input type=\"password\" name=\"password\">
    <br />
    <input type=\"submit\" value=\"Login\" name=\"login\">
    </form>");
    //^^ Then show the login form so they can login.
}else{ //If they have posted the login form...
    $s_password = $_POST['password']; //Change the password variable to something easier to handle.
    if($s_password != $set_password){ //If the supplied password doens't match the set password in the configuration file...
        die("You did not enter the correct password!"); //Tell them so, and close the session so they can't edit anything.
    } //Ends the if statement (the supplied password didn't match the set one)
    setcookie("loggedin","yes"); //Sets a cookie with the users information in, will be used in the next step.
    header("Location: edit.php"); //Sends them off to the edit info page.
} //End the if statement (the login from hasn't been posted)
mysql_close(); //Close any remaining MySQL connections.
?> 

Link to comment
Share on other sites

Hmm, now its even wierder now i have this i got the rest working but when its online heres my code:

but it gives me this error:

Warning: Cannot modify header information - headers already sent by (output started at e:\domains\p\prowebdesigns.co.uk\user\htdocs\config.php:13) in e:\domains\p\prowebdesigns.co.uk\user\htdocs\index.php on line 4

i read the headers thing but didn't really understand it.

<?php
require("config.php"); //Includes the configuration file we made earlier.
if($i->status == "on"){ //If the site status is set to on...
    header('Location: http://www.prowebdesigns.co.uk/'); //Then forward the user to the online page.
}
elseif($i->status == "off"){ //If the site status is set to off...
    echo("The site is currently in offline mode!<br />The reason for this is: <b>" . $i->offmsg . "</b><br />We appologise for any disturbance this may cause.");
    //^^ Then tell them so, and show the offline message.
} //Closes the statement.
mysql_close(); //Stops any MySQL connections we had running.
?> 

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.