ask for and save the 'fairname' configuration variable

This commit is contained in:
james 2005-06-07 20:12:27 +00:00
parent 5ef9051c0a
commit 7df9e6e444

View File

@ -120,7 +120,11 @@ if($_POST['action']=="save")
$q=mysql_query("SELECT * FROM config WHERE year='-1'");
while($r=mysql_fetch_object($q))
{
mysql_query("INSERT INTO config (var,val,description,year) VALUES ('$r->var','$r->val','$r->description','".$_POST['fairyear']."'");
//add the actual fair name, and just insert the defaults of everything else
if($r->var=="fairname")
mysql_query("INSERT INTO config (var,val,description,year) VALUES ('$r->var','".mysql_escape_string(stripslashes($_POST['fairname']))."','$r->description','".$_POST['fairyear']."'");
else
mysql_query("INSERT INTO config (var,val,description,year) VALUES ('$r->var','$r->val','$r->description','".$_POST['fairyear']."'");
}
//copy over the dates defautls
$q=mysql_query("SELECT * FROM dates WHERE year='-1'");
@ -156,6 +160,7 @@ echo "<form method=\"post\" action=\"install3.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"save\" />";
echo "<table>";
echo "<tr><td>Fair Name</td><td><input size=\"25\" type=\"text\" name=\"fairname\" value=\"\"></td><td>The name of the fair you are installing SFIAB to run</td></tr>";
echo "<tr><td>Fair Year</td><td><input size=\"8\" type=\"text\" name=\"fairyear\" value=\"$fairyearsuggest\"></td><td>The year of the fair you are installing SFIAB to run</td></tr>";
echo "<tr><td>Directory</td><td><input size=\"25\" type=\"text\" name=\"sfiabdirectory\" value=\"$directorysuggest\"></td><td>The directory of this SFIAB installation as seen by the web browser</td></tr>";