djfox Posted September 13, 2007 Share Posted September 13, 2007 settings.php <?php //Date: September 13 2007 //For: secrettrance.net //Description: Manage Profile: Update Settings session_start(); include("dbcon.php"); include("func.php"); require_once "design.php"; require_once "auth.php"; require_once "includes/defines.php"; $id = $_SESSION['gal']; $lev=$_SESSION['level2']; $Title = "Secret Trance: Manage Profile: Update Settings"; require_once "header.php"; require_once "hidestatus.php"; if (!isLoggedIn()) { Redirect("index.php"); } ?> <table border=0 width=100%><? //1 ?> <tr> <td> <table border=0 width=100% bgcolor="000000"><? //2 ?> <tr> <td background="<? echo "$boxbanner"; ?>"><b>Manage Profile: Update Settings</b> <tr> <td background="<? echo "$boxback"; ?>"> <?php if( $lev > 0){ if( $suspend < 1){ $res = mysql_query("SELECT adult FROM userdata WHERE id='$id'"); $rows = mysql_fetch_row($res); mysql_free_result($res); ?> <blockquote> <font size=2><i>Change settings at your own risk. Secret Trance is not held respnsible for anything that could happen when any part of the settings are altered. By setting adult rating to "Adult/Mature", you are verifying that you are at least 18 years of age to view such content.</i></font> </blockquote> <form action="settings2.php"> <b>Adult Rating:</b> <br><select name="adult" style="border: 0px; background-color:#000000; color: #B6ABCE;"> <option value="0">Up to PG-13</option> <option value="1">Adult/Mature Content</option> </select> <p> <? echo "<input type='hidden' name='id' value='$id'>"; echo "<input type='submit' name='submit' value='Update Settings'>"; ?> </form> <?php } else { if( $suspend > 0){ echo "Sorry, your account is on suspension. You must wait until suspension expires before you can access this."; } } } ?> </table><? //2 ?> </table><? //1 ?> <p> <? require("footer.php"); ?> settings2.php <?php session_start(); include("dbcon.php"); include("auth.php"); //Date: September 13 2007 //For: secrettrance.net //Description: Update Settings if (!isLoggedIn()) { Redirect("index.php"); } $id = $_SESSION['gal']; mysql_query("UPDATE userdata SET adult='$adult' WHERE id=$id"); mysql_close($con); //redirect header("Location: manageprofile.php"); ?> It`s more or less the same codes I used to update other fields in databases but for some reason this one will not work. It will not update the adult field. It keeps leaving it at 1. Quote Link to comment Share on other sites More sharing options...
djfox Posted September 13, 2007 Author Share Posted September 13, 2007 I removed this from settings.php: $res = mysql_query("SELECT adult FROM userdata WHERE id='$id'"); $rows = mysql_fetch_row($res); mysql_free_result($res); but that didn`t make any difference. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 14, 2007 Share Posted September 14, 2007 Try this: $adult = intval($_POST['adult']); $sql = "UPDATE userdata SET adult='$adult' WHERE id=$id"; mysql_query($sql) OR die(mysql_error().' with query: '.$sql); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.