上篇文章给大家介绍了《你了解PHP常量和变量可变变量?如何去使用呢???》,本文继续给大家介绍PHP常量和变量之外部变量,跟随我的脚步一起出发吧!!!

PHP常量和变量之外部变量:
外部变量:外部变量就是PHP在使用过程中规定好的一些变量;
例如:我们将一下代码放在一个表单中,命名为user.html:
代码如下:
代码执行结果如下:

以上代码是HTML最基础的一段代码,再次代码中,其意思就是把用户和密码,采用get方法,将数据发送给reg.php。reg.php在接受用户传来的username和password这两个值;
从而得出第一个外部变量:$_GET
$_GET的主要作用是指将得到的get传值的数据;
建立一个新的表单:命名为reg.php,用$_GET来接受值:
代码如下所示:
代码如下所示:

关于$_GET传值,在地址栏会看到密码,如果不想让其他人看到密码,我们需要在PHP的代码中把$_GET改为$_POST:
代码如下所示:
代码如下所示:

推荐:《PHP视频教程》
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!
Pourquoi Win11 ne peut-il pas être installé ?
largeur de décalage
Introduction à l'utilisation du code complet VBS
Introduction aux paramètres de l'indice de performances du processeur
Quels sont les avantages du modèle d'usine Java
Comment effacer le flotteur en CSS
Comment convertir le format wav
Comment supprimer mon adresse WeChat