Gayner Posted December 13, 2009 Share Posted December 13, 2009 switch($_GET['CODE']) { case '91': $this->do_signature_2(); break; } and my form: <form name="a" action="index.php" method="post"><input type='hidden' name='CODE' value='91' /> why isn't it <input stuff working ? Link to comment https://forums.phpfreaks.com/topic/184958-swtich-not-working-help-plz/ Share on other sites More sharing options...
corbin Posted December 13, 2009 Share Posted December 13, 2009 Errrr.... Have you read your HTML and the PHP code? $_GET but your form method is POST. Link to comment https://forums.phpfreaks.com/topic/184958-swtich-not-working-help-plz/#findComment-976387 Share on other sites More sharing options...
GFXUniverse Posted December 13, 2009 Share Posted December 13, 2009 Yes your method is POST so use $_POST and use if statement instead <?php $code = $_POST['CODE']; if ($code == 91) { $this->do_signature_2(); } ?> Switch is use to select an option from a set of options but if there is one option you can use IF statement. or if switch statement is required so use this <?php $code = $_POST['CODE']; switch ($code) { case 91: $this->do_signature_2(); break; } ?> Link to comment https://forums.phpfreaks.com/topic/184958-swtich-not-working-help-plz/#findComment-976390 Share on other sites More sharing options...
emopoops Posted December 13, 2009 Share Posted December 13, 2009 lol simple mistake hon Link to comment https://forums.phpfreaks.com/topic/184958-swtich-not-working-help-plz/#findComment-976502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.