sg

Cuma, Aralık 02, 2005

[Gmail-Lounge] Re: php questions

yeah i have gd.  ok, so i can explode the url to find the filetype then call the appropriate function. awesome.
But even as application/x-javascript I still cant install it w/ greasemonkey.

On 12/1/05, Kass Lloyd <kasslloyd@gmail.com> wrote:

On 12/1/05, Caleb Eggensperger <calebegg@gmail.com> wrote:
> Anyone who knows anything about php and can answer these, it would be
> greatly appreciated
>
> 1) Im trying to generate a greasemonkey script with my PHP script.  I can
> change the content type in the header to text/javascript but i cant make
> greasemoneky recognise it.  I assume its keyed to the .user.js so is there
> any way to make a PHP script output and display a .js file?

Yes, you need to set the headers for it:

header("Content-type: application/x-javascript");

as the first thing you output to the browser

> 2) If i give the php script the url of an image can it find the dimensions?

Yes:

$img = LoadJpeg("http://url/file.jpg");
$width = imagesx($img);
$height = imagesy($img);

But you need the GD library installed for this... and you have to use
the approrate function to load the image type, like LoadPng(),
LoadGif(), etc...

> --
> Caleb Eggensperger
> "No one can solve problems for someone whose problem is that they don't want
> problems solved" --Richard Bach



--
Caleb Eggensperger
"No one can solve problems for someone whose problem is that they don't want problems solved" --Richard Bach

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık