I have a login that has been working well on my test machine but now I have uploaded my site onto bluehost but its not working. Here is a copy of the php files
<?php
/* Created by Adam Khoury @ www.developphp.com */
$error_msg = "";
if ($_POST['username']) {
$username = $_POST['username'];
$password = $_POST['password'];
// Simple hard coded values for the correct username and password
$admin = "myname";
$adminpass = "mypassword";
// connect to mysql here if you store admin username and password in your database
// This would be the prefered method of storing the values instead of hard coding them here into the script
if (($username != $admin) || ($password != $adminpass)) {
$error_msg = ': <font color="#FF0000">Your login information is incorrect</font>';
} else {
session_register('admin');
$_SESSION['admin'] = $username;
require_once "index.php";
exit();
}
}// close if post username
?>
<?php include('../includes/header.php');?>
<?php
if ($_SESSION['admin'] != "myname") {
echo '<h3>Only the administrator can view this directory</h3><br />
<table width="340" border="0">
<form action="admin_check.php" method="post" target="_self">
<tr>
<td colspan="2">Please Log In Here' . $error_msg . '</td>
</tr>
<tr>
<td width="96">Username:</td>
<td width="234"><input type="text" name="username" id="username" style="width:98%" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" id="password" style="width:98%" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="button" id="button" value="Log In Now" /></td>
</tr>
</form>
</table>
<br />
<br />
<br />
<a href="../index.php">Or click here to head back to the homepage</a>';
exit();
}
?>
<?php include('../includes/footer.php'); ?>
here is the create_page.php for creating the a new webpage when I try to access it it just refers me back to the the admin_check.php
<?
// You may copy this PHP section to the top of file which needs to access after login.
session_start(); // Use session variable on this page. This function must put on the top of page.
if(!session_is_registered("admin")){ // if session variable "username" does not exist.
header("location:index.php"); // Re-direct to index.php
}
?>
<?php include('../includes/header.php');?>
<script type="text/javascript" src="formfieldlimiter.js">
/***********************************************
* Form field Limiter v2.0- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com for full source code
***********************************************/
</script>
<script type="text/javascript">
function validate_form ( ) {
valid = true;
if ( document.form.heading.value == "" ) {
alert ( "Please enter the heading." );
valid = false;
} else if ( document.form.description.value == "" ) {
alert ( "Please enter description for the story." );
valid = false;
} else if ( document.form.pagebody.value == "" ) {
alert ( "Please enter some info into the page body." );
valid = false;
}
return valid;
}
</script>
<script language="JavaScript" type="text/javascript" src="scripts/wysiwyg.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/wysiwyg-settings.js"></script>
<script language="javascript1.2">
// attach the editor to all textareas of your page.
//WYSIWYG.attach('all');
// attach the editor to the textarea with the identifier 'textarea1'.
WYSIWYG.attach('pagebody');
</script>
<table width="100%" border="0" cellpadding="8">
<form id="form" name="form" method="post" action="page_new_parse.php" onsubmit="return validate_form ( );">
<tr>
<td><h3>Creating a New Page • <a href="index.php">Admin Home</a> • <a href="../" target="_blank">View Live Website</a></h3></td>
</tr>
<tr>
<td>Be sure to fill in all fields, they are all required.<br /></td>
</tr>
<tr>
<td>
<fieldset>
<table width="100%" border="0" cellpadding="5">
<form id="form" name="form" method="post" action="page_new_parse.php" onsubmit="return validate_form ( );">
<tr>
<td align="right">Heading:</td>
<td><input type="text" id="heading" name="heading" /></td>
</tr>
<tr>
<td align="right">Short Description :</td>
<td><textarea type="text" name="description" style="width:300px" id="description" rows="8"></textarea>
<div id="description-status"></div></td>
</tr>
<tr>
<td align="right">Category:</td>
<td><select id="category" name="category"> <option>News</option>
<option>Politics</option>
<option>Entertainment</option>
<option>Sports</option>
<option>Health</option>
<option>Religion</option>
</select>
</td>
</tr>
<tr>
<td align="right">Country:</td>
<td><select id="country" name="country"><option>Zimbabwe</option>
<option>Kenya</option>
<option>Ghana</option>
<option>Nigeria</option>
<option>Zambia</option>
<option>Gambia</option>
<option>South Africa</option>
</select>
</td>
</tr>
<tr>
<td align="right">News :</td>
<td><textarea id="pagebody" name="pagebody" rows="20" style="width:500px" ></textarea></td>
</tr>
<tr>
<td align="right">keywords:</td>
<td><input type="text" id="keywords" name="keywords" /></td>
</tr>
<tr><td colspan="2"><center><input type="submit" value="Add News"/></center></td></tr>
</form>
</table>
</fieldset>
</td>
</tr>
</form>
</table>
<!--
<form name="sampleform"">
<input type="text" name="george" style="width:250px" />
<div id="george-status"></div>
</form>
-->
<script type="text/javascript">
fieldlimiter.setup({
thefield: document.form.description, //reference to form field
maxlength: 160,
statusids: ["description-status"], //id(s) of divs to output characters limit in the form [id1, id2, etc]. If non, set to empty array [].
onkeypress:function(maxlength, curlength){ //onkeypress event handler
//define custom event actions here if desired
}
})
</script>
<?php include('../includes/footer.php');?>