eliwedel eliwedel - 1 year ago 114
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!

Answer Source
if( isset($_POST['fromPerson']) )
     $fromPerson = '+from%3A'.$_POST['fromPerson'];
     echo $fromPerson;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download