php-general Digest 23 Nov 2001 14:10:17 -0000 Issue 1011

Topics (messages 75546 through 75577):

Missing PHP.ini
        75546 by: John Monfort
        75547 by: Joseph Blythe
        75548 by: Martin Towell
        75549 by: John Monfort
        75551 by: David Robley

Re: error handling and __LINE__
        75550 by: Papp Gyozo

Re: SQL in Function
        75552 by: David Robley

strip php out of html
        75553 by: Joseph Blythe
        75554 by: David Robley
        75555 by: Michael Sims
        75556 by: Joseph Blythe
        75558 by: Joseph Blythe

Object Persistence like Resource Persistence already implemented?
        75557 by: Yermo M. Lamers

MySQL query problem!
        75559 by: De Necker Henri
        75561 by: David Robley
        75562 by: De Necker Henri
        75564 by: David Robley

Re: GD, PNG
        75560 by: Yamin Prabudy
        75563 by: Joseph Blythe

read file
        75565 by: PHP Newbie
        75566 by: Andrey  Hristov

HTTP_REFERER
        75567 by: Jordan Elver
        75568 by: gaouzief
        75569 by: Sebastian Wenleder
        75570 by: Matt Williams
        75572 by: Jordan Elver
        75573 by: Matt Williams
        75577 by: Jordan Elver

file upload troubles
        75571 by: Nikola Veber
        75574 by: fitiux

php->html
        75575 by: Christoph Starkmann

upload problems
        75576 by: Nikola Veber

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


 Hello everyone!

 I upgraded my system from win98 to win2k, a few weeks ago.
 Now,  I can't seem to locate my php.ini file.

 I've looked in
  C:\
  C:\windows
  C:\windows\system (and system32)

  to no success.

 Is anyone aware of what may have happened?
 I was under the impression that PHP could NOT run without the Php.ini
 file, is that incorrect?

 Please help.

 -john

__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-


--- End Message ---
--- Begin Message ---
John,

Look in the original distribution files for php.ini-dist (or
php.ini-optimized) and copy it to c:\windows\php.ini

As far as I know php can run without a php.ini I beleive it has builtin
defaults.

Regards,

Joseph

