php-general Digest 16 Jun 2008 05:28:25 -0000 Issue 5516

Topics (messages 275403 through 275421):

Re: Strategy to protect images
        275403 by: Nirmalya Lahiri
        275404 by: Stephen
        275405 by: Bastien Koert
        275406 by: tedd
        275407 by: Richard Heyes
        275411 by: Dmitri
        275414 by: tedd
        275416 by: Richard Heyes
        275417 by: tedd
        275419 by: Børge Holen

Canvas examples
        275408 by: Richard Heyes
        275409 by: David Giragosian
        275410 by: Richard Heyes
        275412 by: Ray Hauge
        275415 by: Richard Heyes

extension=mssql.so vs. ;extension=php_mssql.dll
        275413 by: Wei, Alice J.

PHP session expiring too early?
        275418 by: gh

Re: PHPMailer not working but Squirell mail works
        275420 by: Gabriel Sosa

Does PHP support utf16 encode / decode
        275421 by: hce

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
 Yes... you can do it. Instade of direct url image, use the url of a php script 
written(algorithm) below..

<?php
/*
Write down the code to check
authentication of users
if( unauthorise user )
 then exit from code
*/

/* Read the image data from file */
header('Content-type: image/jpeg');
/* echo the raw image data */
?>


---
Nirmalya Lahiri
[+91-9433113536]


--- On Sun, 6/15/08, Stefano Esposito <[EMAIL PROTECTED]> wrote:

> From: Stefano Esposito <[EMAIL PROTECTED]>
> Subject: [PHP] Strategy to protect images
> To: [EMAIL PROTECTED]
> Date: Sunday, June 15, 2008, 5:18 PM
> Hi all,
> 
> i have to forbid users of my site to view images directly
> (i.e.
> writing the image URL in the address bar) but they'd be
> able viewing
> them from the pages of the site. What's the best way of
> doing it, or
> something similar? Is there a common strategy using PHP?
> Thank you for
> any hint :-)
> 
> Ciao,
> Stefano
>  
>  
>  --
>  Email.it, the professional e-mail, gratis per te:
> http://www.email.it/f
>  
>  Sponsor:
>  VOGLIA DI VACANZE ? 
> * A Riccione i Family Hotels sono gli alberghi
> specializzati per le vacanze dei bambini
>  Clicca qui:
> http://adv.email.it/cgi-bin/foclick.cgi?mid=7984&d=15-6
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


      

--- End Message ---
--- Begin Message --- I am not familiar with this bit of http. It looks like something I want to explore.

Can you send html as well as just the image?

Thanks
Stephen

Nirmalya Lahiri wrote:
 Yes... you can do it. Instade of direct url image, use the url of a php script 
written(algorithm) below..

<?php
/*
Write down the code to check
authentication of users
if( unauthorise user )
 then exit from code
*/

/* Read the image data from file */
header('Content-type: image/jpeg');
/* echo the raw image data */
?>


---
Nirmalya Lahiri
[+91-9433113536]


--- On Sun, 6/15/08, Stefano Esposito <[EMAIL PROTECTED]> wrote:

From: Stefano Esposito <[EMAIL PROTECTED]>

i have to forbid users of my site to view images directly
(i.e.
writing the image URL in the address bar) but they'd be
able viewing
them from the pages of the site. What's the best way of
doing it, or
something similar? Is there a common strategy using PHP?
Thank you for
any hint :-)


--- End Message ---
--- Begin Message ---
On Sun, Jun 15, 2008 at 8:51 AM, Stephen <[EMAIL PROTECTED]> wrote:

> I am not familiar with this bit of http. It looks like something I want to
> explore.
>
> Can you send html as well as just the image?
>
> Thanks
> Stephen
>
> Nirmalya Lahiri wrote:
>
>>  Yes... you can do it. Instade of direct url image, use the url of a php
>> script written(algorithm) below..
>>
>> <?php
>> /*
>> Write down the code to check
>> authentication of users
>> if( unauthorise user )
>>  then exit from code
>> */
>>
>> /* Read the image data from file */
>> header('Content-type: image/jpeg');
>> /* echo the raw image data */
>> ?>
>>
>>
>> ---
>> Nirmalya Lahiri
>> [+91-9433113536]
>>
>>
>> --- On Sun, 6/15/08, Stefano Esposito <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> From: Stefano Esposito <[EMAIL PROTECTED]>
>>>
>>> i have to forbid users of my site to view images directly
>>> (i.e.
>>> writing the image URL in the address bar) but they'd be
>>> able viewing
>>> them from the pages of the site. What's the best way of
>>> doing it, or
>>> something similar? Is there a common strategy using PHP?
>>> Thank you for
>>> any hint :-)
>>>
>>>
>>>
>>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
No, the content type directive is only for the image

-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
At 1:48 PM +0200 6/15/08, Stefano Esposito wrote:
Hi all,

