Stuck on ticket system

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.

Stuck on ticket system

Postby Connor » Mon Jan 23, 2017 8:23 pm

I've been trying to build a really basic ticket system for hours and i am really stuck on what to do next


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>
Connor
 
Posts: 9
Joined: Wed Jan 18, 2017 12:41 am
Has thanked: 1 time
Been thanked: 0 time

Re: Stuck on ticket system

Postby hallsofvallhalla » Wed Jan 25, 2017 10:53 am

User avatar
hallsofvallhalla
Site Admin
 
Posts: 11499
Images: 13
Joined: Wed Apr 22, 2009 6:29 pm
Location: mobile, al
Has thanked: 11 times
Been thanked: 112 times
Blog: View Blog (3)


Return to Beginner Help and Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x