Jump to content

Archived

This topic is now archived and is closed to further replies.

localhost

wont write to config table

Recommended Posts

[code]<?php

/* BRAINGSTORMING IDEA....!
Configuration made by Copernicus, Dann, UNTESTED
*/

require('../includes/connect.php');
$form = "
<form action=". $_SERVER['PHP_SELF'] ." method=\"POST\">
<p>dotOmega Installation - One time setup</p>
<p>Forum name:
  <input type=\"text\" name=\"pagetitle1\" value=\"My dotOmega Forum\"><BR>
  What you want your forum to be displayed as
</p>
<p>Site URL:
  <input type=\"text\" name=\"siteurl1\" value=\"http://\"><BR>
  If this is not filled out correctly the theme system will not work
</p>
<p>Login method:
  <input type=\"text\" name=\"loginmethod1\" value=\"SESSION\"> <br>
  If you would like to use cookies type in COOKIE</p>
<p>Threads per page:
  <input type=\"text\" name=\"threadsperpage1\" value=\"10\"><br>
  Set to however many threads you want until it creates a new page</p>
<p>Allow Guest posting:
  <input type=\"text\" name=\"allowguestposting1\" value=\"NO\"><Br>
  Set to yes if you want un logged in members to post</p>
<p>Allow main page threads:
  <input type=\"text\" name=\"allowmainpagethreads1\" value=\"YES\"><BR>
<p>Enable post count:
  <input type=\"text\" name=\"postcount1\" value=\"YES\"><br>
  If enabled, each post will add one to their post count</p>
<p>Post count tag update:
  <input type=\"text\" name=\"postcounttagupdate1\" value=\"YES\" readonly><Br>
  Not too sure about, leave at YES</p>
<p>Post count avatar update:
  <input type=\"text\" name=\"postcountavatarupdate1\" value=\"YES\" readonly><BR>
  Not too sure about either, leave at yes</p>
<p>Page Style:
  <input type=\"text\" name=\"pagestyle1\" value=\"Default\" readonly><Br>
  Refer to last two fields, leave at Default
</p>
<p>Server platform:
  <input type=\"text\" name=\"platform1\" value=\"LINUX\"><br>
  If not sure, keep it as LINUX otherwise use WINDOWS
</p>
<p>
<input type=\"submit\" name=\"submit\" value=\"Continue\"><br>
</p>
</form>
";

$error = ''; #blank error message variable
if(isset($_POST['submit'])) {

// POST form variables
$forumname1 = $_POST['forumname1'];
$siteurl1 = $_POST['siteurl1'];
$loginmethod1 = $_POST['loginmethod1'];
$threadsperpage1 = $_POST['threadsperpage1'];
$allowguestposting1 = $_POST['allowguestposting1'];
$allowmainpagethreads1 = $_POST['allowmainpagethreads1'];
$postcount1 = $_POST['postcount1'];
$postcounttagupdate1 = $_POST['postcounttagupdate1'];
$postcountavatarupdate1 = $_POST['postcountavatarupdate1'];
$pagestyle1 = $_POST['pagestyle1'];
$platform1 = $_POST['platform1'];


// Check if all fields are fulfilled
if($forumname1==NULL || $siteurl1==NULL || $loginmethod1==NULL || $threadsperpage1==NULL || $allowguestposting1==NULL || $postcount1==NULL || $postcounttagupdate1==NULL || $postcountavatarupdate1==NULL || $pagestyle1==NULL || $platform1==NULL)
{
$error .= 'All fields must be filled in before you proceed with your install.';
}

// Check login method
if($loginmethod1!=COOKIE || $loginmethod1!=SESSION){
$error .= 'Login method must be fulfilled as COOKIE or SESSION';
}

// Check platform
if($platform1!=LINUX || $platform1!=WINDOWS) {
$error .= 'Platform must be fulfilled as LINUX or WINDOWS';
}


if($error != '') {
echo $error;
echo $form;
} else {
// Run the query to insert these details into the database table
$query = "INSERT INTO `config` (`forumname1`, `siteurl1`, `loginmethod1`, `threadsperpage1`, `allowguestposting1`, `allowmainpagethreads1`, `postcount1`, `postcounttagupdate1`, `postcountavatarupdate1`, `pagestyle1`, `platform1`) VALUES ('$forumname1', '$siteurl1', '$loginmethod1', '$threadsperpage1', '$allowguestposting1', '$allowmainpagethreads1', '$postcount1', '$postcounttagupdate1', '$postcountavatarupdate1', '$pagestyle1', '$platform1');";

$result = mysql_query($query);
}  

} else {
// Form for the page
echo $form;
}
?> [/code]

very distraught! please help ive tried everything!!!!!1

Share this post


Link to post
Share on other sites
Whats your question!!!!!??????

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.