i have to forbid users of my site to view images directly (i.e.
writing the image URL in the address bar) but they'd be able viewing
them from the pages of the site. What's the best way of doing it, or
something similar? Is there a common strategy using PHP? Thank you for
any hint :-)

Ciao,
Stefano


Stefano:

As for protecting images, when a user views an image, they have it in their browser. Its' usually a simple process for users to drag and drop the image to their desktop so they can view it anytime they want.

You can slow them down by making it a bit more complicated, like so:

http://webbytedd.com/b/protect-image/

But, a sophisticated user will find a way around that.

The typical way to protect pictures is to provide them as thumbnails and when viewed normal size, then add a watermark (copyright notice or other such image alteration) to the picture, like so:

http://webbytedd.com/b/watermark/

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
But, a sophisticated user will find a way around that.

A less sophisticated one will use the PrintScr key... :-)

--
Richard Heyes

        Employ me:
http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
This is how I do it:

1) put image files in folder that is not accessable from browser, like outside of http root dir.

2) in the img src tag point src to script like <img src="/image.php?imageID=$someID">
where $someID is the id of image or name of image you want user to see

3) the image.php script will have the function to make sure that user has right to access the image, for example the user is logged in.
if user has the right to view the image then do something like this:

$pathtoimage is the full path you have to calculate based on image name or imageID
$strFile = file_get_contents($pathtoimage);
   if($strFile)
   {
       header('Content-type: image/jpeg' );
       echo $strFile;
   }



Stefano Esposito wrote:

Hi all,

i have to forbid users of my site to view images directly (i.e.
writing the image URL in the address bar) but they'd be able viewing
them from the pages of the site. What's the best way of doing it, or
something similar? Is there a common strategy using PHP? Thank you for
any hint :-)

Ciao,
Stefano


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
VOGLIA DI VACANZE ? * A Riccione i Family Hotels sono gli alberghi specializzati per le vacanze dei bambini
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7984&d=15-6



--

Open Source ALL content management
with streaming video
http://wiki.sharedlog.com



--- End Message ---
--- Begin Message ---
At 4:11 PM +0100 6/15/08, Richard Heyes wrote:
But, a sophisticated user will find a way around that.

A less sophisticated one will use the PrintScr key... :-)

--
Richard Heyes


Must be a windozes thing.  :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Must be a windozes thing.  :-)

I guess so. PrintScr takes a snapshot of the current screen, ie a screenshot and places it on the clipboard. Then you simply paste into something like Paint and save it.

--
Richard Heyes

        Employ me:
http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
At 7:35 PM +0100 6/15/08, Richard Heyes wrote:
Must be a windozes thing.  :-)

I guess so. PrintScr takes a snapshot of the current screen, ie a screenshot and places it on the clipboard. Then you simply paste into something like Paint and save it.

