How to integrate a form from our servr into another website?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

How to integrate a form from our servr into another website?

Post by php_ghost »

I have this somewhat like an application form that must be integrated into our clients' website. Everything that their customers inputs in that form goes to our server's database.

How can I make this, so that only authorized clients/users can integrate the form in their site?

TIA :)
Mohit_Prog
Forum Commoner
Posts: 26
Joined: Mon Apr 23, 2007 6:10 am

Post by Mohit_Prog »

1.
you can write a form. that should be on [s]ur[/s] your client's server.
In form's action method give path of script written at your server( i.e., http://www.myserver.com/formdb.php )
In that file do whatever [s]u[/s] you want with those data.

2.
Or [s]u[/s] you can put some link on your client's website. From that link, user come to [s]ur[/s] your site.( In this case form and script both are at [s]ur[/s] your side. )
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

Post by php_ghost »

In form's action method give path of script written at your server( i.e., http://www.myserver.com/formdb.php )
Yah I've thought of this too. But if I use this, others can spam my database. Is there anyway to limit others from submitting to the page?
mentor
Forum Contributor
Posts: 100
Joined: Sun Mar 11, 2007 11:10 am
Location: Pakistan

Post by mentor »

You can confirm from which host/referrer ($_SERVER['HTTP_REFERER']) it is being posted. Though it is not completely reliaable.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

I believe you could use an iframe but not sure if it is allowed for browser security. One of your major difficulties is the client security. Passing a unique id in the URL doesn't work as someone could simply copy it. You need to therefore figure out an alternative method.

Racking my brains... one possible solution would be to give your clients (if they had PHP) a PHP CURL script which logs into your site with a client_name and password then goes to the form and inserts it (and any results) into the HTML on their side. The CURL script runs on their site not yours. Anyone other than the clients wouldn't have the CURL script, only access to the HTML hence problem solved. They wouldn't even necessarily know they are connecing to your site.

Of course I'm now waiting for someone to tell me I'm wrong and that there is a much easier method. :wink:
mentor
Forum Contributor
Posts: 100
Joined: Sun Mar 11, 2007 11:10 am
Location: Pakistan

Post by mentor »

@CoderGoblin

cURL/fopen is a good option, but on shared servers you are not sure if these are enabled.
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

Post by php_ghost »

You can confirm from which host/referrer ($_SERVER['HTTP_REFERER']) it is being posted. Though it is not completely reliaable.
Yah I've been trying this one and yes it's not completely reliable.

Thanks mentor and CoderGoblin. I'll try your suggestions.

Thanks everyone for your replies. :D
Post Reply