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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:04:34+00:00 2026-06-18T08:04:34+00:00

In a webpage a user can enter strings into input elements. After the form

  • 0

In a webpage a user can enter strings into input elements. After the form is submitted, all inputs are verified against rules. After the validation the inpit page is displayed again to the user with marked errors and the already filled in input elements.

Partial code in the validation page for sending back the data:

$query_string = '?filename='.$timed_file_name . '&name=' . $name . '&text='.$text; 
header('Location: http://' . $server_dir . $next_page . $query_string);

It’s obvious that the ampersand cannot be used in the header, because if I type jack&jones it will mess up the header and php will return only jack.

I can do it in an ugly way:

Validation page:

$name = html_entity_decode($name); 
$name = str_replace("&","aammppeerrssaanndd",$name);

Input page:

$name = $_GET['name'];
if (strpos($name,'aappoossttrroopphh') !== false) {
    $name = html_entity_decode($name); 
    $name = str_replace("aappoossttrroopphh","&",$name);
}

Is there an easy solution for this?

  • 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-18T08:04:35+00:00Added an answer on June 18, 2026 at 8:04 am

    When creating the URL, run your variables through this:

    $var = urlencode( $var );
    

    And when showing users the results, go the other way:

    $var = urldecode( $var );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application where the user can enter text into an input
I have around 50 textboxes in my webpage, where user can enter numeric values.
I wrote a webpage where a user can enter a log entry that is
I have a TextBox on my ASP.NET webpage, where the user can enter a
I have a javascript backed 'print' button on my webpage where the user can
I have a webpage that has a textbox. When the user enters information into
I have a tag field in my web page, in which user can enter
I have a WPF System.Windows.Controls.WebBrowser control in a Window. A user can enter information
How can I open a webpage from a java application and enter username and
I'm trying to create a webpage where the user can submit information that they

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.