--
Richard Heyes
`

Oh that -- in Mac-land we have as well. Plus we have a way to save any part of a screen shot.

But I was talking about drag and drop from the browser window that will allow the user to get the original image and not just the screen shot of the image, which may be a different size.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Sunday 15 June 2008 14:25:36 Nirmalya Lahiri wrote:
>  Yes... you can do it. Instade of direct url image, use the url of a php
> script written(algorithm) below..
>
> <?php
> /*
> Write down the code to check
> authentication of users
> if( unauthorise user )
>  then exit from code
> */
>
> /* Read the image data from file */
> header('Content-type: image/jpeg');
> /* echo the raw image data */
> ?>

I used this method to put out images, some of witch was our own that had to be 
watermarked and the rest just echoed.
Then I didn't have to care if someone just addressed site.com/images?id=2
or just site.com/index.php
I got credit for my own images.
Watermarking must be one of the best hinderance to keep ppl from using their 
images without asking. Of course not putting them out at all, should be 
considered.

Heh while on topic, if for one reason you _need_ to have visitors on your site 
and not just the shortcuts to the important stuff(?), you probably do that 
for comercial reasons, witch implies a login system, witch would make denying 
access easy. =D

For a ad bogged down site, witch also would like to hinder guest to access 
material their prefered way.... yeah well, Hope they go backrupt
 


>
>
> ---
> Nirmalya Lahiri
> [+91-9433113536]
>
> --- On Sun, 6/15/08, Stefano Esposito <[EMAIL PROTECTED]> wrote:
> > From: Stefano Esposito <[EMAIL PROTECTED]>
> > Subject: [PHP] Strategy to protect images
> > To: [EMAIL PROTECTED]
> > Date: Sunday, June 15, 2008, 5:18 PM
> > Hi all,
> >
> > i have to forbid users of my site to view images directly
> > (i.e.
> > writing the image URL in the address bar) but they'd be
> > able viewing
> > them from the pages of the site. What's the best way of
> > doing it, or
> > something similar? Is there a common strategy using PHP?
> > Thank you for
> > any hint :-)
> >
> > Ciao,
> > Stefano
> >
> >
> >  --
> >  Email.it, the professional e-mail, gratis per te:
> > http://www.email.it/f
> >
> >  Sponsor:
> >  VOGLIA DI VACANZE ?
> > * A Riccione i Family Hotels sono gli alberghi
> > specializzati per le vacanze dei bambini
> >  Clicca qui:
> > http://adv.email.it/cgi-bin/foclick.cgi?mid=7984&d=15-6
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php



-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message --- Does anyone have any more examples of the new canvas element they've written?

FF only: http://www.phpguru.org/canvas.html

--
Richard Heyes

        Employ me:
http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
On 6/15/08, Richard Heyes <[EMAIL PROTECTED]> wrote:
>
> Does anyone have any more examples of the new canvas element they've
> written?
>
> FF only: http://www.phpguru.org/canvas.html
>
> --


That's very cool, Richard.

--David.

--- End Message ---
--- Begin Message ---
That's very cool, Richard.

Well, thanks, but I wouldn't call it "very cool". Now a graphing library that output the results using a canvas, thus negating the need for JPGraph would definitely be nice.

Or you could just use JPGraph and get to the pub earlier... :-)

--
Richard Heyes

        Employ me:
http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
Does anyone have any more examples of the new canvas element they've written?

FF only: http://www.phpguru.org/canvas.html


This is a pretty interesting use of Canvas as well.  Thanks for sharing!

http://ejohn.org/blog/processingjs/

--
Ray Hauge
www.primateapplications.com

--- End Message ---
--- Begin Message ---
This is a pretty interesting use of Canvas as well.  Thanks for sharing!

http://ejohn.org/blog/processingjs/

This is very nice.

--
Richard Heyes

        Employ me:
http://www.phpguru.org/cv

+----------------------------------------+
| Access SSH with a Windows mapped drive |
|    http://www.phpguru.org/sftpdrive    |
+----------------------------------------+

--- End Message ---
--- Begin Message ---
Hi,

  I am not sure what is exactly the problem with my configurations while I am 
trying to configure Apache, PHP and FreeTDS throughout my attempts to install 
these packages into my Linux.

 It appears that I am doing everything correctly as I am going through 
listservs, forums and online articles for the configurations, but there is 
something that goes wrong. So far I have noticed that in my phpinfo() page, I 
still don't see the mssql packages listed as I should have.

  Some things I need to be clarified:


1.      I noticed that in http://us.php.net/mssql, it mentioned how we are 
supposed to add extension=mssql.so in the php.ini file, while in other places I 
was told to uncomment extension=php_mssql.dll. It appears that this did not 
give me the right configurations, still, even though the installation did 
suggest that mssql support is yes.



2.      I used the following to configure my PHP AFTER I had installed and 
compiled FreeTDS like most of you said, ./configure 
--with-mssql=/usr/local/freetds --prefix=/usr/local/php, but every single time, 
it gives me this: Directory /usr/local/freetds is not a FreeTDS installation 
directory



Could this signify the reason why I cannot see PHP configured with MSSQL 
connection? If yes, why is it possible that the support for MSSQL in the 
php.ini file has been commented out?


Thanks in advance.

---------------------------------------
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- I am experiencing a strange bug after upgrading to PHP 5.2.4 with the Zend Optimizer 3.3.3.

In two of our locally-hosted web applications, NolaPro and SugarCRM, the login sessions are expiring after 5 minutes of inactivity and I cannot figure why. The relevant values from my /etc/php.ini file are as follows:

session.save_path = /var/lib/php
session.use_cookies = 1
session.cookie_lifetime = 0
session.auto_start = 0
session.cookie_path = /
session.cookie_domain =
session.gc_maxlifetime = 1440
session.cache_limiter = nocache
session.cache_expire = 180

/var/lib/php is set to 777 permissions.

There is a cron job in /etc/cron.d/php:
09,39 * * * * root [ -d /var/lib/php ] && find /var/lib/php/ -type f -mmin +$(/usr/lib64/php/maxlifetime) -print0 | xargs -r -0 rm

The script /usr/lib64/php/maxlifetime outputs the value "24" which is consistent with the value in the php.ini file.

There are no .htaccess files in the root directories for either of the applications.

Does anyone know what else could be causing this problem?

--- End Message ---
--- Begin Message ---
i just dont know if this may help... but Im 90%sure SquirrelMail uses
IMAP to connect with the server
also, phpmailer should give you an error code and error string, can
you paste here?



saludos

On Fri, Jun 13, 2008 at 8:55 PM, Iv Ray <[EMAIL PROTECTED]> wrote:
> Shiplu wrote:
>>
>> In my web server, I cant send mail by PHPMailer.
>
> What does this mean?
>
> Do you get an error message, etc.?
>
> Iv
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Los sabios buscan la sabiduría; los necios creen haberla encontrado.
Gabriel Sosa

--- End Message ---
--- Begin Message ---
Hi,

I know PHP supports utf8 encode/decode, but does it support utf16
encode/decode? If yes, would you please point me a php manual URL?

Thank you.

Jim

--- End Message ---

Reply via email to