Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Copy html file from one server to another
Old 10-02-2010, 06:44 PM Copy html file from one server to another
Novice Talker

Posts: 5
Trades: 0
Hi, I am trying to make a page which allows my client to be able to log into my website, and edit one of their pages and would have a save button so it would change their edits onto their website. Is there any way that I could do this? I tried using the ftp functions, like fget, and fputs but I cant get it to work... All I am trying to do is have it connect with the ftp settings, and copy the file to my website. When they click save it will re-upload the file and put it back on their site. I would appreciate any suggestions on how to do this.. Thanks

Jack
JakSimms is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-05-2010, 10:19 AM Re: Copy html file from one server to another
Justinwiz's Avatar
Skilled Talker

Posts: 58
Name: Justin
Location: /etc/httpd/logs/error_log
Trades: 0
You could add a script on your client's website that'll retrieve the source code of a page in their directory and display it in a textbox and download the changes when you call it from your PHP script on the login site.
Example: Retrieve the file from the client server and display it, when the client presses save, create a temporary file on your server with the contents of the edit, then call the script on the client's website to replace the file to be editted with the temporary file that was just created by the page editor, after the copy has completed, delete the temporary file and show a link to the new page.

Hope that works for you.
__________________
█ Reliable VPS and Minecraft server hosting at extremely affordable prices.

Please login or register to view this content. Registration is FREE

Last edited by Justinwiz; 10-05-2010 at 10:24 AM..
Justinwiz is offline
Reply With Quote
View Public Profile
 
Old 10-05-2010, 02:17 PM Re: Copy html file from one server to another
Novice Talker

Posts: 5
Trades: 0
Ok, I just made something like that to take the file and copy it to my server. Any ideas on how to edit the page? I am messing around with javascript's innerhtml but havent got anything working yet. Thanks
JakSimms is offline
Reply With Quote
View Public Profile
 
Old 10-07-2010, 05:15 AM Re: Copy html file from one server to another
Banned

Posts: 1
Name: Christopher
Trades: 0
hey jack,

I agree with justin. the best way is to create a client program on your customer's server. I've never tried it, but I'm pretty sure you could grab the source code of that file using CURL. And load it into a textbox, or display it into a div's innerhtml. Depending on the level of customization, you could easily use javascript to change predefined sections of the code and update the div innerhtml.

after your done, you could pass the entire page code back to a script on the clients server(using curl, or ajax), who's sole purpose is to take the the provided code and overwrite the existing file. Obviously you'll want to add some security to this script, like a authentication string or something.
Teddi B is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Copy html file from one server to another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16571 seconds with 12 queries