php-general Digest 6 Apr 2010 14:09:59 -0000 Issue 6678

Topics (messages 303844 through 303857):

Updating HTML on page
        303844 by: Ashley M. Kirchner
        303845 by: TG
        303846 by: Ashley M. Kirchner
        303848 by: Paul M Foster
        303857 by: tedd

Re: include path in httpd.conf
        303847 by: ad

imagecopyresize???????
        303849 by: Karl DeSaulniers

no-cache control
        303850 by: Karl DeSaulniers
        303855 by: Kim Emax

Re: imagecopyresize
        303851 by: Karl DeSaulniers
        303853 by: Auto-Deppe C. Hänsel
        303854 by: Nadim Attari
        303856 by: tedd

Re: problems with utf-8 conversion
        303852 by: Apis SARL

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
I have a PHP script that queries a DB to get a list of image names.  Then it
processes each name and generate thumbnails and what not.  What I want to do
is have a page called (through the browser) which updates as the PHP process
in the background is working.  So when you first pull up the page it will
say 'There are x images to process' and then dynamically update the page
with a progress status.  In its crudest form it should say something like
'Processing 1 of 5 images .'  When that image is done, it should update the
page with 2 of 5 . etc., etc.  Ideally without refreshing the page each
time.

 

Is this where I need to figure out Ajax and incorporate it with PHP?


--- End Message ---
--- Begin Message ---
The only way to do it with PHP alone would be to control the output 
buffering and I've found that to be inconsistant in quality and 
predictability with different browsers even web servers.  I'm sure 
there's an art to getting that all working well with various technologies 
that are involved in the script -> client caching and processing, but why 
mess with iffy when you can use a proven technology like AJAX.

Get familiar with jQuery (or one of the other big JS libraries, but jQuery 
is my choice hands-down) and you'll probably find it's pretty easy.

-TG

----- Original Message -----
From: "Ashley M. Kirchner" <ash...@pcraft.com>
To: <php-gene...@lists.php.net>
Date: Mon, 5 Apr 2010 20:12:30 -0600
Subject: [PHP] Updating HTML on page

> I have a PHP script that queries a DB to get a list of image names.  Then 
it
> processes each name and generate thumbnails and what not.  What I want to 
do
> is have a page called (through the browser) which updates as the PHP 
process
> in the background is working.  So when you first pull up the page it will
> say 'There are x images to process' and then dynamically update the page
> with a progress status.  In its crudest form it should say something like
> 'Processing 1 of 5 images .'  When that image is done, it should update 
the
> page with 2 of 5 . etc., etc.  Ideally without refreshing the page each
> time.
> 
>  
> 
> Is this where I need to figure out Ajax and incorporate it with PHP?


--- End Message ---
--- Begin Message ---
Hrm, been looking at it for a while now and I can feel a headache coming up.
I think I need to have one PHP script that does the processing, and another
that the user pulls up in their browser.  That one "pings" the processor
every so often to get updated data.  Yes?

Am I way off here?

> -----Original Message-----
> From: TG [mailto:tg-...@gryffyndevelopment.com]
> Sent: Monday, April 05, 2010 8:48 PM
> To: Ashley M. Kirchner; php-gene...@lists.php.net
> Subject: Re: [PHP] Updating HTML on page
> 
> The only way to do it with PHP alone would be to control the output
> buffering and I've found that to be inconsistant in quality and
> predictability with different browsers even web servers.  I'm sure
> there's an art to getting that all working well with various
> technologies
> that are involved in the script -> client caching and processing, but
> why
> mess with iffy when you can use a proven technology like AJAX.
> 
> Get familiar with jQuery (or one of the other big JS libraries, but
> jQuery
> is my choice hands-down) and you'll probably find it's pretty easy.
> 
> -TG


--- End Message ---
--- Begin Message ---
On Mon, Apr 05, 2010 at 09:29:26PM -0600, Ashley M. Kirchner wrote:

> Hrm, been looking at it for a while now and I can feel a headache coming up.
> I think I need to have one PHP script that does the processing, and another
> that the user pulls up in their browser.  That one "pings" the processor
> every so often to get updated data.  Yes?
> 
> Am I way off here?

Slightly. PHP code runs on the server, so in the browser, it won't
"ping" the server.

Yes, you should have a PHP script on the server to do the processing,
(call it, say, "process.php") and one which paints the basic screen for
the browser (call it "page.php" or somesuch). But the connection between
these should be AJAX code in the page.php script. That will most likely
be Javascript in the page.php script which will "ping" the process.php
script for whatever contents you want.

