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!

 

Link to comment
Share on other sites

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,

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.