ok so i started! and i dont know what i did wrong... here is what i got so far:
db.php:
<?php
// Database variables
$host = 'BLOCKED';
$user = 'dbo154983898';
$pass = 'BLOCKED';
$dbname = 'db1549838989';
// Connect to Mysql Database
$mysql = mysql_connect($host,$user,$pass);
$db = mysql_select_db($dbname,$mysql);
//grab rveiews vars
function reviews($reviews) {
$get_reviews = mysql_fetch_array(mysql_query("select * from reviews"));
$reviews = $get_reviews[$reviews];
return $reviews;
}
?>
index.php:
<?php
include("db.php");
access();
echo ('<h4>Submit a Review</h4>');
if($_POST['options']){
$title = $_POST['title'];
$posted = $_POST['posted'];
$story = $_POST['story'];
$picturepath = $_POST['picturepath'];
$quality = $_POST['quality'];
$effect = $_POST['effect'];
$overall = $_POST['overall'];
$options = "UPDATE reviews SET title='$title',posted='$posted',story='$story',picturepath='$picturepath',quality='$quality',effect='$effect',overall='$overall'";
$update_options = mysql_query($options);
echo("Reviews Submited.<br /><br />");
}
$config = mysql_fetch_array(mysql_query("select * from reviews"));
$title = $config['title'];
$posted = $config['posted'];
$story = $config['story'];
$picturepath = $config['picturepath'];
$quality = $config['quality'];
$effect = $config['effect'];
$overall = $config['overall'];;
?>
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
<table cellspacing="1" cellpadding="4" border="0" bgcolor="#f2f2f2">
<tr>
<td width="95">Title: </td><td width="352" style="border-right: 10px solid <? echo $bg1; ?>;"><input type="text" name="bg1" value="<? echo $title; ?>" size="20" /></td></tr>
<tr>
<td>Posted By : </td><td style="border-right: 10px solid <? echo $bg2; ?>;"><input type="text" name="bg2" value="<? echo $posted; ?>" size="20" /></td></tr>
<tr>
<td valign="top">Story: </td><td style="border-right: 10px solid <? echo $text; ?>;"><textarea name="text" cols="50" rows="8"><? echo $story; ?></textarea></td></tr>
<tr>
<td>Picture Url: </td><td><input type="text" name="size" value="<? echo $picturepath; ?>" size="20" /></td></tr>
<tr>
<td> </td>
<td><b>Ratings:</b></td>
</tr>
<tr>
<td>Picture Quality: </td>
<td><label>
<select name="select">
<option value="<? echo $quality; ?>">1</option>
<option value="<? echo $quality; ?>">2</option>
<option value="<? echo $quality; ?>">3</option>
<option value="<? echo $quality; ?>">4</option>
<option value="<? echo $quality; ?>">5</option>
</select>
</label></td>
</tr>
<tr>
<td>Effects:</td>
<td><select name="select2">
<option value="<? echo $effect; ?>">1</option>
<option value="<? echo $effect; ?>">2</option>
<option value="<? echo $effect; ?>">3</option>
<option value="<? echo $effect; ?>">4</option>
<option value="<? echo $effect; ?>">5</option>
</select></td>
</tr>
<tr>
<td>Overall:</td>
<td><select name="select3">
<option value="<? echo $overall; ?>">1</option>
<option value="<? echo $overall; ?>">2</option>
<option value="<? echo $overall; ?>">3</option>
<option value="<? echo $overall; ?>">4</option>
<option value="<? echo $overall; ?>">5</option>
</select></td>
</tr>
</table>
<br /><br />
<input type="submit" name="options" value="Submit" />
</form>
i made it myself i got help from other scripts! PLEASE SOMOENE HELP, because its not submiting to the database at all!