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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:10:27+00:00 2026-06-11T08:10:27+00:00

Hello I have the following script in PHP: $correct = array(a, a, a, a);

  • 0

Hello I have the following script in PHP:

$correct = array("a", "a", "a", "a");
$totalValue = "First Name: " . $fname . "\n";
$totalValue .= "About Our Mission | Question 01: " . $S1Q1 . "    " . (compare $correct[0] with $S1Q1 choice) ? "Correct" : "Wrong" . "\n";

$S1Q1 is a variable which I accept from a form using radio button:

    <input type="radio" name="S1Q1" value="a" /> True
    <input type="radio" name="S1Q1" value="b" /> False

(compare $correct[0] with $S1Q1 choice) ? “Correct” : “Wrong” < how do I implement that in the php code.

And for the next radio choice I would compare $correct[1] with $S1Q2… and so forth.

  • 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-11T08:10:29+00:00Added an answer on June 11, 2026 at 8:10 am

    This will check if value entered in radio button is = to correct answer

    $S1Q1 = $_GET['S1Q1'];
    ($S1Q1 == $correct[0]) ? 'correct' : 'wrong'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in a PHP script: <?php if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
CODE HERE: http://jsfiddle.net/B7Y43/ Hello fello programmers, I have the following situation: My PHP-script generates
Hello I have the following php script $db =& JFactory::getDBO(); $sql = select uid
I have the following php script sends an email based on parameters returned: <?
I am a newbie in php, mysql. I have written a hello.php script, which
Hello friends I have the following script in my Template: window.addEvent('domready', function () {
I have encounteed an issue with php treating 0 differently. I run following script
I have the following jquery script that I want to work <?php $script=<<<SCRIPT $(#btn).click(function(){
Hello! I have the following script: import os import stat curDir = os.getcwd() autorun_signature
I have the following jQuery-tmpl template: <script id=month-template type=text/x-jquery-tmpl> <div style=width:${width};> <div>Hello</div> </div> </script>

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.