eliwedel eliwedel - 3 months ago 21x
PHP Question

Check if $_POST exists

I'm trying to check whether a $_POST exists and if it does, print it inside another string, if not, don't print at all.

something like this:

$fromPerson = '+from%3A'.$_POST['fromPerson'];

function fromPerson() {
if !($_POST['fromPerson']) {
print ''
} else {
print $fromPerson

$newString = fromPerson();

Any help would be great!

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