martynball
New Member
- Messages
- 60
- Reaction score
- 0
- Points
- 0
I don't know if this is anything to do with the server upgrade, or my coding? But for some reason my page is not changing...
http://martynleeball.x10hosting.com/stokeGTA/settings.php
Temp username: username
Temp password: password
http://martynleeball.x10hosting.com/stokeGTA/settings.php
Temp username: username
Temp password: password
PHP:
<?php
session_start();
include "scripts/php/db.connect.php";
if(isset($_SESSION['session'])){
//user is logged-in, so do nothing
}
else {
//user needs to log in.
header ("location: scripts/php/login.php");
}
$result = mysql_query("SELECT * from settings WHERE id='1'") or die ('Error: '.mysql_error());
$row = mysql_fetch_array($result);
$reg = $row['RegOpen'];
echo "gets here";
//$green = "style=\"color:#006600\"";
if (isset($_POST['submit'])) {
$register = $_POST['oReg'];
$query="UPDATE settings SET RegOpen='$register'";
$result=mysql_query($query);
if (!$result) {
echo "Error updating settings!";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Settings</title>
<link rel="stylesheet" href="../stokeGTA/css/mainsheet.css"/>
<script type="text/javascript" src="scripts/js/hoverFix.js"></script>
</head>
<body>
<div class="container">
<a href="scripts/php/logout.php" style="float:right;">-Logout-</a>
<?php include "includes/menu.php"; ?>
<fieldset>
<legend>Settings</legend>
<form name="settings" action="settings.php" method="post">
<p>Registrations open? Blah</p><br />
<table><tr>
<td <?php if ($registrationStatus == 1) { echo "$green"; } ?>>Open </td>
<td <?php if ($registrationStatus == 0) { echo "$green"; } ?>> Closed</td></tr><tr><td>
<input type="radio" name="oReg" <?php if ($registrationStatus == 1) { echo "CHECKED"; } ?> value="1" /></td><td>
<input type="radio" name="oReg" <?php if ($registrationStatus == 0) { echo "CHECKED"; } ?> value="0" /></td></tr>
</table>
<input type="submit" name="submit" value="Save Settings">
</form>
<?php echo "$reg"; ?>
</fieldset>
</div>
</body>
</html>