“PHP -Post” Code-Antworten

VAR_DUMP _POST PHP

<?php print_r($_POST); ?>
Upset Unicorn

PHP -Post

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
  Name: <input type="text" name="fname">
  <input type="submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
  // do logic
  $name = $_POST['fname'];
}
?>
Andrew Lautenbach

PHP if $ _post

if( isset($_POST['fromPerson']) )
{
     $fromPerson = '+from%3A'.$_POST['fromPerson'];
     echo $fromPerson;
}

//Note: This resolves as true even if all $_POST values are empty strings
if (!empty($_POST))
{
    // handle post data
    $fromPerson = '+from%3A'.$_POST['fromPerson'];
    echo $fromPerson;
}
Healthy Hamster

PHP -Postanfrage

$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');

// use key 'http' even if you send the request to https://...
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }

var_dump($result);
mountainpython

post php

<?php
echo 'Hello ' . htmlspecialchars($_POST["name"]) . '!';
?>
Tame Tuatara

Ähnliche Antworten wie “PHP -Post”

Fragen ähnlich wie “PHP -Post”

Weitere verwandte Antworten zu “PHP -Post” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen