Jump to content

[SOLVED] Help with radio buttons


Leadwing

Recommended Posts

You need to submit the form one place first then see which radio button was selected and redirect them accordingly

 

Example:

 

<?php
if($_POST['radio_button'] == 'button1') {

  header("Location: button1_page.php");

  }
   elseif($_POST['radio_button'] == 'button2') {

  header("Location: button2_page.php");

  }
?>

 

In this case its probably best to put this in the top of your page with the form and set the form action to:

 

<form action="?" method="post">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.