The following code is what i have so far, it displays my category and ticket priories from my mysql table, which is great! Buuuttt, i do not have a clue to how i would fill it in (As a user) and then submit it. I've tried loads of things and it just wont insert into my database. Help would be really appreciated, thanks!
(Also, yes i know my coding is horrible, i am extremely bad at it, but it works lol)
Ticket.php
Code: Select all
<?php
include_once 'connect.php';
session_start();
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
?>
</div>
<?php
$bypass = 0;
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
include_once 'runcron.php';
include_once 'statpanel.php';
?>
<div id ="pageinfobar">
Ticket System
</div>
<div id ="locations">
<br />
Type of problem:
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('tutorial');
$sql = "SELECT type FROM tickettype";
$result = mysql_query($sql);
echo "<select name='ticketpriority'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['type'] ."'>" . $row['type'] ."</option>";
}
echo "</select>";
?>
<br>
<br>
Select importance:
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('tutorial');
$sql = "SELECT level FROM ticketpriority";
$result = mysql_query($sql);
echo "<select name='ticketpriority'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['level'] ."'>" . $row['level'] ."</option>";
}
echo "</select>";
?>
<br>
<br>
Describe the problem:
<br>
<textarea value="" rows="10" cols="50" name="">
</textarea>
<br>
<br>
</div>
</html>
The code for the ticket system
Code: Select all
Type of problem:
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('tutorial');
$sql = "SELECT type FROM tickettype";
$result = mysql_query($sql);
echo "<select name='ticketpriority'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['type'] ."'>" . $row['type'] ."</option>";
}
echo "</select>";
?>
<br>
<br>
Select importance:
<?php
mysql_connect('localhost', 'root', '');
mysql_select_db('tutorial');
$sql = "SELECT level FROM ticketpriority";
$result = mysql_query($sql);
echo "<select name='ticketpriority'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['level'] ."'>" . $row['level'] ."</option>";
}
echo "</select>";
?>
<br>
<br>
Describe the problem:
<br>
<textarea value="" rows="10" cols="50" name="">
</textarea>