xyn Posted August 10, 2006 Share Posted August 10, 2006 Hii,I have a script which is for support tickets, The problem isI wanted 3 options before the person begins the ticket. nowI wanted it so they use the "ratio" buttons to choose theredepartment.How ever when I submit the choice, it doesn't do anything. :/.Any ideas:[code=php:0]<?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> </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" 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.'; } }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17132-little-help-needed/ Share on other sites More sharing options...
wildteen88 Posted August 10, 2006 Share Posted August 10, 2006 Try this:[code]<?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.'; }}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17132-little-help-needed/#findComment-72474 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.