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 7739471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:31:54+00:00 2026-06-01T08:31:54+00:00

I started with the code from simplemodal, and modified to suit my needs. That

  • 0

I started with the code from simplemodal, and modified to suit my needs. That went amazingly well. The last issue I have is getting some radio buttons to post. I’ll skip the code blocks I don’t think are necessary and just show what I think is relevant. I’ve tried literally dozens of attempts of solutions from php.net, but nothing seems to work.

HTML

<label for='PayPlatform'>Are you willing to pay for a trading platform?</label>
<input type='radio' name='PayPlatform' value='Yes' tabindex='1001' />Yes
<input type='radio' name='PayPlatform' value='No' tabindex='1002' />No

Here’s where I can’t get the value and my attempt there are two attempts in the codeblock below, they were of course not attempted at the same time.

else if ($action == "send") {
// other elements form values are retrieved fine, just not the below
$PayPlatform = isset($_POST['PayPlatform']) ? ' checked="checked"' : "";
    //the ternary above just submits 'checked="checked" no matter which radio is checked
    //another attempt
    $PayPlatform = isset($_POST["PayPlatform"]);
    //this just submits "1" weather yes or no is checked
$token = isset($_POST["token"]) ? $_POST["token"] : "";

// make sure the token matches
if ($token === smcf_token($to)) {
    smcf_send($name, $email, $subject, $phone, $message, $PayPlatform);
    echo "Your message was successfully sent, you can close this window";
}
else {
    echo "Unfortunately, your message could not be verified.";
}
}
  • 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-06-01T08:31:55+00:00Added an answer on June 1, 2026 at 8:31 am
    $p = (isset($_POST['PayPlatform']) && $_POST['PayPlatform'] == 'Yes');
    

    Boolean true if the yes radio is checked, and false otherwise.

    Assume you have the following:

    $a = 'Yes';
    isset($a); //true
    $b = 'No';
    isset($b); //true
    

    Strings are considered set, and as PsyCoder said, you’ll receive the value values, not Booleans.

    Also, on a different (chastise-y) note, this question could have been entirely avoided with a bit of better debugging. The first thing I would have done would have been to var_dump($_POST) and see what the value was. You’d have then seen that $_POST[‘PayPlatform’] was always Yes or No, and you’d have potentially realized that isset is always true on strings.

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

Sidebar

Related Questions

I have checked out code from a svn repository and started making changes. But
I have received some code from another team and started to simple improvement and
I have simple application from this tutorial: WCF 4 Getting Started Tutorial How can
I have recently migrated my code from Rails 2.3.4 to rails 3 and started
I'm a newbie, and plainly started with a sample code from the book 'Beginning-iOS-5-Games-Development'.
From the discussion started here , I'd like to know whether the following code
I have just installed C# 2008 Express Edition 2008 and started writing code. My
I just started the use of Mapkit Framework. I got a sample code from
i have implement this code from programming pearls and i think it should be
I have this code from programming pearls #include <iostream> //#include <string> using namespace std;

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.