Jump to content

form button that goes to a certain part of the processing page


jeff5656

Recommended Posts

Ok I have this form:

 

<form  name="delete_record" method="post" action="delete_bundle.php"> 

 

Now how do I do it so the action goes to a certain section of delete_bundle.php?  In other words can it be something like action=delete_bundle.php?$id=hello

and then have in the processing form:

 

switch

case: get['id']

 

does this work with a submit button?

Thanks!

you can do it that way. for example on your page you could have some php code that determines the action like so.

<?php

if($foo  == 'bar'){

$action = 'delete_bundle.php?id=1'

}

?>

 

<form  name="delete_record" method="post" action="<?php echo $action; ?>">

 

then on delete_bundle.php

 

you would have this

 

<?php

switch ($_REQUEST['id']){

    case "1":

  // something

  break;

}

 

?>

 

 

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.