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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:11:00+00:00 2026-06-12T05:11:00+00:00

my code below is giving an output when I check the page source of

  • 0

my code below is giving an output when I check the page source of not removing the HTML tags for the username even though I specify to strip them. If I remove the <p> tags at the bottom and just echo through the PHP function Login() itself, strip_tags works, but if I try and output the value of strip tags in the HTML, it fails.

PHP Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<?php

function Login() {
    $username = $_POST['username'];
    $password = $_POST['password'];

    $username = strip_tags($username);
    $password = strip_tags($password);
    $username = trim($username);
    $password = trim($password);
?>


<?php echo "<p>" . $username . "</p>" ?></p>
<?php echo "<p>" . $password . "</p>" ?></p> 
</body>
</html>

Any insight as to why the echoed text $username and $password are being displayed with tags still would greatly be 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-06-12T05:11:01+00:00Added an answer on June 12, 2026 at 5:11 am

    You’re not calling the Login() function in this example and you’re missing a } after the function declaration. Additionally, the variable scope is off. Consider the following 🙂

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    </head>
    <body>
    <?php
    
    function Login() {
        $username = strip_tags(trim($_POST['username']));
        $password = strip_tags(trim($_POST['password']));
        echo '<p>', $username, '</p><p>', $password, '</p>';
    }
    
    if (!empty($_POST)) Login();
    ?>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been wondering why the code below is giving me different output on
The code below is giving the following error: An expression tree may not contain
The code below is giving me the error: column 'id' in field list is
I cannot understand why the code below is giving me this error in firebug
The code below works in FF, Safari, Chrome. But IE is giving me issues.
When I run below code, it's giving a message that: the application stopped unexcepctedlly
I've simplified my JavaScript code to the example below; this code is giving me
I've got the following java code, which is giving the error below: import java.io.File;
I have the below code: <cfset abcList = *,B,b,A,C,a> <cfset abcList=ListToArray(abcList,',')> When I output
The code below is giving me a flat line for the line of best

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.