php-general Digest 5 Aug 2007 04:15:39 -0000 Issue 4943

Topics (messages 260173 through 260196):

Re: Problem with getting time in EST
        260173 by: Leonard Burton
        260174 by: Jan Reiter
        260175 by: Michael Preslar
        260176 by: tedd
        260183 by: Jan Reiter

Authentication script working in firefox but strange results in ie7
        260177 by: Brian Seymour
        260188 by: Sancar Saran

Re: UTF-8 support
        260178 by: Daniel Macedo
        260181 by: Naz Gassiep
        260184 by: Daniel Macedo

Creating watermarks
        260179 by: Tom Ray [Lists]
        260180 by: Greg Donald
        260185 by: Jan Reiter
        260186 by: GP INTERACTIVE
        260187 by: tedd
        260189 by: Tom Ray [Lists]
        260192 by: zerof

Re: About PHP/MYSQL Pagination
        260182 by: Sanjeev N
        260190 by: Richard Heyes

Which Chat system to use
        260191 by: robert mena
        260193 by: zerof

XHTML/CSS templates for developers
        260194 by: Steve Finkelstein
        260195 by: Instruct ICC

Problem with php mail
        260196 by: Jason Sia

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 ---
HI,

Are you looking for EDT or EST?

EST = EDT -1.
EDT = EST +1

Take care,

Leonard

On 8/4/07, Crab Hunt <[EMAIL PROTECTED]> wrote:
> Hi,
> I need to get the current time in EST timezone while my current timezone is
> CEST. I use the function :
>
> date_default_timezone_set('EST')
>
>
> But now the time that I get is 1 hour less than the time in EST (
> http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/), probably
> without taking care of the daylight savings time (DST)... Can anyone help me
> out how to solve it, its an urgent issue for me.
>
> Thanks a lot in advance,
> regards,
> Rakesh
>


-- 
Leonard Burton, N9URK
http://www.jiffyslides.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

--- End Message ---
--- Begin Message ---
Hi!
Try setting the timezone to one of the cities inside it from this list:
http://www.php.net/manual/en/timezones.america.php

DST will be taken into account automatically. 

Hope that helps. 

Jan

--- End Message ---
--- Begin Message ---
if time() is always 1 hour behind what you want, why not

time() + 3600 // 60 seconds * 60 minutes

On 8/4/07, Crab Hunt <[EMAIL PROTECTED]> wrote:
> Hi,
> I need to get the current time in EST timezone while my current timezone is
> CEST. I use the function :
>
> date_default_timezone_set('EST')
>
>
> But now the time that I get is 1 hour less than the time in EST (
> http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/), probably
> without taking care of the daylight savings time (DST)... Can anyone help me
> out how to solve it, its an urgent issue for me.
>
> Thanks a lot in advance,
> regards,
> Rakesh
>

--- End Message ---
--- Begin Message ---
At 3:57 PM +0200 8/4/07, Jan Reiter wrote:
Hi!
Try setting the timezone to one of the cities inside it from this list:
http://www.php.net/manual/en/timezones.america.php

DST will be taken into account automatically.

Hope that helps.

Jan


Jan:

That's the problem, it doesn't work.

I have mine set for Detroit and it's an hour off Detroit time.

It kind of bugged me that when I upgraded to php5 that I had to define the default time zone in my code, but then to find out that it's off by an hour really ticks me off. What's the point of defining a time zone if php5 isn't going to get it right?

All this time I thought that I was doing something wrong, but it appears that this is a problem for others as well -- are we doing something wrong?

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
Tedd:

you can set your default php timezone in the php.ini with the date.timezone
value. 

What Server do you use? What OS? 

I'm using apache2.x on win32, debian and fedora core. The time of Detroit
looks ok to compared to 
times stated on world time pages on the internet. 

After upgrading to PHP5, did you check for the latest version of PECL's
timezonedb.

I don't know if its included with the PHP package!

May be a bad question, but are the time and timezone settings of your HW
clock correct?? Just as the
very last option to check, if everything else fails ...  ;-)

Jan




