Jump to content


Photo

Little help needed :]


  • Please log in to reply
1 reply to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 10 August 2006 - 01:57 PM

Hii,
I have a script which is for support tickets, The problem is
I wanted 3 options before the person begins the ticket. now
I wanted it so they use the "ratio" buttons to choose there
department.

How ever when I submit the choice, it doesn't do anything. :/.
Any ideas:

<?PHP
	$x = $_GET['ticket'];
	if(!isset( $_POST['submit'] )) {
	echo '<form method="post" action="add_ticket.php">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="250">
    <tr>
      <td width="14"><input type="radio" value="1" name="option"></td>
      <td width="236"><b>Website</b><br>
      Info about website.<br>
&nbsp;</td>
    </tr>
    <tr>
      <td width="14"><input type="radio" value="2" name="option"></td>
      <td width="236"><b>Testing</b><br>
      Testing purposes.<br>
&nbsp;</td>
    </tr>
    <tr>
      <td width="14"><input type="radio" value="3" name="option"></td>
      <td width="236"><b>Other</b><br>
      Other queries not listed above.<br>
&nbsp;</td>
    </tr>
  </table>
  <input type="submit" value="Post Ticket" style="width: 80; height: 22">
</form>';
	
	}else{
	
		if( $_POST['option'] == "1" ) {
		echo 'option 1';
		
		}elseif( $_POST['option'] == "2" ) {
		echo 'option 2';
		
		}elseif( $_POST['option'] == "3" ) {
		
		}else{
		echo 'Error: Option unavailable...';
		}
		
			if( $x = submit ) {
			echo 'submit_ticket';
			
			}else{
			echo 'Error: Ticket function does not exist.';
		}
	}
?>


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 August 2006 - 02:11 PM

Try this:
<?php

$x = isset($_GET['ticket']) ? $_GET['ticket'] : '';

if(!isset($_POST['submit']))
{
    echo <<<HTML
<form method="post" action="test.php?ticket={$x}">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="250">
    <tr>
      <td width="14"><input type="radio" value="1" name="option"></td>
      <td width="236">
        <b>Website</b><br>
        Info about website.
      </td>
    </tr>
    <tr>
      <td width="14"><input type="radio" value="2" name="option"></td>
      <td width="236">
        <b>Testing</b><br>
        Testing purposes.<br>
      </td>
    </tr>
    <tr>
      <td width="14"><input type="radio" value="3" name="option"></td>
      <td width="236">
        <b>Other</b><br>
        Other queries not listed above.<br>
      </td>
    </tr>
  </table>
  <input type="submit" value="Post Ticket" name="submit" style="width: 80; height: 22">
</form>
HTML;
}
else
{
    if($x == 'submit')
    {
        echo 'submit_ticket<br /><br />';

        switch($_POST['option'])
        {
            case 1:
                echo 'Option 1';
            break;

            case 2:
                echo 'Option 1';
            break;

            case 3:
                echo 'Option 3';
            break;

            default:
                echo 'Error: Option unavailable...';
            break;
        }
    }
    else
    {
        echo 'Error: Ticket function does not exist.';
    }
}

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users