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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:51:52+00:00 2026-06-11T21:51:52+00:00

<html> <head><title></title></head> <body> <?php if (isset ($_POST[‘posted’])) { if ($_POST[‘question1’] == Lisbon) { echo

  • 0
<html>
<head><title></title></head>
<body>
<?php
if (isset ($_POST['posted'])) {
if ($_POST['question1'] == "Lisbon") {
  echo "You are correct, $_POST[question1] is the right answer<hr>";
}

if ($_POST['question1'] != "Lisbon") {
  echo "You are incorrect, $_POST[question1] is not. the right answer<hr>";
}
}
?>
<form method="POST" action="quiz.php">
<input type="hidden" name="posted" value="true">
What is the capital of Portugal?
<br>
<br>
<input name=''question1" type=''radio" value=''Porto''>
Porto
<br>
<input name=''question1" type="radio" value=''Lisbon''>
Lisbon
<br>
<input name="question1" type="radio" value=''Madrid''>
Madrid
<br>
<br>
<input type=''submit''>
</form>
</body>
</html>

This is the whole part, it’s from a PDF. Thing is though, they didn’t specified why they used ‘ ‘ for the question1 in the if statement but no quotes in the echo statement.

In a nutshell: why $_POST[‘question1’] has ‘ ‘ in the if statement
and why $_POST[question1] doesn’t have in the echo statement. They are the same variable.
Thank you.

  • 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-11T21:51:53+00:00Added an answer on June 11, 2026 at 9:51 pm

    Always use quotes (for string keys), unless inside a double quoted string. See the string parsing section of the manual.

    $juices = array("apple", "orange", "koolaid1" => "purple");
    
    echo "He drank some $juices[0] juice.".PHP_EOL;
    echo "He drank some $juices[1] juice.".PHP_EOL;
    echo "He drank some juice made of $juice[0]s.".PHP_EOL; // Won't work
    echo "He drank some $juices[koolaid1] juice.".PHP_EOL;
    
    • 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 sample upload3.php: <html> <head> <title>PHP Form Upload</title> </head> <body>
I have my registerUsers.html as below <html> <head> <title>userlogin</title> </head> <body> <h1><center>User login</center></h1> <p>
For example: <html xmlns=http://www.w3.org/1999/xhtml xml:lang=en lang=en> <head> <title>title</title> </head> <body> <a href=aaa.asp?id=1> I want
<html> <head> <title>Latency Tracking Demo</title> </head> <body> <script type=text/javascript src=http://www.google-analytics.com/ga.js></script> <script type=text/javascript src=http://www.example.com/scripts/time-tracker.js></script> <script
The code is as below: <html> <head> <title>test</title> </head> <body> <div><span>shanghai</span><span class=margin> </span><span>male</span></div> </body>
I have the following html/php/javascript code: <?php $textBox1 = $_POST[textBox1]; ?> <html> <head> </head>
Here's my registerFormOne.php code: <?php session_start(); require(validationLibrary.php); $validForm = true; ?> <html> <head> <title>Registration
Suppose that I have the PHP code as below: <html> <head> <title>Convert HTML to
See example: <!DOCTYPE html> <html> <head> <title>language</title> <script type=text/javascript src=http://www.google.com/jsapi> </script> </head> <body> <div
I'm breaking my head over this code: <html> <head> <title>Westpop</title> <link rel=stylesheet href=opmaak.css> </head>

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.