I have customers who want access to my secure forms. However, they want the page to appear like it is till on their site. The easy solution is to use frames however, I don't care for frames and that would require too much design effort on my customer. On top of that you loose the secure https in the address bar and the lock in the status bar of my secure forms page. Here is what I was thinking; I'm just looking for suggestions to move forward...
Have my customer design a template page. In the body of the page where the forms should begin insert comments such as <!-- forms start here --><!-- forms end here -->
When a form is called grabs that template and inserts my form HTML between the above comments. Presto...it should work.
Is fopen() the best function to grab the external HTML?
Is there a better way to do this?
Get template from customers site...Insert your forms
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'd suggest caching their template on your server, just so you don't have to make an external page request every request, which will slow down the page response in various times. file_get_contents() is probably the better function to use if you have access to it. Otherwise, fopen works, however you cannot do a filesize() on it. .. and of course, regular expressions are probably best to switch out the form.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you can use a cron or other schedule to make sure it's pretty new...
curl may incur a lot of overhead you don't need. If you needed to post or parse header information in the response, then curl is the sure thing. But for a simple page request, file_get_contents() does the job quite well. You do need to have fopen URL wrappers on though, but most hosts have that on already.
curl may incur a lot of overhead you don't need. If you needed to post or parse header information in the response, then curl is the sure thing. But for a simple page request, file_get_contents() does the job quite well. You do need to have fopen URL wrappers on though, but most hosts have that on already.