php-windows Digest 5 Oct 2006 00:52:56 -0000 Issue 3051

Topics (messages 27209 through 27214):

Re: header()
        27209 by: Stut
        27210 by: Luis Moreira

Re: ImageCreate() function Problem
        27211 by: Arief Kurniawan
        27212 by: Arief Kurniawan
        27213 by: Arief Kurniawan
        27214 by: Niel Archer

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 ---
Alf Stockton wrote:
I have copied the code almost verbatim out of the manual and it still
does not work.
/* Redirect to a different page in the current directory that was
requested */
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'index.shtml';
    $ReturnTo = sprintf("http://%s%s/%s";, $host, $uri, $extra);
    echo "<br>".$ReturnTo;
    header("Location: $ReturnTo");
    exit;

and when I cut and paste the line produced by the echo into the, can I
call it "go box", at the top of the screen and press enter it goes where
I want?

What *exactly* do you mean by "does not work"? What does it do?

Do you have display_errors on in your php.ini? If not then chances are that you have output something before calling the header() function in which case it probably won't work. However, because the default PHP configuration does not display errors you will not be told about it. There are a lot of notes on the manual page for header (http://php.net/header) about this issue, the reasons for it and how to resolve it.

Also, FYI, requesting a read receipt when sending to a public, non-commercial mailing list is generally considered bad manners.

-Stut

--- End Message ---
--- Begin Message ---
Probably I missed a message, so forgive me if I did.

If what the code below wants is to redirect to a different page, then I
believe that the HEADER command can not be preceeded by an ECHO.

    echo "<br>".$ReturnTo;
    header("Location: $ReturnTo");

It won't work after that, and that is clear on the docs.
Remove the echo and force a new call to the same URL.

Luis

-----Original Message-----
From: Alf Stockton [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 4 de Outubro de 2006 13:44
To: [email protected]
Subject: Re: [PHP-WIN] header()

Niel Archer wrote:
> Hi Alf
>
>   
>> Is this the correct method to use in Windows?
>>     
>
> No, it's not the correct method on ANY platform.  Before asking a
> question on these lists, it's wise to check the documentation first.
>
>   
>> Note: HTTP/1.1 requires an absolute URI as argument to Location:
including the scheme, hostname and absolute path, but some clients accept
relative URIs.
>>     
I have copied the code almost verbatim out of the manual and it still
does not work.
/* Redirect to a different page in the current directory that was
requested */
    $host  = $_SERVER['HTTP_HOST'];
    $uri  = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'index.shtml';
    $ReturnTo = sprintf("http://%s%s/%s";, $host, $uri, $extra);
    echo "<br>".$ReturnTo;
    header("Location: $ReturnTo");
    exit;

and when I cut and paste the line produced by the echo into the, can I
call it "go box", at the top of the screen and press enter it goes where
I want?

-- 
Regards,
Alf Stockton            www.stockton.co.za
 
Your sister swims out to meet troop ships.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

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

--- End Message ---
--- Begin Message ---
Yes It is, actually I also copied it to other directory :
c:\php\ext
c:\php
c:\windows\system32

Something else I should do ?

Regards,

Arief K

On 10/4/06, Henrik Hornemann <[EMAIL PROTECTED]> wrote:
Check that php_gd2.dll actually exists.

Regards Henrik Hornemann

-----Oprindelig meddelelse-----
Fra: Arief Kurniawan [mailto:[EMAIL PROTECTED]
Sendt: 4. oktober 2006 04:34
Til: [email protected]
Emne: [PHP-WIN] Fwd: ImageCreate() function Problem

Dear All,
I'm using :
- Apache 2.2.3
- PHP 5.2
- On Windows XP SP2

Executing a simple code :
<?php
$myImage  =   imagecreate(200, 100);
$myGrey = imagecoloraallocate ($myImage, 204, 204, 204);
$myBlack =  imagecolorallocate($myImage,  0,  0,  0);
imageline($myImage,  15, 35, 120, 60, $myBlack);
header("Content-type: image/png");
imagepng($myImage);
imagedestroy($myImage);
?>

On Execution I Got :
Fatal error: Call to undefined function imagecreate() ..........

In php.ini :
extension_dir = "c:\php\ext"
;php_gd2 extension uncommented
extension=php_gd2.dll

Restarted many times. Still the problem exist. Any suggestion please,
what should I do ?

Regards,

Arief K

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




--- End Message ---
--- Begin Message ---
Nope, Text search on output of PHPINFO() only found  :
Configure Command : cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"

I think this is the problem. How to enable DG2 beside the way I did on
my previous mail (through php.ini).

Regards,

Arief K

On 10/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Does it say that you have enabled GD2 when you output PHPINFO()?

 Tryst



 -----Original Message-----
 From: [EMAIL PROTECTED]
 To: [email protected]
 Sent: Wed, 4 Oct 2006 3.33AM
 Subject: [PHP-WIN] Fwd: ImageCreate() function Problem


 Dear All,
 I'm using :
 - Apache 2.2.3
 - PHP 5.2
 - On Windows XP SP2

 Executing a simple code :
 <?php
 $myImage = imagecreate(200, 100);
 $myGrey = imagecoloraallocate ($myImage, 204, 204, 204);
 $myBlack = imagecolorallocate($myImage, 0, 0, 0);
 imageline($myImage, 15, 35, 120, 60, $myBlack);
 header("Content-type: image/png");
 imagepng($myImage);
 imagedestroy($myImage);
 ?>

 On Execution I Got :
 Fatal error: Call to undefined function imagecreate() ..........

 In php.ini :
 extension_dir = "c:\php\ext"
 ;php_gd2 extension uncommented
 extension=php_gd2.dll

 Restarted many times. Still the problem exist. Any suggestion please,
 what should I do ?

 Regards,

 Arief K

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



--- End Message ---
--- Begin Message ---
I found this on Apache Error log :

PHP Warning:  PHP Startup: gd: Unable to initialize module\nModule
compiled with module API=20060613, debug=0, thread-safety=1\nPHP
compiled with module API=20050922, debug=0, thread-safety=1\nThese
options need to match\n in Unknown on line 0

Any suggestion ?

regards,

Arief K

On 10/5/06, Arief Kurniawan <[EMAIL PROTECTED]> wrote:
Nope, Text search on output of PHPINFO() only found  :
Configure Command : cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"

I think this is the problem. How to enable DG2 beside the way I did on
my previous mail (through php.ini).

Regards,

Arief K

--- End Message ---
--- Begin Message ---
Hi
that looks like you have a newer version of module compared to PHP.

Your original post said you had PHP v5.2, as the current stable release
is only 5.1.6, I'd suggest you check again.  If necessary download, and
install again

Niel

--- End Message ---

Reply via email to