call funcution when clicking submit

I've built a WordPress plugin, this plugin has a form in front-end using a shortcode I need the submit button to do two things, first to send the entries to the database which I did it successfully. The second thing is to build a URL from entries and run it

this is the form code:

form name=frm action=# method=post enctype=multipart/form-data
        tr
            td?php echo __( 'Your Name', 'msf')?/td
            tdinput type=text name=nm/td
        /tr
        tr
            td?php echo __('Mobile no' , 'msf' )?/td
            tdinput pattern=\d* maxlength=9 type=number name=mob/td
        /tr
        tr
            td/td
            tdinput class=button-primary type=submit value=?php echo __('Send' , 'msf' )? name=ins action=/td
           !-- alert --
            div class=success_msg style=display: noneMessage
                Sent Successfully/div

            div class=error_msg style=display: noneMessage
                Not Sent, There is some error./div
        /tr
    /form

this is my function

function SMS_SEND($message,$numbers)
    {
    $text = urlencode($message);
    $to = $numbers;
    $user=;
    $pass=;
    $sender=;
    $ch = curl_init();
curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.9.2.18) Gecko/20110628 Ubuntu/10.04 (lucid) Firefox/3.6.18' );
curl_setopt( $ch, CURLOPT_URL, 'http://www.*****.com/sms/api/sendsms.php?username='.$user.'password='.$pass.'numbers='.$to.'sender='.$sender.'message='.$text );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
$result = curl_exec ( $ch );
curl_close ( $ch );
    return nl2br($result); 
     }

Topic sms api plugin-development Wordpress

Category Web


    <?php
        if(array_key_exists('button1', $_POST)) { 
            button1(); 
        } 
        function button1() { 
            echo "This is Button1 that is selected"; 
        } 
    ?> 

    <form method="post"> 
        <input type="submit" name="button1"
                class="button" value="Button1" /> 
        
    </form> 
</head> 

</html> 

you call button click function this type you need more refrance follow this link

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.