The Javascript to do this is beyond the scope of this list (it's a PHP
list, after all). The "process" script doesn't have to be PHP. It could
be any language you prefer, as long as you can get it to return JSON or
XML to page.php, so that the Javascript in the page.php script can
interpret it.

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
At 8:12 PM -0600 4/5/10, Ashley M. Kirchner wrote:
I have a PHP script that queries a DB to get a list of image names.  Then it
processes each name and generate thumbnails and what not.  What I want to do
is have a page called (through the browser) which updates as the PHP process
in the background is working.  So when you first pull up the page it will
say 'There are x images to process' and then dynamically update the page
with a progress status.  In its crudest form it should say something like
'Processing 1 of 5 images .'  When that image is done, it should update the
page with 2 of 5 . etc., etc.  Ideally without refreshing the page each
time.



Is this where I need to figure out Ajax and incorporate it with PHP?

Exactly.

Here's an example:

http://webbytedd.com/b/timed-php/

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
Ash,

Nice call. .htaccess was not being processed at all which led me to a cname configuration error for the sub domain.

Thanks!.

On 4/5/2010 8:27 PM, Ashley Sheridan wrote:
On Mon, 2010-04-05 at 19:40 -0400, ad wrote:
I have several virtual hosts on a dedicated server.
In a IFmodule mod_php5c container in an httpd.conf  include file I have
the following to create a unique include path for each virtual host:

IfModule mod_php5.c>
php_value include_path ".:/home/virtual/site#/path/to/include"
php_admin_flag safe_mode off
</IfModule>

  For one of the virtual hosts I've set up a dev site in a subdomain at
  dev.site#.com for development.
  In the root directory of this development site I have an .htacces file
  to create another unique include_path solely for this development subdomain.

  php_value include_path  ".:/home/virtual/site#/path/to/dev/includes"

  Also in the httpd.conf I have
      <Directory /home/virtual/site#/path/to/dev/root/>
          Allow from all
          AllowOverride All
          Order allow,deny
      </Directory>


  The configuration is CentOS 5.3, Apache/2.2.3, PHP 5.1.6

  I recently upgraded the OS from FC6 and the PHP version and I have not
  been able to get the include_path to change for this dev.subdomain.
  Even after restarting apache it PHPinfo tells me it is reading the
  server php.ini and the virtual host include path for the httpd.conf but
  it is ignoring the .htaccess file.

  I've even tried putting the php.ini with specific settings in the
  /home/virtual/site#/root directory to no avail.

Any ideas how to make this work or even a better set up?

Thanks in advance.



Are you able to determine if you can set any attributes with the .htaccess file? Is it possible the .htaccess isn't being processed at all?

I'm not sure why the virtual server settings are being ignored in the httpd.conf file though. Have you checked any other .conf files in that directory to see that they are not being set there? As far as I can remember, the .conf files in that directory are executed in alphabetical order, so a different file might be overriding your settings?

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---
Hello List,
I am new here, and I am hoping this will be a quick and easy for someone to help me with. I am trying to create an upload form that lets a user upload a product photo to the server. In the process of this upload, I want to take the file they are uploading and create two images to put on the server.
Both are specific sizes. A large image and a thumbnail.
I then want to throw away the file they uploaded.

My question is what is the proper way to do the uploading/resizing/ destroying?
I have been toying with imagecopyresize, but it never works.
I think I just have parameters out of order or something.

Also, I would like to put a copyright on the side.
I have been able to use imagestringup to do that,
but it covers the image I'm placing it on with
a transparent background and deletes the image.

How do you duplicate an image with transparency?
Or keep the transparency an image already has?
Most grateful for any help, pointers, tuts.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message --- Is there a way to set up a no-cache control in your php.ini file or some config file?
Sorry if this is a newb question.
Thanks,


Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
Hi Karl

2010/4/6 Karl DeSaulniers <k...@designdrumm.com>

> Is there a way to set up a no-cache control in your php.ini file or some
> config file?
> Sorry if this is a newb question.
>


Put it in the header:

header("Cache-Control: no-cache, must-revalidate");

Remember headers must be the first output you do, read more here.
http://dk.php.net/manual/en/function.header.php

-- 
Kind regards
Kim Emax

--- End Message ---
--- Begin Message ---
Sweet deal.
Thanks Nadim. I think I got my script to work finally, but if it proves to be a no-go.
I will definately take a look. Thanks for sharing.

Best,

Karl


On Apr 6, 2010, at 3:29 AM, Nadim Attari wrote:

Hello Karl,

