wordpress - In PHP, how do I specify different form actions depending on input text? -


so basically, if type in zip code between 85700 , 85775 want post to: http://medicarechoicesofarizona.com/

if else entered, want post http://www.ehealthmedicare.com below. guess javascript fine php great because wordpress widget. everyone!

<form action="http://www.ehealthmedicare.com/find-coverage?allid=med35993" method="post" target="blank" _lpchecked="1">     <p style="font-size:16px; text-align:center">         zip code:  <input type="text" name="zip" style="width:60px; height: 25px;">     </p>     <p style="text-align:center">         <input type="image" src="/wp-content/plugins/medicare-quote-widget/ehealth-medicare-go.png" title="find medicare insurance options" alt="find medicare insurance options" class="go-btn">     </p> </form> 

actually, can done pure php:

<form action="forwarder.php" method="post" target="blank" _lpchecked="1">     <p style="font-size:16px; text-align:center">         zip code:  <input type="text" name="zip" style="width:60px; height: 25px;">     </p>     <p style="text-align:center">         <input type="image" src="/wp-content/plugins/medicare-quote-widget/ehealth-medicare-go.png" title="find medicare insurance options" alt="find medicare insurance options" class="go-btn">     </p> </form> 

and add forwarder.php:

<?php     if($_post)     {         $zip = (int)$_post['zip'];         if($zip >= 85700 && $zip <= 85775)         {             header('location: http://medicarechoicesofarizona.com/');         }         else         {             header('location: http://www.ehealthmedicare.com/find-coverage?allid=med35993');         }     } ?> 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -