Well, it's not so much sending the info, but getting the info sent to the database with the connection to it based on the form. Anotherwords, when the person fills in the info in the form to connect to the database, it sends the information to the table.
Here is where the page is to do this.... http://www.blyster.com/bschedule/bsadmin/connectionsettings.php
Here is the script I have so far...
First at the top the html:
<html>
<head>
<title>Band Schedule Install</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
BODY {scrollbar-face-color: #020302; scrollbar-shadow-color: #020202; scrollbar-highlight-color: #000000;
scrollbar-3dlight-color: #333333; scrollbar-darkshadow-color: #020202; scrollbar-track-color: #333333;
scrollbar-arrow-color: #660000}
</style>
<body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="36">
<table width="100%" border="0" background="images/headerback.gif" cellspacing="0" cellpadding="0">
<tr>
<td height="60" width="6%"><img src="images/logosmall.gif" width="181" height="58"></td>
<td height="60" width="94%">
<div align="center"><font face="Arial, Helvetica, sans-serif"><b><font color="#CCCC00">Concert
Schedule V: 1.2</font></b></font></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="2"><font color="#CCCC00" face="Arial, Helvetica, sans-serif">Database
connection setup<br>
<font color="#000000">. </font></font></td>
</tr>
<tr>
<td height="2">
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#CCCCCC"><b><font color="#DFDFDF">Next
we need to set up connection to the database. Enter the information below
and click on enter.</font></b></font></div>
</td>
</tr>
</table>
<form action="" method="post">
<table width="70%" border="1" align="center" bordercolorlight="#333333" bordercolordark="#666666">
<tr>
<td width="39%"><font size="2" face="Arial, Helvetica, sans-serif"><b>Name
of Database:</b><br>
<font color="#CCCCCC">(Ex: mydomain_database Seen when setting up)</font></font></td>
<td width="31%">
<input type="text" name="dbdataname" size="" value="" />
</td>
<td width="30%"> </td>
</tr>
<tr>
<td width="39%"><font size="2" face="Arial, Helvetica, sans-serif"><b>Name
of Database Host:</b><br>
<font color="#CCCCCC">(Almost always: localhost if not then erase and
replace it)</font></font></td>
<td width="31%">
<input type="text" name="dbhost" size="" value="localhost" />
</td>
<td width="30%"> </td>
</tr>
<tr>
<td width="39%"><font size="2" face="Arial, Helvetica, sans-serif"><b>User
Name: </b><br>
<font color="#CCCCCC">(Typically the name you gave when setting up the
database)</font></font></td>
<td width="31%">
<input type="text" name="dbusername" size="" value="" />
</td>
<td width="30%"> </td>
</tr>
<tr>
<td width="39%"><font size="2" face="Arial, Helvetica, sans-serif"><b>Password:
</b><br>
<font color="#CCCCCC">(Typically the password you gave when setting up
the database) </font></font></td>
<td width="31%">
<input type="text" name="dbpassword" size="" />
</td>
<td width="30%">
<div align="center">
<input type="submit" name="submit" value="Enter" />
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
Here is the PHP script under it.
<?php
if (isset($_POST['submit']))
{
$getdbusername = $_POST['dbusername'];
$getdbpassword = $_POST['dbpassword'];
$getdbhost = $_POST['dbhost'];
$getdbname = $_POST['dbdataname'];
if(!empty($getdbusername) && !empty($getdbpassword)&& !empty($getdbhost) && !empty($getdbdataname) ) {
//echo $getusername."<br>".$getpassword."<br>".$gethost."<br>".$getname ;
$query = "insert into schedule values(NULL,'$getdbusername','','$getdbpassword','$getdbdataname','$getdbhost',NULL)";
$result = mysql_query($query)or die("Could not do a mysql query. Reason why: ".mysql_error());
echo "Success.. start adding the shows.";
$sqlQ = "SELECT * FROM schedule WHERE bsusername = '$getdbusername' AND bspassword = '$getdbpassword' AND bsdatahost = '$getdbhost' AND bsdataname = '$getdbdataname';";
$sqlR = mysql_query($sqlQ);
if(mysql_num_rows($sqlR)==1){
$showinfo = mysql_fetch_assoc($sqlR);
?>
<?php
echo "<INPUT TYPE=\"hidden\" name=\"id\" value=\"".$showinfo['id']."\">\n";
} else {
echo "Invalid mySQL result [".mysql_num_rows($sqlR)."]";
}
}
@mysql_connect($dbhost,$dbusername,$dbpassword)
or die("could not connect to MySQL server!");
@mysql_select_db($dbdataname)
or die("Something went wrong. Please check to see if you have the correct information.");
$result = mysql_query($query);if(!$result){echo "Something went wrong. Please check to see if you have the correct information.";}
echo "<meta http-equiv=\"refresh\" content=\"0; URL=installcomplete.htm\">";
echo "You have set up your database. You can now start adding your events.";
if(!$query){echo "something screwed up! try again"; }
mysql_close();
}
?>
The problem thus far is that it wont send the info to the database. This is actually the second step of the bundle... and the objective to this is that the info that gets filled out is sent to the database, and then I'm going to have the setting.php page read that from the database... making it so the user never has to edit a php page and re-upload it.
Very similar to how it works with phpbb forums, but I cant seem to weed through that to figure it out since they have alot more complex things in it.
Much appreciation.
Thanks
Peredy