View Full Version : remote GD version testing

Jun 20th, 2002, 10:27 PM
Basically running up a gallery package that relies heavily on them
there GD libraries and figured on using a code to ftp the package
directly from my server to the recipients (basically a form asking
for their ftp address and password - for those who trust me not
to keep a copy ;) - and then establish a conxion and send the
file(s) ). That's the easy bit.

I wondered if I can test whether their server has GD libraries and
which version they have, before sending the lot.

Brad did a phpinfo read test script that can do it locally - so is
there a way to read a remote servers phpinfo?

Or would I need to send the script, load it into a frame and
bounce the variable I need back to the holding page (assuming
I can even do that) ???

Any ideas before I run down too many dead-end possibilities?

Jun 20th, 2002, 11:49 PM
The easier way to do it, would be that they download an index.php page with a form on it...

They fill in teh form with username, pass, ftp address and that contacts your site et voila ;)

Before you send teh info, check for GD library, and version, then alert them to the fact that it might not work before pressing a proceed button should they want to proceed

One thing.. most shared servers have outgoing connections through PHP switched off.. i.e., sockets is off.. :(


Jun 21st, 2002, 01:09 AM
Aha - brilliant :)

So I just tell them to d/l grabfiles.php and upload it to a new nicely chmodded folder called 'gallery' on their server and it posts the info back to me -

2 more questions - anyway to encrypt the data effectively and decrypt at my end (other than mCrypt) ?
- can I test for open sockets in scripting?

Jun 21st, 2002, 01:37 AM
The grabfile.php can auto-chmod the directory using chmod() (suprised?!) www.php.net/chmod

And to encrypt/decrypt you're gonna need to use something like mcrpyt... obv md5 won't work.. unless you use some serious coding, and mail it to the server, then use PHP to parse the mail message and retrieve the data, but that's more hassle then its worth ;)


Jun 21st, 2002, 05:29 AM
Jees idea is cool - let them upload a test file to the server and
you can fopen() that to see what they got !

if(function_exists ($some_gd_function)){
echo "gotGD";

sockets etc are different as the socket functions may well be
compiled in but still unavailable so they may show up but be
unusable , that is also the problem with CHMOD & CHOWN functions they are often disabled on shared hosting (but may still appear to exist).

as for security check out if your server has sftp (most/*NIX hosts
will) which will alow you to use a secure FTP connection, only
downside is you will have to exec() or system all the commands

( http://www.nevis.columbia.edu/cgi-bin/man.sh?man=sftp )