it9888 Posted February 27, 2007 Share Posted February 27, 2007 Can I pass variables to a file that I run directly from my computer? Like: C:\test.html?x=5 I don't want to use any kind of server including the IIS. Link to comment Share on other sites More sharing options...
pulpfiction Posted February 27, 2007 Share Posted February 27, 2007 If you use GET method it should work, even if you are not using (localhost)IIS.......<form action="nextpage.html" method="get" name="frm"> Link to comment Share on other sites More sharing options...
Skemcin Posted February 27, 2007 Share Posted February 27, 2007 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 More sharing options...
justsomeguy Posted February 27, 2007 Share Posted February 27, 2007 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. Link to comment Share on other sites More sharing options...
croatiankid Posted February 27, 2007 Share Posted February 27, 2007 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 More sharing options...
pulpfiction Posted February 27, 2007 Share Posted February 27, 2007 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 More sharing options...
justsomeguy Posted February 27, 2007 Share Posted February 27, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now