PDA

View Full Version : Passing variable to html pages



vatsia
11-05-2005, 09:45 AM
Hello,
hope this question doesn't sound stupid :o :
how can i pass a variable from an html site to another (apart from using forms) something like site.html?variable=sometext and how can i display this variable in an html file? :confused:
I am using mostly php (echo or print) but how can i do this in simple html??????

Sean
11-05-2005, 10:15 AM
I don't think you can because the variable is only in the PHP... don't quote me on this thought because I'm always learning new stuff you can do with PHP.

Chris
11-05-2005, 10:46 AM
You can't, HTML does not contain the ability to parse a variable out from a query string.

What you can do is setup your server to parse .html files as PHP code. This would allow you to keep the .html extension but use PHP within the file.

intelliot
11-05-2005, 07:25 PM
In addition to what Chris said, I think it's also possible to use those variables in Javascript. Of course, it would all be done client-side.

Todd W
11-05-2005, 09:25 PM
Why does it have to be .HTML why not just convert to .PHP or do what Chris said?

vatsia
11-06-2005, 04:07 AM
Why does it have to be .HTML why not just convert to .PHP or do what Chris said?

Because the landing page is not mine (is on different server). I think it is what Chris said. I have to look into that this way ...