It's a code with 3 text boxes, when someone presses 'submit' it doesn't edit the mySQL. +rep to all help/suggestions.
PHP Code:<?php
include "mainsite_config.php";
$action = $_GET ["action"];
if ($action == "update_settings") {
$site_title = $_POST ["title"];
$welcome_content = $_POST ["welcome_content"];
$logo = $_POST ["logo"];
mysql_query ("update settings SET logo = '$logo', update settings SET welcome_content = '$welcome_content', update settings SET title = '$title'");
echo "Site settings updated. <meta http-equiv=\"refresh\" content=\"2;url=settings.php\">";
}
else {
?>
<form action="?action=update_settings" method="post">
<label>Site Title - <span>this is the title your browser displays for your website.</span></label><br />
<input class="textbox" name="title" type="text" value="<?php
include "mainsite_config.php";
$sql = "SELECT * FROM settings";
$check = mysql_query("SELECT title FROM settings") or die("There is currently no title. Edit this with your own.");
while ($display = mysql_fetch_array($check)) {
$title = $display['title'];
echo "$title";
}
?>"/><br />
<br />
<label>Main Content - <span>this is the text you see when you navigate to the homepage, above the news.</span></label>
<textarea class="textarea" name="welcome_content" type="text">
<?php
include "mainsite_config.php";
$sql = "SELECT * FROM settings";
$check = mysql_query("SELECT welcome_content FROM settings") or die("There is currently no welcome content. Edit this with your own.");
while ($display = mysql_fetch_array($check)) {
$welcome = $display['welcome_content'];
echo "$welcome";
}
?>
</textarea><br />
<br />
<label>Logo - <span>this is the URL to your site's main logo, above your welcome content.</span></label>
<input class="textbox" name="logo" type="text" value="<?php
include "mainsite_config.php";
$sql = "SELECT * FROM settings";
$check = mysql_query("SELECT logo FROM settings") or die("You have no logo URL. Edit this with your own.");
while ($display = mysql_fetch_array($check)) {
$logo = $display['logo'];
echo "$logo";
}
?>"/><br />
<br />
<input class="submit" type="submit" value="Update Settings" class="textbox" />
</form>
<?php } ?>






Reply With Quote

lol.

