-2

My update function is not working the browser is showed $_GET['ticketID'] is not set.

    <form action="ticketResolve.php" role="form" method="post">
           <input type="hidden" name="ticketID" value="<?=$ticket['ticketID']?
          <label for="username">Sender_name</label>
          <input type="text" class="form-control" name="sender_name"placeholder="Enter Username" value="<=$ticket['sender_name']>"readonly>
          </div>
          <div class="form-group col-xs-6">
         label for="firstName">Contact</label>
        <input type="text" class="form-control" name="contact" placeholder="Enter First Name" value="<?=$ticket['contact']?>" readonly>
          </div>
         <br><br>
        <button type="submit" class="btn btn-orange-1" name="resolveTicket">Resolve</button>
  </form>

this is my form

ticketID is from this loop and transfer it to the ticketResolve.php page where the ticketID is use to get the details of the ticket, which works data from the database populate the input tags.

and this is the code in the ticketResolve.php page

$ticket = getTicketDetails($_GET['ticketID']);

if(isset($_POST['resolveTicket'])) {

    resolveTicket($loggedUser['userName'], $loggedUser['userID'], 
$_POST['ticketID']);
    header("Location: admin_viewTickets.php");

}

<input type="text" value="<?=$text?>"> //this is showing 1

the "resolve" field should change from 0 to 1

Please help thank you

2 Answers2

0

You're missing a = in the href attribute, change it to

<a class="btn btn-info btn-sm" href="ticketResolve.php?ticketID=<?=$ticket['ticketID']?>">view</a>
Giorgio.dev
  • 131
  • 2
  • 12
0

Update it is now working there was a typo error in my sql command -_- thank you for your help guys. All it took was a little nap.