Jump to content


Photo

Is PHP good In These Areas?


  • Please log in to reply
4 replies to this topic

#1 inVINCEable

inVINCEable
  • Members
  • PipPipPip
  • Advanced Member
  • 82 posts

Posted 06 April 2006 - 10:18 PM

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





#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 06 April 2006 - 11:10 PM

PHP can indeed accomplish the tasks you want to achieve.
follow me on twitter @PHPsycho

#3 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 07 April 2006 - 12:22 AM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#4 inVINCEable

inVINCEable
  • Members
  • PipPipPip
  • Advanced Member
  • 82 posts

Posted 07 April 2006 - 01:19 AM

[!--quoteo(post=362403:date=Apr 6 2006, 07:22 PM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Apr 6 2006, 07:22 PM) View Post[/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


#5 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 07 April 2006 - 06:59 AM

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.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users