Question:

How do you use the ? to pass information to a web page?

by  |  earlier

0 LIKES UnLike

I know how to type it in as the URL but do you need to use CGI or can you just add something to the HTML?

 Tags:

   Report

1 ANSWERS


  1. You can't access it in straight HTML.

    However, in a cgi script, or some other language (such as PHP), you can access it via the environment variable "QUERY_STRING".

    For example, "http://www.example.com/something.php?fo... then you will have $_SERVER["QUERY_STRING"] equal to "foo=bar&bar=foo".

    If your web server allows "server-side includes", then you may be able to have your HTML file "include" the output of an external program, and this program can access then environment.  The specifics on doing this depends on the web server being used by your hosting company.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.