Forum Moderators: open

Message Too Old, No Replies

Possible to send form info to another websites form?

Better explanation inside...

         

rmphoto

7:36 pm on Dec 26, 2007 (gmt 0)

10+ Year Member



Ok heres what I want to do.

I have a link on my website that takes users to a form, (name, email etc). The site where the form is hosted is not my own, and looks much different than my site, and I find users less likely to fill out this form due do the change in looks.

Is is possible somehow to have a form on MY website, where when a user fills it out and presses send, the data they entered can be sent as if from the other form?

Wow im reallt not good at explaining, I hope you all understand what im trying to do.

coopster

1:46 am on Dec 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, you can. You can use server-side programming such as PHP, Perl, etc. to capture form values, open your own link from your server to the form processing page of the form on the other server, and post your values and then read the response.

rmphoto

2:01 am on Dec 27, 2007 (gmt 0)

10+ Year Member



ya i figured this could be done with php.

unfortunately im not exactly a php expert... any idea where to source some code for this?

coopster

2:14 am on Dec 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Since the form is specific, I'm guessing your code is going to be specific -- I don't think you will find a "one-size-fits-all" open-source code package to get the job done. At least, if it exists I am unaware of the package. You may end up coding it yourself or hiring it out.

rmphoto

2:41 am on Dec 27, 2007 (gmt 0)

10+ Year Member



guesse ill have to do some more research..
thanks coopster.

coopster

2:52 am on Dec 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You bet. Don't forget, there are server-side scripting forums here at WebmasterWorld with plenty of knowledgeable folks that are more than willing to help you get over your programming issues if you decide to go that route!

Solution1

6:45 am on Dec 27, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



No need to do this with server side programming.

You can just copy the form's HTML code, and change the "action" attribute to the URL the form needs to post to.

Let's say the actual form is on http://www.example.com/there/here.php, and has this form tag:

<form name="frm" action="here.php" method="POST">

change this to:
<form name="frm" action="http://www.example.com/there/here.php" method="POST">

coopster

2:11 pm on Dec 27, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That would certainly work, until there is an input error and they are redirected back to the original site's form page again which is exactly what rmphoto is trying to avoid.

rmphoto

6:05 pm on Dec 27, 2007 (gmt 0)

10+ Year Member



solution1, i thought of that, but there is no action field in the sites form, so im not sure how its coded on the server. plus the problem coopster mentioned.

i think the only way to make it reliable is to have some custom code done.

Solution1

7:04 am on Dec 30, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



rmphoto, you can simply add the action attribute if it isn't there, and have it contain the URL of the form. It will solve your actual problem (users not entering data), though a better solution (coopster's) is possible.

You could avoid input errors with some Javascript.