[HELP] mySQL
Posted: Mon Jan 17, 2005 4:05 pm
wtf? i cant post my code, i get an Error
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
error_reporting(E_ALL);
if (!empty($_POSTї'submitted']) && $_POSTї"submitted"] == 1){
$alias = $_POSTї"alias"];
$name= $_POSTї"name"];
$position = $_POSTї"position"];
$age = $_POSTї"age"];
$email = $_POSTї"email"];
$location = $_POSTї"location"];
$map = $_POSTї"map"];
$gun = $_POSTї"gun"];
$quote = $_POSTї"quote"];
$sensitivity = $_POSTї"sensitivity"];
$resolution = $_POSTї"resolution"];
$dbh=mysql_connect ("localhost", "***", "***") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("steve_onepurpose");
$sql = "SELECT * FROM `roster`";
mysql_query("INSERT " . "INTO `roster` (`id`, `alias`, `name`, `position`, `age`, `email`, `location`, `map`, `gun`, `quote`, `sensitivity`, `resolution`) VALUES ('', '$alias', '$name', '$position', '$age', '$email', '$location', '$map', '$gun', '$quote', $'sensitivity', '$resolution')");
$result = mysql_query($sql, $dbh) or die (mysql_error());
echo mysql_error();
echo "Roster Updated!!";
}
else
{
//display the form
?>
<form action=rostercms.php method=post>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>Alias</td>
<td>Full Name </td>
<td>Position</td>
</tr>
<tr>
<td><input name="alias" type="text"></td>
<td><input name="name" type="text"></td>
<td><input name="position" type="text"></td>
</tr>
</table>
<br>
Extended Profile (for profile page)
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>Age</td>
<td>E-Mail</td>
<td>Location</td>
<td>Favorite Map</td>
<td>Favorite Gun</td>
<td>Quote</td>
<td>Sensitivity</td>
<td>Resolution</td>
</tr>
<tr>
<td><input name="age" type="text" maxwidth="2" size="15"></td>
<td><input name="email" type="text"></td>
<td><input name="location" type="text" value="City, State"></td>
<td><input name="map" type="text"></td>
<td><input name="gun" type="text"></td>
<td><input name="quote" type="text"></td>
<td><input name="sensitivity" type="text"></td>
<td><input name="resolution" type="text"></td>
</tr>
</table>
<input type="hidden" name="submitted" value="1">
<input type="image" name=submitted src="submit.jpg" value="1">
<?php } echo mysql_error(); ?>Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 246
Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 249
Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 252
Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 255
Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 258
Notice: Undefined variable: s in /home/steve/public_html/onepurpose/ap/index.php on line 261
Code: Select all
<?PHP
switch ($s) {
default:
echo ("News");
break;
case 'roster':
echo ("Roster");
break;
case 'matches':
echo ("Matches");
break;
case 'servers':
echo ("Servers");
break;
case 'sponsors':
echo ("Sponsors");
break;
case 'about':
echo ("About");
break;
case 'downloads':
echo ("Downloads");
break;
}
?>