-----Original Message-----
From: John Monfort [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 November 2001 12:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Missing PHP.ini




 Hello everyone!

 I upgraded my system from win98 to win2k, a few weeks ago.
 Now,  I can't seem to locate my php.ini file.

 I've looked in
  C:\
  C:\windows
  C:\windows\system (and system32)

  to no success.

 Is anyone aware of what may have happened?
 I was under the impression that PHP could NOT run without the Php.ini
 file, is that incorrect?

 Please help.

 -john

__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
doesn't win2k files go under C:\winnt ?
what about looking under the php directory???

-----Original Message-----
From: John Monfort [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 23, 2001 1:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Missing PHP.ini




 Hello everyone!

 I upgraded my system from win98 to win2k, a few weeks ago.
 Now,  I can't seem to locate my php.ini file.

 I've looked in
  C:\
  C:\windows
  C:\windows\system (and system32)

  to no success.

 Is anyone aware of what may have happened?
 I was under the impression that PHP could NOT run without the Php.ini
 file, is that incorrect?

 Please help.

 -john

__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---


 Thanks Joseph!

 btw,

 Happy Thanksgiving to all!


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Fri, 23 Nov 2001, Joseph Blythe wrote:

> John,
>
> Look in the original distribution files for php.ini-dist (or
> php.ini-optimized) and copy it to c:\windows\php.ini
>
> As far as I know php can run without a php.ini I beleive it has builtin
> defaults.
>
> Regards,
>
> Joseph
>
> -----Original Message-----
> From: John Monfort [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 23 November 2001 12:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Missing PHP.ini
>
>
>
>
>  Hello everyone!
>
>  I upgraded my system from win98 to win2k, a few weeks ago.
>  Now,  I can't seem to locate my php.ini file.
>
>  I've looked in
>   C:\
>   C:\windows
>   C:\windows\system (and system32)
>
>   to no success.
>
>  Is anyone aware of what may have happened?
>  I was under the impression that PHP could NOT run without the Php.ini
>  file, is that incorrect?
>
>  Please help.
>
>  -john
>
> __________John Monfort_________________
> _+-----------------------------------+_
>      P E P I E  D E S I G N S
>        www.pepiedesigns.com
> "The world is waiting, are you ready?"
> -+___________________________________+-
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
On Fri, 23 Nov 2001 12:36, John Monfort wrote:
>  Hello everyone!
>
>  I upgraded my system from win98 to win2k, a few weeks ago.
>  Now,  I can't seem to locate my php.ini file.
>
>  I've looked in
>   C:\
>   C:\windows
>   C:\windows\system (and system32)
>
>   to no success.
>
>  Is anyone aware of what may have happened?
>  I was under the impression that PHP could NOT run without the Php.ini
>  file, is that incorrect?
>
>  Please help.

No, PHP uses default settings if it doesn't find the ini file. Run 
phpinfo() in a script to see where it expects to find the ini file to be, 
then put one there, if you need other than the default settings.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Brain fried - core dumped.
--- End Message ---
--- Begin Message ---
try, assert() instead of echo()ing error messages.

assert('is_object($obj)');

and write your error handler code or use mine :)
or am i missing something?

Papp Gyozo
- [EMAIL PROTECTED]

----- Original Message ----- 
From: "SafeV" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 22, 2001 4:15 PM
Subject: [PHP] error handling and __LINE__


| Hi,
| I wonder if there's a way to find the line number of the calling script 
| from a function, like the error messages PHP generates. An example:
| 
| In an included file I have a function and want to do something similar to:
| 
| function foo($obj) {
|     if (!is_object($obj)) {
|         echo "Error: supplied argument is not an object in ";
|         echo __FILE__ . " line " . __LINE__; 
|     }
|     ...
| }
| 
| But __FILE__ and __LINE__ refers to the current file, ie. the file with 
| the function in, and not the file where the function is called from.
| The first one I can solve by using $SCRIPT_NAME, but what about the line 
| number???
| 
| 
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
| 
--- End Message ---
--- Begin Message ---
On Thu, 22 Nov 2001 18:30, Oosten, Sjoerd van wrote:
> Hello, im a newbie in writing functions but right now im trying to.
>
> I have made the following function
>
> // FUNCTION TO DECIDE WHETHER A PROJECT IS IN BETWEEN PROJECTBEGIN AND
> PROJECTEND , YES OR NO
>
> function Activeyesno($month,$day,$year,$Project_id){
> $dayactief = mktime(0, 0, 0, $month, $day, $year);
> $daytemp = date("Y-m-d", $dayactief);
> $resultactive = mysql_query("SELECT * FROM EIAProjecten WHERE
> ((Project_begindatum >= '$daytemp' AND Project_id = '$Project_id') OR
> (Project_einddatum <= '$daytemp' AND Project_id =
> '$Project_id'))",$db);
>
> $num_rows = mysql_num_rows($resultactive);
> if ($num_rows == '1'){
> return "red"; }
> }
>
>
> AND i'm calling this function in an while loop
>
> <? echo Activeyesno($month,$day,$year,$Project_id); ?>
>
> (I translated it into english so maybe some mistakes!)
>
> When i try to call the function i get a mysql error every time, even
> when i make $resultactive ("SELECT * FROM EIAProjecten") // NO DATE
>
> 1. Is it possible to make a sql connection in my function
> 2. did i do something wrong?
>
> Can somebody help me?
>

What is the error?

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   (((((This tagline in Stereo where available)))))
--- End Message ---
--- Begin Message ---
Hello,

Is there a way to strip only php code out of an html file? I know about
strip_tags but its going to be alot of work to make the allowable list, as
all I want to strip out is:

<?php ... ?>

I tried like so:

eregi_replace ("<?php include(\"whatever.php\"); ?>", "", $string);

but it didn't find it suppose because of the escape characters...

Another option would be to find the php code evaluate it and then put the
result back in the correct position, I sort of tried this with not much
luck.

Any ideas..

Regards,

Joseph


--- End Message ---
--- Begin Message ---
On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote:
> Hello,
>
> Is there a way to strip only php code out of an html file? I know about
> strip_tags but its going to be alot of work to make the allowable list,
> as all I want to strip out is:
>
> <?php ... ?>
>
> I tried like so:
>
> eregi_replace ("<?php include(\"whatever.php\"); ?>", "", $string);
>
> but it didn't find it suppose because of the escape characters...
>
> Another option would be to find the php code evaluate it and then put
> the result back in the correct position, I sort of tried this with not
> much luck.
>
> Any ideas..
>
> Regards,
>
> Joseph

It sounds like you want to capture the output of the script - so you just 
end up with what you would see in View Source???

Is this a one off thing, or what exactly is the problem you are trying to 
solve?

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Always draw your curves, then plot the data.
--- End Message ---
--- Begin Message ---
At 02:28 PM 11/23/2001 +1030, David Robley wrote:
>It sounds like you want to capture the output of the script - so you just
>end up with what you would see in View Source???

If that is what he wants to do, I think this would be an easy way:

$ lynx -source http://host/file_to_be_captured.php > result_without_php.html

This assumes you have access to a machine with lynx installed.

--- End Message ---
--- Begin Message ---
David,

Basically I have found a way of making printable versions of every page in a
website I am currently working on (without a database etc), because I am
using a dreamweaver template the main content is always surrounded by:

<!-- #BeginEditable "content" -->
...
<!-- #EndEditable -->

Just a link on a page pointing at the script below:

<-- html -->
<?php
$file = fopen($HTTP_REFERER, "r");
if(!$file)die("Cannot open the file.");
$readfile = fread($file ,40000);
$searchfile = eregi("<!-- #BeginEditable \"content\" -->(.*)<!--
#EndEditable -->", $readfile ,$out);

echo $out[0];
?>
<-- html -->

My problem is that there is a bit of php code showing in the source view
which gives away some of my included files names which I really don't want
people seeing, especially clever  people like the ones on this list :) I
don't need the php in the printable version so if I can either eval it or
strip it out that would be nice.

Regards,


Joseph

-----Original Message-----
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 November 2001 2:28 PM
To: Joseph Blythe; [EMAIL PROTECTED]
Subject: Re: [PHP] strip php out of html


On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote:
> Hello,
>
> Is there a way to strip only php code out of an html file? I know about
> strip_tags but its going to be alot of work to make the allowable list,
> as all I want to strip out is:
>
> <?php ... ?>
>
> I tried like so:
>
> eregi_replace ("<?php include(\"whatever.php\"); ?>", "", $string);
>
> but it didn't find it suppose because of the escape characters...
>
> Another option would be to find the php code evaluate it and then put
> the result back in the correct position, I sort of tried this with not
> much luck.
>
> Any ideas..
>
> Regards,
>
> Joseph

It sounds like you want to capture the output of the script - so you just
end up with what you would see in View Source???

Is this a one off thing, or what exactly is the problem you are trying to
solve?

--
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA

   Always draw your curves, then plot the data.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Sorry people it is actually evaluating the code I was looking at it from
inside Maguma PHP4EE studios internal preview which was not evaluating it,
after uploading it to the webserver it now is ok doh! :)

Anyway i do need to strip out the original link that points to the printable
script so that people don't click on it and point it at its self, it just
comes up blank anyway as it does not use the dreamwaever template.

Regards,

Joseph

-----Original Message-----
From: Joseph Blythe [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 November 2001 2:47 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] strip php out of html


David,

Basically I have found a way of making printable versions of every page in a
website I am currently working on (without a database etc), because I am
using a dreamweaver template the main content is always surrounded by:

<!-- #BeginEditable "content" -->
...
<!-- #EndEditable -->

Just a link on a page pointing at the script below:

<-- html -->
<?php
$file = fopen($HTTP_REFERER, "r");
if(!$file)die("Cannot open the file.");
$readfile = fread($file ,40000);
$searchfile = eregi("<!-- #BeginEditable \"content\" -->(.*)<!--
#EndEditable -->", $readfile ,$out);

echo $out[0];
?>
<-- html -->

My problem is that there is a bit of php code showing in the source view
which gives away some of my included files names which I really don't want
people seeing, especially clever  people like the ones on this list :) I
don't need the php in the printable version so if I can either eval it or
strip it out that would be nice.

Regards,


Joseph

-----Original Message-----
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 November 2001 2:28 PM
To: Joseph Blythe; [EMAIL PROTECTED]
Subject: Re: [PHP] strip php out of html


On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote:
> Hello,
>
> Is there a way to strip only php code out of an html file? I know about
> strip_tags but its going to be alot of work to make the allowable list,
> as all I want to strip out is:
>
> <?php ... ?>
>
> I tried like so:
>
> eregi_replace ("<?php include(\"whatever.php\"); ?>", "", $string);
>
> but it didn't find it suppose because of the escape characters...
>
> Another option would be to find the php code evaluate it and then put
> the result back in the correct position, I sort of tried this with not
> much luck.
>
> Any ideas..
>
> Regards,
>
> Joseph

It sounds like you want to capture the output of the script - so you just
end up with what you would see in View Source???

Is this a one off thing, or what exactly is the problem you are trying to
solve?

--
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA

   Always draw your curves, then plot the data.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---

I'm building a reusable component object system in PHP where construction
of object trees, which needs to occur on every page, is very expensive. 

Running the subsequently built objects is very inexpensive. 

To make this system viable to use on high volume websites, I want to keep
these objects tree instances around for the life-time of the server 
instance just like persistent resources are implemented. (i.e. have these
objects been long-lived. Not saved and reloaded on a page by page basis.)

Has anything like this been built for PHP? 

If not, could anyone provide pointers where I could start taking a look at
PHP internals to develop such a beast?

On a related question, is there a way to pre-load class definitions when
the server starts so that class definition files don't have to be
re-parsed on a page by page basis?

thanks,

-- Yermo
 
---------------------------------------------------------------------
DTLink Software                                       [EMAIL PROTECTED]
Software Development and Consulting        http://services.dtlink.com
---------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
I have the following query
        $query = "INSERT INTO acl ( username, password )
           VALUES ( 'henri', ENCRYPT('diesel','henri') )";

This is the error i get : 
        Column 'password' cannot be null
What is wrong with my query?

--- End Message ---
--- Begin Message ---
On Fri, 23 Nov 2001 16:17, De Necker Henri wrote:
> I have the following query
>       $query = "INSERT INTO acl ( username, password )
>                  VALUES ( 'henri', ENCRYPT('diesel','henri') )";
>
> This is the error i get :
>       Column 'password' cannot be null
> What is wrong with my query?

Mysql docs say:

ENCRYPT(str[,salt])
Encrypt str using the Unix crypt() system call. The salt argument should
be a string with two characters. (As of MySQL Version 3.22.16, salt may be
longer than two characters.):
mysql> select ENCRYPT("hello");
-> 'VxuFAJXVARROc'

If crypt() is not available on your system, ENCRYPT() always returns NULL.

ENCRYPT() ignores all but the  rst 8 characters of str, at least on some 
systems.

This will be determined by the behavior of the underlying crypt() system 
call.
#####

It may be that you don't have crypt on your system; also, you might want 
single quotes around the ENCRYPT and double quotes to delimit the string 
and salt, thus:

VALUES ( 'henri', 'ENCRYPT("diesel","henri")' )";

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   " ," said Tom blankly.
--- End Message ---
--- Begin Message ---
On waht systems does encrypt() work on.In my Mysql client my query results
are null,so i dont have encrypt on my system!

-----Original Message-----
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2001 08:24
To: De Necker Henri; PHP-General (E-mail)
Subject: Re: [PHP] MySQL query problem!


On Fri, 23 Nov 2001 16:17, De Necker Henri wrote:
> I have the following query
>       $query = "INSERT INTO acl ( username, password )
>                  VALUES ( 'henri', ENCRYPT('diesel','henri') )";
>
> This is the error i get :
>       Column 'password' cannot be null
> What is wrong with my query?

Mysql docs say:

ENCRYPT(str[,salt])
Encrypt str using the Unix crypt() system call. The salt argument should
be a string with two characters. (As of MySQL Version 3.22.16, salt may be
longer than two characters.):
mysql> select ENCRYPT("hello");
-> 'VxuFAJXVARROc'

If crypt() is not available on your system, ENCRYPT() always returns NULL.

ENCRYPT() ignores all but the  rst 8 characters of str, at least on some 
systems.

This will be determined by the behavior of the underlying crypt() system 
call.
#####

It may be that you don't have crypt on your system; also, you might want 
single quotes around the ENCRYPT and double quotes to delimit the string 
and salt, thus:

VALUES ( 'henri', 'ENCRYPT("diesel","henri")' )";

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   " ," said Tom blankly.
--- End Message ---
--- Begin Message ---
On Fri, 23 Nov 2001 17:05, De Necker Henri wrote:
>
> -----Original Message-----
> From: David Robley [mailto:[EMAIL PROTECTED]]
> Sent: 23 November 2001 08:24
> To: De Necker Henri; PHP-General (E-mail)
> Subject: Re: [PHP] MySQL query problem!
>
> On Fri, 23 Nov 2001 16:17, De Necker Henri wrote:
> > I have the following query
> >     $query = "INSERT INTO acl ( username, password )
> >                VALUES ( 'henri', ENCRYPT('diesel','henri') )";
> >
> > This is the error i get :
> >     Column 'password' cannot be null
> > What is wrong with my query?
>
> Mysql docs say:
>
> ENCRYPT(str[,salt])
> Encrypt str using the Unix crypt() system call. The salt argument
> should be a string with two characters. (As of MySQL Version 3.22.16,
> salt may be longer than two characters.):
> mysql> select ENCRYPT("hello");
> -> 'VxuFAJXVARROc'
>
> If crypt() is not available on your system, ENCRYPT() always returns
> NULL.
>
> ENCRYPT() ignores all but the  rst 8 characters of str, at least on
> some systems.
>
> This will be determined by the behavior of the underlying crypt()
> system call.
> #####
>
> It may be that you don't have crypt on your system; also, you might
> want single quotes around the ENCRYPT and double quotes to delimit the
> string and salt, thus:
>
> VALUES ( 'henri', 'ENCRYPT("diesel","henri")' )";

> On waht systems does encrypt() work on.In my Mysql client my query
> results are null,so i dont have encrypt on my system!

I doubt that crypt would exist on a Winblows box - you might have to use 
PASSWORD instead. However I'd hope to find it on a *nix system because 
that is what is used to encrypt the user passwords in *nix

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   Never say, "Oops!"; always say, "Ah, interesting!"
--- End Message ---
--- Begin Message ---
I try to compile againts PNG and JPEG and for web inteface

i had install zlib 
and png and jpeg
then gd
but still have no  sucess on it


On Thursday 22 November 2001 09:03, you wrote:
> The operating system you are using would be nice to know- and wether its
> for apache, cgi-bin, or whatever.
>
> Most unixes (and it looks like you got a unix) have zlib in /usr not
> /usr/local.
> Quite a few already have gd and libpng in /usr as well.
>
> That's why it would be nice to know what your build environment is.
>
> Anyway, I'm pretty sure that you need to make sure gd is compiled against
> png.
>
> On my system, for example, my gd library is compiled with png, jpeg, and
> FreeType2 support.
> Secondly- if your system is darwin, you need to fix a few things.
>
> First, run ranlib on /usr/local/lib/libpng.a
>
> Then you can build gd against it.
> Then, though, you need to do the same to libgd
>
> ranlib /usr/local/lib/libgd.a
>
> note that the above is only needed on Darwin.
> That is properly done on most other unixes for you (in fact, most unixes
> compile those as shared libraries)
>
>
--- End Message ---
--- Begin Message ---
Two things come to mind when compiling under redhat 6.x

1) Delete all headers and libs relating to gd in /usr/lib and /usr/include
these are old and will cause conflicts.

2) Use --with-..-dir=..

