im trying to call a php function in submiting a form.
here my full php file: ( am i write correct? )
<?php
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
?>
<div class="manual_sending_form" id="manual_sending_form">
<div class="inside">
<form class="initial-form" id="manual_sending" method="post" name="post"
action="<?php echo admin_url( 'admin.php?page=my-page' ) ?>">
<p>
<label for="resive_number">My Field</label><br>
<input type="text" name="resive_number" id="resive_number"
value="<?php echo isset( $_POST['sms_numbers'] ) ? sanitize_text_field( $_POST['sms_numbers'] ) : '' ?>"
</p>
<p>
<input type="submit" class="button button-primary" name="send_sms_button"
value="Send">
</p>
</form>
</div>
</div>
<?php
if ( isset( $_POST['send_sms_button'] ) ) {
try
{
$phone = $_POST['sms_numbers'];
// do some code hwre
?>
did i correct on below line? i just want to input something there ( i need this value on function.
value="<?php echo isset( $_POST['sms_numbers'] ) ? sanitize_text_field( $_POST['sms_numbers'] ) : '' ?>"
or this part is correct ? ( $phone = $_POST['sms_numbers']; )
i dont know why i get below error, //// Notice: Undefined index: sms_numbers in