-----Original Message-----
From: tedd [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 04, 2007 5:02 PM
To: Jan Reiter; 'Crab Hunt'; [EMAIL PROTECTED]
Subject: RE: [PHP] Problem with getting time in EST


Jan:

That's the problem, it doesn't work.

I have mine set for Detroit and it's an hour off Detroit time.

It kind of bugged me that when I upgraded to php5 that I had to 
define the default time zone in my code, but then to find out that 
it's off by an hour really ticks me off. What's the point of defining 
a time zone if php5 isn't going to get it right?

All this time I thought that I was doing something wrong, but it 
appears that this is a problem for others as well -- are we doing 
something wrong?

Cheers,

tedd

--- End Message ---
--- Begin Message ---
I mostly use Firefox but still I check to make sure everything works in IE7
and other browsers equally as well. I had strange results here. I have a
simple login form(user/pass field and submit button). I have the actual
login request script in a common php file. I have an Authentication class
that handles my auth stuff. With the code the way it is, it works perfectly
in firefox. However, in IE7 when you log in it shows the restricted stuff
but as soon as you navigate anywhere else you no longer have access. If you
login again then it works fine just like the first time you logged in using
firefox.

Now if you change $_SESSION['uid']=="" to !isset($_SESSION['uid']) then it
works perfectly on both browsers.

Anyhow, rifle through the code -- just something to think about. Anybody
else have a similar issue before?

Web Code:
Restricted stuff:
                <?php 
                        if ($_SESSION['uid']==""){
                                $ops->postLogin($e);
                        }else{ 
                ?>
                        Logged in stuff(Restricted stuff)
                <?php } ?>

Common snippet:
        if ($_POST[action]=="login"){
                $auth = new
Authentication($host,$user,$pass,"dbname","http://aerocore.net/";);
                if
($auth->verifyCreds($_POST['username'],$_POST['password'],"base_contributors
","id"))
                {
                        $_SESSION['uid'] = $auth->retId;
                        $auth->failSafe();
                        break;
                }
        }

Authentication:
        class Authentication extends SQL {
                public $errorMsg;
                public $retId;
                public $clean = array();
                public $fail;
                
                public function __construct($host,$user,$pass,$dbname =
null,$fail)
                {
                        parent::__construct($host,$user,$pass,$dbname =
null);
                        $this->fail=$fail;
                }
                
                public function failSafe()
                {
                        header("Location: {$this->fail}");
                }
                
                final public function sanitizeLoginCreds($user, $pass)
                {
                        $this->clean['username']=strip_tags($user);
                        $this->clean['password']=strip_tags($pass);
                        if (!ctype_alnum($this->clean['username'])){
$this->clean['username']=""; }
                        if (!ctype_alnum($this->clean['password'])){
$this->clean['password']=""; }
                }
                
                final public function verifyCreds($user, $pass, $table,
$retVal = null)
                {
                        $this->sanitizeLoginCreds($user,$pass);
                        
                        //$this->result = $this->query("SELECT * FROM $table
where username='{$this->clean[username]}' and
password='{$this->clean[password]}'");
                        
                        if ($this->fetchNumRows("SELECT * FROM $table where
username='{$this->clean[username]}' and
password='{$this->clean[password]}'") == 0)
                        {
                                $this->errorMsg = "Incorrect
Username/Password Combo";
                                $this->failSafe();
                                return false;
                        }
                        else
                        {
                                if (isset($retVal))
                                {
                                        $this->retId =
$this->fetchArray("SELECT * FROM $table where
username='{$this->clean[username]}' and
password='{$this->clean[password]}'");
                                        $this->retId =
$this->retId[$retVal];
                                }
                                return true;
                        }
                        
                }
                
                final public function secureLogout()
                {
                        $_SESSION = array();
                        session_destroy();
                        $this->failSafe();
                }
                
                public function __destruct(){}
        }

Brian Seymour
Zend Certified Engineer
AeroCoreProductions
http://www.aerocore.net/ 

--- End Message ---
--- Begin Message ---
Hello ,
Those code doesn't mean anything to client browser, you may session cookie 
problem. Please check php.net online manual about it.

Regards

Sancar

On Saturday 04 August 2007 18:20:49 Brian Seymour wrote:
> I mostly use Firefox but still I check to make sure everything works in IE7
> and other browsers equally as well. I had strange results here. I have a
> simple login form(user/pass field and submit button). I have the actual
> login request script in a common php file. I have an Authentication class
> that handles my auth stuff. With the code the way it is, it works perfectly
> in firefox. However, in IE7 when you log in it shows the restricted stuff
> but as soon as you navigate anywhere else you no longer have access. If you
> login again then it works fine just like the first time you logged in using
> firefox.
>
> Now if you change $_SESSION['uid']=="" to !isset($_SESSION['uid']) then it
> works perfectly on both browsers.
>
> Anyhow, rifle through the code -- just something to think about. Anybody
> else have a similar issue before?
>
> Web Code:
> Restricted stuff:
>               <?php
>                       if ($_SESSION['uid']==""){
>                               $ops->postLogin($e);
>                       }else{
>               ?>
>                       Logged in stuff(Restricted stuff)
>               <?php } ?>
>
> Common snippet:
>       if ($_POST[action]=="login"){
>               $auth = new
> Authentication($host,$user,$pass,"dbname","http://aerocore.net/";);
>               if
> ($auth->verifyCreds($_POST['username'],$_POST['password'],"base_contributor
>s ","id"))
>               {
>                       $_SESSION['uid'] = $auth->retId;
>                       $auth->failSafe();
>                       break;
>               }
>       }
>
> Authentication:
>       class Authentication extends SQL {
>               public $errorMsg;
>               public $retId;
>               public $clean = array();
>               public $fail;
>
>               public function __construct($host,$user,$pass,$dbname =
> null,$fail)
>               {
>                       parent::__construct($host,$user,$pass,$dbname =
> null);
>                       $this->fail=$fail;
>               }
>
>               public function failSafe()
>               {
>                       header("Location: {$this->fail}");
>               }
>
>               final public function sanitizeLoginCreds($user, $pass)
>               {
>                       $this->clean['username']=strip_tags($user);
>                       $this->clean['password']=strip_tags($pass);
>                       if (!ctype_alnum($this->clean['username'])){
> $this->clean['username']=""; }
>                       if (!ctype_alnum($this->clean['password'])){
> $this->clean['password']=""; }
>               }
>
>               final public function verifyCreds($user, $pass, $table,
> $retVal = null)
>               {
>                       $this->sanitizeLoginCreds($user,$pass);
>
>                       //$this->result = $this->query("SELECT * FROM $table
> where username='{$this->clean[username]}' and
> password='{$this->clean[password]}'");
>
>                       if ($this->fetchNumRows("SELECT * FROM $table where
> username='{$this->clean[username]}' and
> password='{$this->clean[password]}'") == 0)
>                       {
>                               $this->errorMsg = "Incorrect
> Username/Password Combo";
>                               $this->failSafe();
>                               return false;
>                       }
>                       else
>                       {
>                               if (isset($retVal))
>                               {
>                                       $this->retId =
> $this->fetchArray("SELECT * FROM $table where
> username='{$this->clean[username]}' and
> password='{$this->clean[password]}'");
>                                       $this->retId =
> $this->retId[$retVal];
>                               }
>                               return true;
>                       }
>
>               }
>
>               final public function secureLogout()
>               {
>                       $_SESSION = array();
>                       session_destroy();
>                       $this->failSafe();
>               }
>
>               public function __destruct(){}
>       }
>
> Brian Seymour
> Zend Certified Engineer
> AeroCoreProductions
> http://www.aerocore.net/

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

Any byte function is NOT safe for UTF-8.
trim() works properly with UTF-8 IF you don't specify the charlist (second argument). This is because all whitespace characters are in the ASCII range, and therefore it won't corrupt the UTF-8 string.

The explode() function will handle UTF-8 as long as it's well formed.
This means that if you properly specify UTF-8 delimiters, it doesn't corrupt the UTF-8 input string.

~ DM


adel escreveu:
http://www.php.net/manual/en/ref.mbstring.php

On 8/3/07, Naz Gassiep <[EMAIL PROTECTED]> wrote:
The functions trim() and explode() appear to be munging multibyte UTF-8
strings. I can't find multibyte safe versions of them in the manual, do
they exist, or do I have to make my own?
- Naz.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message --- Great! Thanks for the answer, that's very helpful. Will trim() work if I specify charlists in the ASCII range? Not that I ever do, but just curious.
- Naz

Daniel Macedo wrote:
Hi Naz,

Any byte function is NOT safe for UTF-8.
trim() works properly with UTF-8 IF you don't specify the charlist (second argument). This is because all whitespace characters are in the ASCII range, and therefore it won't corrupt the UTF-8 string.

The explode() function will handle UTF-8 as long as it's well formed.
This means that if you properly specify UTF-8 delimiters, it doesn't corrupt the UTF-8 input string.

~ DM


adel escreveu:
http://www.php.net/manual/en/ref.mbstring.php

On 8/3/07, Naz Gassiep <[EMAIL PROTECTED]> wrote:
The functions trim() and explode() appear to be munging multibyte UTF-8
strings. I can't find multibyte safe versions of them in the manual, do
they exist, or do I have to make my own?
- Naz.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message --- Yes it will, trim() was given the option to specify other characters in PHP 4.1.0.

Rember that it's a byte function, so single byte characters can be handled, you just can't use it for multi-byte characters.

~ DM


Naz Gassiep escreveu:
Great! Thanks for the answer, that's very helpful. Will trim() work if I specify charlists in the ASCII range? Not that I ever do, but just curious.
- Naz

--- End Message ---
--- Begin Message --- I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create "security code" images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added.

How would one go about doing that?

--- End Message ---
--- Begin Message ---
On 8/4/07, Tom Ray [Lists] <[EMAIL PROTECTED]> wrote:
> I've been learning how to use PHP with the GD Library and I've managed
> to learn quite a bit. I can upload, resize, create thumbnails and I'm
> even able to create "security code" images for forms. My question is how

This is usually referred to as a "captcha".

> do I create a Watermark on the image? I want something transparent but
> still visible enough to see the copyright and the website. I want to put
> it in the center of the image. I would use a non-water marked image and
> when it's called on (depending on viewing size) I want the water mark to
> be added.
>
> How would one go about doing that?

You can write words on images using imagettftext().


-- 
Greg Donald
http://destiney.com/

--- End Message ---
--- Begin Message ---
Hi!

Try using imagealphablending() to blend your logo onto the original image.
This function should not require the user browser to be capable of blending
functions as would using the alpha channel of a png inmage or such ... 

Jan


-----Original Message-----
From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 04, 2007 5:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Creating watermarks

I've been learning how to use PHP with the GD Library and I've managed 
to learn quite a bit. I can upload, resize, create thumbnails and I'm 
even able to create "security code" images for forms. My question is how 
do I create a Watermark on the image? I want something transparent but 
still visible enough to see the copyright and the website. I want to put 
it in the center of the image. I would use a non-water marked image and 
when it's called on (depending on viewing size) I want the water mark to 
be added.

How would one go about doing that?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
you can use also the following function :

<?php

  // --- image play path
  $watermarkfile = 'images/play_small.png'; // as an example

  function getPictureMarked($sourcefile, $watermarkfile) {

    #
    # $sourcefile = Filename of the picture to be watermarked.
    # $watermarkfile = Filename of the 24-bit PNG watermark file.
    #

    //Get the resource ids of the pictures
    $watermarkfile_id = imagecreatefrompng($watermarkfile);

    imageAlphaBlending($watermarkfile_id, false);
    imageSaveAlpha($watermarkfile_id, true);

    $fileType = strtolower(substr($sourcefile, strlen($sourcefile)-3));

    switch($fileType) {
        case('gif'):
            $sourcefile_id = imagecreatefromgif($sourcefile);
            break;

        case('png'):
            $sourcefile_id = imagecreatefrompng($sourcefile);
            break;

        default:
            $sourcefile_id = imagecreatefromjpeg($sourcefile);
    }

    //Get the sizes of both pix
    $sourcefile_width=imageSX($sourcefile_id);
    $sourcefile_height=imageSY($sourcefile_id);
    $watermarkfile_width=imageSX($watermarkfile_id);
    $watermarkfile_height=imageSY($watermarkfile_id);

    $dest_x = ( $sourcefile_width / 2 ) - ( $watermarkfile_width / 2 );
    $dest_y = ( $sourcefile_height / 2 ) - ( $watermarkfile_height / 2 );

    // if a gif, we have to upsample it to a truecolor image
    if($fileType == 'gif') {
        // create an empty truecolor container
        $tempimage = imagecreatetruecolor($sourcefile_width,
$sourcefile_height);

        // copy the 8-bit gif into the truecolor image
        imagecopy($tempimage, $sourcefile_id, 0, 0, 0, 0, $sourcefile_width,
$sourcefile_height);

        // copy the source_id int
        $sourcefile_id = $tempimage;
    }

    imagecopy($sourcefile_id, $watermarkfile_id, $dest_x, $dest_y, 0, 0,
$watermarkfile_width, $watermarkfile_height);

    //Create a jpeg out of the modified picture
    switch($fileType) {

        // remember we don't need gif any more, so we use only png or jpeg.
        // See the upsaple code immediately above to see how we handle gifs
        case('png'):
            header("Content-type: image/png");
            imagepng ($sourcefile_id);
            break;

        default:
            header("Content-type: image/jpg");
            imagejpeg ($sourcefile_id);
    }

    imagedestroy($sourcefile_id);
    imagedestroy($watermarkfile_id);

}
?>

Regards,

Greg
http://www.psmdev.com


On 8/4/07, Tom Ray [Lists] <[EMAIL PROTECTED]> wrote:
>
> I've been learning how to use PHP with the GD Library and I've managed
> to learn quite a bit. I can upload, resize, create thumbnails and I'm
> even able to create "security code" images for forms. My question is how
> do I create a Watermark on the image? I want something transparent but
> still visible enough to see the copyright and the website. I want to put
> it in the center of the image. I would use a non-water marked image and
> when it's called on (depending on viewing size) I want the water mark to
> be added.
>
> How would one go about doing that?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
At 11:32 AM -0400 8/4/07, Tom Ray [Lists] wrote:
I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create "security code" images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added.

How would one go about doing that?

Tom:

I just combine images -- it's simple.

Here's an example:

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

Refresh and the watermark position will move.

Here's the code (refreshing will shift the watermark around):

<?php

$place = "c";
$original=imagecreatefromjpeg("mydog.jpg");
$watermark=imagecreatefrompng("copyright.png");

$osx=imagesx($original);
$osy=imagesy($original);
$wsx=imagesx($watermark);
$wsy=imagesy($watermark);

$place = rand(1,5);
switch ($place)
        {
        case 1: //"c":
imagecopy($original, $watermark, ($osx-$wsx)/2, ($osy-$wsy)/2, 0, 0, $wsx, $wsy); //center works
        break;

        case 2: //"nw":
imagecopy($original, $watermark,0, 0, 0, 0, $wsx, $wsy); // upper left works
        break;

        case 3: //"sw":
imagecopy($original, $watermark, 0, ($osy-$wsy), 0, 0, $wsx, $wsy); // lower right works
        break;

        case 4: //"ne":
imagecopy($original, $watermark, ($osx-$wsx), 0, 0, 0, $wsx, $wsy); // upper left works
        break;

        case 5: //"se":
imagecopy($original, $watermark, ($osx-$wsx), ($osy-$wsy), 0, 0, $wsx, $wsy); // lower right works
        break;

        }

imagepng($original, "trans.png");

?>

Cheers,

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

--- End Message ---
--- Begin Message ---
GP INTERACTIVE wrote:
you can use also the following function :

<?php

  // --- image play path
  $watermarkfile = 'images/play_small.png'; // as an example
function getPictureMarked($sourcefile, $watermarkfile) { #
    # $sourcefile = Filename of the picture to be watermarked.
    # $watermarkfile = Filename of the 24-bit PNG watermark file.
    #
//Get the resource ids of the pictures
    $watermarkfile_id = imagecreatefrompng($watermarkfi
le);
imageAlphaBlending($watermarkfile_id, false);
    imageSaveAlpha($watermarkfile_id, true);

    $fileType = strtolower(substr($sourcefile, strlen($sourcefile)-3));

    switch($fileType) {
        case('gif'):
            $sourcefile_id = imagecreatefromgif($sourcefile);
            break;
case('png'):
            $sourcefile_id = imagecreatefrompng($sourcefile);
            break;
default:
            $sourcefile_id = imagecreatefromjpeg($sourcefile);
    }

//Get the sizes of both pix $sourcefile_width=imageSX($sourcefile_id);
    $sourcefile_height=imageSY($sourcefile_id);
    $watermarkfile_width=imageSX($watermarkfile_id);
    $watermarkfile_height=imageSY($watermarkfile_id);

    $dest_x = ( $sourcefile_width / 2 ) - ( $watermarkfile_width / 2 );
    $dest_y = ( $sourcefile_height / 2 ) - ( $watermarkfile_height / 2 );
// if a gif, we have to upsample it to a truecolor image
    if($fileType == 'gif') {
        // create an empty truecolor container
$tempimage = imagecreatetruecolor($sourcefile_width, $sourcefile_height); // copy the 8-bit gif into the truecolor image imagecopy($tempimage, $sourcefile_id, 0, 0, 0, 0, $sourcefile_width, $sourcefile_height); // copy the source_id int
        $sourcefile_id = $tempimage;
    }

imagecopy($sourcefile_id, $watermarkfile_id, $dest_x, $dest_y, 0, 0, $watermarkfile_width, $watermarkfile_height);

    //Create a jpeg out of the modified picture
    switch($fileType) {
// remember we don't need gif any more, so we use only png or jpeg. // See the upsaple code immediately above to see how we handle gifs
        case('png'):
            header("Content-type: image/png");
            imagepng ($sourcefile_id);
            break;
default:
            header("Content-type: image/jpg");
            imagejpeg ($sourcefile_id);
} imagedestroy($sourcefile_id);
    imagedestroy($watermarkfile_id);
}
?>

Regards,

Greg
http://www.psmdev.com <http://www.psmdev.com/>



On 8/4/07, *Tom Ray [Lists]* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I've been learning how to use PHP with the GD Library and I've
    managed
    to learn quite a bit. I can upload, resize, create thumbnails and I'm
    even able to create "security code" images for forms. My question
    is how
    do I create a Watermark on the image? I want something transparent
    but
    still visible enough to see the copyright and the website. I want
    to put
    it in the center of the image. I would use a non-water marked
    image and
    when it's called on (depending on viewing size) I want the water
    mark to
    be added.

    How would one go about doing that?

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    <http://www.php.net/unsub.php>


I'll test this tonight...thanks!

--- End Message ---
--- Begin Message ---
Tom Ray [Lists] escreveu:
I've been learning how to use PHP with the GD Library and I've managed to learn quite a bit. I can upload, resize, create thumbnails and I'm even able to create "security code" images for forms. My question is how do I create a Watermark on the image? I want something transparent but still visible enough to see the copyright and the website. I want to put it in the center of the image. I would use a non-water marked image and when it's called on (depending on viewing size) I want the water mark to be added.

How would one go about doing that?
---------------
http://www.educar.pro.br/en/a/gdlib/index.php?pn=76&tr=97

http://www.educar.pro.br/en/a/gdlib/index.php?pn=23&tr=97

http://www.educar.pro.br/en/a/gdlib/index.php?pn=81&tr=97

--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
----------------------------------------------------------      
You must hear, always, one second opinion! In all cases.
----------------------------------------------------------
Let the people know if this info was useful for you!
----------------------------------------------------------

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

 

1. first you know current page number

2. you know how many pages

Next consider total how many page number you want to display Assume 5

 

I.e.  << 

first previous | 1 2 3 4 5 | next last >>

Now when you come to page 4 then starting page is around 4-1 or 4-2 (however
you want) and start the for loop till 4+2 or 4+3(depends on you).

 

I.e. first previous | (4-2) (4-1) 4 (4+1) (4+2) (4+3) | next last >>

 

For loop will be

For(i=-2; i<=2; i++)

      Echo <a href="">$pagenumber+$i</a>;

 

I think you got some idea

 

Warm Regards,

Sanjeev

http://www.sanchanworld.com/

http://webdirectory.sanchanworld.com

 

-----Original Message-----
From: Kelvin Park [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 03, 2007 6:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] About PHP/MYSQL Pagination

 

I just couldn't find it anywhere, google or yahoo. I know how to make 

first, previous, last, and next links for php/mysql pagination. How do 

you list page numbers in the middle, between previous and next? (ex. << 

first previous | 1 2 3 4 5 | next last >> )

 

I know how to display them from 1 to whatever by using for loop, but the 

problem comes in when I click "next" from page "5", it does not get 

re-listed starting from page "6".

 

-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
I just couldn't find it anywhere, google or yahoo. I know how to make first, previous, last, and next links for php/mysql pagination. How do you list page numbers in the middle, between previous and next? (ex. << first previous | 1 2 3 4 5 | next last >> )

I know how to display them from 1 to whatever by using for loop, but the problem comes in when I click "next" from page "5", it does not get re-listed starting from page "6".

The PEAR Pager package might be able to help you.

--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

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

I need to add a simple chat system to my site and I am trying to find out
good solutions, free or paid.  Some of the requirements :
- php :)
- uses some sort of template system (smarty better)
- support for private chats
- source code available
- one chat room (except for private chats everybody sees everything)

So far the chat systems I've found are too complex (need to register the
nick before entering the chat, confusing interface), not stable enough (
http://www.phpfreechat.net/) or integrated with other systems.

There is no need for :
- multiple chat rooms
- operator/ban
- registration of the nickname
- archive of previous chats

thanks.

--- End Message ---
--- Begin Message ---
robert mena escreveu:
Hi,

I need to add a simple chat system to my site and I am trying to find out
good solutions, free or paid.  Some of the requirements :
- php :)
- uses some sort of template system (smarty better)
- support for private chats
- source code available
- one chat room (except for private chats everybody sees everything)

So far the chat systems I've found are too complex (need to register the
nick before entering the chat, confusing interface), not stable enough (
http://www.phpfreechat.net/) or integrated with other systems.

There is no need for :
- multiple chat rooms
- operator/ban
- registration of the nickname
- archive of previous chats

thanks.

----------
http://socket7.net/lace/

--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
----------------------------------------------------------
You must hear, always, one second opinion! In all cases.
----------------------------------------------------------
Let the people know if this info was useful for you!
----------------------------------------------------------

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

I was curious if anyone could provide some insight on tools which allow
developers who strictly focus on server-side programming and not UI, to
quickly implement XHTML/HTML templates with proper div placement. Drag and
drop would be preferable.

I'm currently working on a project which no design was thrown at me. I have
since hired a designer who's going to take everything I hand to him and CSS
it and add the right touches to it to make it a deliverable project. Other
than that, I'd like to spend the least amount of time designing, but have
the layout prepared for my designer so he can integrate his work with ease.

Thank you kindly for any insight.

- sf

--- End Message ---
--- Begin Message ---
I have since hired a designer who's going to take everything I hand to him and CSS
it and add the right touches to it to make it a deliverable project.

You mean you will hand him your PHP code? I wouldn't expect a designer to take it from there. Perhaps you mean hand him the rendered HTML?

Thank you kindly for any insight.

- sf

To the person who started this post and everyone answering it...

I would appreciate your thoughts on this post as well:

From :  Instruct ICC <[EMAIL PROTECTED]>
Sent :  Thursday, August 2, 2007 1:46 PM
To :    [EMAIL PROTECTED]
Subject :       [PHP] Separation of Roles; with Salaries

_________________________________________________________________
Learn.Laugh.Share. Reallivemoms is right place! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--- End Message ---
--- Begin Message ---
Hi Everyone,
    I'm having problem with php mail.  When I try to create an html message 
with only <a href='mydomain.com'>mydomain</a>, gmail is registering it as a 
spam while yahoo is not.  Can you suggest solutions to my problem.

Thanks,
Jason



Send instant messages to your online friends http://uk.messenger.yahoo.com 

--- End Message ---

Reply via email to