How to bind the form to the php to pull the data from the form itself?

Greetings to all. Guys I'm new in this field, do not judge strictly. In General. I have a form, for it has button (index.php) and there is script(script.php) which at the push of a button sends an SMS message to your phone with a specific text, but in the same library from smsc(smsc_api.php). The bottom line is what script.php only works on one phone which I put in the script under $tel="79999999999". I need to make when choosing a man in uniform, and when you press the button, the value data, that is the phone number passed to this script and replace the value $tel="Newnuber" and accordingly sent a message. Help good people. Give clues through which this can be done please. Thanks in advance!
June 27th 19 at 15:24
2 answers
June 27th 19 at 15:26
Solution
Yeah, I wanted to say that I have a form drop-down list. As well to use? - quincy8 commented on June 27th 19 at 15:29
no matter, just read about POST / GET requests and processing, and questions you should not stay. - Rodolfo_Klein21 commented on June 27th 19 at 15:32
: Okay, thank you! - quincy8 commented on June 27th 19 at 15:35
June 27th 19 at 15:28
Solution
Of is the room?
$tel=$_POST['tel'];

In the form of a phone number field should be called tel
The form itself:
(form class="name" action="script.php" method="post">
(p class="col-sm-4">(select class="form-control">
(option disabled selected>Find in this list:(/option>
(option value="123123123">Name(/option>
(option value="123123123">Name(/option>
(option value="71234567890">Name(/option>
(select>(p>
(to output the form here and we can not

Script:

ini_set('display_errors',1);
error_reporting(E_ALL);
include_once "smsc_api.php";

$win_login = "text";
$win_pass = "text";
$mp_login = "text";
$mp_pass = "text";
$tel = "Here it is necessary to introduce from phone";

$str = " WINDOWS: ". $win_login." / ".$win_pass;

list($sms_id, $sms_cnt, $cost, $balance) = send_sms("there should be a phone", "arbitrary text", 1);

var_dump(list($sms_id, $sms_cnt, $cost, $balance));

?> - quincy8 commented on June 27th 19 at 15:31
<select name="tel">
 <option>Select a hero</option>
 <option value="71234567890">Cheburashka</option>
 <option value="71234567890">Crocodile Gena</option>
 <option value="71234567890">Shapoklyak</option>
 <option value="71234567890">Rat Larisa</option>
/select>
$tel = "Here it is necessary to introduce from phone";
replace 
$tel = $_POST['tel'];</select>
- Rodolfo_Klein21 commented on June 27th 19 at 15:34
Your
<select class="form-control"> should be with name</select>

a in the code:
$tel = "Here it is necessary to introduce from phone";
replace
$tel = $_POST['tel']; - quincy8 commented on June 27th 19 at 15:37
Thank you very much! - quincy8 commented on June 27th 19 at 15:40

Find more questions by tags PHPHTML