Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6348995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:31:42+00:00 2026-05-24T21:31:42+00:00

Got some great help yesterday with some php code for a mailer and forgot

  • 0

Got some great help yesterday with some php code for a mailer and forgot that I also need to know how to include the code so the mailer knows which option is checked in the checkbox. It is a simple ‘join mailing list’ option with only a yes or no option available.

Code is as follows:

    <?php
    $state = 0;
    // check to see if verificaton code was correct
    if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){
    // if verification code was correct send the message and show this page
    mail("myemail@gmail.com", 'Online Form: '.$subject, "\n".$message." 

    \n\n".$name."\n\n".$lastname."\n\n".$from."\n\n".$_SERVER['REMOTE_ADDR']."        \n\n".'mailinglist: '.$mailinglist, "From: $from");
   // delete the cookie so it cannot sent again by refreshing this page
   setcookie('tntcon','');
    $state = 2;
    } else if(isset($message) and $message!=""){
    // if verification code was incorrect then return to contact page and show error
    $state = 1;
    }

    if ($state == 0) {  ?>

I tried playing with this a bit to see if I could figure it out, but thought I would stop before I get ahead of myself and totally mess it up:

   <td align="left"><input type=checkbox name="mailinglist" id="mailinglist"     value="1<?php echo $_GET['mailinglist'];?>">Yes<input type=checkbox name="mailinglist"  id="mailinglist" value="2<?php echo $_GET['mailinglist'];?>">No<font face="Verdana"  size="3" color="#666666"></font><br> </td></tr><tr valign="top" align="right"> <td  nowrap><font face="Verdana" size="3" color="#666666">comments (<span class="R">*</span>)</font></td> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:31:43+00:00Added an answer on May 24, 2026 at 9:31 pm

    If you want the email to say whether the user selected Yes for maling list do the following:

    <td align="left">
    <input type="radio" name="mailinglist" value="Yes" /> Yes
    <input type="radio" name="mailinglist" value="No" /> No
    </td>
    

    and in the email you can print the selection as:

    Mailing list: <?= $_POST['mailinglist'] ?>
    

    assuming that you used method POST for form submission

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got some code here that works great on IPv4 machines, but on our
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I've got a great MS Outlook 2003 addin going that adds some features to
I asked some similar questions [1, 2] yesterday and got great answers, but I
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I got some legacy code with that caption spread out as comment almost in
I've got some code that needs to run every 2 minutes which seems simple
I got some help a few weeks ago on some code for a drop
I need some Regex help. I've got a series of numbers. For example: 2010
I got a RS232 signal capture device. and it working great. I need some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.