I have the following PHP code, instead of updating the mySQL as it should, it just clears the contents that should be updating.
+rep to all help, whether it works or not.PHP Code:<?php
include( "site_config.php" );
if( $_GET["action"] == "update_settings" )
{
$title = $_POST["title"];
$status = $_POST["status"];
$logo = $_POST["main_logo"];
$offline = $_POST["offline"];
$left = $_POST["left_logo"];
@mysql_query( "UPDATE `settings` SET `title` = '$title', `main_logo` = '$logo', `offline_text` = '$offline', `status` = '$status', `logo_left` = '$left'" );
}
else
{
$fetch = @mysql_fetch_array( mysql_query( "SELECT * FROM `settings`" ) );
$title = $fetch["title"];
$status = $fetch["statust"];
$logo = $fetch["main_logo"];
$offline = $fetch["offline_text"];
$left_logo = $fetch["logo_left"];
}
$html = <<<HTML
<form action="?action=update_settings" method="post">
<h2>site title - <span>this is the title your browser displays for your website.</span></h2><br />
<input class="textbox" name="title" type="text" value="$title"/>
<h2>site status - <span>this declares whther your site is online or offline.</span></h2><br />
<input name="status" type="radio" value="offline">Offline</input> <input name="status" type="radio" value="online">Online</input>
<h2>offline notice - <span>this is the message users see when the website is set to offline.</span></h2>
<textarea class="textarea" name="offline" type="text">$offline</textarea>
<h2>main logo - <span>this is your sites main logo.</span></h2>
<input class="textbox" name="main_logo" type="text" value="$logo"/>
<h2>semi-main logo - <span>this is your sites semi-main logo. its the bigger logo seen on the left of each page.</span></h2><br />
<input class="textbox" name="left_logo" type="text" value="$left_logo"/>
<br /><br />
<input type="submit" value="edit settings" class="submit" />
</form>
HTML;
echo( $html );
?>






Reply With Quote




lol.