Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-18-2007, 09:00 AM   PM User | #1
.Darkman
New Coder

 
Join Date: Jul 2006
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
.Darkman is an unknown quantity at this point
A Simple Form

Hello Everybody,

I need some help in making a simple form.

What i want is, once i fill in the information and hit submit, an "external" url will be contacted using GET method. It sends the form data to the url and displayed the response in place of the form.

How do i do it ?

I came up with something basic. But when i put the form on one server and the processing PHP script on another, it fails.



Thanks,
.Darkman is offline   Reply With Quote
Old 05-18-2007, 11:20 AM   PM User | #2
ess
Regular Coder

 
Join Date: Oct 2006
Location: United Kingdom
Posts: 865
Thanks: 7
Thanked 29 Times in 28 Posts
ess will become famous soon enough
It fails due to security issues. Basically, you cannot use ajax to make calls to a remote server...other than the server you script resides in.

If you are looking for a work around, then you might have to submit your script to your server...and then have PHP forwarding the request to the second server.

Cheers,
Ess
ess is offline   Reply With Quote
Old 05-18-2007, 03:11 PM   PM User | #3
.Darkman
New Coder

 
Join Date: Jul 2006
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
.Darkman is an unknown quantity at this point
Oh ! Okay

So how can i do it simply ? on the same server of course.

Instead of form, just using a link.

When a link is clicked, a GET url will be contacted and the result will be displayed in place of the link.
.Darkman is offline   Reply With Quote
Old 05-19-2007, 10:45 AM   PM User | #4
ess
Regular Coder

 
Join Date: Oct 2006
Location: United Kingdom
Posts: 865
Thanks: 7
Thanked 29 Times in 28 Posts
ess will become famous soon enough
Check out the following link...it is a very good tutorial on Ajax...and should demonstrate how you can do just that

http://developer.mozilla.org/en/docs/AJAX

Cheers,
Ess
ess is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:50 PM.


Advertisement
Log in to turn off these ads.