TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   clone a webpage using php? (http://www.talkphp.com/advanced-php-programming/5613-clone-webpage-using-php.html)

gamerNL 10-29-2010 02:15 PM

clone a webpage using php?
 
hi all,

do anyone know how to clone a webpage using php and after cloning rename the webpage?

please help me

tony 10-29-2010 02:51 PM

What do you mean by cloning?

gamerNL 10-29-2010 03:00 PM

Quote:

Originally Posted by tony (Post 31152)
What do you mean by cloning?

a exact copy from a pre-made webpage (wich is already on the server

Village Idiot 10-29-2010 07:30 PM

Quote:

Originally Posted by gamerNL (Post 31153)
a exact copy from a pre-made webpage (wich is already on the server

Using curl you can get the HTML and everything you need for a clone of the page design. But there is absolutely no way to steal the PHP code form a server that you do not have backed access to.

gamerNL 10-29-2010 07:46 PM

Quote:

Originally Posted by Village Idiot (Post 31154)
Using curl you can get the HTML and everything you need for a clone of the page design. But there is absolutely no way to steal the PHP code form a server that you do not have backed access to.

it's kinda my code that needs to be cloned when a user signs up.
for example.

I make some account called: "omega" I (the user) get a personal page wich is: "omega.php"
the easiest way to achieve that is cloning I think

Village Idiot 10-30-2010 05:33 PM

Quote:

Originally Posted by gamerNL (Post 31155)
it's kinda my code that needs to be cloned when a user signs up.
for example.

I make some account called: "omega" I (the user) get a personal page wich is: "omega.php"
the easiest way to achieve that is cloning I think

It isn't. You need to look into mod rewrite. You can make it look like they are on their own page whn they are not.

Basically mod rewrite allows you to rewrite the URLs so the following page (form example)
http://testsite.com/users/omega
Actually runs
http://testsite.com/user.php?name=omega

clonepal 05-05-2011 07:51 PM

Press ctrl + s in your browser, save files to your PC - modify links, upload to your domain.

NOTE:Pleass be aware that if the clone site gets indexed by google and the website owner see that you cloned his website you can get sued.

The best way to clone a site is to understand its functionality and develop it, with a custom template, and same functionality. This is what we do on our company.

Hope that helps.

sketchMedia 05-12-2011 12:09 PM

I think you may need to re-think your architecture, seems like to me you are using a PHP file per page? Sorry if I have the wrong end of the proverbial stick. I'm also assuming you are using a DB to populate user information.

The easiest way is like VI suggested, using mod_rewrite. To elaborate on what I think hes suggesting (and is my suggestion also).
You need to reduce all traffic to one point of access (i.e. index.php) and write a script that farms off requests to the necessary script files (for example user.php for viewing user profiles, which is what I'm assuming you are trying to achieve). After you have done this you can then use mod_rewrite to pretty up the urls.

The technique of focusing user requests to a single, manageable place is often called a front controller (amongst other names). These are usually found in MVC style applications (because it complements the technique well) and once you get to grips with it you wont want to develop without it (like MVC, TDD and all the other cool stuff I have grown to love!)

A simple overview:
http://www.w3style.co.uk/a-lightweig...ller-for-php-5

obviously they can be (and often are) more complex than the examples described on that article, but it should give you a good idea of the method.

Hope that helps.


All times are GMT. The time now is 03:42 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0