URL problem

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
flaming
Forum Newbie
Posts: 12
Joined: Tue Oct 21, 2008 9:57 am

URL problem

Post by flaming »

~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


Hi i'm new to the php world

i'd like to know is it possible to submit data from a html form to a url then open it in a new window

here is an example of the code i've got so far but it keeps opening in the same window

Code: Select all

<form method="PUT" target="_blank">
<input name="postcode" type="text" onclick="clickclear(this, 'Post Code')" onblur="clickrecall(this,'Post Code')" value="Post Code" size="10" maxlength="10" />
<input type="hidden" name="comppost" value="B66QE" />
<input name="submit" type="submit" onclick='window.location = "http://maps.google.co.uk/maps?saddr=" + postcode.value + "&daddr=" + comppost.value + ""; return(false);' value="Get Directions" />
</form>
any ideas??

any suggestions welcome

Thanks
James


~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: URL problem

Post by pickle »

Yes it is possible, but it has nothing to do with PHP (which only runs on the server).

If you put a "target" attribute in your <form> tag and give it a value of "_blank" or "_new", it should open in a new window. I'm not sure how compliant that is to XHTML standards though.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
flaming
Forum Newbie
Posts: 12
Joined: Tue Oct 21, 2008 9:57 am

Re: URL problem

Post by flaming »

thank you

i've got _blank and just tried _new but neither work unfortunately

could you suggest somewhere for me to look for an answer??

Much appreciated
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: URL problem

Post by pickle »

Google
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: URL problem

Post by papa »

I've never used target in a form element and I'm not so sure it works.

You could do a php execution after the form is submitted instead, using php and javascript.
Post Reply