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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:21:11+00:00 2026-05-31T08:21:11+00:00

I am in the process of learning PHP and I ran into a snag,

  • 0

I am in the process of learning PHP and I ran into a snag, and I feel it is because the video tutorials I am watching are from 2005 and some of the API’s haven’t transferred over to current standards. Long story short one of the “challenges” is to create a quiz and no matter what I do the PHP code leaks over and is printed along with the HTML.

<html>
<head><title>Chapter #4 Challenge</title></head>
<body>
<h2> Chapter #4 Quiz</h2>
<?php
$question1 = "<b>Question #1: What does the operator == mean?</b><br>
        A) <input type=radio name='q1' value='a'>Equals<br>
        B) <input type=radio name='q1' value='b'>Not Equal<br>
        C) <input type=radio name='q1' value='c'>True<br>
        D) <input type=radio name='q1' value='d'>Assignment<br>
        <input type=submit value='Submit'>
        </form><br>";
$q1answer = "d";
?>
</body>
</html>

The code outputs everything that it is supposed to but at the very end it also prints out:” “; $q1answer = “d”; ?>”

What’s confusing to me is why it prints anything at all, for starters, because I am just instantiating a variable and no where am I printing it. Second, why is it displaying the PHP code as text output?

Also, for the record I am using a switch statement which prefixes the variable $question1 with the opening “form” brackets so I don’t think it is because I am including it on the variable. Any thoughts would be greatly appreciated!

  • 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-31T08:21:12+00:00Added an answer on May 31, 2026 at 8:21 am

    I am sure, your file is not with *.php extension or/and your server is not php running.

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

Sidebar

Related Questions

Right now, I am in the process of learning PHP and I have some
Im the process of learning C++. I got stuck debugging some of my code
I'm in the process of learning Databases and SQL. From what I have read
I am in the process of learning xhtml/html5/PHP, and I have grasped the majority
In the process of learning to use Mongo and PHP, and got stuck with
I am currently in the process of learning the CodeIgniter PHP framework. At the
i'm learning about COM through an internet tutorial(http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5567/Step-by-Step-COM-Tutorial.htm). The first thing is creating a
I have some php and javascript experience and just started learning curl. Been messing
In the process of learning Prolog I'm making simple program which given some thing
I'm in the process of learning PHP and MYSQL. I created a new user

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.