Use the attached code i wrote myelf for my projects. You can upload and create images of other sizes.

Hope it will be easy to use. Ese if you need help, come on MSN (my email address)

Note that you will have to implement the watermark part - i'm providing you the upload and create codes only.

regards,

nadim attari
mauritius (indian ocean)
-----------------------

Karl DeSaulniers wrote:

Hello List,
I am hoping this will be a quick and easy for someone to help me with.
I am trying to create an upload form that lets a user upload a product photo to the server. In the process of this upload, I want to take the file they are uploading and create two images to put on the server.
Both are specific sizes. A large image and a thumbnail.
I then want to throw away the file they uploaded.

My question is what is the proper way to do the uploading/resizing/ destroying?
I have been toying with imagecopyresize, but it never works.
I think I just have parameters out of order or something.

Also, I would like to put a copyright on the side.
I have been able to use imagestringup to do that,
but it covers the image im placing it on with
a transparent background and deletes the image.

How do you duplicate an image with transparency?
Or keep the transparency an image already has?
Most grateful for any help, pointers, tuts.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5002 (20100405) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
<image.upload.php><nadim.vcf>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Karl DeSaulniers [mailto:k...@designdrumm.com]
> Sent: Tuesday, April 06, 2010 10:39 AM
> To: na...@alienworkers.com
> Cc: php-gene...@lists.php.net
> Subject: [PHP] Re: imagecopyresize
> 
> Sweet deal.
> Thanks Nadim. I think I got my script to work finally, but if it
> proves to be a no-go.
> I will definately take a look. Thanks for sharing.
> 
> Best,
> 
> Karl
> 
> 
> On Apr 6, 2010, at 3:29 AM, Nadim Attari wrote:
> 
> Hello Karl,
> 
> Use the attached code i wrote myelf for my projects. You can upload
> and create images of other sizes.
> 
> Hope it will be easy to use. Ese if you need help, come on MSN (my
> email address)
> 
> Note that you will have to implement the watermark part - i'm
> providing you the upload and create codes only.
> 
> regards,
> 
> nadim attari
> mauritius (indian ocean)
> -----------------------
> ....

Hello Nadim,

would you mind sharing this script with me / us, too? I'd love to have a
look at it, if you don't mind :o)

All the best

Chris


--- End Message ---
--- Begin Message ---
Hello Chris,

Here's a link: http://pages.intnet.mu/nadim/php/image.upload.txt

The code is minimal. Things I would like to add:

- resize transparent gifs
- resize animated gifs

Time doesn't permit me, unfortunately :-(

Regards,

Nadim Attari
-------------

Auto-Deppe C. Hänsel wrote:
-----Original Message-----
From: Karl DeSaulniers [mailto:k...@designdrumm.com]
Sent: Tuesday, April 06, 2010 10:39 AM
Subject: [PHP] Re: imagecopyresize

Sweet deal.
Thanks Nadim. I think I got my script to work finally, but if it
proves to be a no-go.
I will definately take a look. Thanks for sharing.

Best,

Karl

On Apr 6, 2010, at 3:29 AM, Nadim Attari wrote:

Hello Karl,

Use the attached code i wrote myelf for my projects. You can upload
and create images of other sizes.

Hope it will be easy to use. Ese if you need help, come on MSN (my
email address)

Note that you will have to implement the watermark part - i'm
providing you the upload and create codes only.

regards,

nadim attari
mauritius (indian ocean)
-----------------------
....
Hello Nadim,

would you mind sharing this script with me / us, too? I'd love to have a
look at it, if you don't mind :o)

All the best

Chris



__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 5003 (20100406) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


--- End Message ---
--- Begin Message ---
Hi:

Here's my code for doing watermarks:

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


Cheers,

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

--- End Message ---
--- Begin Message ---
I found lot of poeple having matters with chars over 1 byte, so I've
published that : http://www.phpcs.com/codes/ENCODAGE-UTF16_51501.aspx

If you take a look, give me a feedback please (to a...@apieum.com)

regards,
greg

Le 05/04/2010 17:08, sudhir patil a écrit :
> Thanks Nathan,
> 
> i tried with utf8_encode, that doesn't help. Yes both content-type & metatag 
> are set to utf-8.
> 
> When i try utf-8 converted csv everything shows up properly. Issue is when i 
> try to change encoding in php, special characters are messed up.
> 
> Character that i am facing problem with is
> 
> ’ &#8217; &rsquo; right single quotation mark 
> Thanks,
> Sudhir
> 



--- End Message ---

Reply via email to