Jump to content

initialize varaibles


greggustin

Recommended Posts

I want to preset variables in case users leave certain fields blank in a html form
eg $email='[email protected]';
then php has the following:
$Email=$_POST['Email'];
echo "Email : ".$Email."<p>";
if the user leaves the field empty, I want it to echo
[color=red]Email: [email protected][/color]
BUT
it does this -->
[color=red][font=Verdana]Email:          [/font][/color]
(ie nothing)
soooooooooo, am I stuck doing a IF test for each post?
that is, if post is empty, then set the variable to the desired default value?

Link to comment
https://forums.phpfreaks.com/topic/26896-initialize-varaibles/
Share on other sites

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.