Jump to content

Can anyone help with this PHP form checkbox query?


markrees

Recommended Posts

I have a contact form in php format. The results are e-mailed to me.

 

I'm having a problem getting an indication of whther the Subscribe field is checked or not checked. The other fields (text fields) come through on the e-mail fine.

 

this is the part of the php that decides what gets displayed on the e-mail - however for the subscribe field (checkbox) it doesnt show if the checkbox is ticked or not - the e-mail just shows the word Suscribe:

 

$message = " $todayis [EST] \n

Attention: $attn \n

Message: $notes \n

From: $visitor ($visitormail)\n

Postal Address: $postal \n

Subscribe: $subscribe \n

Additional Info : IP = $ip \n

Browser Info: $httpagent \n

Referral : $httpref \n

 

 

thanks in advance if you can help on this!

 

Something like this .

 

if (isset($subscribe))

{

$subscribe = "Subscribed";

}

else

{

$subscribe = "Not Subscribed";

}

 

put that after

$subscribe = $_POST['subscribe'];

 

only if that is how you have your code written post up your php code so i can tell you for sure,

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.