PHP include one website into another - php

I'm trying to show my Dropbox Public Folder on my website, i've got the link and i'm trying to use PHP include to do it like this:
<?php
include("MY DROPBOX LINK");
?>
But nothing shows up. I'm trying to avoid iFrames and thought PHP might be cleaner

include only works with local file references (same server)*- what are you specifically after? You could use an iframe?
<iframe src='MY DROPBOX LINK'></iframe>
OR
To include in your application, there are also native PHP scripting means such as here..and also here
*correction: as per the comments below, you can grab external content, though it is not recommended

You should probably be looking at using the Dropbox API for this. There is some PHP code here which should be a good starting point.

If you can install the php-curl module (or already have it), that seems the best option to me without iframes.

Related

Including phpBB

I installed phpBB on my localhost and can access it via localhost/myProject/board/, while my normal access path to my website would be localhost/myProject/?s=home
I want to include phpBB into my site in a way that it won't feel like a different site anymore, but behaves more like an iframe. I tried adding a board.php which just executes
include("viewforum.php");
and is accessed via localhost/myProject/?s=board. Result should be my basic .html site, with the phpBB included in the contentArea. However it doesn't work by giving errors like
WARNING: INCLUDE(/BOARD/COMMON.PHP): FAILED TO OPEN STREAM: NO SUCH FILE OR DIRECTORY
I googled a bit and can't find a solution for this. My train of thought here is that board.php could act as a wrapper around the phpBB and include the whole stuff in my side to act like an iframe AND handle the GET parameters. For example when browsing normally in the phpBB i get URLs like
http://localhost/myProject/board/viewforum.php?f=2
This should be handled by the wrapper by wrapping the GET parameters like
http://localhost/myProject/?s=board&boardSite=viewforum&f=2
Is something like that possible without to much effort?
Thanks in advance!
One way to do this is that you may find a similar scheme theme to add to the forum and add required menu at the top by using html & css code from the main site's menu.
Well, the most easiest and worst way is to use an iframe. It would display the board in a frame inside the page. It virtually makes linking imposibble and has other negative side-effects.
You will have a very hard time attempt to embed it like this. The application is not designed to be wrapped like this.
Your best bet is to adapt the phpBB styles to your website templates.

How to copy a complete php/mysql website with php?

I have a typo3 website with no user genrated or dynamic content.
So it is unnecessary to use php and the database.
Is it possible (with php) to clone the hole website and store every page as an html page?
I have only a normal webspace, so i cant install tools like "eAccelerator".
My idea:
- grab every link from the sitemap
- file_get_contents -> store as html
But i think this is not a clean solution? Or?
Thanks in advance!
james
you can use a simple software called HTTRACK., here is the link:
httrack.com
Why you need to use php to copy it? Did you consider using a command line tool like wget? wget allows you to create an "offline" copy of a website which you can of course host somewhere else. Sounds to me exactly like the thing you want to do.
In case you are really stucked to php, you will need an HttpRequest, call the site, parse all links and resources, download the resources, follow the links and do the same again. This is the most simple solution, without any checking for conflicting resources or other stuff which could go wrong.
Sitesucker http://sitesucker.us is an excellent tool you can run from any mac. It works very well, I use it all the time.
But don't forget that by creating a static copy of your site, you will lose your templating functionality. So if you really want to make your website static, I strongly recommend to - at least - put the identical parts of each page into php-includes. Mostly head, page header, footer, navigation. So you're ready for future changes.
If it's just because your TYPO3 is too slow, look at the nc_staticfilecache extension which can speed it up very well.
Using TYPO3 where you need just a simple HTML is a huge overflow, invest in DreamWeaver and code all things 'manually'.

Including content in index file by using php or ajax for search optimization

I have been designing a website for the past few days and I realized I may be using the wrong format to code the website.
I generally would use in the index.php (this is simple for dicussion)
<?php
require("header.php");
include("home.php");
require("footer.php);
?>
I can use this for setting up an easy layout where I do not need to rewrite the code over again for a new page.
Or sometimes I would use a variant of that to have it point in the link i wanted.
A friend of mine told me this is not a good way to have pages load because of searching for google and such.
I'm wondering if I have to somehow use Ajax and writing codes according to googles crawling system (I'm really confused about)
PHP is run serverside when the page is requested so it will have already run when a client is able to view the page. Whatever you output with the php will be what is seen, not the actual php.

Mediawiki - Using PHP inside a form or page

I need to use some PHP code inside of a MediaWiki form. Basically, I need to use some PHP date stuff and create a few infoboxes based on timeframes. Is there a way to use PHP to generate a "template" in the "edit" box?
I'm very new to developing with MediaWiki, so I'm not sure how MediaWiki exactly works, and this is a very small project, so I haven't really dived into any documentation for the most part.
You can certainly add secure HTML within a wiki page. It seems there is also a securePHP extension. I haven't tried the PHP one myself but the HTML one works very well.
I was able to do this myself with a MediaWiki plugin called SemanticForms:
SemanticForms

How to include output of PHP script in Python driven Plone site?

I need to have the output of a PHP snippet in a Plone site. It was delivered to be a small library that has a display() function, in PHP, that outputs a line of text. But I need to put it in a Plone site. Do you have any recommendations?
I was thinking a long the lines of having a display.php that just runs display() and from the Plone template to download that URL and output the content. Do you think it might work? What methods of hitting a URL, retrieve the content and outputting can I use from inside a Plone template?
One important and critical constraint is that the output should be directly on the HTML and not an an iframe. This is a constraint coming from the outside, nothing technical.
Another option is to run the PHP script on the server using os.popen, then just printing the output. Quick and dirty example:
import os
print os.popen('php YourScript.php').read()
Well, use AJAX to call the PHP script (yes, you will need apache) and display the output. Adding a custom JS to plone is trivial and this abstract the technology issue.
Just be sure this is not a critical feature. Some users still deactivate JS and the web page should therefor degrade itself nicely.
Probably the easiest way: install windowz inside your site. That way you get a page with an iframe in your plone layout. Make sure the php script outputs a regular html page and configure your windowz page with that url. Done.
Works great for existing in-company phonebook applications and so.

Categories