Web Hosting Talk







View Full Version : Very Complicated Question (or atleast hard to explain)


DDoodler
12-08-2006, 12:32 AM
Okay, I don't know the best way to word this question, so I guess I'll try to explain what I'm trying to do.

I'm looking to offer a service that, say, hosts peoples blogs. I want these individual blogs, however, to be unique to the user. So if the person had a university website, like name.university.edu or university.edu/~name , their blog would show up there, even though it's being hosted with me. The university is just an example. I'd like the content to show up in any directory they wanted it to.

The problem is that all of the PHP files and MySQL tables are hosted by me at a central location. So they might actually have a URL like www.mydomain.com/user/userName or www.mydomain.com/user.php?userID=123 , but they wouldn't be using that directly. I want them to be able to access all information through whatever domain they wish.

I would prefer not to use frames or redirections for this. I'd really like to have all of the content displayed in their own directory, without showing any connection to the actual page on my servers at all.

I know this probably doesn't make sense, but if you have any questions, please let me know and I'll explain further.

Thanks for the help! I appreciate any and all ideas you might have! :)

sysadmin001
12-08-2006, 12:58 AM
I guess your setting up a directory..so you can have all the links in a database and setup up a page to point to that link in the directory

If I'm wrong then I'm not getting your post

DDoodler
12-08-2006, 01:07 AM
I guess I should add that I won't have much control over their page on their own server. Like their user page at a university, etc. I can have them put a file in there or something, but not much more complicated than that. So in regards to having a database on their end, that won't be possible, since they probably don't even have DB priveleges.

dexxtreme
12-08-2006, 03:20 AM
You will need to create a script for your users to upload to their site. This script will need to connect to your site (probably through an "fopen" call) and download the actual content. It will then re-format it and display it to your users' visitors. However, there will be several big hurdles to overcome:

1) All links will need to be relative to the users' site. You will need to either modify the blog software to generate only internal links, or make sure that the script that you users use on their end can properly rewrite the HTML code to generate all internal links (i.e., convert http://mydomain.com/user/blog/page1 to http://university.edu/~user/blog/page1). You will also need to decide on where the users' images will be stored (the users' site or your central server), and be able to provide the user with an intuitive management interface that works with (or around) the URL rewriting.

2) You don't know what kind of server environment your users will have access to. The file that will need to be uploaded to your users' servers will need to be some sort of script. Not every server will have PHP available (although most will), nor is it guaranteed that Perl (and its various modules) or python, ruby, etc. will be available. Not even the paths to the binaries will be absolutely guaranteed.

3) You don't know how restricted (or hostile) the users' server will be. Not every server that has PHP will allow remote fopen calls, and not every one will have "register_globals = on" or "safe_mode = off" or "setuid perl = no". These conditions may or may not affect how well your scripts will work (if they work at all). This may or may not be an issue with most standard web hosts, however I have no idea how well university servers are locked down (it probably depends heavily on the policies of the school's computing department). Even remote connections to port 80 may be firewalled off. You will need to make sure that the script your end users will be using will work on the most minimally configured and heavily locked down servers.

Ultimately you may be forced to use something like frames, redirects, or weird javascript code to pull this off.

DDoodler
12-08-2006, 09:18 AM
Thanks dexxtreme for your very thorough response. I've thought about doing something similar to what you described, although I forgot about considering all of the different server configurations people might have. I knew that not all will have php, but those other situations could cause some big problems.

I know the easiest way is to simply use a frame that takes up 100% of the window and just load the external page there. And then all of the links would be fine too, since they would all be external, but would load in the same window.

I just wish there was a better way to go about this. Any other suggestions?

Thanks! :)

C~J~V
12-08-2006, 11:10 AM
Don't over complicate things.
they can have .php files on their normal site with nothing other than a php include line pointing to the content <?php include ("hxxp://www.yoursite.com/yourfile.php") ?>

maxymizer
12-08-2006, 11:57 AM
And if you view > source of their sites, you'd find that all the links point to another site, which is exactly what DDoodler wanted to avoid.

DDoodler
12-08-2006, 12:01 PM
That would be fine if I wanted to just include one page. But I want to include an entire site that has multiple pages in it. A simple include won't take care of that.

