Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In one sentence - what is PHP? 1

Status
Not open for further replies.

TheDemon

Programmer
Feb 7, 2000
108
0
0
GB
I was told to come here after posting up a problem with uploading then resizing images (I'll explain in more detail if need be), but I've only recently come across PHP. What is it?<br>
<br>
Apologies for my general dumbness.
 
First, PHP is a server-side web programming language very similar to ASP, although in my opinion, more powerful and straightforward.<br>
<br>
However, since I was the one that sent you here, I'll have to take a moment more to help evaluate your situation, which might not need PHP at all.<br>
<br>
1. Do the people uploading these images need immediate feedback on the image size? In other words does it need to display online instantly at the new resampled size, or can it wait until the next day or whatever time period you decide?<br>
<br>
2. What kind of web server are you running? Apache on Unix, IIS on Windows NT, or another server? Do you have any authority to install software on this server?<br>
<br>
3. Do you have direct access to the server yourself on an internal network, or are you using FTP to connect?<br>
<br>
If the answer to #1 is no, then all you need to do is set up some sort of scheduled script or macro to run every day (or more) on the server or a connected workstation which checks all the images in a certain directory, resizes them, then saves them to another directory. In this case, on a Unix system, you could use a program like Gimp (we have a forum), which is the Unix version of Photoshop, but which also has a very capable scripting language that could handle this task. In fact, Gimp can be run in &quot;batch mode&quot; which doesn't even use the graphical interface at all. If you are on a Windows system, or have an attached Windows workstation, you could use CorelDraw 8 or 9, which also has a complete scripting environment. I once ran a Corel macro that resized 2000 images in an hour, and saved them back to the web server at the appropriate size. Corel could also import vector images and export them as bitmapped gifs or jpegs, as you mention in your other post.<br>
<br>
If the answer to #1 is yes, then you will need something a little more complicated. PHP can be used as the scripting language to control another program which can then resize the image and display the finished product online. ASP could also accomplish this. The main difficulty is WHICH program do you use? The Unix program called GD can resize GIF images only, so I doubt its usefulness. Gimp can be controlled server-side with Perl, and I believe PHP, but it will be a big learning curve.There is another Unix program called Image Magick. Another possibility is using Java either on the server side or the client.<br>
<br>
I would suggest if at all possible to answer no to question #1 and do the first of these options, because it will save you a lot of work. If you need to have instant feedback, though, PHP is the right forum to be in.<br>
<br>
Good luck, and I will try to help.<br>
<br>

 
rycamor,<br>
<br>
thanks for your reply, that’s really cool. After reading through your response I considered your point about instant display after uploading: in this situation I think the image will have to go through some kind of administration process so that the file size is optimized. For example, the file uploaded may have been created as a gif with a palette of 256 colors, when it may display just as well with 128; or it could have an index transparency when in fact an alpha transparency would suffice. Whilst I could stipulate that the image size be 100x300 ppi, it may not be fully optimized, and that could impact on download time. Therefore, in the short term at least, I think I’m going to have to get people uploading images to agree that it be 100x300 ppi, with a file size of no more than 20k, and I’ll just have to do a quick health check in Fireworks.<br>
<br>
Your response, however, was really useful and it’s given me food for thought. I’m just learning asp (I’ve always been front-end design until recently) but your enthusiasm for PHP is encouraging – I’ve since subscribed to the forum and will do a little investigating. Also, I didn’t know CorelDraw 8/9 had a scripting environment - that sounds extremely useful - I may have to purchase a copy!<br>
<br>
Thanks once again for your time. <br>

 
Your welcome, and good luck; it's a crazy new web world out there...<br>
<br>
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top