Jump to content

Javascript and PHP


ThePsion5

Recommended Posts

Hi,I would like to figure out how to create a small popup window whenever a certain link is clicked. I think I have an idea of what I should do, but i'm not entirely positive it will work.Basicly, i have a search page that displays various results, one of which I would like to be a link that opens a new window. I know i can use the window.open function for this, but the problem is that I want to transfer information that I can use in a php script on the page. What's the best way to go about this? I was thinking about using GET to send the values (by dynamicly putting the GET values into the URL via javascript), but is this a good idea and how would I go about doing this (I havn't found any good tutorials on using GET values by entering them directly into the URL)?P.S. Security isn't an issue for the information i'm passing into the popup window.

Link to comment
Share on other sites

Passing ht einfo in GET is alright since you say security is not an issue. I use this method often.You can do it with javascript or PHP.You could catch the values of the form when the form is submitted with javascript and then open the new window. (this is probably easiest).Or you could submit the values to a php page which then builds the url then opens the new window by echoing some javascript.I would go with the first one. If you are worried about users that have javascript turned off you could use the target attribute of the form tag (it is depreciated in XHTML) http://www.htmlcodetutorial.com/forms/_FORM_TARGET.html.

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...