PDA

View Full Version : PHP code


Bruce
04-27-2007, 01:13 PM
I need two php codes that will:
1. Get the text off a specific web page
2. Replace text on a specific web page

Here's the rub, I want to build a AMS project for a friend that owns a bike shop that will allow him to change ride schedules on his web site.

Any ideas?

Tek
04-27-2007, 04:32 PM
I think if you had the data on the page stored in a simple way (either with bullets where the <li> tags are used, or in a table where you can specify rows <tr> or data <tr>) that making a simple editor would involve downloading the HTML file from the site, having a simple editor to modify the contents, then click a button which would compile a new HTML file and upload it again to the website.

I made a similar type of program which allowed the user to input information for links, which when generated by AMS would open the HTML file in their default web browser.

Intrigued
04-27-2007, 05:30 PM
I have done this before for HTML. Created a small application that did this via FTP with a TextFile.ReadToString and Textfile.WriteToString. It was setup so that the client could change in real-time information at the top of their Website's main page. It worked great. You could even password protect it.

Bruce
04-27-2007, 07:13 PM
I have done this before for HTML. Created a small application that did this via FTP with a TextFile.ReadToString and Textfile.WriteToString. It was setup so that the client could change in real-time information at the top of their Website's main page. It worked great. You could even password protect it.

Would you be willing to pass it on?

Intrigued
04-27-2007, 08:06 PM
Would you be willing to pass it on?

Let me dig it up from one of my HDs.

Intrigued
04-28-2007, 11:13 PM
Bruce, that must be with a previous employer still.

But, I coded a bare-bones .apz example here. It does not have error checking and you can only upload to the root directory of the FTP server (both easily updated).

Just add in the Host, Username, Password, and Message. Then click the button (Label object) and then you will see a Dialog.Message() box come up to tell you to check your Web page for changes (again, add in some error checking and the ability to change directories, would be best).

Here's that file:

http://www.amsuser.com/ams/examples/HTMLupdates-AMS6-Intrigued.apz

Bruce
04-29-2007, 10:14 AM
Your the bomb! Thnx

Intrigued
04-29-2007, 10:50 AM
Thanks, heh heh and you're welcome.

Proent
05-02-2007, 01:16 AM
Though this post is a couple days old, I wanted to add that if your friend didn't want to type the html code you can use a flash dynamic text box that loads from, say, a notepad. The notepad can be edited through an ams window and all he would need to do is change his schedule dates and hit update. I just did this recently for a client and he loves it. Since most websites I build are flash, this is an easy way for clients to edit their flash sites, without paying for changes or external editors (contribute, fCMS, etc.)