开发者

embedding a php webpage inside a webpage like vanilla forums embed plugin

开发者 https://www.devze.com 2023-04-05 15:14 出处:网络
I am creating this website (php app). Let\'s call it Site开发者_如何学编程1 (so ingenious, I know).

I am creating this website (php app). Let's call it Site开发者_如何学编程1 (so ingenious, I know).

I want other people to be able to "embed" my site into their site/their webpages. Something similar to Vanilla embed plugin For example, if you wanted to embed Vanilla forum into your webpage, all you need to do is: copy and paste this forum embed code into the remote application where you would like the forum to appear.

<script type="text/javascript" src="http://embed.vanillaforums.com/plugins/embedvanilla/remote.js"></script>

If you insert that code, the forums would appear in your webpage.

I want other people to be able to embed my app into their page as well. I am not sure how to code my site in a way that it can be done.

To put things in context: My php app is going to be a "classified-directory" app. It will list out some classifieds based on user's location. So, when user embeds my app into their page, we also need to make sure they have a way of passing "correct" location so that my app (embedded inside their webpage) shows correct classified listings.

Thanks


The actual build of your remote site has little in this case to do with embedding on another's website. The real key to your solution is inside of http://embed.vanillaforums.com/plugins/embedvanilla/remote.js. I'm not going to tell you how to go about it (leave that bit up to you), but the above script essentially creates and formats an iFrame on the user's page containing the remote application. Study the script and you'll figure it out.

0

精彩评论

暂无评论...
验证码 换一张
取 消