Jump to content

[SOLVED] if field empty, submits empty field?


tronicsmasta

Recommended Posts

personally i would use IF's

 

IF(isset($_POST['name'])){

$name=$_POST['name'];

}else{

$name="Anonymous";

}

 

now that i look at it,

this:

IF(isset($_POST['name'])){
$name=$_POST['name'];
}else{
$name="Anonymous";
}

 

should be this:

 

if (!$_POST['name']) {
$name="Anonymous";
} else {
$name=$_POST['name'];
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.