So if you have an idea that would allow me to use the include and make all of the files local and allow me to link to multiple pages, please let me know.

Also, they might not necessarily have php installed. I suppose I could have other versions too, just in case, like ASP, but that still doesn't fix the problem of wanting to include multiple pages.

Don't over complicate things.
they can have .php files on their normal site with nothing other than a php include line pointing to the content <?php include ("hxxp://www.yoursite.com/yourfile.php") ?>

tamasrepus
12-08-2006, 04:25 PM
You've almost exactly described Google's Blogger.com.

Or at least, they way they used to work: I'm not so sure how they work now. Before, users would login to the blogger.com website, write their blog post, and it'd be stored in their databases. Whenever a new post was added, blogger.com would connect via FTP to the user's website (which could be anywhere--their own .com, their university, etc) and upload generated HTML.

This allowed for dynamic content without users having to deal with uploading all the time, and without blogger.com itself having to use very many resources at all.

DDoodler
12-08-2006, 07:23 PM
You've almost exactly described Google's Blogger.com.

Or at least, they way they used to work: I'm not so sure how they work now. Before, users would login to the blogger.com website, write their blog post, and it'd be stored in their databases. Whenever a new post was added, blogger.com would connect via FTP to the user's website (which could be anywhere--their own .com, their university, etc) and upload generated HTML.

This allowed for dynamic content without users having to deal with uploading all the time, and without blogger.com itself having to use very many resources at all.

I thinking of something very similar last night. I was not aware that that was how Blogger worked, but now it seems more feasible if Google was able to pull it off.

One of the things I don't like about that is that users would be required to enter their ftp information, or most importantly, their username and password, which might turn them away from the service. For instance, at a university, that username and password might be the same username and password you use for email and registering for classes. Obviously I would not abuse it, but the user's fear that I might could drive them away.

Essentially, I guess you would have to store everything like you typically would, like data in MySQL and images in a directory, etc., and then have, in my case, a PHP file that would output all of the formatting with the data and FTP it to their own site. Then, when they come back to my site to make changes, everything would have to be outputted and FTPed again.

Right now, that might be the best solution, but I'm hoping there might be an even better one. Thanks for all the great suggestions so far. Anyone else have any ideas?

brendandonhu
12-08-2006, 09:06 PM
EDIT: Nevermind, misread.

xgoth3
12-09-2006, 01:59 PM
Have you thought of WebServices?

DDoodler
12-09-2006, 04:37 PM
Have you thought of WebServices?

Could you elaborate a little more? I'm not familiar with WebServices at all.

Zimdale
12-12-2006, 08:25 PM
Hmm, ive always wanted to do something like that but just havn't had the demand to put the effort into making it.

As far as I know there is no way to make it show up as their domain when everything is hosting on their server unless you put a forward and a mask on their domain. But what they could do is host one small php file with include commands brining in all the other files. umm as far as I know in php which isn't very deep you could probably do it by using mode commands to call the files to include.

Example:
When they login instead of going to a different login page you go to somethin like this

www.page.com/blog.php?mode=login

then with that you define the mode in the php to call upon the login script to do everything...which are hosted on your server.

It would be an interesting setup to say the least but I think it would work.

DDoodler
12-12-2006, 11:36 PM
I think I understand what you're getting at, and it definitely seems like the most feasible plan...

I guess in terms of site files, instead of having, for example, index.php, archive.php, comments.php, there would just be index.php?mode=archive, index.php?mode=comments, etc.

I could see this working perfectly if I was using PHP and the client was using PHP. But in some cases, PHP might not be installed, and the second best choice would probably be ASP. I haven't worked too much with ASP, but does it have a similar include command?

Thanks a lot for the great idea!

Zimdale
12-12-2006, 11:50 PM
I imagine it would because I can't see coding done without it but I have berrely used ASP at all.

As far as I know you use this include in asp which is basically the same thing


<!-- #Include file="header.asp" -->
<!-- #Include file="bodytag.asp" -->
<!-- #Include file="banner.asp" -->
<!-- #Include file="toptable.asp" -->

Not 100% either if the ?mode=thing works in asp but Im pretty sure theres something.


the mode fuction thing like that(dunno what exactly its called) is how forums work. So that they don't need a new page for every single topic and stuff they just use that to define what items they take out of the database.

Well good luck :)