Thread: UPDATE Problems
View Single Post
03-11-2008, 09:58 PM
#7
Will Green is offline Will Green
Status: I'm new around here
Join date: Mar 2008
Location:
Expertise:
Software:
 
Posts: 9
iTrader: 0 / 0%
 

Will Green is on a distinguished road

  Old

No errors.

I may have added the code wrong though, I did the following:

PHP Code:
<?php

include("site_config.php");
if(
$_GET["action"] == "update_settings")
{

    
$title addslashes(trim($_POST["title"]));
    
$status addslashes(trim($_POST["status"]));
    
$logo addslashes(trim($_POST["logo"]));
    
$offline addslashes(trim($_POST["offline"]));
    
$left addslashes(trim($_POST["left_logo"]));
$s "UPDATE settings SET title = '$title', status = '$status', main_logo = '$logo', offline_text = '$offline', logo_left = '$left_logo' ";

$q mysql_query($s) or trigger_error(mysql_error());  
}


?>

 <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="<?php 
$sql 
mysql_query "SELECT * FROM settings" ); 
while ( 
$fetch mysql_fetch_array $sql ) ) {?><?php echo $fetch["title"]; ?> <?php }?>"/> 

<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>&nbsp;<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"><?php 
$sql 
mysql_query "SELECT * FROM settings" ); 
while ( 
$fetch mysql_fetch_array $sql ) ) {?><?php echo $fetch["offline_text"]; ?> <?php }?></textarea> 

<h2>main logo - <span>this is your sites main logo.</span></h2> 
<input class="textbox" name="logo" type="text" value="<?php 
$sql 
mysql_query "SELECT * FROM settings" ); 
while ( 
$fetch mysql_fetch_array $sql ) ) {?><?php echo $fetch["main_logo"]; ?> <?php }?>"/> 

<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="<?php 
$sql 
mysql_query "SELECT * FROM settings" ); 
while ( 
$fetch mysql_fetch_array $sql ) ) {?><?php echo $fetch["logo_left"]; ?> <?php }?>"/> 

<br /><br /> 

<input type="submit" value="edit settings"  class="submit" /> 
</form>