Monday, 26 August 2013

Button shortcode with two actions

Button shortcode with two actions

I have a shortcode that handles url parameters and returns html form
button to send user to info page. But now I need to include additional
action that would run allow.php script when button is clicked. How to
include it to the action?
What I have is
function buttontogo($atts, $content = null) {
extract(shortcode_atts(array(
'bclass' => 'bclass' ,
'blabel' => 'blabel' ,
), $atts));
$adrlink="userinfo";
$link=esc_url(add_query_arg(
array(
'ui' =>$_GET['ui'],
'eventid' =>$_GET['evid'],
),
home_url($adrlink)));
return
'<form class="eventb" method="post" action="'.$link.'">
<input type="submit" value="'.$blabel.'"'.do_shortcode($content).'>
</form>';
add_shortcode('butntogo', 'buttontogo');
}

No comments:

Post a Comment