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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:27:36+00:00 2026-06-04T07:27:36+00:00

I have a page index.php and i am fetching the values from url for

  • 0

I have a page index.php and i am fetching the values from url for a word.

<a href="index.php?skills=software engineer">Software Job</a>

In code below, it displaying the full value from $_GET, but its not showing in textbox

and url is

http://localhost/mysite/index.php?skills=software%20engineer


<?php

    if (isset($_GET['skills']) and !empty($_GET['skills'])) {
        $is_skill = 1;  // true and has value
        $skill_data = $_GET['skills'];
        echo "The searched skills : " . $skill_data; // Here its displaying full values
    } else {
        $is_skill = 0;  // false and has no value
    }

?>



<input type="text" name="textbo1" <?php if ($is_skill == 1) { echo "value=" . $skill_data; } ?> />

Now, in textbox, its not display the full value ie software engineer where as in
php code output is

The searched skills : software engineer

and value in textbox : software

Dont know what is the issue, need help on this why it doesnot accept

  • 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-04T07:27:38+00:00Added an answer on June 4, 2026 at 7:27 am

    Attribute values with spaces in them must be quoted.

    value=software engineer
    

    … is parsed as “A value attribute with the value ‘software’ and ‘An engineer attribute’

    You are also vulnerable to an XSS attack and your URL is invalid.

    Corrected code:

    <a href="index.php?skills=software%20engineer">Software Job</a>
    

    and

    <input type="text" name="textbo1" <?php 
        if ($is_skill == 1) { 
            echo 'value="' . htmlspecialchars($skill_data) . '"'; 
        } 
    ?> />
    

    Note you need to make all instances of external data safe for HTML with htmlspecialchars, not just the one I fixed in this example.

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

Sidebar

Related Questions

I have a page (index.php) that takes a GET variable from the URL and
At current i have an index page which shows values from an XML page
i have this URI. http://localhost/index.php?properties&status=av&page=1 i am fetching basename of the URI using following
I have a page (index.php) that pulls posts from mysql database. The posts are
I have 3 links on page index.php: <div id=languages> <a href=index.php?page=test&lang=en id=flag> <img src=./images/flags/en.png
I have the following code in a page (index.php), it's composed by just two
I have a page index.php where i have a link called add_users.php. In add_users.php,
I have an index page index.php , and when the user clicks on a
I have my index.php page and just afrer my header i want to include
i have a dynamic php web page localhost/ctd/index.php All working good except if i

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.