PDA

View Full Version : Pull post text from one domain home to other


slinky
05-12-2001, 10:55 PM
I have two domains, thelaw.com and thelawforums.com. I set it up as 2 separate domains for a couple of reasons (price is great for 2 separate domains, usesseparate bandwidth, space, and traffic on two different servers, etc.) It's being virtual hosted.

I'm using vBportal for thelawforums, and the front page for it is really nice. So nice, that I'd say that the front page contains many elements of what I'd like to put on the home page of thelaw.com. Sticky polls are great, the "active topics" which would lead to discussion are great, etc.. Given the way that the pages are built at thelawforums, I'm wondering whether I'll have a problem pulling text from thelawforums home page onto the home page of thelaw.com (which is currently on an MS/ASP system that I'm thinking of switching to UNIX/PHP).

Has anyone done something like this? If I would switch it to a PHP based system I'm thinking it's a lot easier but still may involve a whole lot of work pulling info from the other domain. I'm also wondering whether I'll have an issue with access to and from mySQL from a separate domain. I'm a bit new to PHP and have been learning it for the past few weeks.

Anyone?

tubedogg
05-13-2001, 12:46 AM
You can use PHP on an MS server.

If you do use PHP, you can pull includes from across domains.

<?php include("http://www.thelawforums.com/info.php"); ?>

I'm pretty sure you can do this in ASP too, although I wouldn't have the foggiest idea how. :)

slinky
05-20-2001, 05:02 AM
Originally posted by tubedogg
You can use PHP on an MS server.

If you do use PHP, you can pull includes from across domains.

<?php include("http://www.thelawforums.com/info.php"); ?>

Just moved all my asp server stuff on thelaw.com to php! :) I'm much happier and have been getting into php programming. Thanks for the reply but I'm not sure how this is supposed to work. I can always use absolute addresses, for example:

require('http://www.thelawforums.com/forums/global.php');

but the other stuff, like functions, don't seem to work. Even if I put the functions.php in an include, I still get this error:

Fatal error: Call to undefined function: getpermissions() in /www/thelaw/index.php on line 12

which deals with this line of code:

$permissions=getpermissions();

Not sure why this doesn't work... this is probably going to be a bigger pain than even I had thought....

Kier
05-20-2001, 05:17 AM
You can't pull PHP pages from an HTTP address, as the target HTTP server will process the PHP page and send HTML, rather than the source PHP code.

slinky
05-20-2001, 06:10 AM
Originally posted by Kier
You can't pull PHP pages from an HTTP address, as the target HTTP server will process the PHP page and send HTML, rather than the source PHP code. True - but that's fine. I'm trying to pull the html results of the PHP code generated by vBulletin in one domain and put them into another html page on another domain. For example, the code that creates the calendar in vBulletin is based upon the calendar template. I want to pull the results of the template (created in my forums on thelaw.com) and embed it into my home page on another domain (thelaw.com).

The problem I run into is that several templates may create one element, for example the calendar (calendarbit, calendarbit_today, etc.). You can't just paste php code from one template into the html page as <?php ?> code because there are calls to other templates which include functions, etc. which results in undefined functions or variables. I'm not sure I'm using includes correctly, if at all and I have to include templates which are located in the mySQL database, not in a file like the global.php. How would I include the calendar template so that I can call it and build the calendar? I see the variable $headinclude
but I don't see where the value for this variable is set and therefore it must be called in from another template that calls calendar... I know... I'm still a little green but I've got a good learning curve. :)

Kier
05-20-2001, 06:21 AM
I'm going to move this to the hack requests forum, as this is becoming more suitable to that forum than this.

slinky
05-20-2001, 06:33 AM
Originally posted by Kier
I'm going to move this to the hack requests forum, as this is becoming more suitable to that forum than this. Sounds about right... oh... I also see what you mean about the http requests... mmm...