Jump to content

Archived

This topic is now archived and is closed to further replies.

inVINCEable

Is PHP good In These Areas?

Recommended Posts

I have talked to a few people knowledgable in the area of computers. They have pointed me in the direction of the pHp language... let me tell you what I intend to do.


1. I want to write a script that searches for text and jpeg files from a few sites, download the files that meet the requirements, and then upload to another site. I prefer this to run from a server. Is PHP the right language for this? If not, what language do you recommend I learn?


I have one more task I wish to accomplish.


2. I want to create a website where I have a database where registered users can upload a small text file, and put it into the appropriate area. Is php the right language for this? Do I also need some sort of database like sql or can php do all this?


Thank you in advance for any replies.


Vince



Share this post


Link to post
Share on other sites
I would use MySQL instead of uploading text files. A nice interface with a MySQL database on back-end would do what you wanted for that anyway.

I must ask what the reason is for downloading JPEG files from one server and placing them on another and do you have FTP access to the two servers? If you are just trying to crawl the site and grab images PHP may not be the choice for you, though it could do it. There are other methods that would probably work better in that case.

Ultimately PHP can do what you have asked for.

Share this post


Link to post
Share on other sites
[!--quoteo(post=362403:date=Apr 6 2006, 07:22 PM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Apr 6 2006, 07:22 PM) [snapback]362403[/snapback][/div][div class=\'quotemain\'][!--quotec--]


If you are just trying to crawl the site and grab images PHP may not be the choice for you, though it could do it. There are other methods that would probably work better in that case.
[/quote]

Well, you have guessed my intentions. Yes, I want something that can crawl the website (predefined sites, not the whole entire web) and grab images, and then post them to my webserver.

I have access to my webserver, although the websites I will be crawling through, I will not have access to the servers (although copyright is not a problem with these images so no need to worry about that).

So, in your opinion txmedic03, what would be the best do accomplish this task of crawling predefine sites, grabbing images, and then uploading them to my site? Thanks.

Vince

Share this post


Link to post
Share on other sites
Well a PHP script requires a request to run it can't just be set to execute itself at intervals. Someone has to send an http/https request to the server to start the script executing and then there is the 30 second time out, which you do not want to change, that you might exceed. My suggestion would be to write a VB/C++ application that crawls the site then uploads them to your server. You can build a small app that will execute on a time interval and crawl the pages looking for images that meet the criteria and replace/ignore multiple instances of the same image. This is of course if you are running a windows based system. If you are running linux you could probably just write a script or something and use cron to set it up on an interval. These are just the things I would look into. You could do what you are trying to do with PHP, but I am sure there is probably a better way. If you use PHP and linux you could setup a cron job to load the page on an interval to make it find and copy images.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.