Here is my successful configure command assuming you have successfully
installed freetype2 and gd with frretype2 support. redhat comes with
compatible zlib, png and jpeg libs

./configure \
--prefix=/usr/local/Zend \
--with-apxs=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/Zend/etc \
--with-mysql=../../mysql \
--with-gd=/usr/local/gd \
--with-freetype-dir=/usr/local/freetype2 \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-zlib-dir=/usr \
--with-xml \
--with-pdf \
--enable-wddx \
--enable-sockets \
--enable-track-vars \
--disable-debug

Hope this helps some as I too had major troubles geeting gd support under
php seems to work really well now though.

Regards,

Joseph

-----Original Message-----
From: Yamin Prabudy [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 24 November 2001 4:46 AM
To: Michael A. Peters; PHP
Subject: Re: [PHP] GD, PNG


I try to compile againts PNG and JPEG and for web inteface

i had install zlib
and png and jpeg
then gd
but still have no  sucess on it


On Thursday 22 November 2001 09:03, you wrote:
> The operating system you are using would be nice to know- and wether its
> for apache, cgi-bin, or whatever.
>
> Most unixes (and it looks like you got a unix) have zlib in /usr not
> /usr/local.
> Quite a few already have gd and libpng in /usr as well.
>
> That's why it would be nice to know what your build environment is.
>
> Anyway, I'm pretty sure that you need to make sure gd is compiled against
> png.
>
> On my system, for example, my gd library is compiled with png, jpeg, and
> FreeType2 support.
> Secondly- if your system is darwin, you need to fix a few things.
>
> First, run ranlib on /usr/local/lib/libpng.a
>
> Then you can build gd against it.
> Then, though, you need to do the same to libgd
>
> ranlib /usr/local/lib/libgd.a
>
> note that the above is only needed on Darwin.
> That is properly done on most other unixes for you (in fact, most unixes
> compile those as shared libraries)
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
hi,
i have a file with ips inside

192.168.1.1
192.168.1.2
...

now i must write that in a html table with php.
i think that is easy, but i'm a newbie and don't find anything how to do it.

please help me

thx
--- End Message ---
--- Begin Message ---
$content = file('file_name.txt');
$HTML .='<table>';
foreach ($content as $v){
    $HTML .='<tr><td>'.$v.'</td></tr>';
}
$HTML .='</table>';
echo $HTML;

Regards
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS


----- Original Message ----- 
From: "PHP Newbie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 23, 2001 11:00 AM
Subject: [PHP] read file


> hi,
> i have a file with ips inside
> 
> 192.168.1.1
> 192.168.1.2
> ...
> 
> now i must write that in a html table with php.
> i think that is easy, but i'm a newbie and don't find anything how to do it.
> 
> please help me
> 
> thx
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

--- End Message ---
--- Begin Message ---
Hi,
I'm writing a 404 handler and in order to report the item that was requested 
I was trying to get the value of HTTP_REFERER. But, it does seem to get set. 
Does anyone know how to find thi value? Is there a reason why it would not 
get set?

TIA,

Jord
-- 
Jordan Elver
Web Developer
http://www.theinternetone.co.uk
Carpe Aptenodytes! (Seize the Penguins!)
--- End Message ---
--- Begin Message ---
hi

reasons why it couldn't be set:

the url was typed directly

some browser don't send referer information

other (like opera 5.12) send a wrong value

you shouldn't rely on HTTP_REFERER too much


regards

hassan el forkani
http://WarmAfrica.com

23/11/2001 11:55:04, Jordan Elver <[EMAIL PROTECTED]> wrote:

>Hi,
>I'm writing a 404 handler and in order to report the item that was requested 
>I was trying to get the value of HTTP_REFERER. But, it does seem to get set. 
>Does anyone know how to find thi value? Is there a reason why it would not 
>get set?
>
>TIA,
>
>Jord
>-- 
>Jordan Elver
>Web Developer
>http://www.theinternetone.co.uk
>Carpe Aptenodytes! (Seize the Penguins!)
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>



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

You don't need to get HTTP_REFERER, in order to know what the client 
requested! And every browser stores some other info in HTTP_REFERER...
The filename that was reqested is stored in $REQUEST_URI

Best,
Sebastian

>Hi,
>I'm writing a 404 handler and in order to report the item that was requested
>I was trying to get the value of HTTP_REFERER. But, it does seem to get set.
>Does anyone know how to find thi value? Is there a reason why it would not
>get set?
>
>TIA,
--- End Message ---
--- Begin Message ---
> Hi,
> I'm writing a 404 handler and in order to report the item that 
> was requested 
> I was trying to get the value of HTTP_REFERER. But, it does seem 
> to get set. 
> Does anyone know how to find thi value? Is there a reason why it 
> would not 
> get set?
> 

Hi 

I think you're looking for this

$HTTP_SERVER_VARS["REQUEST_URI"]

M:
--- End Message ---
--- Begin Message ---
Hi,
When I use HTTP_REFERER it gives me the name of the php script which is 
handling the 404's?!

Should that happen?

Jord

On Friday 23 November 2001 11:41, you wrote:
> > Hi,
> > I'm writing a 404 handler and in order to report the item that
> > was requested
> > I was trying to get the value of HTTP_REFERER. But, it does seem
> > to get set.
> > Does anyone know how to find thi value? Is there a reason why it
> > would not
> > get set?
>
> Hi
>
> I think you're looking for this
>
> $HTTP_SERVER_VARS["REQUEST_URI"]
>
> M:

-- 
Jordan Elver
Web Developer
http://www.theinternetone.co.uk
testing? What's that? If it compiles, it is good, if it boots up it is 
perfect. --- Linus Torvalds
--- End Message ---
--- Begin Message ---
> Hi,
> When I use HTTP_REFERER it gives me the name of the php script which is
> handling the 404's?!
>
> Should that happen?

As someone put in one of the other reply's don't rely on HTTP_REFERER.
This is set (or not) by the browser and they all have different ideas about
they want to play ball with it.

You said you wanted to find the url they were trying to get at.
Use the variable I told you about before to get his

Regards
M:

>
> Jord
>
> On Friday 23 November 2001 11:41, you wrote:
> > > Hi,
> > > I'm writing a 404 handler and in order to report the item that
> > > was requested
> > > I was trying to get the value of HTTP_REFERER. But, it does seem
> > > to get set.
> > > Does anyone know how to find thi value? Is there a reason why it
> > > would not
> > > get set?
> >
> > Hi
> >
> > I think you're looking for this
> >
> > $HTTP_SERVER_VARS["REQUEST_URI"]
> >
> > M:
>
> --
> Jordan Elver
> Web Developer
> http://www.theinternetone.co.uk
> testing? What's that? If it compiles, it is good, if it boots up it is
> perfect. --- Linus Torvalds
>

--- End Message ---
--- Begin Message ---
On Friday 23 November 2001 13:39, you wrote:
> Are you using it as
>
> $HTTP_SERVER_VARS["REQUEST_URI"]
>
> or
>
> $REQUEST_URI
>
> ?

Well, I think I'm buggered then because i just tried to use both and they 
both report the same value :-(

Back to the drawing board.

> I had the same problem using the latter. The former displays properly.
> Other than that I can't remember if I changed anything else
>
> M:

-- 
Jordan Elver
Web Developer
http://www.theinternetone.co.uk
Unix is not a "A-ha" experience, it is more of a "holy-shit" experience. --- 
Colin McFadyen in alt.folklore.computers
--- End Message ---
--- Begin Message ---
Hi !

I'm having terrible troubles with the file upload program I need. I have read a couple 
of tutorials and studied the examples 
in the manual, but it won't work. Every tutorial I read worked with variables 
$usrefile, $userfile_name etc. When I copy 
the same example code , I get the error msg. that $usefile_name is unkown. I'd also 
like to know what does 
enctype=\"multipart/form-data\"
mean and what is its function. 

Thanks

Nikola 


--- End Message ---
--- Begin Message ---
Hi  :-)
could you post your code?

regards,
--Patricio

----- Original Message -----
From: Nikola Veber <[EMAIL PROTECTED]>
To: php forum <[EMAIL PROTECTED]>
Sent: Thursday, November 22, 2001 10:01 PM
Subject: [PHP] file upload troubles
> Hi !
> I'm having terrible troubles with the file upload program I need. I have
read a couple of tutorials and studied the examples
> in the manual, but it won't work. Every tutorial I read worked with
variables $usrefile, $userfile_name etc. When I copy
> the same example code , I get the error msg. that $usefile_name is unkown.
I'd also like to know what does
> enctype=\"multipart/form-data\"
> mean and what is its function.
> Thanks
> Nikola


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

I had to create a large number of HTML-files with large parts
within that are identical (the navigation).
To avoid redundant writing during the creation of the files,
I used PHP-Includes to include this navigation from one file.

Now I have to get static HTML-pages from these php-enriched files.

I am thinking about using regexp to filter the php-tags and include
the corresponding HTML-Sniplets.

Or I guess I could open a connection to the server and read these
files as if I was a client (browser) and stzore the resulting HTML-pages.

Any idea what would be easier (I got very few time...)

Any hints?

Cheers, 

Kiko

-----
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-----
--- End Message ---
--- Begin Message ---
Hi !

You asked for the code ...
Here you go :

<html>
<body>

<form action="<?global $PHP_SELF; echo $PHP_SELF?>" method=POST 
ENCTYPE="multipart/form-data">
  <table>
    <tr>
      <td>Select File:</td>
      <td>:</td>
      <td><input type=file name=userfile></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type=submit value=Upload></td>
    </tr>
</table>
  </form>
<?php
//the code is not finished due to those problems ...
//when I proceed with the submit button, I get white screen (nothing at all)!
print_r ($HTTP_POST_VARS);
global $userfile;
global $userfile_name;
$dir = "\upload";
$temp = "\temp";
$twhere = $temp . "/" . $userfile_name;
$where = $dir . "/" . $userfile_name;
rename("$userfile", "$temp/$userfile_name");
                copy("twhere", "$where");
                unlink("$twhere");
                echo "OK: File \"$userfile_name\" uploaded succesfully";
?>
</body>
</html>


Thanks
Nikola


--- End Message ---

Reply via email to