如何制作一个php curl / POST处理网址



我想问的是一个网址,任何人都可以在其上发布变量。我怎样才能创建一个PHP页面,它可以接受通过post发送的变量,通过curl或表单post或其他方式发送。

我可以接受通过邮寄发送的变量吗

$_POST['varible']

这样如果有人在我的网址上发布一个"变量",我就能得到它吗

<?php
if (isset($_POST['submit'])) { //Check if the submit button is pressed.
    $field1 = $_POST['field1']; //Take the post data of "field1" from the form.
    $field2 = $_POST['field2']; //Take the post data of "field2" from the form.
    echo "$field1 $field2"; //Echo the fields.
}
?>
<form method="post">
<input type="text" name="field1" placeholder="Field 1"><br>
<input type="text" name="field2" placeholder="Field 2"><br>
<input type="submit" name="submit" value="Send Data">
</form>

是的,您可以使用 $_POST 接受值.form 发布到 php 的数据是使用您所说的接收

最新更新