Crmgo Blog

PHP Getting Started (GET and POST Methods)

PHP Getting Started (GET and POST Methods)

The first thing that interested me was the passing of parameters (get, post methods).

PHP Getting Started (GET and POST Methods)

The first thing that interested me was parameter passing (get and post methods)

обращение к пхп на стороне клиента:
<span style="color: #000080;" data-mce-style="color: #000080;"><form method="post" action="login.php"> Логин:<br><input type="edit" name="login"><br> Пароль:<br><input type="password" name="pas"><br> <input type="submit" value="Ok"> </form></span>
строка в браузере должна быть такого вида:
[адрес сайта][имя скрипта]?([переменная 1]=[значение переменной 1])&([переменная 2]=[значение переменной 2])...&([переменная N]=[значение переменной N]) 
прием параметров на стороне сервера:
<?php //... 
$login=$_POST['login']; //логин 
$pas= $_POST['pas']; //пароль 
//... 
?>

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.

Categories: PHP