Jump to content

Passing variables to local file


it9888

Recommended Posts

Using a form with the get method (as pulpfiction points out) is one way, but creating the string in a link is another.Naturally, you know that without a web server the page is not processed. Therefore a server side scripting language can not do anything with that url query string. In fact, only javascript would be able to do anything with the query string values.Although I think your question has been answered, would you care to share a little more about what you are doing to better understand the application or context of your question?

Link to comment
Share on other sites

actually if you have PHP or any server scripting language installed, you CAN make use of it (on your own computer). however know, that you can't actually have a file with that kind of name in windows. you can declare a variable with it (eg x=5), and if you have a conditional or switch in the php file, it can do something with that.

Link to comment
Share on other sites

It seems like a contradiction to me. You want to pass variables to a local page without using a web server, but without a web server you won't be able to do anything with the variables that you pass.
Guess we can use JavaScript to get the querystring variable... but might not be of much usehttp://www.activsoftware.com/code_samples/...s_in_JavaScript
Link to comment
Share on other sites

actually if you have PHP or any server scripting language installed, you CAN make use of it (on your own computer).
You can execute PHP on the command line, but that won't get invoked if you are clicking on a link on a web page or loading a page in a browser. If you are integrating a scripting language to work with web pages, then you need a web server running, you can't get around that. You can't load and execute a dynamic page in a browser without a web server. It's like trying to send email without an email server.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...