|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Tue Aug 21 2001 - 12:24:29 CDT
php-general Digest 21 Aug 2001 17:24:29 -0000 Issue 829
Topics (messages 63622 through 63741):
Re: Switch case syntax
63622 by: David Robley
63624 by: -:-Doigy-:-
Re: "mode" in mkdir()
63623 by: David Robley
63629 by: Raphael Pirker
charset
63625 by: Mark Lo
63626 by: Maxim Maletsky
63627 by: Maxim Maletsky
63635 by: Lawrence.Sheed.dfait-maeci.gc.ca
register_globals odd behaviour?
63628 by: Sean C. McCarthy
63719 by: Johnson, Kirk
multiple select question
63630 by: Raphael Pirker
63644 by: David Robley
if statement and imageline()
63631 by: Hugh Danaher
Creating images on the fly
63632 by: Niklas Lampen
63670 by: _lallous
Importing a GIF image and making it transparent
63633 by: Ben Quinn
63634 by: Chris Lambert
63637 by: Ben Quinn
63643 by: David Robley
63666 by: Ben Quinn
63669 by: Chris Lambert
63673 by: Ben Quinn
Re: ImagePNG problem
63636 by: Adrian Ciutureanu
Re: ADODB Library
63638 by: Jaros³aw Jankowski
Re: converting str with \n to one line str??
63639 by: Jens Schodt
63640 by: Jens Schodt
63642 by: Lawrence.Sheed.dfait-maeci.gc.ca
63645 by: David Robley
63658 by: Jens Schodt
63659 by: Jens Schodt
63685 by: Dave
63696 by: Christian Eichert
Re: ADODB?
63641 by: Jaros³aw Jankowski
Re: basename()
63646 by: Renze Munnik
63651 by: Gerard Samuel
Re: Free PHP runtime Accelerator for Linux available
63647 by: PHP Accelerator
63664 by: Maxim Maletsky
63677 by: PHP Accelerator
63698 by: Michael Kimsal
63737 by: PHP Accelerator
mime types
63648 by: Evan Nemerson
63649 by: Brad Hubbard
Re:
63650 by: PHP Accelerator
Re: flash and php
63652 by: Tribun
63708 by: Dan Harrington
Mutiline read as Sigle Line!
63653 by: Jack
begginer how to make integer ?
63654 by: Andras Kende
63657 by: Renze Munnik
Re: How to download an entire dynamic website?
63655 by: Tim Ward
Re: [PHP-WIN] Mutiline read as Sigle Line!
63656 by: Michael Rudel
Re: Multi-dimensional array issue
63660 by: Tim Ward
63662 by: Nick Davies
63697 by: Ken Hopkins
Returning a string from a function
63661 by: Richard Kurth
Security implications - CGI vs module
63663 by: Daniel Baldoni
pdflib+pdi
63665 by: Jonathan S
Re: Function to Build Trees
63667 by: Chris Hayes
how to discover cause of php crash under win98?
63668 by: Chris Hayes
63672 by: _lallous
63740 by: rm
Re: [PHP-DEV] php and autoconf 2.50
63671 by: jan.kneschke.de
Use cron to execute a script
63674 by: Augusto Cesar Castoldi
63675 by: Brad Hubbard
63676 by: Brad Hubbard
Re: Use cron to execute a script --> OTHER problem now
63678 by: Augusto Cesar Castoldi
63692 by: Dave
Resizing jpegs
63679 by: Seb Frost
Re: HTTPS w/ header() ?
63680 by: Dave
List of files?
63681 by: Seb Frost
63686 by: Renze Munnik
63689 by: Brian C. Doyle
Help me on server.
63682 by: Hari Prakash
Re: Picking random numbers
63683 by: Dave
Linux
63684 by: Roman
63687 by: Nick Davies
PHP_Commander
63688 by: Andrey Hristov
Why linx don't work with cron?
63690 by: Augusto Cesar Castoldi
Why lynx don't work with cron?
63691 by: Augusto Cesar Castoldi
63694 by: Stig-Ørjan Smelror
63695 by: Cristopher Daniluk
Re: new one is it ??
63693 by: billfarr.ages.com
our country
63699 by: nafiseh saberi
Re: PHP based auth -----------------
63700 by: Sheridan Saint-Michel
Detecting empty query result?
63701 by: Seb Frost
63703 by: Renze Munnik
63704 by: DevilKin
63705 by: Seb Frost
404 header
63702 by: Boaz Yahav
ISAPI under Win98
63706 by: Tribun
mcrypt trouble
63707 by: Dominic Schanen
63714 by: Andrew Libby
IIS
63709 by: nafiseh saberi
63710 by: Tyler Longren
63713 by: B. van Ouwerkerk
63731 by: Gabe da Silveira
header function
63711 by: Jay Paulson
63712 by: Tyler Longren
63715 by: Jay Paulson
Page detect
63716 by: Kevin P
63717 by: Jay Paulson
63735 by: rm
Re: Need "Working..." pop up dialog (repost)
63718 by: Ray Clouse
Listing files from a directory
63720 by: Martin E. Koss
63723 by: Seb Frost
63724 by: Thomas Deliduka
Re: sendmail
63721 by: BRACK
Re: Errors
63722 by: BRACK
Re: PHP indexOf()?
63725 by: Kevin P
63726 by: Taylor, Stewart
63727 by: Thomas Deliduka
Re: php and flash
63728 by: Jeff Pearson
PHP/Apache configuration for Win NT
63729 by: paul.eaton.globalgraphics.com
63730 by: Julie Meloni
63732 by: Neil Freeman
63733 by: Julie Meloni
generate documenation?
63734 by: Daniel Adams
63739 by: eschmid+sic.s.netic.de
chicken and egg problem with SID
63736 by: Egan
Re: hacks we should know about
63738 by: Bill Rausch
63741 by: Seb Frost
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
On Tue, 21 Aug 2001 14:22, -:-Doigy-:- wrote:
> Hi Folks,
>
> In a switch, I have a load of 3 letter prefixes I'm sorting by. They
> are the truncated first 3 letters of alpha-numeric product codes which
> gives the category of the product.
> Some codes start with MB- for instance, and this causes a parsing
> error. Can I fix this without changing the fact I'm switching on a 3
> letter string?
>
> Cheers
You are sticking those values in quotes? Frinstance
switch($variable) {
case 'IBM':
break;
case 'DEC':
break;
case 'MB-':
break;
}
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAIf I knew what I was doing...I'd be dangerous...
attached mail follows:
No, they weren't in quotes strangely. Adding quotes removes parsing error.
Thanks David
attached mail follows:
On Tue, 21 Aug 2001 14:50, Raphael Pirker wrote: > What does the ending "0700" mean in this line? (please don't refer me > to the manual, I read through it...) are these the user-permissions as > you specify them in chmod? > > mkdir ("/path/to/my/dir", 0700);
Yes - it's the mode of access to the file. man chmod should give you more info if you need, (if you are on *nix, otherwise $DEITY knows how Win handles this) but in particular:
A numeric mode is from one to four octal digits (0-7), derived by adding up the bits with values 4, 2, and 1. Any omitted digits are assumed to be leading zeros. The first digit selects the set user ID (4) and set group ID (2) and save text image [`sticky'] (1) attributes. The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1); the third selects permissions for other users in the file's group, with the same values; and the fourth for other users not in the file's group, with the same values.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAI'm not lost, I'm "locationally challenged."
attached mail follows:
thanks dave!
attached mail follows:
Hi,
What could be wrong if I don't specific the CHARSET in my webpage. If my webpage will display both chinese and english, then what charset should i use.
Thank you
Mark
attached mail follows:
Chinese charset.
Maxim Maletsky
-----Original Message-----
From: Mark Lo [mailto:mark
3dsources.com]
Sent: Tuesday, August 21, 2001 3:03 PM
To: php-general
lists.php.net
Subject: [PHP] charset
Hi,
What could be wrong if I don't specific the CHARSET in my webpage. If my webpage will display both chinese and english, then what charset should i use.
Thank you
Mark
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
P.S: just as in this email :-)
Maxim Maletsky
-----Original Message-----
From: Maxim Maletsky
Sent: Tuesday, August 21, 2001 3:02 PM
To: 'Mark Lo'; php-general
lists.php.net
Subject: RE: [PHP] charset
Chinese charset.
Maxim Maletsky
-----Original Message-----
From: Mark Lo [mailto:mark
3dsources.com]
Sent: Tuesday, August 21, 2001 3:03 PM
To: php-general
lists.php.net
Subject: [PHP] charset
Hi,
What could be wrong if I don't specific the CHARSET in my webpage. If my webpage will display both chinese and english, then what charset should i use.
Thank you
Mark
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Depends on what Chinese charset you want.
Simplified Chinese or Traditional.
GB or BIG5
Use a meta content type for the charset type
for simplified <meta http-equiv="content-type" content="text/html; charset=gb2312">
for traditional <META http-equiv=Content-Type content="text/html; charset=big5">
eg
<head> <title>Yahoo! China - NA?¢FOD1u</title> <meta http-equiv="content-type" content="text/html; charset=gb2312"> </head>
¦n¤F??
Lawrence.
-----Original Message-----
From: Maxim Maletsky [mailto:maxim
japaninc.com]
Sent: August 21, 2001 2:03 PM
To: Maxim Maletsky; 'Mark Lo'; php-general
lists.php.net
Subject: RE: [PHP] charset
P.S: just as in this email :-)
Maxim Maletsky
-----Original Message-----
From: Maxim Maletsky
Sent: Tuesday, August 21, 2001 3:02 PM
To: 'Mark Lo'; php-general
lists.php.net
Subject: RE: [PHP] charset
Chinese charset.
Maxim Maletsky
-----Original Message-----
From: Mark Lo [mailto:mark
3dsources.com]
Sent: Tuesday, August 21, 2001 3:03 PM
To: php-general
lists.php.net
Subject: [PHP] charset
Hi,
What could be wrong if I don't specific the CHARSET in my webpage. If my webpage will display both chinese and english, then what charset should i use.
Thank you
Mark
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi All,
I just come across and odd behaviour with the register_globals and session handling. The problem is that when I set the register globals to on I cannot access the session_variables through the associative array HTTP_SESSION_VARS. The manual says explicitly that with track_vars and register_globals both on the array and the vars will point to the same.
It just doesn't happen the vars are not written at the end of the script. I mean with register_globals ON:
<? session_register("count"); $HTTP_SESSION_VARS["count"]++; ?>
this does not work. My php is PHP Version 4.0.3pl1 running on Linux 2.2.18 and Apache1.3.9 . Does this bogus behaviour happen with higher versions too?
Thanks in advance.
Sean C. McCarthy SCI, S.L. (www.sci-spain.com)
attached mail follows:
> I just come across and odd behaviour with the register_globals and > session handling. The problem is that when I set the register > globals to > on I cannot access the session_variables through the associative array > HTTP_SESSION_VARS. The manual says explicitly that with track_vars and > register_globals both on the array and the vars will point to > the same.
I believe this was a bug in all versions prior to 4.0.6, globals and $HTTP_SESSION_VARS did *not* reference the same value while on the current page, in spite of what the manual says. So, either upgrade to 4.0.6, or use the global version of session variables rather than the $HTTP_SESSION_VARS array.
Kirk
attached mail follows:
Hi,
I have a dynamic multiple select where data is added to using the JavaScript found here:
http://javascript.internet.com/forms/menu-swapper.html
I have a question: How do I read all the values into an array or something else? My select has the NAME "read".
TIA,
Raphael
attached mail follows:
On Tue, 21 Aug 2001 15:38, Raphael Pirker wrote: > Hi, > > I have a dynamic multiple select where data is added to using the > JavaScript found here: > > http://javascript.internet.com/forms/menu-swapper.html > > I have a question: How do I read all the values into an array or > something else? My select has the NAME "read". > > TIA, > > Raphael
Without checking that URL: the usual way to return the contents of multiple select box as an array is to name the selct as an array with name[] - so in your case, <SELECT NAME=read[] MULTIPLE> etc
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIACan't learn to do something well? Learn to enjoy doing it badly!
attached mail follows:
help,
I am trying to set up a .jpg file to graph the earnings per year of a company. I can generate a log-normal graph, can get it to display the earnings per year as circles on the graph, but I can't get the " if () " statement to work. I know I am setting two of the variables in the if statement after the if statement executes once, but these variables won't be used until after the " for () " loops once, and therefore should be available for use in " imageline() " on the second loop (where $year>$startyear). Somehow, I think my logic is correct but it mustn't be so.
$startyear=1996; $chart_start_year=1992; for ($year=$startyear;$year<=$startyear+7;$year++) { $x=(($year-$chart_start_year)*20)+20; $y=420-log(${"earnings_".$year})*75; if ($year>$startyear) { imageline($image,$first_x,$first_y,$x,$y,$blue); } $first_x=$x; $first_y=$y; imagettftext($image,9,0,$x_distance-4,$y_distance+3,$blue,$font2,"m"); }
attached mail follows:
Is it possible to create images on the fly, if my phpinfo says nothing about GD? What I know is that ImageCreateFromPNG() says it's undefined.
If not, what do I need to install to php to make it possible?
Niklas Lampén
attached mail follows:
Yes... get inspired from this simple HTML example even!
<html>
<head>
<title>Inline Image generation (via JavaScript)</title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script language="JavaScript">
<!--
img = "#define x_width 16\n#define x_height 16\nstatic char x_bits[] = {0x00, 0x01, 0xe0, 0x0f, 0x10, 0x10, 0xf8, 0x3f, 0x10, 0x10, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x16, 0x50, 0x15, 0x10, 0x10, 0xe0, 0x0f, 0x00, 0x00}";
//-->
</script>
<body>
<img src="javascript:img">
</body>
</html>
"Niklas Lampen" <niklas.lampen
luukku.com> wrote in message
news:001701c12a09$25470c50$1521b9d5
laptop...
> Is it possible to create images on the fly, if my phpinfo says nothing
about
> GD? What I know is that ImageCreateFromPNG() says it's undefined.
>
> If not, what do I need to install to php to make it possible?
>
>
> Niklas Lampén
>
attached mail follows:
Hi all
I've been trying to make a script that imports a GIF image from an external server (i have permission to do this, see below) and designates a certain colour transparent for some time now and i'm not having much luck. Can anyone help or provide a script that does this?
The images i'm using are Australian weather radar images with a rather plain brown background
http://mirror.bom.gov.au/radar/IDR503.gif
What i'd like to do is have an orographic map for the background, like this
http://www.bsch.au.com/temp/preview.jpg
The radar images are available to the public and i have permission to make these alterations
Is it possible for PHP to download a GIF image (through HTTP), designate a certain colour transparent and then display the image on the screen without saving the image to the server?
Any help i can get with this would be much appreciated
attached mail follows:
It doesn't look like you'll be able to use GD, as GIF support was dropped in 1.6 and JPEG support was only added in 1.8. You'd have to experiment with ImageMagick, or another command-line tool independent of PHP.
/* Chris Lambert, CTO - chris
whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: Ben Quinn <benquinn
optushome.com.au>
To: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 2:23 AM
Subject: [PHP] Importing a GIF image and making it transparent
| Hi all
|
| I've been trying to make a script that imports a GIF image from an
external
| server (i have permission to do this, see below) and designates a certain
| colour transparent for some time now and i'm not having much luck. Can
| anyone help or provide a script that does this?
|
| The images i'm using are Australian weather radar images with a rather
plain
| brown background
|
| http://mirror.bom.gov.au/radar/IDR503.gif
|
| What i'd like to do is have an orographic map for the background, like
this
|
| http://www.bsch.au.com/temp/preview.jpg
|
| The radar images are available to the public and i have permission to make
| these alterations
|
| Is it possible for PHP to download a GIF image (through HTTP), designate a
| certain colour transparent and then display the image on the screen
without
| saving the image to the server?
|
| Any help i can get with this would be much appreciated
|
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
| For additional commands, e-mail: php-general-help
lists.php.net
| To contact the list administrators, e-mail: php-list-admin
lists.php.net
|
|
|
attached mail follows:
Hi Chris,
Thanks for the speedy reply. In the GD section here http://www.bsch.au.com/admin/phpinfo.php it says "GIF support - enabled"
I'm starting to wonder though if PHP can do this? I looked up the imagecolourtransparent function on the PHP site and it says:
int imagecolortransparent (int im [, int col])
ImageColorTransparent() sets the transparent color in the im image to col. Im is the image identifier returned by ImageCreate() and col is a color identifier returned by ImageColorAllocate().
Note "Im is the image identifier returned by ImageCreate()" - does this mean this function only works with images PHP has created?
----- Original Message -----
From: "Chris Lambert" <chris
php.net>
To: "Ben Quinn" <benquinn
optushome.com.au>
Cc: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 4:49 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent
> It doesn't look like you'll be able to use GD, as GIF support was dropped
in
> 1.6 and JPEG support was only added in 1.8. You'd have to experiment with
> ImageMagick, or another command-line tool independent of PHP.
>
> /* Chris Lambert, CTO - chris
whitecrown.net
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> ----- Original Message -----
> From: Ben Quinn <benquinn
optushome.com.au>
> To: <php-general
lists.php.net>
> Sent: Tuesday, August 21, 2001 2:23 AM
> Subject: [PHP] Importing a GIF image and making it transparent
>
>
> | Hi all
> |
> | I've been trying to make a script that imports a GIF image from an
> external
> | server (i have permission to do this, see below) and designates a
certain
> | colour transparent for some time now and i'm not having much luck. Can
> | anyone help or provide a script that does this?
> |
> | The images i'm using are Australian weather radar images with a rather
> plain
> | brown background
> |
> | http://mirror.bom.gov.au/radar/IDR503.gif
> |
> | What i'd like to do is have an orographic map for the background, like
> this
> |
> | http://www.bsch.au.com/temp/preview.jpg
> |
> | The radar images are available to the public and i have permission to
make
> | these alterations
> |
> | Is it possible for PHP to download a GIF image (through HTTP), designate
a
> | certain colour transparent and then display the image on the screen
> without
> | saving the image to the server?
> |
> | Any help i can get with this would be much appreciated
> |
> |
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> | For additional commands, e-mail: php-general-help
lists.php.net
> | To contact the list administrators, e-mail: php-list-admin
lists.php.net
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
On Tue, 21 Aug 2001 16:24, Ben Quinn wrote: > Hi Chris, > > Thanks for the speedy reply. In the GD section here > http://www.bsch.au.com/admin/phpinfo.php > it says "GIF support - enabled" > > I'm starting to wonder though if PHP can do this? I looked up the > imagecolourtransparent function on the PHP site and it says: > > int imagecolortransparent (int im [, int col]) > > ImageColorTransparent() sets the transparent color in the im image to > col. Im is the image identifier returned by ImageCreate() and col is a > color identifier returned by ImageColorAllocate(). > > Note "Im is the image identifier returned by ImageCreate()" - does this > mean this function only works with images PHP has created?
I wonder if it might not work on the image identifier returned from ImageCreateFromGIF, which is presumably what you are using?
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAA diplomat thinks twice before saying nothing.
attached mail follows:
Thanks to those who replied, i finally worked it out - the script has been pasted below just incase anyone is sifting through the list archives looking for the same thing. One thing though, my server doesn't allow me to open a GIF file through HTTP - ie this doesn't work
$image = ImageCreateFromGif(http://www.severname.com/image.gif);
Does anyone know of a server/hosting company that will allow me to do this?
The script:
<?
$id = ImageCreateFromGif("image.gif");
$trans = imagecolorexact($id, 120, 100, 90);
imagecolortransparent($id, $trans);
ImageGIF($id,"newimage.gif");
echo "done";
?>
----- Original Message -----
From: "Chris Lambert" <chris
php.net>
To: "Ben Quinn" <benquinn
optushome.com.au>
Cc: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 4:49 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent
> It doesn't look like you'll be able to use GD, as GIF support was dropped
in
> 1.6 and JPEG support was only added in 1.8. You'd have to experiment with
> ImageMagick, or another command-line tool independent of PHP.
>
> /* Chris Lambert, CTO - chris
whitecrown.net
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> ----- Original Message -----
> From: Ben Quinn <benquinn
optushome.com.au>
> To: <php-general
lists.php.net>
> Sent: Tuesday, August 21, 2001 2:23 AM
> Subject: [PHP] Importing a GIF image and making it transparent
>
>
> | Hi all
> |
> | I've been trying to make a script that imports a GIF image from an
> external
> | server (i have permission to do this, see below) and designates a
certain
> | colour transparent for some time now and i'm not having much luck. Can
> | anyone help or provide a script that does this?
> |
> | The images i'm using are Australian weather radar images with a rather
> plain
> | brown background
> |
> | http://mirror.bom.gov.au/radar/IDR503.gif
> |
> | What i'd like to do is have an orographic map for the background, like
> this
> |
> | http://www.bsch.au.com/temp/preview.jpg
> |
> | The radar images are available to the public and i have permission to
make
> | these alterations
> |
> | Is it possible for PHP to download a GIF image (through HTTP), designate
a
> | certain colour transparent and then display the image on the screen
> without
> | saving the image to the server?
> |
> | Any help i can get with this would be much appreciated
> |
> |
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> | For additional commands, e-mail: php-general-help
lists.php.net
> | To contact the list administrators, e-mail: php-list-admin
lists.php.net
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Did you use quotes around the URL when trying to access the image?
/* Chris Lambert, CTO - chris
whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: Ben Quinn <benquinn
optushome.com.au>
To: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 6:09 AM
Subject: Re: [PHP] Importing a GIF image and making it transparent
|
| Thanks to those who replied, i finally worked it out - the script has been
| pasted below just incase anyone is sifting through the list archives
looking
| for the same thing. One thing though, my server doesn't allow me to open
a
| GIF file through HTTP - ie this doesn't work
|
| $image = ImageCreateFromGif(http://www.severname.com/image.gif);
|
| Does anyone know of a server/hosting company that will allow me to do
this?
|
|
| The script:
|
| <?
|
| $id = ImageCreateFromGif("image.gif");
|
| $trans = imagecolorexact($id, 120, 100, 90);
|
| imagecolortransparent($id, $trans);
|
| ImageGIF($id,"newimage.gif");
|
| echo "done";
|
| ?>
|
|
|
| ----- Original Message -----
| From: "Chris Lambert" <chris
php.net>
| To: "Ben Quinn" <benquinn
optushome.com.au>
| Cc: <php-general
lists.php.net>
| Sent: Tuesday, August 21, 2001 4:49 PM
| Subject: Re: [PHP] Importing a GIF image and making it transparent
|
|
| > It doesn't look like you'll be able to use GD, as GIF support was
dropped
| in
| > 1.6 and JPEG support was only added in 1.8. You'd have to experiment
with
| > ImageMagick, or another command-line tool independent of PHP.
| >
| > /* Chris Lambert, CTO - chris
whitecrown.net
| > WhiteCrown Networks - More Than White Hats
| > Web Application Security - www.whitecrown.net
| > */
| >
| > ----- Original Message -----
| > From: Ben Quinn <benquinn
optushome.com.au>
| > To: <php-general
lists.php.net>
| > Sent: Tuesday, August 21, 2001 2:23 AM
| > Subject: [PHP] Importing a GIF image and making it transparent
| >
| >
| > | Hi all
| > |
| > | I've been trying to make a script that imports a GIF image from an
| > external
| > | server (i have permission to do this, see below) and designates a
| certain
| > | colour transparent for some time now and i'm not having much luck. Can
| > | anyone help or provide a script that does this?
| > |
| > | The images i'm using are Australian weather radar images with a rather
| > plain
| > | brown background
| > |
| > | http://mirror.bom.gov.au/radar/IDR503.gif
| > |
| > | What i'd like to do is have an orographic map for the background, like
| > this
| > |
| > | http://www.bsch.au.com/temp/preview.jpg
| > |
| > | The radar images are available to the public and i have permission to
| make
| > | these alterations
| > |
| > | Is it possible for PHP to download a GIF image (through HTTP),
designate
| a
| > | certain colour transparent and then display the image on the screen
| > without
| > | saving the image to the server?
| > |
| > | Any help i can get with this would be much appreciated
| > |
| > |
| > |
| > |
| > | --
| > | PHP General Mailing List (http://www.php.net/)
| > | To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
| > | For additional commands, e-mail: php-general-help
lists.php.net
| > | To contact the list administrators, e-mail:
php-list-admin
lists.php.net
| > |
| > |
| > |
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
| > For additional commands, e-mail: php-general-help
lists.php.net
| > To contact the list administrators, e-mail: php-list-admin
lists.php.net
| >
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
| For additional commands, e-mail: php-general-help
lists.php.net
| To contact the list administrators, e-mail: php-list-admin
lists.php.net
|
|
|
attached mail follows:
G'day Chris
Yep i did, with this code
$id = ImageCreateFromGif("http://mirror.bom.gov.au/radar/IDR503.gif");
I get this error :<
Warning: imagecreatefromgif: Sockets are not supported for image type 'GIF' in /home/httpd/html/bsch/temp/monkey.php on line 5
Brick wall #9080982093848934 - but i guess that makes the end result just that little bit better :-)
BTW - can anyone recommend a good GD install tutorial? If i can't run this script on my website i'll install PHP and GD and run it from my computer
----- Original Message -----
From: "Chris Lambert" <chris
php.net>
To: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 8:45 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent
> Did you use quotes around the URL when trying to access the image?
>
> /* Chris Lambert, CTO - chris
whitecrown.net
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> ----- Original Message -----
> From: Ben Quinn <benquinn
optushome.com.au>
> To: <php-general
lists.php.net>
> Sent: Tuesday, August 21, 2001 6:09 AM
> Subject: Re: [PHP] Importing a GIF image and making it transparent
>
>
> |
> | Thanks to those who replied, i finally worked it out - the script has
been
> | pasted below just incase anyone is sifting through the list archives
> looking
> | for the same thing. One thing though, my server doesn't allow me to
open
> a
> | GIF file through HTTP - ie this doesn't work
> |
> | $image = ImageCreateFromGif(http://www.severname.com/image.gif);
> |
> | Does anyone know of a server/hosting company that will allow me to do
> this?
> |
> |
> | The script:
> |
> | <?
> |
> | $id = ImageCreateFromGif("image.gif");
> |
> | $trans = imagecolorexact($id, 120, 100, 90);
> |
> | imagecolortransparent($id, $trans);
> |
> | ImageGIF($id,"newimage.gif");
> |
> | echo "done";
> |
> | ?>
> |
> |
> |
> | ----- Original Message -----
> | From: "Chris Lambert" <chris
php.net>
> | To: "Ben Quinn" <benquinn
optushome.com.au>
> | Cc: <php-general
lists.php.net>
> | Sent: Tuesday, August 21, 2001 4:49 PM
> | Subject: Re: [PHP] Importing a GIF image and making it transparent
> |
> |
> | > It doesn't look like you'll be able to use GD, as GIF support was
> dropped
> | in
> | > 1.6 and JPEG support was only added in 1.8. You'd have to experiment
> with
> | > ImageMagick, or another command-line tool independent of PHP.
> | >
> | > /* Chris Lambert, CTO - chris
whitecrown.net
> | > WhiteCrown Networks - More Than White Hats
> | > Web Application Security - www.whitecrown.net
> | > */
> | >
> | > ----- Original Message -----
> | > From: Ben Quinn <benquinn
optushome.com.au>
> | > To: <php-general
lists.php.net>
> | > Sent: Tuesday, August 21, 2001 2:23 AM
> | > Subject: [PHP] Importing a GIF image and making it transparent
> | >
> | >
> | > | Hi all
> | > |
> | > | I've been trying to make a script that imports a GIF image from an
> | > external
> | > | server (i have permission to do this, see below) and designates a
> | certain
> | > | colour transparent for some time now and i'm not having much luck.
Can
> | > | anyone help or provide a script that does this?
> | > |
> | > | The images i'm using are Australian weather radar images with a
rather
> | > plain
> | > | brown background
> | > |
> | > | http://mirror.bom.gov.au/radar/IDR503.gif
> | > |
> | > | What i'd like to do is have an orographic map for the background,
like
> | > this
> | > |
> | > | http://www.bsch.au.com/temp/preview.jpg
> | > |
> | > | The radar images are available to the public and i have permission
to
> | make
> | > | these alterations
> | > |
> | > | Is it possible for PHP to download a GIF image (through HTTP),
> designate
> | a
> | > | certain colour transparent and then display the image on the screen
> | > without
> | > | saving the image to the server?
> | > |
> | > | Any help i can get with this would be much appreciated
> | > |
> | > |
> | > |
> | > |
> | > | --
> | > | PHP General Mailing List (http://www.php.net/)
> | > | To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> | > | For additional commands, e-mail: php-general-help
lists.php.net
> | > | To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> | > |
> | > |
> | > |
> | >
> | >
> | > --
> | > PHP General Mailing List (http://www.php.net/)
> | > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> | > For additional commands, e-mail: php-general-help
lists.php.net
> | > To contact the list administrators, e-mail:
php-list-admin
lists.php.net
> | >
> | >
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> | For additional commands, e-mail: php-general-help
lists.php.net
> | To contact the list administrators, e-mail: php-list-admin
lists.php.net
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi Andy,
I don't need to use ImageCreateTrueColor() (or do I?). I just want to read a PNG24, write a text to it and save. I don't have GD 2.0.1. And again: I can read PNG24, but when I save it with ImagePNG($fileName), GD writes a PNG8 :-(
adu
"Andrew Chase" <andrew.chase
valleypres.org> wrote
> Make sure you have GD 2.0.1 and PHP 4.0.6 or later for creating true-color
> PNGs, per the manual:
>
> http://php.net/manual/en/function.imagecreatetruecolor.php
>
> -Andy
>
>
> > -----Original Message-----
> > From: Adrian Ciutureanu [mailto:Adrian.Ciutureanu
softure.com]
> >
> > Is there any way to tell ImagePNG() to create PNG24 images instead of
PNG8
> > images? Seems that ImageCreateFromPNG() can read PNG24, but ImagePNG()
> > writes only PNG8.
attached mail follows:
Jochen Kaechelin wrote:
> Anyone made good experiences > with the ADODB Library for PHP4?
Yes. I use it with Oracle8 with any bad experience. It's fast ( except select_limit ) and brings some cool functions like generating <select> menus. Jarry
attached mail follows:
nl2br is not working in this case. It does put a <br> with every new line, but it does not remove the new line. The string will still have the line changes and it will not work in Javascript.
Jens
-----Oprindelig meddelelse-----
Fra: Artwithin [mailto:gatha
artwithin.com]
Sendt: 20. august 2001 20:09
Til: Jens
Cc: php-general
lists.php.net
Emne: Re: [PHP] converting str with \n to one line str??
use nl2br() http://www.php.net/nl2br
or, alternatively, use a regex to strip out the newlines
hope this helps.
----- Original Message -----
From: Jens <nice
email.dk>
To: <php-general
lists.php.net>
Sent: Monday, August 20, 2001 11:15
Subject: [PHP] converting str with \n to one line str??
> When I use Javascript with PHP i run into one problem. When I get the data
i
> need from the database it often has a lot of <br> and \n (new lines) in
it.
> The <br> are no problem when converting a string to a Javascript string,
but
> the \n are. The string has to be all in one line.
>
> example:
> <? $temp = "here
> I
> am"; ?>
>
> <script>var temp = <? echo $temp?> </script>
>
> This is not working!! But this would :
>
> <? $temp = "here I am"; ?>
>
> <script>var temp = '<? echo $temp?>'; </script>
>
> Can you help me please?
>
> thanks Jens
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
$temp = str_replace("\n","test",$temp) is doing the same thing. It is still a string in several lines if you look in the source :-(
jens
-----Oprindelig meddelelse-----
Fra: Tyler Longren [mailto:tyler
captainjack.com]
Sendt: 20. august 2001 20:20
Til: Jens
Cc: php-general
lists.php.net
Emne: Re: [PHP] converting str with \n to one line str??
You could use str_replace().
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Mon, 20 Aug 2001 20:15:54 +0200 "Jens" <nice
email.dk> wrote:
> When I use Javascript with PHP i run into one problem. When I get the > data i > need from the database it often has a lot of <br> and \n (new lines) in > it. > The <br> are no problem when converting a string to a Javascript string, > but > the \n are. The string has to be all in one line. > > example: > <? $temp = "here > I > am"; ?> > > <script>var temp = <? echo $temp?> </script> > > This is not working!! But this would : > > <? $temp = "here I am"; ?> > > <script>var temp = '<? echo $temp?>'; </script> > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
just a thought - \r\n?
try stripping out \r's as well. windows does \r\n (carriage return, line feed) for text, unix only \n's
-----Original Message-----
From: Jens Schodt [mailto:js
e-sense.dk]
Sent: August 21, 2001 3:20 PM
To: 'Tyler Longren'
Cc: 'php-general
lists.php.net'
Subject: SV: [PHP] converting str with \n to one line str??
$temp = str_replace("\n","test",$temp) is doing the same thing. It is still a string in several lines if you look in the source :-(
jens
-----Oprindelig meddelelse-----
Fra: Tyler Longren [mailto:tyler
captainjack.com]
Sendt: 20. august 2001 20:20
Til: Jens
Cc: php-general
lists.php.net
Emne: Re: [PHP] converting str with \n to one line str??
You could use str_replace().
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Mon, 20 Aug 2001 20:15:54 +0200 "Jens" <nice
email.dk> wrote:
> When I use Javascript with PHP i run into one problem. When I get the > data i > need from the database it often has a lot of <br> and \n (new lines) in > it. > The <br> are no problem when converting a string to a Javascript string, > but > the \n are. The string has to be all in one line. > > example: > <? $temp = "here > I > am"; ?> > > <script>var temp = <? echo $temp?> </script> > > This is not working!! But this would : > > <? $temp = "here I am"; ?> > > <script>var temp = '<? echo $temp?>'; </script> > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On Tue, 21 Aug 2001 16:49, Jens Schodt wrote:
> $temp = str_replace("\n","test",$temp) is doing the same thing. It is
> still a string in several lines if you look in the source :-(
>
> jens
>
> -----Oprindelig meddelelse-----
> Fra: Tyler Longren [mailto:tyler
captainjack.com]
> Sendt: 20. august 2001 20:20
> Til: Jens
> Cc: php-general
lists.php.net
> Emne: Re: [PHP] converting str with \n to one line str??
>
>
> You could use str_replace().
>
> --
> Tyler Longren
> Captain Jack Communications
> tyler
captainjack.com
> www.captainjack.com
>
>
>
> On Mon, 20 Aug 2001 20:15:54 +0200
>
> "Jens" <nice
email.dk> wrote:
> > When I use Javascript with PHP i run into one problem. When I get the
> > data i
> > need from the database it often has a lot of <br> and \n (new lines)
> > in it.
> > The <br> are no problem when converting a string to a Javascript
> > string, but
> > the \n are. The string has to be all in one line.
> >
> > example:
> > <? $temp = "here
> > I
> > am"; ?>
> >
> > <script>var temp = <? echo $temp?> </script>
> >
> > This is not working!! But this would :
> >
> > <? $temp = "here I am"; ?>
> >
> > <script>var temp = '<? echo $temp?>'; </script>
> >
> > Can you help me please?
> >
> > thanks Jens
Regular expressions? There is an example for ereg_replace in the manual that does just this:
$string = ereg_replace ("\n", "", $string); /* Get rid of any newline characters in $string. */
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA"Yes, I have been reading Voltaire," Tom admitted candidly.
attached mail follows:
Yes!! This was the solution... With str_replace you can use an array as the search argument. Like this
$arrReplace = array ("\n","\r"); $temp = str_replace($arrReplace,"",$temp); $temp = addcslashes($temp,"'"); // just to make sure that the string will work as my JS string
thanks for the help :-)
jens
-----Oprindelig meddelelse-----
Fra: Lawrence.Sheed
dfait-maeci.gc.ca
[mailto:Lawrence.Sheed
dfait-maeci.gc.ca]
Sendt: 21. august 2001 09:31
Til: Jens Schødt; tyler
captainjack.com
Cc: php-general
lists.php.net
Emne: RE: [PHP] converting str with \n to one line str??
just a thought - \r\n?
try stripping out \r's as well. windows does \r\n (carriage return, line feed) for text, unix only \n's
-----Original Message-----
From: Jens Schodt [mailto:js
e-sense.dk]
Sent: August 21, 2001 3:20 PM
To: 'Tyler Longren'
Cc: 'php-general
lists.php.net'
Subject: SV: [PHP] converting str with \n to one line str??
$temp = str_replace("\n","test",$temp) is doing the same thing. It is still a string in several lines if you look in the source :-(
jens
-----Oprindelig meddelelse-----
Fra: Tyler Longren [mailto:tyler
captainjack.com]
Sendt: 20. august 2001 20:20
Til: Jens
Cc: php-general
lists.php.net
Emne: Re: [PHP] converting str with \n to one line str??
You could use str_replace().
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Mon, 20 Aug 2001 20:15:54 +0200 "Jens" <nice
email.dk> wrote:
> When I use Javascript with PHP i run into one problem. When I get the > data i > need from the database it often has a lot of <br> and \n (new lines) in > it. > The <br> are no problem when converting a string to a Javascript string, > but > the \n are. The string has to be all in one line. > > example: > <? $temp = "here > I > am"; ?> > > <script>var temp = <? echo $temp?> </script> > > This is not working!! But this would : > > <? $temp = "here I am"; ?> > > <script>var temp = '<? echo $temp?>'; </script> > > Can you help me please? > > thanks Jens > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Allmost, but you have to look for the \r ass well! With str_replace you can use an array as the search argument. Like this
$arrReplace = array ("\n","\r"); $temp = str_replace($arrReplace,"",$temp); $temp = addcslashes($temp,"'"); // just to make sure that the string will work as my JS string
thanks for the help :-)
jens
-----Oprindelig meddelelse-----
Fra: David Robley [mailto:huntsman
www.nisu.flinders.edu.au]
Sendt: 21. august 2001 09:43
Til: Jens Schødt
Cc: 'php-general
lists.php.net'
Emne: Re: [PHP] converting str with \n to one line str??
On Tue, 21 Aug 2001 16:49, Jens Schodt wrote:
> $temp = str_replace("\n","test",$temp) is doing the same thing. It is
> still a string in several lines if you look in the source :-(
>
> jens
>
> -----Oprindelig meddelelse-----
> Fra: Tyler Longren [mailto:tyler
captainjack.com]
> Sendt: 20. august 2001 20:20
> Til: Jens
> Cc: php-general
lists.php.net
> Emne: Re: [PHP] converting str with \n to one line str??
>
>
> You could use str_replace().
>
> --
> Tyler Longren
> Captain Jack Communications
> tyler
captainjack.com
> www.captainjack.com
>
>
>
> On Mon, 20 Aug 2001 20:15:54 +0200
>
> "Jens" <nice
email.dk> wrote:
> > When I use Javascript with PHP i run into one problem. When I get the
> > data i
> > need from the database it often has a lot of <br> and \n (new lines)
> > in it.
> > The <br> are no problem when converting a string to a Javascript
> > string, but
> > the \n are. The string has to be all in one line.
> >
> > example:
> > <? $temp = "here
> > I
> > am"; ?>
> >
> > <script>var temp = <? echo $temp?> </script>
> >
> > This is not working!! But this would :
> >
> > <? $temp = "here I am"; ?>
> >
> > <script>var temp = '<? echo $temp?>'; </script>
> >
> > Can you help me please?
> >
> > thanks Jens
Regular expressions? There is an example for ereg_replace in the manual that does just this:
$string = ereg_replace ("\n", "", $string); /* Get rid of any newline characters in $string. */
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA"Yes, I have been reading Voltaire," Tom admitted candidly.
attached mail follows:
try "\r\n" (return and new line) Have had to use this when parsing cisco output... uses both not just newlines.
Dave
>-----Original Message-----
>From: Jens Schodt [mailto:js
e-sense.dk]
>Sent: Tuesday, August 21, 2001 3:20 AM
>To: 'Tyler Longren'
>Cc: 'php-general
lists.php.net'
>Subject: SV: [PHP] converting str with \n to one line str??
>
>
>
>$temp = str_replace("\n","test",$temp) is doing the same thing. It is still
>a string in several lines if you look in the source :-(
>
>jens
>
>-----Oprindelig meddelelse-----
>Fra: Tyler Longren [mailto:tyler
captainjack.com]
>Sendt: 20. august 2001 20:20
>Til: Jens
>Cc: php-general
lists.php.net
>Emne: Re: [PHP] converting str with \n to one line str??
>
>
>You could use str_replace().
>
>--
>Tyler Longren
>Captain Jack Communications
>tyler
captainjack.com
>www.captainjack.com
>
>
>
>On Mon, 20 Aug 2001 20:15:54 +0200
>"Jens" <nice
email.dk> wrote:
>
>> When I use Javascript with PHP i run into one problem. When I get the
>> data i
>> need from the database it often has a lot of <br> and \n (new lines) in
>> it.
>> The <br> are no problem when converting a string to a Javascript string,
>> but
>> the \n are. The string has to be all in one line.
>>
>> example:
>> <? $temp = "here
>> I
>> am"; ?>
>>
>> <script>var temp = <? echo $temp?> </script>
>>
>> This is not working!! But this would :
>>
>> <? $temp = "here I am"; ?>
>>
>> <script>var temp = '<? echo $temp?>'; </script>
>>
>> Can you help me please?
>>
>> thanks Jens
>>
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>> For additional commands, e-mail: php-general-help
lists.php.net
>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
I usualy work on chr() I whould have done for the \n: $temp = str_replace(chr(10),"test",$temp) and for the \r\n $temp = str_replace( chr(13).chr(10) ,"test",$temp)
but my experience tells me it's \n\r not \r\n I use the $temp = str_replace( chr(10).chr(13) ,"test",$temp)
have a nice day eichert
> -----Original Message-----
> From: Dave [mailto:dave
hawk-systems.com]
> Sent: Dienstag, 21. August 2001 14:40
> To: Jens Schodt; 'Tyler Longren'
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] converting str with \n to one line str??
>
>
> try "\r\n" (return and new line) Have had to use this when parsing cisco
> output... uses both not just newlines.
>
> Dave
> >-----Original Message-----
> >From: Jens Schodt [mailto:js
e-sense.dk]
> >Sent: Tuesday, August 21, 2001 3:20 AM
> >To: 'Tyler Longren'
> >Cc: 'php-general
lists.php.net'
> >Subject: SV: [PHP] converting str with \n to one line str??
> >
> >
> >
> >$temp = str_replace("\n","test",$temp) is doing the same thing.
> It is still
> >a string in several lines if you look in the source :-(
> >
> >jens
> >
> >-----Oprindelig meddelelse-----
> >Fra: Tyler Longren [mailto:tyler
captainjack.com]
> >Sendt: 20. august 2001 20:20
> >Til: Jens
> >Cc: php-general
lists.php.net
> >Emne: Re: [PHP] converting str with \n to one line str??
> >
> >
> >You could use str_replace().
> >
> >--
> >Tyler Longren
> >Captain Jack Communications
> >tyler
captainjack.com
> >www.captainjack.com
> >
> >
> >
> >On Mon, 20 Aug 2001 20:15:54 +0200
> >"Jens" <nice
email.dk> wrote:
> >
> >> When I use Javascript with PHP i run into one problem. When I get the
> >> data i
> >> need from the database it often has a lot of <br> and \n (new lines) in
> >> it.
> >> The <br> are no problem when converting a string to a
> Javascript string,
> >> but
> >> the \n are. The string has to be all in one line.
> >>
> >> example:
> >> <? $temp = "here
> >> I
> >> am"; ?>
> >>
> >> <script>var temp = <? echo $temp?> </script>
> >>
> >> This is not working!! But this would :
> >>
> >> <? $temp = "here I am"; ?>
> >>
> >> <script>var temp = '<? echo $temp?>'; </script>
> >>
> >> Can you help me please?
> >>
> >> thanks Jens
> >>
> >>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >> For additional commands, e-mail: php-general-help
lists.php.net
> >> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >For additional commands, e-mail: php-general-help
lists.php.net
> >To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Jochen Kaechelin wrote:
> is there a source for further information > connecting to databases with ADODB for PHP4? > > I only know http://php.weblogs.com/ADODB > > --
I thing this is the only one, but you can try asking on php.weblog.com Jarek
attached mail follows:
On Mon, Aug 20, 2001 at 03:42:34PM -0400, Gerard Samuel wrote: > $file = basename ($path); > $file = $file.php3; >
You might want to consider using,
$file = basename ($path); $file = "$file.php3"; // <-- !
instead, if you don't like warnings.
$file = $file.php3
isn't the way to do it! You _could_ use
$file = $file.".php3";
though.
-- * R&zE:-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Oh yes, I dont like warnings. Thanks for pointing that out
Renze Munnik wrote: > On Mon, Aug 20, 2001 at 03:42:34PM -0400, Gerard Samuel wrote: > >>$file = basename ($path); >>$file = $file.php3; >> >> > > You might want to consider using, > > $file = basename ($path); > $file = "$file.php3"; // <-- ! > > instead, if you don't like warnings. > > $file = $file.php3 > > isn't the way to do it! You _could_ use > > $file = $file.".php3"; > > though. > >
attached mail follows:
Thanks. If you're running Linux then have you tried it yet? I'm really keen for some folks to try and break it, and either find that they can't (which looks promising at the moment), and so start getting the benefit, or expose any remaining show-stoppers so that they can get resolved asap.
There are no fancy graphics, and a simple goal -
* If you install it * Your scripts run quicker
That's it!
I'll be updating the http://212.67.208.211 site over the next few days, give it a domain name, and most importantly be updating the accelerator to hopefully yield further performance gains.
>From: Maxim Maletsky <maxim
japaninc.com>
>To: 'PHP Accelerator' <php_accelerator
hotmail.com>, danno
wpi.edu
>CC: php-general
lists.php.net
>Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
>Date: Tue, 21 Aug 2001 13:49:42 +0900
>
>Great work, Nick.
>keep it this way!
>
>Maxim Maletsky
>
>
>-----Original Message-----
>From: PHP Accelerator [mailto:php_accelerator
hotmail.com]
>Sent: Tuesday, August 21, 2001 12:00 PM
>To: danno
wpi.edu
>Cc: php-general
lists.php.net
>Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
>
>
>Right, and neither is the accelerator at the moment, and it may very well
>never be, although there's no particular reason for that. But the scripting
>engine is as it's part of PHP, and that's what I explored in order to write
>the accelerator.
>
>And now that I've studied the engine pretty intensely I've a good idea for
>some of the optimisations that their optimiser is probably having a go at.
>It's been a few fun, late nigh, and at times intensely frustrating,
>evenings, but I'm happy with even the sub-optimal current performance
>gains.
>
>
> >From: Daniel Adams <danno
wpi.edu>
> >To: PHP Accelerator <php_accelerator
hotmail.com>
> >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
> >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT)
> >
> >Cool. :-) the zend optimizer is not open-source, right?
> > - Dan
> >
> >On Tue, 21 Aug 2001, PHP Accelerator wrote:
> >
> > > Hi. Yes, it caches the result of compiling scripts and loads the
> >compiled
> > > code on subsequent runs, thus bypassing the parsing of source code
> >entirely
> > > - unless the source code has changed and the compiled code is stale.
> > >
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
Thanks, Nick. Well, I am running FreeBSD machine, but can start up my old Linux box to play with your accelerator. I'll let you know when I do that, I am kind of curious to compare it with Zend's Cache.
Cheers, Maxim Maletsky
-----Original Message-----
From: PHP Accelerator [mailto:php_accelerator
hotmail.com]
Sent: Tuesday, August 21, 2001 4:53 PM
To: Maxim Maletsky; danno
wpi.edu
Cc: php-general
lists.php.net
Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
Thanks. If you're running Linux then have you tried it yet? I'm really keen
for some folks to try and break it, and either find that they can't (which looks promising at the moment), and so start getting the benefit, or expose any remaining show-stoppers so that they can get resolved asap.
There are no fancy graphics, and a simple goal -
* If you install it * Your scripts run quicker
That's it!
I'll be updating the http://212.67.208.211 site over the next few days, give
it a domain name, and most importantly be updating the accelerator to hopefully yield further performance gains.
>From: Maxim Maletsky <maxim
japaninc.com>
>To: 'PHP Accelerator' <php_accelerator
hotmail.com>, danno
wpi.edu
>CC: php-general
lists.php.net
>Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
>Date: Tue, 21 Aug 2001 13:49:42 +0900
>
>Great work, Nick.
>keep it this way!
>
>Maxim Maletsky
>
>
>-----Original Message-----
>From: PHP Accelerator [mailto:php_accelerator
hotmail.com]
>Sent: Tuesday, August 21, 2001 12:00 PM
>To: danno
wpi.edu
>Cc: php-general
lists.php.net
>Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
>
>
>Right, and neither is the accelerator at the moment, and it may very well
>never be, although there's no particular reason for that. But the scripting
>engine is as it's part of PHP, and that's what I explored in order to write
>the accelerator.
>
>And now that I've studied the engine pretty intensely I've a good idea for
>some of the optimisations that their optimiser is probably having a go at.
>It's been a few fun, late nigh, and at times intensely frustrating,
>evenings, but I'm happy with even the sub-optimal current performance
>gains.
>
>
> >From: Daniel Adams <danno
wpi.edu>
> >To: PHP Accelerator <php_accelerator
hotmail.com>
> >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
> >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT)
> >
> >Cool. :-) the zend optimizer is not open-source, right?
> > - Dan
> >
> >On Tue, 21 Aug 2001, PHP Accelerator wrote:
> >
> > > Hi. Yes, it caches the result of compiling scripts and loads the
> >compiled
> > > code on subsequent runs, thus bypassing the parsing of source code
> >entirely
> > > - unless the source code has changed and the compiled code is stale.
> > >
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
Actually it would be interesting to get a FreeBSD port. When I've made the immediate batch of changes that I have in mind, and if things are still looking good, then volunteers to contribute builds would be welcome.
Right now, even though the accelerator provides a decent speed up, the Zend Cache is going to be faster - there's really no way that it couldn't be :-) But the accelerator should get faster too, and with the core code seemingly working, the first set of changes will be to simply do some things more sensibly. After that there are a number of things that I can imagine doing to really minimise the processing required in loading a given script, but I have other things I want to work on too. I also have ideas for a project that might slash execution time more than any other extensions currently available, but again for now this will remain a 'would like to start' project.
Cheers Nick
>From: Maxim Maletsky <maxim
japaninc.com>
>To: 'PHP Accelerator' <php_accelerator
hotmail.com>, danno
wpi.edu
>CC: php-general
lists.php.net
>Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
>Date: Tue, 21 Aug 2001 18:45:13 +0900
>
>Thanks, Nick.
>Well, I am running FreeBSD machine, but can start up my old Linux box to
>play with your accelerator.
>I'll let you know when I do that,
>I am kind of curious to compare it with Zend's Cache.
>
>Cheers,
>Maxim Maletsky
>
>
>-----Original Message-----
>From: PHP Accelerator [mailto:php_accelerator
hotmail.com]
>Sent: Tuesday, August 21, 2001 4:53 PM
>To: Maxim Maletsky; danno
wpi.edu
>Cc: php-general
lists.php.net
>Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
>
>
>Thanks. If you're running Linux then have you tried it yet? I'm really
>keen
>
>for some folks to try and break it, and either find that they can't (which
>looks promising at the moment), and so start getting the benefit, or expose
>any remaining show-stoppers so that they can get resolved asap.
>
>There are no fancy graphics, and a simple goal -
>
> * If you install it
> * Your scripts run quicker
>
>That's it!
>
>I'll be updating the http://212.67.208.211 site over the next few days,
>give
>
>it a domain name, and most importantly be updating the accelerator to
>hopefully yield further performance gains.
>
> >From: Maxim Maletsky <maxim
japaninc.com>
> >To: 'PHP Accelerator' <php_accelerator
hotmail.com>, danno
wpi.edu
> >CC: php-general
lists.php.net
> >Subject: RE: [PHP] Free PHP runtime Accelerator for Linux available
> >Date: Tue, 21 Aug 2001 13:49:42 +0900
> >
> >Great work, Nick.
> >keep it this way!
> >
> >Maxim Maletsky
> >
> >
> >-----Original Message-----
> >From: PHP Accelerator [mailto:php_accelerator
hotmail.com]
> >Sent: Tuesday, August 21, 2001 12:00 PM
> >To: danno
wpi.edu
> >Cc: php-general
lists.php.net
> >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
> >
> >
> >Right, and neither is the accelerator at the moment, and it may very well
> >never be, although there's no particular reason for that. But the
>scripting
> >engine is as it's part of PHP, and that's what I explored in order to
>write
> >the accelerator.
> >
> >And now that I've studied the engine pretty intensely I've a good idea
>for
> >some of the optimisations that their optimiser is probably having a go
>at.
> >It's been a few fun, late nigh, and at times intensely frustrating,
> >evenings, but I'm happy with even the sub-optimal current performance
> >gains.
> >
> >
> > >From: Daniel Adams <danno
wpi.edu>
> > >To: PHP Accelerator <php_accelerator
hotmail.com>
> > >Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
> > >Date: Mon, 20 Aug 2001 22:34:12 -0400 (EDT)
> > >
> > >Cool. :-) the zend optimizer is not open-source, right?
> > > - Dan
> > >
> > >On Tue, 21 Aug 2001, PHP Accelerator wrote:
> > >
> > > > Hi. Yes, it caches the result of compiling scripts and loads the
> > >compiled
> > > > code on subsequent runs, thus bypassing the parsing of source code
> > >entirely
> > > > - unless the source code has changed and the compiled code is stale.
> > > >
> >
> >
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at
>http://explorer.msn.com/intl.asp
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> >For additional commands, e-mail: php-general-help
lists.php.net
> >To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
Hello Nick,
First off, thanks for your contribution. We've not tested it as of yet, but it's always good to see more people getting involved at some level. :)
Second, have you compared the mechanism(s) you use against APC or bware? Have you considered perhaps helping with one of those projects instead of starting from scratch? It sounds like this was primarily an intellectual exercise for you to begin with, so I can understand the DIY mindset. However, if you've got many ideas for improving things further (PHP code optimization, reduced CPU time, etc) perhaps helping out with a more established project would benefit everyone more in the long run.
Just some thoughts. :)
Thanks again
Michael Kimsal http://www.tapinternet.com/php/ PHP Training Courses 734-480-9961
attached mail follows:
Hi Michael,
Thanks a lot for your email! I must confess to, for once, not checking the web first and looking other products. I hadn't come across any others and was just aware of the Zend offering, hence putting together the accelerator. Now things are suddenly more interesting :-)
I would be suprised if the accelerator didn't come bottom of the performance tables at the moment compared to the others to be honest. Seeing as I hadn't looked at a line of php-4.0.6/Zend code before last Monday, the first milestone was merely to get something that worked at all :-) 6 days later I reached the first version that ironed out all showstoppers that I'm aware of. Intellectual exercise? Of course, what else, but the reason was that I needed a cache. Had I looked at the others then... well I'd have probably still started anyway having seen Zend outstripping the others <g>
Looking at the performance stats from John Lim back in January, it seems likely that all non-Zend caches are missing a fundamental trick or two. What do you think? For example, and this may be poor one because apc,bw,bez might all be doing this in one way or another, but when restoring a compiled file it can be that only a fraction of the functions/methods, and even entire classes are ever used. Loading the never used functions and classes and restoring unused static vars initialisers would quite literally be a waste of time.
Another thing that comes to mind is that you probably want to ensure that the usual cleaning up of memory that Zend does actually *doesn't* happen quite as completely as it does by default. I actually ask myself - do I want to restore compiled code from shared memory? Do I event want to restore compiled code from web server memory? And the answer is ideally no to both. And of course I don't want to restore from files. Bottom line, I actually don't want to *restore anything* if it requires any memory copying. Ideally I'd like the same hashtables, same function pointers, same static_variables, etc. etc. that were used last time a page was loaded. Not *copies of* these things.
My ultimate goal, if I were making this a full time project, would be to 'get' all the state I needed by a single lookup for the value of compiler/executor_globals using the i-number for the root source file in a devno specific structure. No copying of anything. Of course this might be unrealistic, but I'd want to know why, and focus not just how can I speed things up, but how can I eliminate what is slowing me down!
Another part of the engine that seems 'fair game' is the executor. One might perhaps reduce the size of CG(class_table) and CG(function_table) for example by switching between tables that contain just the likely or reachable items from certain points in the code. It's also possible to hijack what would normally be fatal errors, regard them as faults rather like a page fault, patch up what caused the error on the fly, such as a function lookup failure, and carry on as though nothing happened. Again, perhaps other cache developers are getting mileage from this, or perhaps there is no mileage in this, or perhaps there is and they are not?
And then there's a zend_op->C->nativecode.so optimiser that produces .so files of your scripts when there's nothing else better to be getting on with :-)
Nick
>From: Michael Kimsal <michael
tapinternet.com>
>To: PHP Accelerator <php_accelerator
hotmail.com>
>CC: php-general
lists.php.net
>Subject: Re: [PHP] Free PHP runtime Accelerator for Linux available
>Date: Tue, 21 Aug 2001 09:27:53 -0400
>
>
>Hello Nick,
>
>First off, thanks for your contribution. We've not tested it as of yet,
>but it's
>always good to see more people getting involved at some level. :)
>
>Second, have you compared the mechanism(s) you use against APC or bware?
>Have you considered perhaps helping with one of those projects instead of
>starting from scratch? It sounds like this was primarily an
>intellectual exercise for you
>to begin with, so I can understand the DIY mindset. However, if you've
>got many ideas
>for improving things further (PHP code optimization, reduced CPU time,
>etc) perhaps
>helping out with a more established project would benefit everyone more
>in the long run.
>
>Just some thoughts. :)
>
>Thanks again
>
>
>Michael Kimsal
>http://www.tapinternet.com/php/
>PHP Training Courses
>734-480-9961
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
Well, I hope nobody will ever have to do what I just did, so here you go. I got them from the apache/conf/mime.types
Have fun!
$extensions = Array( "ez" => "application/andrew-inset", "hqx" => "application/mac-binhex40", "cpt" => "application/mac-compactpro", "doc" => "application/msword", "bin" => "application/octet-stream", "dms" => "application/octet-stream", "lha" => "application/octet-stream", "lzh" => "application/octet-stream", "exe" => "application/octet-stream", "class" => "application/octet-stream", "oda" => "application/oda", "pdf" => "application/pdf", "ai" => "application/postscript", "eps" => "application/postscript", "ps" => "application/postscript", "smi" => "application/smil", "smil" => "application/smil", "mif" => "application/vnd.mif", "xls" => "application/vnd.ms-excel", "ppt" => "application/vnd.ms-powerpoint", "wbxml" => "application/vnd.wap.wbxml", "wmlc" => "application/vnd.wap.wmlc", "wmlsc" => "application/vnd.wap.wmlscriptc", "bcpio" => "application/x-bcpio", "vcd" => "application/x-cdlink", "pgn" => "application/x-chess-pgn", "cpio" => "application/x-cpio", "csh" => "application/x-csh", "dcr" => "application/x-director", "dir" => "application/x-director", "dxr" => "application/x-director", "dvi" => "application/x-dvi", "spl" => "application/x-futuresplash", "gtar" => "application/x-gtar", "hdf" => "application/x-hdf", "js" => "application/x-javascript", "skp" => "application/x-koan", "skd" => "application/x-koan", "skt" => "application/x-koan", "skm" => "application/x-koan", "latex" => "application/x-latex", "nc" => "application/x-netcdf", "cdf" => "application/x-netcdf", "sh" => "application/x-sh", "shar" => "application/x-shar", "swf" => "application/x-shockwave-flash", "sit" => "application/x-stuffit", "sv4cpio" => "application/x-sv4cpio", "sv4crc" => "application/x-sv4crc", "tar" => "application/x-tar", "tcl" => "application/x-tcl", "tex" => "application/x-tex", "texinfo" => "application/x-texinfo", "texi" => "application/x-texinfo", "t" => "application/x-troff", "tr" => "application/x-troff", "roff" => "application/x-troff", "man" => "application/x-troff-man", "me" => "application/x-troff-me", "ms" => "application/x-troff-ms", "ustar" => "application/x-ustar", "src" => "application/x-wais-source", "zip" => "application/zip", "au" => "audio/basic", "snd" => "audio/basic", "mid" => "audio/midi", "midi" => "audio/midi", "kar" => "audio/midi", "mpga" => "audio/mpeg", "mp2" => "audio/mpeg", "mp3" => "audio/mpeg", "aif" => "audio/x-aiff", "aiff" => "audio/x-aiff", "aifc" => "audio/x-aiff", "ram" => "audio/x-pn-realaudio", "rm" => "audio/x-pn-realaudio", "rpm" => "audio/x-pn-realaudio-plugin", "ra" => "audio/x-realaudio", "wav" => "audio/x-wav", "pdb" => "chemical/x-pdb", "xyz" => "chemical/x-xyz", "bmp" => "image/bmp", "gif" => "image/gif", "ief" => "image/ief", "jpeg" => "image/jpeg", "jpg" => "image/jpeg", "jpe" => "image/jpeg", "png" => "image/png", "tiff" => "image/tiff", "tif" => "image/tiff", "wbmp" => "image/vnd.wap.wbmp", "ras" => "image/x-cmu-raster", "pnm" => "image/x-portable-anymap", "pbm" => "image/x-portable-bitmap", "pgm" => "image/x-portable-graymap", "ppm" => "image/x-portable-pixmap", "rgb" => "image/x-rgb", "xbm" => "image/x-xbitmap", "xpm" => "image/x-xpixmap", "xwd" => "image/x-xwindowdump", "igs" => "model/iges", "iges" => "model/iges", "msh" => "model/mesh", "mesh" => "model/mesh", "silo" => "model/mesh", "wrl" => "model/vrml", "vrml" => "model/vrml", "css" => "text/css", "htm" => "text/html", "html" => "text/html", "asc" => "text/plain", "txt" => "text/plain", "rtx" => "text/richtext", "rtf" => "text/rtf", "sgml" => "text/sgml", "sgm" => "text/sgml", "tsv" => "text/tab-separated-values", "wml" => "text/vnd.wap.wml", "wmls" => "text/vnd.wap.wmlscript", "etx" => "text/x-setext", "xml" => "text/xml", "mpg" => "video/mpeg", "mpeg" => "video/mpeg", "mpe" => "video/mpeg", "qt" => "video/quicktime", "mov" => "video/quicktime", "avi" => "video/x-msvideo", "movie" => "video/x-sgi-movie", "ice" => "x-conference/x-cooltalk" );
attached mail follows:
On Tue, 21 Aug 2001 18:01, Evan Nemerson wrote: > Well, I hope nobody will ever have to do what I just did, so here you go. I > got them from the apache/conf/mime.types > > Have fun! > > > > $extensions = Array( "ez" => "application/andrew-inset", <snip>
What are you using them for Evan?
Brad
attached mail follows:
Yes, and it works fine. It basically replaces the parser/compiler with a cache lookup when it determines that it can, and so the real scope for error is if it doesn't correctly restore the original post compilation/pre execution state from when the compiler was run. But at the moment it seems to, at least enough so that things work.
As an aside, and about dynanmic content - I also have client side code for transparent PHP database query caching, and display (e.g. HTML) rendering code that actually rewrites itself as more optimal code to a cache on the fly, all as an aid to get speed improvements. I wanted classes that implemented renderers, e.g. a label object, a block of html with a title, a border object that can put a border around other renderers. This makes page development much less an HTML writing job, and more a programming and component based job. This was great, but the cost of such dynamic generation was a performance hit, when in reality, most of what was now dynamically dynamically rendered HTML was really static, most, if not all the time. So I have a client side optimiser that can traverse a hierarchy of renderers, ask them whether they render statically, dynamically based on the state of data elements, or always dynamically. It then emits simpler code for the purely static elements, and either dynamic code or simpler code for the dynamic elements if their dependent data items are in a known state. PHP makes it really feasible to do this kind of stuff.
So the dynamic display rendering works well, but it became clear that was really slowing things down was the fact that there was simply a lot of code to now parse and process, even with with conditional inclusion wherever it made logical sense. Hence the accelerator.
Nick
>From: "Christopher CM Allen" <callen
nocpop.net>
>Reply-To: "Christopher CM Allen" <callen
nocpop.net>
>To: <php_accelerator
hotmail.com>
>Date: Tue, 21 Aug 2001 01:27:28 -0500
>
>Sounds great nick<> Did you sites run with dynamic content? IE database
>querys, if so what did you find for results?
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
attached mail follows:
I can't describe it very well in english, but I try it once again:
1. You cant combine Flash and MySQL.
2. Therefore you must add an interface.
3. You can fabricate this interface using a PHP-File, which reads out the Database and send this data to Flash.
3.1. Use a normal php-code to read out the content.
3.2. echo() an output with the variables and their values.
3.3. do that in this format: "&variablename=variablevalue&var2=val2&"
4. Open a flash keyframe and add the following Action-Script:
Actions > Click on "Load Movie" Change the option from (I use a german-flash version, so I don't know the correct names) "Load Movie from" to "Load Variables from" (the first to the third point)
4.2 type in the URL-Field the filename of the interface-file.
4.3. May be you should change the "Ebene" frm "1" to "0".
4.4. If you want to tell the interface-file, that it should load a specific data, add to the URL field the following string: ?varoption=dothat&blabla=wuff
4.5. If this must be a dynamic variable, you must change the "abc" to "=" and the field must be changed again:
"interface.php?do="&dynamicvariable
5. to read the retrieved variables via flash, just handle them like
_level0:variablename
I hope that was a little bit clearer. If you have anyhow any problems, feel free to ask me again ;)
MöfG, Tribun (Patrick Lehnen)
--- www.mp3o.net----- Original Message ----- From: "Jack" <jacky
activelifestyle.com> To: "Tribun" <mail
tribun.de> Sent: Tuesday, August 21, 2001 4:46 PM Subject: ref: flash and php
> Dear Tribun > I tried to understand what you explained but realised I may need more > information about this. Is there anyway I can go to look up for more info > about what you explained? > Jack > jacky
activelifestyle.com > "Love your enemies, it will drive them nuts" > ----- Original Message ----- > From: "Tribun" <mail
tribun.de> > To: "Jack" <jacky
activelifestyle.com> > Sent: Monday, August 20, 2001 7:43 AM > Subject: Re: flash and php > > > > Simply user the GetVariable function in Flash. > > > > The targeting file must be a PHP-File. > > > > This File should reads out the Informations you want. > > > > If the requests are also variable, call the file through > > GET and add "?query=date" to the filename. > > > > The file must echo this... > > &variable=something&cat=dog& > > > > Hope you understand my short introduction.. > > > > MöfG, > > Tribun (Patrick Lehnen) > > --- > > www.mp3o.net > > > > > > "Jack" <jacky
activelifestyle.com> schrieb im Newsbeitrag > > news:017701c129a4$6dff2e60$0e00a8c0
activelifestyle.com... > > I know this issue has been talk a lot already, but can anyone guide me > where > > can I find information about how to build a dynamic content flash file > > driven by database? > > Jack > > jacky
activelifestyle.com > > "Love your enemies, it will drive them nuts" > > > > > > > > > > > >
attached mail follows:
Isn't it true that Flash can work directly with a JDBC driver? or am I smoking crack?
> -----Original Message-----
> From: Tribun [mailto:mail
tribun.de]
> Sent: Tuesday, August 21, 2001 2:55 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: flash and php
>
>
> I can't describe it very well in english, but I try it once again:
>
> 1. You cant combine Flash and MySQL.
>
> 2. Therefore you must add an interface.
>
> 3. You can fabricate this interface using a PHP-File, which reads out the
> Database and
> send this data to Flash.
>
> 3.1. Use a normal php-code to read out the content.
>
> 3.2. echo() an output with the variables and their values.
>
> 3.3. do that in this format: "&variablename=variablevalue&var2=val2&"
>
> 4. Open a flash keyframe and add the following Action-Script:
>
> Actions >
> Click on "Load Movie"
> Change the option from (I use a german-flash version, so I don't know the
> correct names)
> "Load Movie from" to "Load Variables from"
> (the first to the third point)
>
> 4.2 type in the URL-Field the filename of the interface-file.
>
> 4.3. May be you should change the "Ebene" frm "1" to "0".
>
> 4.4. If you want to tell the interface-file, that it should load a specific
> data, add to the URL
> field the following string:
> ?varoption=dothat&blabla=wuff
>
> 4.5. If this must be a dynamic variable, you must change the "abc" to "="
> and the field must be changed again:
>
> "interface.php?do="&dynamicvariable
>
> 5. to read the retrieved variables via flash, just handle them like
>
> _level0:variablename
>
>
> I hope that was a little bit clearer. If you have anyhow any problems, feel
> free to ask me again ;)
>
> MöfG,
> Tribun (Patrick Lehnen)
> ---
> www.mp3o.net
>
>
> ----- Original Message -----
> From: "Jack" <jacky
activelifestyle.com>
> To: "Tribun" <mail
tribun.de>
> Sent: Tuesday, August 21, 2001 4:46 PM
> Subject: ref: flash and php
>
>
> > Dear Tribun
> > I tried to understand what you explained but realised I may need more
> > information about this. Is there anyway I can go to look up for more info
> > about what you explained?
> > Jack
> > jacky
activelifestyle.com
> > "Love your enemies, it will drive them nuts"
> > ----- Original Message -----
> > From: "Tribun" <mail
tribun.de>
> > To: "Jack" <jacky
activelifestyle.com>
> > Sent: Monday, August 20, 2001 7:43 AM
> > Subject: Re: flash and php
> >
> >
> > > Simply user the GetVariable function in Flash.
> > >
> > > The targeting file must be a PHP-File.
> > >
> > > This File should reads out the Informations you want.
> > >
> > > If the requests are also variable, call the file through
> > > GET and add "?query=date" to the filename.
> > >
> > > The file must echo this...
> > > &variable=something&cat=dog&
> > >
> > > Hope you understand my short introduction..
> > >
> > > MöfG,
> > > Tribun (Patrick Lehnen)
> > > ---
> > > www.mp3o.net
> > >
> > >
> > > "Jack" <jacky
activelifestyle.com> schrieb im Newsbeitrag
> > > news:017701c129a4$6dff2e60$0e00a8c0
activelifestyle.com...
> > > I know this issue has been talk a lot already, but can anyone guide me
> > where
> > > can I find information about how to build a dynamic content flash file
> > > driven by database?
> > > Jack
> > > jacky
activelifestyle.com
> > > "Love your enemies, it will drive them nuts"
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Dear all I had a page which let user to input a long description into it! and had wrote a script which will "fputs" the user input content to content.txt! When i open the content.txt, it is shown below:
This is a test! and this is not a joke!
which is fine , because it display as how the user type into the input text box. I got another php page which i use "fileread" to grap the content from content.txt to display it to the browser!! The problem comes, which it read all the content from content.txt as one line!! It show like below:
This is a test!and this is not a joke!
I want the browser could display exactly the same as the user input! even the lines and format!
Could anyone pls help me with this?
Thx
Jack
jack
nedcor.com
attached mail follows:
Hello, I have a query but it not creating integer result: $saleprice=$amyrow["saleprice"]+$saleprice; $squarefeet=$amyrow["squarefeet"]+$squarefeet; $dom=$amyrow["dom"]+$dom; result: Total listings: 18 -- Average Price: $339166.66666667 Average Square Foot: 1596.6111111111 Average DOM: 52.555555555556 Average Price Per Square Feet: 212.42910330909 But I need Integer numbers like 339166 , 1596 ....
Thanks :) Andras
attached mail follows:
On Tue, Aug 21, 2001 at 02:08:06AM -0700, Andras Kende wrote: > Hello, > > I have a query but it not creating integer result: > > $saleprice=$amyrow["saleprice"]+$saleprice; > $squarefeet=$amyrow["squarefeet"]+$squarefeet; > $dom=$amyrow["dom"]+$dom; > result: > Total listings: 18 -- Average Price: $339166.66666667 > Average Square Foot: 1596.6111111111 > Average DOM: 52.555555555556 > Average Price Per Square Feet: 212.42910330909 > > But I need Integer numbers like 339166 , 1596 .... > > Thanks :) > > Andras
Try: round()
Eg.: $myInt = (integer)round($nonInteger);
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Do you mean make an html copy? If so this is a simplified copy of what I use as the start of building a search engine database for my web site, I think it'll only work on the local database and in this case needs to be in the document root directory to work...
Tim
function GetPage($file, $root, $db) { $flines = file("http://localhost/$root$file"); $filetext = ""; $inscript = false; foreach ($flines as $line) $filetext = $filetext . " " . trim($line); // now do what you want with the html, save it to db or as file in html version of site ... ... } // end of fn GetPage
function spider($root, $db) { $dhandle = opendir($root); while ($ddFile = readdir($dhandle)) { if ($ddFile != "." && $ddFile != "..") { if (is_dir("$root/$ddFile")) { spider("$root$ddFile/", $db); } else { if (substr($ddFile, -5) === ".html" || substr($ddFile, -4) === ".php") GetPage($ddFile, $root, $db); } } } closedir($dhandle); } // end of fn spider
function SearchBuild($thissite = "") { $db = new DbConnect(); spider("$thissite", $thissite, $db); $db->Close(); } // end of fn SearchBuild
----------
From: Josh [SMTP:jawa
networld.com]
Sent: 20 August 2001 18:27
To: php-general
lists.php.net
Subject: How to download an entire dynamic website?
Does anyone know some good programs (or other ways) to download an entire dynamic website?
Thanks
attached mail follows:
Hi Jack,
... look at the generated html-code, you will read:
This is a test! and this is not a joke!
But since html doesn't display \r\n you have to use the php-function nl2br.
Greetinx, Mike
Michael Rudel - Web-Development, Systemadministration -
Besuchen Sie uns am 20. und 21. August 2001 auf der online-marketing-düsseldorf in Halle 1 Stand E 16 _______________________________________________________________
Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:mru
suchtreffer.de
internet: http://www.suchtreffer.de
_______________________________________________________________
> -----Original Message-----
> From: Jack [mailto:jack
nedcor.com]
> Sent: Tuesday, August 21, 2001 10:58 AM
> To: php-general
lists.php.net; php-windows
lists.php.net
> Subject: [PHP-WIN] Mutiline read as Sigle Line!
>
>
> Dear all
> I had a page which let user to input a long description into
> it! and had
> wrote a script which will "fputs" the user input content to
> content.txt!
> When i open the content.txt, it is shown below:
>
> This is a test!
> and this is not a joke!
>
> which is fine , because it display as how the user type into
> the input text
> box.
> I got another php page which i use "fileread" to grap the content from
> content.txt to display it to the browser!! The problem comes,
> which it read
> all the content from content.txt as one line!! It show like below:
>
> This is a test!and this is not a joke!
>
> I want the browser could display exactly the same as the user
> input! even
> the lines and format!
>
> Could anyone pls help me with this?
>
> Thx
> Jack
> jack
nedcor.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe
lists.php.net
> For additional commands, e-mail: php-windows-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
attached mail follows:
The first thing is that 2-dimensional arrays don't really exist in php. Any element of any array can be another array. The second important point is that all php arrays are associative. If you don't declare the key of an element (e.g. $out[] = "fred") when creating it you get the next integer available as the key. Your initial declaration creates ...
$out[0] = $name; $out[1] = $srch; $out[2] = $sel; $out[3] = $case; $out[$qvalues][0] = $vals; $out[$qvalues][1] = $valtypes;
with $name, etc. being whatever the variables are at the time the array is initialised.
What I think you wanted (I'm not entirely sure) is more along the lines of ... for ($i=0; $I < $num_out; $I++) $out[] = array("name"=>$name, "srch"=>$srch, "sel"=>$sel, "case"=>$case, $qvalues => array($vals, $valtypes));
I'm not entirely sure what you're trying to do but I hope this points you in the right direction.
Tim
----------
From: Ken Hopkins [SMTP:hoppy
austin.rr.com]
Sent: 20 August 2001 21:02
To: php-general
lists.php.net
Subject: Multi-dimensional array issue
Hi from a recent PHP convert,
Having a heck of a time declaring and accessing 2 dimensional info in an array. any input on where to start looking for the answer would be greatly appreciated.
I want to have a base array of 5 elements. The first 4 elements are variables, and the fifth is an array of 2 elements. seemed harmless enough at the time;)
Coding conventions suggest access to the first level of elements is: $basearray[base_numerical_offset][$basearray_variable] and this works great for accessing the first 4 elements of the base array.
Accessing the fifth elements' variables in the next dimension is where it fails for me: $basearray[base_numerical_offset][$subarray][sub_numerical_offset][$subarray _variable]
The documentation/snippets/samples, etc. have been to no avail; still can't get to elements in the second dimension properly. Attempts to populate the second level array trahses the entire structure.
I have the following declaration: $out => array($name, $srch, $sel, $case, $qvalues => array($vals, $valtypes); $out is the name of the base array $qvalues is the name of the sub-array under the base array "$out" I need for each $out array to consist of a name, srch, sel, case and then a variable number of qvalues array elements that each have single vals and valtypes elements.
Use the following snippet to see what happens; it's not what I had hoped to see. I hope I'm just doing something wrong..
Thanks, Ken.
mailto:hoppy
austin.rr.com
<?
$out = array($name, $srch, $sel, $case, $qvalues => array($vals, $valtypes)); echo "<pre>"; $out[0][$name] = "free"; $out[1][$name] = "next"; for ($i=0; $i<2; $i++) { echo "<br> OutIndex: ", $i, " Name: ", $out[$i][$name]; }
$out[0][$srch] = "outfreesrch"; $out[0][$sel] = "outfreesel"; $out[0][$case] = "outfreecase"; $out[0][$qvalues][0][$vals] = "outfreeqval0"; $out[0][$qvalues][0][$valtypes] = "outfreeqtype0"; $out[0][$qvalues][1][$vals] = "outfreeqval1"; $out[0][$qvalues][1][$valtypes] = "outfreeqtype1"; echo "<br>Basearray index : ", 0, "\n"; echo "<br> name : ", $out[0][$name], "\n"; echo "<br> srch : ", $out[0][$srch], "\n"; echo "<br> sel : ", $out[0][$sel], "\n"; echo "<br> case : ", $out[0][$case], "\n"; echo "<br> Subarray index : 0 \n"; echo "<br> vals : ", $out[0][$qvalues][0][$vals], "\n"; echo "<br> valtypes : ", $out[0][$qvalues][0][$valtypes], "\n"; echo "<br> Subarray index : 1 \n"; echo "<br> vals : ", $out[0][$qvalues][1][$vals], "\n"; echo "<br> valtypes : ", $out[0][$qvalues][2][$valtypes], "\n"; echo"<br><br>"; $out[1][$srch] = "outnextsrch"; $out[1][$sel] = "outnextsel"; $out[1][$case] = "outnextcase"; $out[1][$qvalues][0][$vals] = "outnextqval0"; $out[1][$qvalues][0][$valtypes] = "outnextqtype0"; $out[1][$qvalues][1][$vals] = "outnextqval1"; $out[1][$qvalues][1][$valtypes] = "outnextqtype1"; echo "<br>Basearray index : ", 1, "\n"; echo "<br> name : ", $out[1][$name], "\n"; echo "<br> srch : ", $out[1][$srch], "\n"; echo "<br> sel : ", $out[1][$sel], "\n"; echo "<br> case : ", $out[1][$case], "\n"; echo "<br> Subarray index : 0 \n"; echo "<br> vals : ", $out[1][$qvalues][0][$vals], "\n"; echo "<br> valtypes : ", $out[1][$qvalues][0][$valtypes], "\n"; echo "<br> Subarray index : 1 \n"; echo "<br> vals : ", $out[1][$qvalues][1][$vals], "\n"; echo "<br> valtypes : ", $out[1][$qvalues][1][$valtypes], "\n"; echo "</pre>"; ?>
attached mail follows:
> ----------
> From: Ken Hopkins [SMTP:hoppy
austin.rr.com]
> Sent: 20 August 2001 21:02
> To: php-general
lists.php.net
> Subject: Multi-dimensional array issue
>
> Hi from a recent PHP convert,
>
> Having a heck of a time declaring and accessing 2 dimensional info
> in an array.
> any input on where to start looking for the answer would be greatly
> appreciated.
>
> I want to have a base array of 5 elements. The first 4 elements are
> variables, and the fifth is an array of 2 elements.
> seemed harmless enough at the time;)
>
> Coding conventions suggest access to the first level of elements is:
> $basearray[base_numerical_offset][$basearray_variable]
> and this works great for accessing the first 4 elements of the base
> array.
The first level of element will be
$basearray[$key] = $value $basearray[$key2] = $value $basearray[$key3] = $value $basearray[$key4] = $value
the extra array
$basearray[$key5][$extraarraykey1] = $value $basearray[$key5][$extraarraykey2] = $value
>
> Accessing the fifth elements' variables in the next dimension is
> where it fails for me:
>
> $basearray[base_numerical_offset][$subarray][sub_numerical_offset][$subarray
> _variable]
>
> The documentation/snippets/samples, etc. have been to no avail;
> still can't get to elements in the
> second dimension properly. Attempts to populate the second level
> array trahses the entire structure.
>
> I have the following declaration:
> $out => array($name, $srch, $sel, $case, $qvalues => array($vals,
> $valtypes);
> $out is the name of the base array
> $qvalues is the name of the sub-array under the base array
> "$out"
> I need for each $out array to consist of a name, srch, sel, case and
> then a variable number of qvalues array elements that each have single vals
> and valtypes elements.
>
> Use the following snippet to see what happens; it's not what I had
> hoped to see.
> I hope I'm just doing something wrong..
>
> Thanks, Ken.
> mailto:hoppy
austin.rr.com
>
> <?
>
> $out = array($name, $srch, $sel, $case, $qvalues => array($vals,
> $valtypes));
> echo "<pre>";
> $out[0][$name] = "free";
> $out[1][$name] = "next";
> for ($i=0; $i<2; $i++)
> {
> echo "<br> OutIndex: ", $i, " Name: ", $out[$i][$name];
> }
>
> $out[0][$srch] = "outfreesrch";
> $out[0][$sel] = "outfreesel";
> $out[0][$case] = "outfreecase";
> $out[0][$qvalues][0][$vals] = "outfreeqval0";
> $out[0][$qvalues][0][$valtypes] = "outfreeqtype0";
> $out[0][$qvalues][1][$vals] = "outfreeqval1";
> $out[0][$qvalues][1][$valtypes] = "outfreeqtype1";
> echo "<br>Basearray index : ", 0, "\n";
> echo "<br> name : ", $out[0][$name], "\n";
> echo "<br> srch : ", $out[0][$srch], "\n";
> echo "<br> sel : ", $out[0][$sel], "\n";
> echo "<br> case : ", $out[0][$case], "\n";
> echo "<br> Subarray index : 0 \n";
> echo "<br> vals : ",
> $out[0][$qvalues][0][$vals], "\n";
> echo "<br> valtypes : ",
> $out[0][$qvalues][0][$valtypes], "\n";
> echo "<br> Subarray index : 1 \n";
> echo "<br> vals : ",
> $out[0][$qvalues][1][$vals], "\n";
> echo "<br> valtypes : ",
> $out[0][$qvalues][2][$valtypes], "\n";
> echo"<br><br>";
> $out[1][$srch] = "outnextsrch";
> $out[1][$sel] = "outnextsel";
> $out[1][$case] = "outnextcase";
> $out[1][$qvalues][0][$vals] = "outnextqval0";
> $out[1][$qvalues][0][$valtypes] = "outnextqtype0";
> $out[1][$qvalues][1][$vals] = "outnextqval1";
> $out[1][$qvalues][1][$valtypes] = "outnextqtype1";
> echo "<br>Basearray index : ", 1, "\n";
> echo "<br> name : ", $out[1][$name], "\n";
> echo "<br> srch : ", $out[1][$srch], "\n";
> echo "<br> sel : ", $out[1][$sel], "\n";
> echo "<br> case : ", $out[1][$case], "\n";
> echo "<br> Subarray index : 0 \n";
> echo "<br> vals : ",
> $out[1][$qvalues][0][$vals], "\n";
> echo "<br> valtypes : ",
> $out[1][$qvalues][0][$valtypes], "\n";
> echo "<br> Subarray index : 1 \n";
> echo "<br> vals : ",
> $out[1][$qvalues][1][$vals], "\n";
> echo "<br> valtypes : ",
> $out[1][$qvalues][1][$valtypes], "\n";
> echo "</pre>";
> ?>
>
>
attached mail follows:
Ok, let me make sure I understand: I see that you included brackets after the $out ($out[] = array instead of $out = array). Does this denote that the $out is now a zero-based array? $out[0] is now an array that has $name, $srch, $sel and $case as single elements in that array. $out[1] is the next array with the same variable names, but different values. If I declare it as: $out[] = array("name"=>$name, "srch"=>$srch, "sel"=>$sel, "case"=>$case, $qvalues[] => array("vals" =>$vals, "valtypes" =>$valtypes)); can I access (for example) the $case variable in the 3rd $out array as $out[2][$case] or do I assign/access it as $out[2]["case"]?
Here is what I'd like to do: (and how would you declare this?) I want 9 arrays (keyed as 0-8) for $out. (accessed as $out[0], $out[1], etc.) each of these arrays has individual $name, $srch, $sel, $case variables that are strings. I want to assign them individual values and access them as: $out[0][$name] = "some_text"; echo $out[0][$name]; {shows the "some_text" string value of the $name variable in the "zero-eth" element of the $out array} $out[4][$case] {shows the string value of the $case variable in the "fourth" element of the $out array}
A step further now: As the fifth element in each of these 9 $out arrays I also need a sub-array that has identical properties to the $out array, but only has 2 elements in each of it's arrays. I want to access them the same way: $out[3][$qvalues[9][$vals] = "some_value"; will assign the text string "some_value" to the $vals variable inside the10th $qvalue array for the 4th $out array.
I want to end up with something like this:
$out=array [0] $name=string $srch=string $sel=string $case=string $qvalues=array [0] $vals=string $valtypes=string [1] $vals=string $valtypes=string [1] $name=string $srch=string $sel=string $case=string $qvalues=array [0] $vals=string $valtypes=string [1] $vals=string $valtypes=string {and so on for a few thousand times}
I guess one of the main issues is whether I can access (for example) the $case variable in the $out array as [$case] or ["case"]. I don't need to initialize the string variables in the declaration of the array, but do I still need to access them as (for example) the ["case"] element of the $out array or can I access them as [$case]?
Thanks for your help; I'm having to un-learn some of my C and Pascal, but not too much.....<g>
"Tim Ward" <tim.ward
stivesdirect.com> wrote in message
news:D2AC2CC91E72D511BD5600500416D3C0068C23
hunters-mail.itnetadmin.com...
> The first thing is that 2-dimensional arrays don't really exist in php.
Any
> element of any array can be another array. The second important point is
> that all php arrays are associative. If you don't declare the key of an
> element (e.g. $out[] = "fred") when creating it you get the next integer
> available as the key. Your initial declaration creates ...
>
> $out[0] = $name;
> $out[1] = $srch;
> $out[2] = $sel;
> $out[3] = $case;
> $out[$qvalues][0] = $vals;
> $out[$qvalues][1] = $valtypes;
>
> with $name, etc. being whatever the variables are at the time the array is
> initialised.
>
> What I think you wanted (I'm not entirely sure) is more along the lines of
> ..
> for ($i=0; $I < $num_out; $I++)
> $out[] = array("name"=>$name, "srch"=>$srch, "sel"=>$sel,
> "case"=>$case, $qvalues => array($vals, $valtypes));
>
> I'm not entirely sure what you're trying to do but I hope this points you
in
> the right direction.
>
> Tim
> ----------
> From: Ken Hopkins [SMTP:hoppy
austin.rr.com]
> Sent: 20 August 2001 21:02
> To: php-general
lists.php.net
> Subject: Multi-dimensional array issue
>
> Hi from a recent PHP convert,
>
> Having a heck of a time declaring and accessing 2 dimensional info
> in an array.
> any input on where to start looking for the answer would be greatly
> appreciated.
>
> I want to have a base array of 5 elements. The first 4 elements are
> variables, and the fifth is an array of 2 elements.
> seemed harmless enough at the time;)
>
> Coding conventions suggest access to the first level of elements is:
> $basearray[base_numerical_offset][$basearray_variable]
> and this works great for accessing the first 4 elements of the base
> array.
>
> Accessing the fifth elements' variables in the next dimension is
> where it fails for me:
>
>
$basearray[base_numerical_offset][$subarray][sub_numerical_offset][$subarray
> _variable]
>
> The documentation/snippets/samples, etc. have been to no avail;
> still can't get to elements in the
> second dimension properly. Attempts to populate the second level
> array trahses the entire structure.
>
> I have the following declaration:
> $out => array($name, $srch, $sel, $case, $qvalues => array($vals,
> $valtypes);
> $out is the name of the base array
> $qvalues is the name of the sub-array under the base array
> "$out"
> I need for each $out array to consist of a name, srch, sel, case and
> then a variable number of qvalues array elements that each have single
vals
> and valtypes elements.
>
> Use the following snippet to see what happens; it's not what I had
> hoped to see.
> I hope I'm just doing something wrong..
>
> Thanks, Ken.
> mailto:hoppy
austin.rr.com
>
> <?
>
> $out = array($name, $srch, $sel, $case, $qvalues => array($vals,
> $valtypes));
> echo "<pre>";
> $out[0][$name] = "free";
> $out[1][$name] = "next";
> for ($i=0; $i<2; $i++)
> {
> echo "<br> OutIndex: ", $i, " Name: ", $out[$i][$name];
> }
>
> $out[0][$srch] = "outfreesrch";
> $out[0][$sel] = "outfreesel";
> $out[0][$case] = "outfreecase";
> $out[0][$qvalues][0][$vals] = "outfreeqval0";
> $out[0][$qvalues][0][$valtypes] = "outfreeqtype0";
> $out[0][$qvalues][1][$vals] = "outfreeqval1";
> $out[0][$qvalues][1][$valtypes] = "outfreeqtype1";
> echo "<br>Basearray index : ", 0, "\n";
> echo "<br> name : ", $out[0][$name], "\n";
> echo "<br> srch : ", $out[0][$srch], "\n";
> echo "<br> sel : ", $out[0][$sel], "\n";
> echo "<br> case : ", $out[0][$case], "\n";
> echo "<br> Subarray index : 0 \n";
> echo "<br> vals : ",
> $out[0][$qvalues][0][$vals], "\n";
> echo "<br> valtypes : ",
> $out[0][$qvalues][0][$valtypes], "\n";
> echo "<br> Subarray index : 1 \n";
> echo "<br> vals : ",
> $out[0][$qvalues][1][$vals], "\n";
> echo "<br> valtypes : ",
> $out[0][$qvalues][2][$valtypes], "\n";
> echo"<br><br>";
> $out[1][$srch] = "outnextsrch";
> $out[1][$sel] = "outnextsel";
> $out[1][$case] = "outnextcase";
> $out[1][$qvalues][0][$vals] = "outnextqval0";
> $out[1][$qvalues][0][$valtypes] = "outnextqtype0";
> $out[1][$qvalues][1][$vals] = "outnextqval1";
> $out[1][$qvalues][1][$valtypes] = "outnextqtype1";
> echo "<br>Basearray index : ", 1, "\n";
> echo "<br> name : ", $out[1][$name], "\n";
> echo "<br> srch : ", $out[1][$srch], "\n";
> echo "<br> sel : ", $out[1][$sel], "\n";
> echo "<br> case : ", $out[1][$case], "\n";
> echo "<br> Subarray index : 0 \n";
> echo "<br> vals : ",
> $out[1][$qvalues][0][$vals], "\n";
> echo "<br> valtypes : ",
> $out[1][$qvalues][0][$valtypes], "\n";
> echo "<br> Subarray index : 1 \n";
> echo "<br> vals : ",
> $out[1][$qvalues][1][$vals], "\n";
> echo "<br> valtypes : ",
> $out[1][$qvalues][1][$valtypes], "\n";
> echo "</pre>";
> ?>
attached mail follows:
Could somebody tell me way this function will not work I know the script inside the function works because I have tested it but when I put it in a function all I get back when I call it is a 1
function &getpath($search) { Global $search,$path; $a = `/bin/ls -al /home/sites/ | awk {'print $9" "$10" "$11" "'} | grep $search`; $items = explode ("www.", $a); For($i = 0; $i< (count($items)/1); $i +=1){ $path=strstr(($items[$i]), '/'); return $path; } }
$path=&getpath($search);
Best regards,
Richard
mailto:rkurth
pacifier.com
attached mail follows:
G'day folks,
It's been mentioned that the module approach to installing PHP4 has some security implications (as compared to the separate interpreter and using CGIs).
My question is:
For sites which do not have user-installed files (i.e. all web- content is provided by the site-owner), what risks are there in the module approach?
Thanks for any information. Ciao.
-- -------------------------------------------------------+--------------------- Daniel Baldoni BAppSc, PGradDipCompSci | Technical Director require 'std/disclaimer.pl' | LcdS Pty. Ltd. -------------------------------------------------------+ 856B Canning Hwy Phone/FAX: +61-8-9364-8171 | Applecross Mobile: 041-888-9794 | WA 6153 URL: http://www.lcds.com.au/ | Australia -------------------------------------------------------+--------------------- "Any time there's something so ridiculous that no rational systems programmer would even consider trying it, they send for me."; paraphrased from "King Of The Murgos" by David Eddings. (I'm not good, just crazy)
attached mail follows:
Hi, we recently purchased the whole PDFlib+PDI package, however I've been having trouble installing it. Many of the different installation instructions i've found have told me contradictory things. I have tried using both the binary distribution aswell as the source. After many rounds of recompiling and testing different options I'm getting kinda beat.
Can anyone please instruct me on how to get PDFlib and PDI working on my machine. I need it urgently for a project. What configure options, what tarballs and what files to copy between source directories.
I'm using Redhat Linux 7.1
Any help is GREATLY appreciated. Sincerely Jonathan Svensson / Sweden
attached mail follows:
Antwoord naar: <dan
tudan.net>
Van: "Dan Harrington" <dan
tudan.net>
Onderwerp: RE: [PHP] Function to Build Trees
> Or you could just buy from http://www.plumbdesign.com/ > or write a PHP SDK for them. > :-)
sorry? what does that horrible coldfusion site have to do with this? Chris
-------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
attached mail follows:
hi, i am trying to install the thousands-of-lines big postnuke.com website thingie. Unfortunately it won't start and the community does not seem to recognize the problem. I get this message:
PHP caused an invalid page fault in module PHP4TS.DLL at 015f:1008e884.
(PHP4 on win98)
Anyone any idea how i can debug?
E_ALL is not giving any related info. I tracked down where the page stops loading but these lines seem to be not related to the problem.
I made it print a html text and this keeps working just unto the place where the page suddenly stops loading in a straight html bit.
By the way, quite complicated structure. Never had so many php files open at the same time to track a bug!
thanks, Chris
-------------------------------------------------------------------- -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- --------------------------------------------------------------------
attached mail follows:
Try installing PHP4 as CGI instead! It's much more stable!
"Chris Hayes" <chayes
antenna.nl> wrote in message
news:3B8254DA.32400.C3717
localhost...
> hi,
> i am trying to install the thousands-of-lines big postnuke.com website
> thingie.
> Unfortunately it won't start and the community does not seem to recognize
> the problem.
> I get this message:
>
> PHP caused an invalid page fault in
> module PHP4TS.DLL at 015f:1008e884.
>
> (PHP4 on win98)
>
> Anyone any idea how i can debug?
>
>
>
>
> E_ALL is not giving any related info.
> I tracked down where the page stops loading but these lines seem to be not
> related to the problem.
>
> I made it print a html text and this keeps working just unto the place
where
> the page suddenly stops loading in a straight html bit.
>
> By the way, quite complicated structure. Never had so many php files open
at
> the same time to track a bug!
>
>
> thanks,
> Chris
>
> --------------------------------------------------------------------
> -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands --
> --------------------------------------------------------------------
>
>
attached mail follows:
I assume your running apache, if so...take a look at the apache error.log file, there may be some hint in there as to the problems...usually/ program files/apache/logs
rm
--- Chris Hayes <chayes
antenna.nl> wrote:
> hi,
> i am trying to install the thousands-of-lines big
> postnuke.com website
> thingie.
> Unfortunately it won't start and the community does
> not seem to recognize
> the problem.
> I get this message:
>
> PHP caused an invalid page fault in
> module PHP4TS.DLL at 015f:1008e884.
>
> (PHP4 on win98)
>
> Anyone any idea how i can debug?
>
>
>
>
> E_ALL is not giving any related info.
> I tracked down where the page stops loading but
> these lines seem to be not
> related to the problem.
>
> I made it print a html text and this keeps working
> just unto the place where
> the page suddenly stops loading in a straight html
> bit.
>
> By the way, quite complicated structure. Never had
> so many php files open at
> the same time to track a bug!
>
>
> thanks,
> Chris
>
>
--------------------------------------------------------------------
> -- C.Hayes Droevendaal 35 6708 PB Wageningen the
> Netherlands --
>
--------------------------------------------------------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
attached mail follows:
On Sat, Aug 11, 2001 at 09:36:09AM +0200, Sascha Schumann wrote: > On Fri, 10 Aug 2001, Daniel Adams wrote: > > > Has anyone got the cvs source to work with autoconf 2.50? > > Noone as far as I know has worked on that so far; anyone who > is interested in this functionality is encouraged to provide > patches which addresses the remaining issues.
Done -> [PHP-DEV] Bug #12871: updating build-system to autoconf 2.5x
> - Sascha Experience IRCG
Jan
--
=> http://www.kneschke.de <==> http://www.random-downloads.com <=
mailto: jan
kneschke.de
attached mail follows:
Hi.
I added to crontab the command "0 * * * * lynx -dump -nolog http://localhost/backup.php" but this task are not running.
In "man cron" I saw this: ------------------------------- DESCRIPTION Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. -------------------------------
How can I stard the cron?
thanks.
Augusto
_______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/
attached mail follows:
On Tue, 21 Aug 2001 21:05, Augusto Cesar Castoldi wrote: > Hi. > > I added to crontab the command "0 * * * * lynx -dump > -nolog http://localhost/backup.php" but this task are > not running. >
On RedHat.
chkconfig --level 2345 crond on
Brad
attached mail follows:
On Tue, 21 Aug 2001 21:27, Brad Hubbard wrote: > chkconfig --level 2345 crond on
Oh and;
/etc/rc.d/init.d/crond start
of course.
Brad
attached mail follows:
Hi.
now my cron is working, but the command don't. If I do
manualy "lynx -dump -nolog
http://localhost/backups/backup.php" it works, but
with cron didn't worked. I receive this "e-mail" from
"Cron Daemon":
-------------------------------------------------------
Subject: Cron <httpd
vendaval> lynx -dump -nolog
http://localhost/backups/backup.php
Your terminal lacks the ability to clear the screen or position the cursor. -------------------------------------------------------
Why didn't worked?
thanks,
Augusto
_______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/
attached mail follows:
php files are text files you have to tell cron (or more directly the system) what to do with it.
like a perl script, simply tell it where to find the PHP processor and it will then use it to run your script... otherwise it is just diaplaying a page of text every minute.
you must have a cgi copy of PHP executable available to run your script, yes you can have both on your server if you are already running the mod_php version.
add
#!/usr/local/bin/php -q
to the first line in your script... then cron will know what to do with your text file.
BTW; a quick search on google for "run php as shell script" produced this as the number 1 result http://www.phpbuilder.com/columns/darrell20000319.php3 searching for "PHP and CRON" produced yet another plethora of responses.
Dave
>-----Original Message-----
>From: Augusto Cesar Castoldi [mailto:accastoldi
yahoo.com.br]
>Sent: Tuesday, August 21, 2001 8:17 AM
>To: php-general
lists.php.net
>Subject: [PHP] Re: Use cron to execute a script --> OTHER problem now
>
>
>Hi.
>
>now my cron is working, but the command don't. If I do
>manualy "lynx -dump -nolog
>http://localhost/backups/backup.php" it works, but
>with cron didn't worked. I receive this "e-mail" from
>"Cron Daemon":
>-------------------------------------------------------
>Subject: Cron <httpd
vendaval> lynx -dump -nolog
>http://localhost/backups/backup.php
>
>Your terminal lacks the ability to clear the screen or
>position the cursor.
>-------------------------------------------------------
>
>Why didn't worked?
>
>thanks,
>
>Augusto
>
>
>_______________________________________________________________________
>________________________
>Yahoo! GeoCities
>Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo!
>GeoCities. É fácil e grátis!
>http://br.geocities.yahoo.com/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
How can I do this? Say I have a 320x240 file but I only want to show a 160x120 thumbnail. I'm looking to decrease download speeds.
cheers,
- seb
attached mail follows:
chicken or egg question here...
assuming the directory requires authentication a la .htaccess or httpd.conf allow/deny does this methos encapsulate the authentication in the SSL or does this only eget applied after authenticating and reading the file to get the header portion.
Example, current setup is to access the secure page via https://mypage
this means the SSL layer is already in place when apache prompts for user/password, thus transmitting the user/pw pair securely to the server.
without the SSL layer in place, your user/pw pair is essentially being snt open text for anyone to parse. If the header information contained in the if statement isn't parsed untill after the uid/pw pair is already sent.
I would suspect that since PHP parses the file prior to delivering it to the user, that the lack of SSL is detected and the resulting login session is encapsulated in the SSL layer.
Can anyone verify this?
Dave
>if(getenv("HTTPS")!="on") >{ >header ("Location: https://logon_screen"); >} > >every page has an include that checks $HTTPS as part of the sessions and >validation. If https!="on" then it kicks you back to the logon screen. > >you could do the same using > >if(getenv("HTTPS")!="on") >{ >header ("Location: https://$SERVER_NAME/$PHP_SELF"); >}
attached mail follows:
OK so I'vebeen reading about reading and writing to/from files, but what I want to do is (I think) simpler than this.
Basically I want to look at a directory and be able to get a list of all subdirectories and then a list of the files in each directory. Can someone give me a hint?
cheers....
- seb
attached mail follows:
On Tue, Aug 21, 2001 at 01:26:27PM +0100, Seb Frost wrote: > OK so I'vebeen reading about reading and writing to/from files, but what I > want to do is (I think) simpler than this. > > Basically I want to look at a directory and be able to get a list of all > subdirectories and then a list of the files in each directory. Can someone > give me a hint? > > cheers.... > > - seb
This should give you all info you need:
http://www.php.net/manual/en/ref.dir.php
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Here is some code that I use to do what you wanted and attach is the files for the folders. This uses javascript that works well with Internet Explorer and creates sublist that appear in the folder.
<? error_reporting (E_ALL ^ E_NOTICE); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <head> <title>Untitled</title> <style> <!-- #foldheader{cursor:hand ; font-weight:bold ; list-style-image:url(fold.gif)} #foldinglist{list-style-image:url(list.gif)} #file{list-style-image:url(list01.gif)} A:link { color: #8000ff; } A:visited { color: #000080;background:#a9a8bd } A:active { color: #0080ff;font-weight:bold;background:#bcbbcc} A:hover { color: #0080ff;font-weight:bold;background:#FFFFFF} //--> </style> <script language="JavaScript1.2"> var head="display:''" img1=new Image() img1.src="fold.gif" img2=new Image() img2.src="open.gif"
function change(){ if(!document.all) return if (event.srcElement.id=="foldheader") { var srcIndex = event.srcElement.sourceIndex var nested = document.all[srcIndex+1] if (nested.style.display=="none") { nested.style.display='' event.srcElement.style.listStyleImage="url(open.gif)" } else { nested.style.display="none" event.srcElement.style.listStyleImage="url(fold.gif)" } } } document.onclick=change </script> </head> <? $dir="../"; $handle=opendir($dir); while ($file = readdir($handle)) { $local="$dir/$file"; if (is_dir($local)) { if ($file != "." && $file != "..") { $dirArray[] = $file; } } elseif(is_file($local)){ $ext=substr($file,$strlen-4,4); if ($ext==".jpg"||$ext=="jpeg"||$ext==".JPG"||$ext=="JPEG"||$ext==".gif"||$ext==".GIF"||$ext=="png"||$ext=="PNG"){ $imageinfo_Array[]=$file; } elseif ($file!="." && $file!=".."){ $fileinfo_Array[]=$file; }; }; }; closedir($handle);
asort($dirArray); asort($imageinfo_Array); asort($fileinfo_Array); ?>
<BODY BGCOLOR=#ffffff TOPMARGIN=10 LEFTMARGIN=5> <ul> <? $dirArray; while (list($key,$value) = each($dirArray)) { $dir_info=base64_encode($value); $subdir="../$value"; ?> <li id="foldheader"> <?$dirinfo=explode("-",$value);while (list($key,$info)=each($dirinfo)){echo ucfirst($info)," ";};?> <? $open_subdir=opendir($subdir); $file_info_Array=array(); while ($file = readdir($open_subdir)) {if (is_dir($img_file)) {} else{ $ext=substr($file,$strlen-4,4); if ($ext==".jpg"||$ext=="jpeg"||$ext==".JPG"||$ext=="JPEG"||$ext==".gif"||$ext==".GIF"||$ext=="png"||$ext=="PNG"){ $image_info_Array[]=$file; } elseif ($file!="." && $file!=".."){ $file_info_Array[]=$file; }; }; }; closedir($open_subdir); natcasesort($file_info_Array); natcasesort($image_info_Array); ?> <?echo $count?></li> <ul id="foldinglist" style="display:none" style=&{head};> <? while (list($key,$value) = each($file_info_Array)) { ?> <LI id="file"> <A HREF="edit.php?dir_info=<?echo $subdir?>&file=<?echo $value?>" TARGET="right" ><?echo $value;?></A></LI> <? }; ?> <? while (list($key,$value) = each($image_info_Array)) { ?> <LI> <?echo $value;?></LI> <? }; ?></ul> <? } while (list($key,$value) = each($fileinfo_Array)) { ?> <LI id="file"> <A HREF="edit.php?dir_info=../&file=<?echo $value?>" TARGET="right" ><?echo $value;?></A></LI> <? }; while (list($key,$value) = each($imageinfo_Array)) { ?> <LI id="foldinglist"> <?echo $value;?></LI> <? }; ?></ul> <DIV ALIGN=center> <TABLE> <TR> <TD COLSPAN="2" ALIGN="center"><A HREF="new.php?new=yes" TARGET="right" ><B>New Page<B></A><TD> </TR> <TR> <TD COLSPAN="2" ALIGN="center"><A HREF="index.html" TARGET="_parent" ><B>Main Page<B></A><TD> </TR> </TABLE> </DIV> </BODY> </HTML>
At 01:26 PM 8/21/01 +0100, Seb Frost wrote:
>OK so I'vebeen reading about reading and writing to/from files, but what I
>want to do is (I think) simpler than this.
>
>Basically I want to look at a directory and be able to get a list of all
>subdirectories and then a list of the files in each directory. Can someone
>give me a hint?
>
>cheers....
>
>- seb
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
- application/zip attachment: filelist.zip
attached mail follows:
Hi,
I'm a PHP Programmer. My collegue Java programmer need to connect a web page which is a php page programmed by me. While he is calling a php page thru apache he gets html o/p. But With IIS 5.0, he gets expection error. But the script is same. Can any one help me?.
Hari.
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.268 / Virus Database: 140 - Release Date: 8/7/2001
attached mail follows:
You've gotten a few responses already... but since you didn't describe the application, here is an alternative if you are using the random numbers to retrieve random records from a database (postgreqsl in this example);
$query = "SELECT * FROM table ORDER BY random() LIMIT 5";
am usre the MySQL and others have similar constructs... again, just in case you were looking for database use and not just the number use (which others have more than adequately answered for you).
Dave
>-----Original Message-----
>From: Seb Frost [mailto:seb
raceshoot.com]
>Sent: Monday, August 20, 2001 9:13 PM
>To: PHP General List
>Subject: [PHP] Picking random numbers
>
>
>OK I want to pick 5 random numbers from 1 to 200. Easy. They must all be
>different. Not so easy.
>
>And I don't want to use shuffle because of the comments on php.net about it.
>
>- seb
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
attached mail follows:
Off topic question:
How I create install file in red hat linux from bin file. example: in /home/name i have file file.bin and I want create install from this file
roman
attached mail follows:
./file.bin :)
On Tue, 21 Aug 2001, Roman wrote:
> Off topic question: > > How I create install file in red hat linux from bin file. > example: in /home/name i have file file.bin and I want create install from > this file > > roman > > > >
attached mail follows:
Hope this will help. Some code is grabbed from the PHP's quickref.
<?php
var_dump($HTTP_POST_VARS);
if (
!$HTTP_POST_VARS['dir']) $HTTP_POST_VARS['dir']='./';
if (is_dir($HTTP_POST_VARS['dir'])){
echo '<form method="post" action="'.$PHP_SELF.'" name="ok">';
echo "<input type='hidden' name='dir'
value='".$HTTP_POST_VARS['dir']."'></form>";
if ($dir =
opendir($HTTP_POST_VARS['dir'].'/')) {
while($file = readdir($dir)) {
if (is_file($HTTP_POST_VARS['dir']."/$file")){
$fsize=filesize($HTTP_POST_VARS['dir']."/$file");
}else{
$fsize=0;
}
printf("<pre>%120s,%10d</pre><br>\n","<a
href='javascript:document.ok.elements[\"dir\"].value=\"".$HTTP_POST_VARS['di
r']."/".$file."\";document.ok.submit();'>$file</a>",$fsize);
}
closedir($dir);
}
}else{
echo "<a href=\"javascript:history.go(-1);\">Back</a><br><br>";
$ar=file($HTTP_POST_VARS['dir']);
while (list($k,$v)=each($ar)){
$ln+=strlen($v);
if ($ln>0){
echo htmlspecialchars($v)."<br>\n";
}
}
}
?>
Have Phun. http://www.phreedom.org is for phun.
attached mail follows:
Hi, I'm trying the command "lynx -dump -nolog http://localhost/script.php > /dev/null" on crontab but I (httpd) receive an e-mail from "Cron Daemon" saying that: "Your terminal lacks the ability to clear the screen or position the cursor."
what should I do run my script with cron?
thanks,
Augusto
_______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/
attached mail follows:
Hi, I'm trying the command "lynx -dump -nolog http://localhost/script.php > /dev/null" on crontab but I (httpd) receive an e-mail from "Cron Daemon" saying that: "Your terminal lacks the ability to clear the screen or position the cursor."
what should I do run my script with cron?
thanks,
Augusto
_______________________________________________________________________________________________ Yahoo! GeoCities Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! http://br.geocities.yahoo.com/
attached mail follows:
Augusto Cesar Castoldi wrote:
> Hi, I'm trying the command "lynx -dump -nolog > http://localhost/script.php > /dev/null" on crontab > but I (httpd) receive an e-mail from "Cron Daemon" > saying that: > "Your terminal lacks the ability to clear the screen > or position the cursor." > > what should I do run my script with cron? > > thanks, > > Augusto > > _______________________________________________________________________________________________ > Yahoo! GeoCities > Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! > http://br.geocities.yahoo.com/ > >
One thing comes to mind.
Compile PHP as a CGI and use that to run your scipts ;)
-- Stig-Ørjan Smelror SystemutviklerLinux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway
tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/
attached mail follows:
Augusto,
If for whatever reason you can't (I don't even begin to want to know why), try wget :)
Regards,
Cristopher Daniluk
President & CEO
email: cris
dsnet.net
direct: 330/530-2373
Digital Services Network, Inc Unleashing Your Potential voice: 800/845-4822 web: http://www.dsnet.net/
-----Original Message-----
From: Stig-Ørjan Smelror [mailto:sos
LinCom.no]
Sent: Tuesday, August 21, 2001 9:10 AM
To: Augusto Cesar Castoldi
Cc: php-general
lists.php.net
Subject: Re: [PHP] Why lynx don't work with cron?
Augusto Cesar Castoldi wrote:
> Hi, I'm trying the command "lynx -dump -nolog > http://localhost/script.php > /dev/null" on crontab > but I (httpd) receive an e-mail from "Cron Daemon" > saying that: > "Your terminal lacks the ability to clear the screen > or position the cursor." > > what should I do run my script with cron? > > thanks, > > Augusto > > ____________________________________________________________________________ ___________________ > Yahoo! GeoCities > Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo! GeoCities. É fácil e grátis! > http://br.geocities.yahoo.com/ > >
One thing comes to mind.
Compile PHP as a CGI and use that to run your scipts ;)
-- Stig-Ørjan Smelror SystemutviklerLinux Communications AS Sandakerveien 48b Box 1801 - Vika N-0123 Oslo, Norway
tel. +47 22 09 28 80 fax. +47 22 09 28 81 http://www.lincom.no/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
DOH! Thanks for the heads-up, David. Here's the code I promised.
My apologies!
Bill -------8<-------8<-------8<-------8<-------8<-------8<-------8<-
<?
/*
Code red autoresponder does the following:
- Checks the whois for the attacking host
- Emails the offender's Internet Service Provider, supplying hostname,
target and date
- Stores the attack into a file with information if email has been sent
or:
- Stores the attack into /var/log/syslog
In order for this script to function, you need the following:
- Add .ida to AddType application/x-httpd-php in httpd.conf
- A writable directory for the user running the webserver or:
- A file called code-red_ips.txt in your $path which has mode 770
bad2da / Efnet #php
#############################################
08/13/2001 jwwf (billfarr
ages.com) Substantially modified to examine
all the root authorities, not just RIPE. Authorities can be
added or removed at liberty by changing the $Authorities
array.
*/
/* Configuration */
$name = "admin";
$from = "you
yourmailbox";
$DefaultSendTo = "you
youradminmailbox";
$path = "/lib/www/html";
$logt = "syslog"; // file or syslog
// jwwf Patch to use all available authorities until we find this guy.
There
// are more than just these three, and APNIC may automatically refer.
$Authorities = array( 'whois.arin.net', 'whois.ripe.net', 'whois.apnic.net'
);
/* Define Variables */
$date = date(r);
/* Is the client behind a proxy? */
if($HTTP_X_FORWARDED_FOR)
{
$ip = $HTTP_X_FORWARDED_FOR;
}
elseif($HTTP_VIA)
{
$ip = $HTTP_VIA;
}
elseif($REMOTE_ADDR)
{
$ip = $REMOTE_ADDR;
}
else
{
die();
}
$host = gethostbyaddr($ip);
/* Define email message */
// jwwf refine spelling *just* a bit.
$subject = "Code Red Infection Attempt from $ip to $HTTP_HOST";
$message = "At $date we received an Code Red Infection attempt on our
$host from a webserver on your network, namely, ";
$message .= "$ip. We would like to help you out and in preventing hosts
from your network from ";
$message .= "infecting any more hosts on the internet and in putting a
stop to the worm\n\n\n";
$message .= "Information about the Code Red Virus Worm\n\n";
$message .= "A Very Real and Present Threat to the Internet:\n\n";
$message .= "Install the patch today\n\n";
$message .= "Summary: The Code Red Worm and mutations of the worm pose a
continued ";
$message .= "and serious threat to Internet users. Immediate action is
required to ";
$message .= "combat this threat. Users who have deployed software that is
vulnerable ";
$message .= "to the worm (Microsoft IIS Versions 4.0 and 5.0) must
install, if they ";
$message .= "have not done so already, a vital security patch\n\n";
$message .= "How Big Is The Problem? On July 19, the Code Red worm
infected more ";
$message .= "than 250,000 systems in just 9 hours. The worm scans the
Internet, ";
$message .= "identifies vulnerable systems, and infects these systems by
installing ";
$message .= "itself. Each newly installed worm joins all the others
causing the rate ";
$message .= "of scanning to grow rapidly. This uncontrolled growth in
scanning directly ";
$message .= "decreases the speed of the Internet and can cause sporadic
but widespread ";
$message .= "outages among all types of systems. Code Red is likely to
start spreading ";
$message .= "again on July 31st, 2001 8:00 PM EDT and has mutated so that
it may be even ";
$message .= "more dangerous. This spread has the potential to disrupt
business and ";
$message .= "personal use of the Internet for applications such as
electronic commerce, ";
$message .= "email and entertainment.\n\n";
$message .= "Who Must Act? Every organization or person who has Windows NT
or Windows ";
$message .= "2000 systems AND the IIS web server software may be
vulnerable. IIS is ";
$message .= "installed automatically for many applications. If you are not
certain, ";
$message .= "follow the instructions to determine whether you are running
IIS 4.0 or ";
$message .= "5.0. If you are using Windows 95, Windows 98, Windows Me,
Windows XP ";
$message .= "RC1 or later, or Windows .NET Server build 3505 or later,
there is no ";
$message .= "action that you need to take in response to this alert.\n\n";
$message .= "What To Do If You Are Vulnerable?\n\n"; $message .= "a. To rid your machine of the current worm, reboot your computer.\n"; $message .= "b. To protect your system from re-infection: Install the patch "; $message .= "as specified in the instructions.\n\n"; $message .= "The security bulletin that describes the patch and the vulnerability "; $message .= "it addresses is posted at: "; $message .= "http://www.microsoft.com/technet/security/bulletin/MS01-033.asp\n\n"; $message .= "Because of the importance of this threat, "; $message .= "this alert is being made jointly by: \n"; $message .= "Microsoft \n"; $message .= "The National Infrastructure Protection Center \n"; $message .= "Federal Computer Incident Response Center (FedCIRC) \n"; $message .= "Information Technology Association of America (ITAA) \n"; $message .= "CERT Coordination Center \n"; $message .= "SANS Institute \n"; $message .= "Internet Security Systems \n"; $message .= "Internet Security Alliance \n"; $headers .= "From: $name <$from>\n"; $headers .= "X-Mailer: PHP\n"; // mailer $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Reply-To: $from\n"; // jwwf - in case the ISP actually replies $headers .= "Return-Path: <$from>\n"; // Return path for errors
// jwwf - more fiddling with the original code
$GotResponse = false;
// ARIN makes a messy output. To get what we want we have to requery using
the NIC
// handle to get the email address for the contact. First, replace this
skimpy output
// with the output that has the required data in it
foreach ( $Authorities as $Authority ) {
if ( $GotResponse ) { break; }
$RespondingAuthority = $Authority;
exec("/usr/bin/whois $ip
$Authority", $WholeResponse, $status );
$UWholeResponse = strtoupper( join( " ", $WholeResponse) );
if ( ( strpos( $UWholeResponse, "NO ENTRIES" ) === false ) && (
strpos( $UWholeResponse, "NO MATCH" ) === false ) ) {
$GotResponse = true;
$Keepgoing = true;
foreach ( $WholeResponse as $Line ) {
if ( ( $Authority == "whois.arin.net" ) && ( $Keepgoing ) )
{
$StartPos = strpos( $Line, chr(40) );
if ( !( $StartPos === false ) ) {
$StartPos++;
$RightSide = strpos( $Line, chr(41)
);
$RightSide = $RightSide - $StartPos;
$Query = substr( $Line, $StartPos,
$RightSide );
$Query .= "
whois.arin.net";
unset( $WholeResponse );
exec( "/usr/bin/whois !$Query",
$WholeResponse, $status );
$Keepgoing = false;
break;
}
}
}
}
}
// APNIC and RIPE produce similar reports. ARIN on the other hand makes
// you work twice as hard to find an email address. With ARIN, one must
// perform a double-query (as above) to get the information associated
// with a network's NIC handle. APNIC and RIPE just hand it to you
// straightaway.
unset( $SendTo ); // just for effect
if ( $RespondingAuthority != "whois.arin.net" ) {
foreach ( $WholeResponse as $Line ) {
list( $Key, $Value ) = explode( ":", $Line );
if ( strtoupper( $Key ) == "E-MAIL" ) {
$SendTo = trim( $Value );
break;
}
}
} else {
foreach ( $WholeResponse as $Line ) {
$Words = explode( " ", trim( $Line ) );
foreach ( $Words as $Word ) {
if
(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*
[a-z0-9-]+(\.[a-z0-9-]+)*$",$Word)) {
$SendTo = $Word;
break;
}
}
if ( isset( $SendTo ) ) { break; }
}
}
if ( !isset( $SendTo ) ) {
$SendTo = $DefaultSendTo;
} else {
$SendTo .= ",".$DefaultSendTo;
}
if($logt == "file")
{
$fp = fopen($path . "/code-red_ips.txt","a+");
}
elseif($logt == "syslog")
{
define_syslog_variables();
openlog("httpd", LOG_PERROR, LOG_DAEMON);
}
/* Email the offender's ISP and also send a copy to our own sysops */
if(!empty($abuse))
{
while(list($key,$var) = each($abuse))
{
mail($var, $subject, $message, $headers);
if($logt == "file")
{
fputs($fp,"$host " . date(r) . " - Email sent to $var\n");
}
elseif($logt == "syslog")
{
syslog(LOG_WARNING,"Code red from $host email sent to $var");
}
}
}
elseif(!empty($notabuse))
{
while(list($key,$var) = each($notabuse))
{
mail($var, $subject, $message, $headers);
if($logt == "file")
{
fputs($fp, "$host " . date(r) . " - Email sent to $var\n");
}
elseif($logt == "syslog")
{
syslog(LOG_WARNING,"Code red from $host email sent to $var");
}
}
}
else
{
fputs($fp, "$host " . date(r) . " - Email not sent!\n");
}
if($logt == "file")
{
fclose($fp);
}
elseif($logt == "syslog")
{
closelog();
}
?>
---------8<---------8<---------8<---------8<---------8<---------8<
-----Original Message-----
From: David Robley [mailto:huntsman
www.nisu.flinders.edu.au]
Sent: Monday, August 20, 2001 9:00 PM
To: Bill Farrell
Subject: Re: [PHP] new one is it ??
On Mon, 20 Aug 2001 23:44, billfarr
ages.com wrote:
> Hiya again, Erik:
>
> Here's the barely-tested but apparently functional Code Red detector.
> I added some variables at the top for configuring email destinations.
> The important change is that it will query ARIN, RIPE, and APNIC until
> it finds a reasonable answer. In the case of ARIN, it's necessary to
> query twice to get the email address you REALLY want, due to the number
> of Tier II providers in the States. Those don't always show up in the
> WHOIS. That caused me to do a bit more looping and fiddling until the
> answers came out the way I would expect if I were looking by eye.
>
> It may be a bit late for Code Red, but the part of the routine that
> does the authority-queries is re-usable all over the place. The code
> ain't pretty (I'm no PHP maven YET :-) but it appears to do the job.
>
> Enjoy!
> Bill
>
Bill
The mailing list strips attachments - if you include it in a message, point us to it or email it separately to us... Or I could stick it somewhere here where people can get at it.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIAThose who can't write, write help files.
attached mail follows:
Date: Wed, 22 Aug 2001 18:22:44 +0430 Message-Id: <200108221352.f7MDqi206313
persia.iraninfocenter.net>
From: "nafiseh saberi" <nsaberi
iraninfocenter.net>
To: php-general
lists.php.net
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Subject: our country
hi.
I want to know how many of people in php group are IRANIAN??
I am IRANIAN too. how about yours?? thanks.
attached mail follows:
What you are trying to do is covered in the manual here: http://www.php.net/manual/en/features.http-auth.php
I think you specifically was the section: Both Netscape Navigator and Internet Explorer will clear the local browser window's authentication cache for the realm upon receiving a server response of 401. This can effectively "log out" a user, forcing them to re-enter their username and password. Some people use this to "time out" logins, or provide a "log-out" button.
All the details of this are in the manual.
Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com
----- Original Message -----
From: "Alex Sofronie" <maxx
mail.dntis.ro>
To: "PHP General" <php-general
lists.php.net>
Sent: Monday, August 20, 2001 4:12 PM
Subject: [PHP] Re: PHP based auth -----------------
> No, I'm just using PHP_AUTH_USER and PHP_AUTH PW and i am trying to
> logout... The session_destroy() is not working.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Basically I want to check to see if $fileDir is already in my database. I do this as:
$result = mysql_query("SELECT fileDir FROM shoots WHERE (fileDir='$fileDir')");
How do I check the result? I normally use
mysql_result($result, $row, $field)
to read my result, but if I try that I get an error:
if(mysql_result($result, $row, $field))
gives me:
Warning: Unable to jump to row 0 on MySQL result index 3
cheers,
- seb
attached mail follows:
On Tue, Aug 21, 2001 at 02:54:33PM +0100, Seb Frost wrote: > Basically I want to check to see if $fileDir is already in my database. I > do this as: > > $result = mysql_query("SELECT fileDir FROM shoots WHERE > (fileDir='$fileDir')"); > > How do I check the result? I normally use > > mysql_result($result, $row, $field) > > to read my result, but if I try that I get an error: > > if(mysql_result($result, $row, $field)) > > gives me: > > Warning: Unable to jump to row 0 on MySQL result index 3 > > > cheers, > > - seb
You're looking for: msql_num_rows()
Try: http://www.php.net/manual/en/function.msql-num-rows.php
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
A good way to check if the result set is empty is to do put all statements that work on the result set in an if-statement with the following condition:
if (mysql_numrows($result) != 0) { ... code here ... }
Hope this helps
DevilKin
At 14:54 21/08/2001 +0100, Seb Frost wrote:
>Basically I want to check to see if $fileDir is already in my database. I
>do this as:
>
> $result = mysql_query("SELECT fileDir FROM shoots WHERE
>(fileDir='$fileDir')");
>
>How do I check the result? I normally use
>
> mysql_result($result, $row, $field)
>
>to read my result, but if I try that I get an error:
>
> if(mysql_result($result, $row, $field))
>
>gives me:
>
> Warning: Unable to jump to row 0 on MySQL result index 3
>
>
>cheers,
>
>- seb
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
just use mysql_num_rows($result) dummy :-)
doh.
sorry to bother y'all.
-----Original Message-----
From: Seb Frost [mailto:seb
raceshoot.com]
Sent: 21 August 2001 14:55
To: php-general
lists.php.net
Subject: [PHP] Detecting empty query result?
Basically I want to check to see if $fileDir is already in my database. I do this as:
$result = mysql_query("SELECT fileDir FROM shoots WHERE (fileDir='$fileDir')");
How do I check the result? I normally use
mysql_result($result, $row, $field)
to read my result, but if I try that I get an error:
if(mysql_result($result, $row, $field))
gives me:
Warning: Unable to jump to row 0 on MySQL result index 3
cheers,
- seb
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi
I'm using IIS and I changed the 404 page to something else. Now the server returns an 200 OK message for a mistaken page :) Does anyone know the exact headers I need to send b4 the page so that the server will send back to the client the 404 NOT FOUND header along with the new page?
thanks
berber
attached mail follows:
May be it's a dummy question, but I can't find how I can install this ISAPI module under win98. (I had only an winNT guide)
Can someone please explain it to me.... thank you. ;)
MöfG; Tribun (Patrick Lehnen)
--- mp3o.net
attached mail follows:
Hello,
I'm trying to do mcrypt encryption but I continue to get the following error:
Warning: mcrypt module initialization failed
and this is the line of code that I get the error from:
$string = mcrypt_cbc("MCRYPT_DES", $key, $test, "encrypt");
I've also tried several different version of using the function mcrypt_encrypt as well but nothing seems to work. In my phpinfo file, this is what I have for the mcrypt module:
Version: 2.4.x
Supported Ciphers: cast-128 cast-256 enigma xtea arcfour panama safer-sk64 saferplus des tripledes blowfish gost rc2 safer-sk128 threeway serpent wake loki97 rijndael-128 rijndael-192 rijndael-256 twofish blowfish-compat
Supported modes: stream cbc cfb ecb ofb nofb
Does someone know if I am coding something wrong or if there is a problem with the installation of php (v 4.0.6) on the server that I am on? Thanks for the help.
-- Dominic
attached mail follows:
Dominic, I'd start by checking the libmcrypt installation. If you're building from source, prior to your installation check that [mcrypt-src-dir]/src/cipher_test runs without error. If that succedes, install libmcrypt (and mcrypt) and then attempt to test with the command line. Start by listing ciphers and modes. Then attempt to encrypt and decrypt something. Once you've verified that the underlying code is working, then attempt to list the ciphers and modes with PHP functions. In general the mcrypt examples given by the php manual at php.net/manual were enough to get me started.
Note, I've experienced problems on Solaris and Linux with the modules not being found (cipher .so's). Sometimes it's as easy as setting directories in php.ini, sometimes I've had to get into the libmcrypt code.
Good luck.
Andy
On Tue, Aug 21, 2001 at 09:16:22AM -0500, Dominic Schanen wrote:
> Hello,
>
> I'm trying to do mcrypt encryption but I continue to get the following
> error:
>
> Warning: mcrypt module initialization failed
>
> and this is the line of code that I get the error from:
>
> $string = mcrypt_cbc("MCRYPT_DES", $key, $test, "encrypt");
>
> I've also tried several different version of using the function
> mcrypt_encrypt as well but nothing seems to work. In my phpinfo file, this
> is what I have for the mcrypt module:
>
> Version: 2.4.x
>
> Supported Ciphers:
> cast-128 cast-256 enigma xtea arcfour panama safer-sk64 saferplus des
> tripledes blowfish gost rc2 safer-sk128 threeway serpent wake loki97
> rijndael-128 rijndael-192 rijndael-256 twofish blowfish-compat
>
> Supported modes:
> stream cbc cfb ecb ofb nofb
>
> Does someone know if I am coding something wrong or if there is a problem
> with the installation of php (v 4.0.6) on the server that I am on? Thanks
> for the help.
>
> --
> Dominic
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- -------------------------------------------------- Andrew Libby Director of Technology CommNav, Inc alibbycommnav.com
attached mail follows:
hi. what is IIS?
thanks.
attached mail follows:
IIS is the web server software that comes with WindowsNT/2000.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Wed, 22 Aug 2001 19:22:16 +0430 "nafiseh saberi" <nsaberi
iraninfocenter.net> wrote:
> > hi. > what is IIS? > > thanks. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
>hi. >what is IIS?
Micro$oft Internet Information Server. It's a webserver. IMHO a poor alternative for Apache. If you want to know more about IIS take a look at the M$ website (www.microsoft.com/iis) should tell you everything you ever want to know.
Bye,
B.
WOW.. this sure looks like flamebait :-) /"\ \ / ASCII Ribbon Campaign X Against HTML Mail and News / \
attached mail follows:
Microsoft Internet Information Server.
> From: nsaberi
iraninfocenter.net (Nafiseh Saberi)
> Newsgroups: php.general
> Date: Wed, 22 Aug 2001 19:22:16 +0430
> To: php-general
lists.php.net
> Subject: IIS
>
>
> hi.
> what is IIS?
>
> thanks.
attached mail follows:
Hello everyone-
I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run my script and it hit's:
header("Location:index.php");
well the thing is once it hits that line in my script and just fails, however i don't get any type of parse error the browser just says 404 error page not found... could it be i forgot to add something when i configured and installed php on my machine?
i'm really losted here cause i can put an echo "blah"; before it or after it and it will print out just fine.. but comment out that echo and have it hit the header() line and i get teh 404 page error.. (and yes i've double and tripled checked that all the files etc are there it's just not doing the header function for some reason)
Thanks! Jay
attached mail follows:
Well, it's not a good idea to put something (like an echo) before a header()...even for testing because that will prevent the header() from working at all. You should have gotten an "All headers have been sent" or some similar error.
-- Tyler Longren Captain Jack Communications tylercaptainjack.com www.captainjack.com
On Tue, 21 Aug 2001 09:53:42 -0500 "Jay Paulson" <jpaulson
lbjs.com> wrote:
> Hello everyone- > > I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run > my > script and it hit's: > > header("Location:index.php"); > > well the thing is once it hits that line in my script and just fails, > however i don't get any type of parse error the browser just says 404 > error > page not found... could it be i forgot to add something when i > configured > and installed php on my machine? > > i'm really losted here cause i can put an echo "blah"; before it or > after it > and it will print out just fine.. but comment out that echo and have it > hit > the header() line and i get teh 404 page error.. (and yes i've double > and > tripled checked that all the files etc are there it's just not doing the > header function for some reason) > > Thanks! > Jay > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
You're right when you say that you shouldn't put an echo before the header.. however I did that just so I could see if I would get the error "All headers have been sent" and well I didn't get that error... I didn't get any error message.. so I thought that was strange and that's why I'm here asking this question because I really don't know what's going on.. I have checked the web server error log and when I call the header function it tries to redirect me to a ".php" file (notice there is no file name). So I'm not sure what exactly is going on.
[Mon Aug 20 17:23:03 2001] [error] [client 64.132.13.114] File does not exist: /home/username/htdocs/admin/.php
----- Original Message -----
From: "Tyler Longren" <tyler
captainjack.com>
To: "Jay Paulson" <jpaulson
lbjs.com>
Cc: <php-general
lists.php.net>
Sent: Tuesday, August 21, 2001 9:54 AM
Subject: Re: [PHP] header function
> Well, it's not a good idea to put something (like an echo) before a
> header()...even for testing because that will prevent the header() from
> working at all. You should have gotten an "All headers have been sent" or
> some similar error.
>
> --
> Tyler Longren
> Captain Jack Communications
> tyler
captainjack.com
> www.captainjack.com
>
>
>
> On Tue, 21 Aug 2001 09:53:42 -0500
> "Jay Paulson" <jpaulson
lbjs.com> wrote:
>
> > Hello everyone-
> >
> > I have a slight problem.. I'm running php 4.0.6 on RedHat 7.1 and I run
> > my
> > script and it hit's:
> >
> > header("Location:index.php");
> >
> > well the thing is once it hits that line in my script and just fails,
> > however i don't get any type of parse error the browser just says 404
> > error
> > page not found... could it be i forgot to add something when i
> > configured
> > and installed php on my machine?
> >
> > i'm really losted here cause i can put an echo "blah"; before it or
> > after it
> > and it will print out just fine.. but comment out that echo and have it
> > hit
> > the header() line and i get teh 404 page error.. (and yes i've double
> > and
> > tripled checked that all the files etc are there it's just not doing the
> > header function for some reason)
> >
> > Thanks!
> > Jay
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi all
I am just five days new to PHP. When sending an HTML form to a PHP page for handling, can you cause the PHP to detect the page name (like form.htm or form2.htm)?
thanks
Kevin
attached mail follows:
if you want the name of the page you are on (i.e. index.php) you can use the $PHP_SELF variable.. if you want to know what page you came from you can use the $HTTP_REFERER variable.. just remember to get those variables you have to have php parse the page (so it can't just be a plain html page)
jay
"Kevin P" <kevin.pottie
odellwebdesign.com> wrote in message
news:20010821150417.49839.qmail
pb1.pair.com...
> Hi all
>
> I am just five days new to PHP. When sending an HTML form to a PHP
page
> for handling, can you cause the PHP to detect the page name (like form.htm
> or form2.htm)?
>
> thanks
>
> Kevin
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
try using $PHP_SELF, this might be what you're looking for
rm
--- Kevin P <kevin.pottie
odellwebdesign.com> wrote:
> Hi all
>
> I am just five days new to PHP. When sending an
> HTML form to a PHP page
> for handling, can you cause the PHP to detect the
> page name (like form.htm
> or form2.htm)?
>
> thanks
>
> Kevin
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
attached mail follows:
It's due to space restrictions on the server. We have 300GB available on the server, but the compressed data takes up 200GB, and we're adding new data (several GB) every month or so.
So we need to keep as much compressed as possible, but we have to uncompress the data for the webpages to use it. The PHP webpages on the server use the uncompressed data to generate plots. The data is never sent to the user, just the plots.
The main problem I'm having is with page resolution. If I say:
print("<SCRIPT>jsPopupWindow('Starting UNZIP');</SCRIPT>\n");
$gunzipcmdline = "gunzip /PATHTO/MYDATA"; $result = exec("$gunzipcmdline", $execout, $execretval);
print("<SCRIPT>jsPopupWindow('Finished UNZIP');</SCRIPT>\n");
the 'Starting UNZIP' popup appears at the same time as the 'Finished UNZIP' one. The page hasn't resolved until after the gunzip is done, so it doesn't execute the Javascript the way I want it to. I've tried popping up a window, getting the handle, passing the handle to the gunzip code, then closing the handle when the gunzip is done, but that hasn't worked either.
Justin French wrote:
>Ray Clouse wrote: > >>When the user clicks on a link that has to gunzip a very large file, I >>want a popup to say "Working..." while the file is uncompressing. >>Then, when the file is uncompressed, I want the "Working..." popup to >>close itself and then the parent window to load a new URL (where it >>will use the uncompressed file). >> >>I've tried doing this with Javascript and window.open(), but I'm having >>no luck. Any ideas? >> > >Is the uncompressing taking place on the server? or on the local (user) >machine? Sounds like it's on the server. > >The problem is, you have no *real* way of knowing how long the de-comp >will take (due to other factors, like server/client load, etc etc), so >how do you know when to go from "working" to "done". > > >So, i'm trying to figure out WHY you're uncompressing a file on the >server that will be used by visitors over http. > >Seems wrong to me. Increased server load, more programs, more problems, >slower server response time, increased user anger, etc etc. > > >Enlighten me as to why, because I may be missing something. > > >Justin French >
-- ------------------------------------------------------------------------- Ray Clouse | Don't fear the penguins. Engineer Scientist/Specialist | Boeing Expendable Launch Vehicles | Ray.Clouse AT boeing.com Huntington Beach, CA | clouse AT rayclouse.org
attached mail follows:
I am trying to find a way to list files alphabetically.
<? // list images in a drop down list $Dir = "../Prod-Images/Thumbnails"; $mydirectory = opendir("$Dir");
while($entryName = readdir($mydirectory)) { if ($entryName[0] != "." && $entryName != "." && $entryName != ".." && $entryName != "WS_FTP.LOG" && $entryName != "NA.gif" && $entryName != "NA.jpg") { PRINT "<option value=\"$entryName\">" . "$entryName</option>\n"; } } closedir($mydirectory); ?>
I've looked through old messages on the subject but even though on Win32 it lists in the right way but not on the Apache Webserver.
Thanks. Martin.
attached mail follows:
store all the names in an array and then sort that using an inbuilt php function, maybe.
- seb
-----Original Message-----
From: Martin E. Koss [mailto:mek
mek.co.uk]
Sent: 21 August 2001 16:43
To: php-general
lists.php.net
Subject: [PHP] Listing files from a directory
I am trying to find a way to list files alphabetically.
<? // list images in a drop down list $Dir = "../Prod-Images/Thumbnails"; $mydirectory = opendir("$Dir");
while($entryName = readdir($mydirectory)) { if ($entryName[0] != "." && $entryName != "." && $entryName != ".." && $entryName != "WS_FTP.LOG" && $entryName != "NA.gif" && $entryName != "NA.jpg") { PRINT "<option value=\"$entryName\">" . "$entryName</option>\n"; } } closedir($mydirectory); ?>
I've looked through old messages on the subject but even though on Win32 it lists in the right way but not on the Apache Webserver.
Thanks. Martin.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On 8/21/2001 11:42 AM this was written:
> I am trying to find a way to list files alphabetically.
Try putting the filenames into an array and sort the array.
--Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
attached mail follows:
Thank you for advise, I think I'll use .htaccess and that would be fine. But why do I need to include ""? I'm using in on my local Apache win32 without "" even though I understand what is "string"
Youri
On 19 Aug 2001, at 16:01, Richard Lynch wrote:
> > I'm on virtual hosting that lets me configure anything with .htaccess
> > file. I was recomended by provider to specify location of sendmail in
> > case I want to use php mail() function I know that I may do it in
> > htaccess file by adding php_value sendmail_path
> > /usr/sbin/sendmail The qwestion is can I do anything else but
> > correcting the path in .htaccess, this is the last thing I want to do.
>
> First of all, you'll need:
>
> php_value sendmail_path "/usr/sbin/sendmail -t"
>
> Yes, you need the quotes.
> And possibly some other options inside quotes depending on your ISP's
> configuration of sendmail.
>
> I don't understand your ISP's rationale for requiring you to do this in
> .htaccess instead of just doing it himself... Either he's letting you use
> mail() or he's not.
>
> I also don't understand why you are loathe to do this... Unless you've
> heard ".htaccess is slow" (which it is). Alas, since your ISP has already
> turned on .htaccess support, you're *NOT* causing any additional significant
> slow-down to *utilize* the feature. The slowness is in Apache looking for
> the damn file, not in your putting (reasonable) stuff in it.
>
> Oh yeah, to answer your original question :-)
>
> You probably *COULD* set up an SMTP server on some other machine and just
> fsockopen() to that SMTP server and spew your emails to that. This will be
> way more faster anyway. Or, perhaps your ISP has an SMTP server that PHP
> can fsockopen() and spew to. Depends on how he configured it. There's all
> sorts of sample code for this SMTP spewing, so you needn't write it from
> scratch -- though it ain't rocket science. I did it, so it *CANNOT* be that
> difficult. :-)
>
> --
> WARNING richard
zend.com address is an endangered species -- Use
> ceo
l-i-e.com
> Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
>
>
>
attached mail follows:
Thank you for advise, everything is working fine now.
Youri
On 19 Aug 2001, at 15:55, Oliver Emberton wrote:
> It looks like PHP has been configured to report ALL errors and warnings - in
> your case it is warning you that you haven't declared the variable $page
> before you used it.
>
> Two ways around this - either set the variable $page to something first, or
> fix the php.ini file to stop being so fussy... try setting error_reporting
> to 7.
>
> (Newbie advice only, so take with a pinch of salt)
>
> ----- Original Message -----
> From: "BRACK" <brak
nettaxi.com>
> To: <php-general
lists.php.net>
> Sent: Sunday, August 19, 2001 3:45 PM
> Subject: [PHP] Errors
>
>
> > Hi
> >
> > I'm getting strange errors if I add
> > "LoadModule php4_module ../php/sapi/php4apache.dll" to http.conf
> > If I don't load it everything is working with php.exe without any errors
> but as I
> > load it as a modul I get for example -
> > Warning: Undefined variable: page in d:\abria> > sql\apache\htdocs\inc\page.inc on line 2
> > here is the page.inc file:> > <?php > > if (!$page): > > $page = 1; > > endif; > > $limit = ($page * 10) - 10; > > ?>
> >
> > What is wrong? I need php as a modul but what do I do
> > wrong, I did everything according to install.txt in php
> > directory.
> >
> > Thank you
> >
> > Youri
> >
> > <>< <>< <>< <>< God is our provider ><> ><> ><> ><>
> > http://www.body-builders.org
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
attached mail follows:
For someone used to Java & JavaScript.. what function would replace myString.indexOf(myStringPiece) ??
attached mail follows:
Message-ID: <2B25A9C95DC8D411BBE500508BB19239515DCE
ntslxch1.int.rdel.co.uk>
From: "Taylor, Stewart" <Stewart.Taylor
uk.thalesgroup.com>
To: "'Kevin P'" <kevin.pottie
odellwebdesign.com>
Cc: php-general
lists.php.net
Date: Tue, 21 Aug 2001 16:50:25 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Subject: RE: [PHP] Re: PHP indexOf()?
http://www.php.net/manual/en/function.strpos.php
-Stewart
-----Original Message-----
From: Kevin P [mailto:kevin.pottie
odellwebdesign.com]
Sent: 21 August 2001 20:44
To: php-general
lists.php.net
Subject: [PHP] Re: PHP indexOf()?
For someone used to Java & JavaScript.. what function would replace myString.indexOf(myStringPiece) ??
attached mail follows:
On 8/21/2001 3:43 PM this was written:
> For someone used to Java & JavaScript.. what function would replace > myString.indexOf(myStringPiece) ??
Strstr()
Or stristr() for case insensative search
http://www.php.net/manual/en/function.strstr.php
--Thomas Deliduka IT Manager ------------------------- New Eve Media The Solution To Your Internet Angst http://www.neweve.com/
attached mail follows:
Best places I learned from are www.flashkit.com as well as the books Dynamic Flash which includes a chapter on php. Other than that, I pulled apart projects downloaded from flashkit.
Jeff Pearson
> -----Original Message-----
> From: Jack [mailto:jacky
activelifestyle.com]
> Sent: Tuesday, August 21, 2001 7:49 AM
> To: php-general
lists.php.net
> Subject: [PHP] php and flash
>
>
> Hi people
> Is there anyone know where can I find something to study more
> about how to make dynamic content in flash using php and mySql?
> Jack
> jacky
activelifestyle.com
> "Love your enemies, it will drive them nuts"
>
attached mail follows:
Hi,
Here's the scenario,
I've installed and am running mySQL on my machine I've installed Apache and have ran it and seen the page in IE confirming correct setup.
I've installed PHP4 from a CGI binary distribution at the following location
c:\Php\
and have been following a tutorial on WebMonkey in order to configure it.
As instructed I have inserted the following lines in my httpd.conf file
ScriptAlias /php/ "C:/Php/"
AddType application/x-httpd-php .php .phtml .html AddType application/x-httpd-php-source .phps
Action application/x-httpd-php /Php/php.exe
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
The tutorial also instructed me to move the php4ts.dll to the following place
c:\Winnt\system
which I have done
After rebooting my machine I started IE and pointed it at the apache server again. This time it produced an error as follows (from the log)
[Tue Aug 21 14:54:47 2001] [error] [client 172.16.18.149] File does not exist: c:/program files/apache group/apache/htdocs/php/php.exe/index.html
As instructed I created the filephpinfo.php in the Document root and pointed the browser at it.
This yielded the following error message:
[Tue Aug 21 14:54:53 2001] [error] [client 172.16.18.149] File does not exist: c:/program files/apache group/apache/htdocs/php/php.exe/phpinfo.php
Can anyone tell me where I am going wrong here please?
Any suggestions gratefully received.
Thanks,
Paul Eaton.
attached mail follows:
pegc> ScriptAlias /php/ "C:/Php/"
pegc> AddType application/x-httpd-php .php .phtml .html pegc> AddType application/x-httpd-php-source .phps
pegc> Action application/x-httpd-php /Php/php.exe
Check for mismatched cases in httpd.conf.
Julie Meloni
julie
thickbook.com
"PHP Essentials" & "PHP Fast & Easy"
--- www.thickbook.com ---
attached mail follows:
You appear to have a typo in your httpd.conf:
Action application/x-httpd-php /Php/php.exe
should be as follows: (note the ")
Action application/x-httpd-php "/Php/php.exe
Hope that helps,
Neil
paul.eaton
globalgraphics.com wrote:
> ***************************************************************
> This message was virus checked with: SAVI 3.48
> last updated 14th August 2001
> ***************************************************************
>
> Hi,
>
> Here's the scenario,
>
> I've installed and am running mySQL on my machine
> I've installed Apache and have ran it and seen the page in IE confirming correct
> setup.
>
> I've installed PHP4 from a CGI binary distribution at the following location
>
> c:\Php\
>
> and have been following a tutorial on WebMonkey in order to configure it.
>
> As instructed I have inserted the following lines in my httpd.conf file
>
> ScriptAlias /php/ "C:/Php/"
>
> AddType application/x-httpd-php .php .phtml .html
> AddType application/x-httpd-php-source .phps
>
> Action application/x-httpd-php /Php/php.exe
>
> DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
>
> The tutorial also instructed me to move the php4ts.dll to the following place
>
> c:\Winnt\system
>
> which I have done
>
> After rebooting my machine I started IE and pointed it at the apache server
> again.
> This time it produced an error as follows (from the log)
>
> [Tue Aug 21 14:54:47 2001] [error] [client 172.16.18.149] File does not
> exist:
> c:/program files/apache group/apache/htdocs/php/php.exe/index.html
>
> As instructed I created the filephpinfo.php in the Document root and pointed the
> browser at it.
>
> This yielded the following error message:
>
> [Tue Aug 21 14:54:53 2001] [error] [client 172.16.18.149] File does not
> exist:
> c:/program files/apache group/apache/htdocs/php/php.exe/phpinfo.php
>
> Can anyone tell me where I am going wrong here please?
>
> Any suggestions gratefully received.
>
> Thanks,
>
> Paul Eaton.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- -------------------------------- Email: neil.freemanasa.co.uk neil_freeman
yahoo.com --------------------------------
attached mail follows:
NF> You appear to have a typo in your httpd.conf:
NF> Action application/x-httpd-php /Php/php.exe
NF> should be as follows: (note the ")
NF> Action application/x-httpd-php "/Php/php.exe
This is not accurate.
Julie Meloni
julie
thickbook.com
"PHP Essentials" & "PHP Fast & Easy"
--- www.thickbook.com ---
attached mail follows:
Anyone know what they use on php.net to generate the documentation? Can you do stuff that big with doxygen? - Dan
--
attached mail follows:
On Tue, Aug 21, 2001 at 12:47:14PM -0400, Daniel Adams wrote: > Anyone know what they use on php.net to generate the documentation? Can > you do stuff that big with doxygen?
We use DocBook (XML), Jade and the modular Stylesheets (DSSSL) from Norman Walsh.
-Egon
-- All known books about PHP and related books: http://php.net/books.php Concert Band of the University of Hohenheim: http://www.concert-band.de/ First and second bestselling book in German: http://www.php-buch.de/
attached mail follows:
I have a multi page sequence of input forms tied to a session. It works perfectly with cookies. But I also want to make it work without cookies, using:
php_value session.use_cookies 0 php_value session.use_trans_sid 1
in my .htaccess file, to use the SID support provided by PHP.
When testing this, I see that the SID works with all pages except the first. But because the first page has no SID passed to it in the URL, the first instance of:
session_start();
creates a new session every time you refresh the first page with the browser. And that is the problem. I only want one session to be created, no matter how many times the user hits refresh on the first page.
So then I tried setting the session id myself, hard coding it to some arbitrary value like:
<? session_id('7777625d282694214b0459cebe287777'); session_start(); ?>
and that solves the multiple session problem; only one session is created, no matter how many times you hit refresh on the first page.
Yay!
But that still leaves a chicken and egg problem to solve:
I can generate some random value to be used for the session_id, but I can't think of a good way to store it for use on the first page.
Since the first page does not get the SID in the URL, I need to set the session_id before calling session_start. But that means I don't have any session where I can store my random value, for recalling it later, on the next page refresh.
Ack! I only need some simple way to store the SID value I generate, before the page is loaded a second time.
I thought of using a CGI to dynamically generate all the PHP and HTML for page 1, and also have the CGI put a random session_id value right into the page source itself, just like I did when testing. I suppose that would work, but it seems like there should be an easier way.
Maybe there is some obvious solution, but it is not obvious to me at the moment.
Has anyone else solved this problem, with a better method?
Egan
attached mail follows:
Richard Lynch replied: >... > > > - Kills file upload completely > >I *think* safe_mode can be on and files can be uploaded if the ISP works at >it... But they have to want it bad enough to do some configuration. Most >ISPs want to just install stuff as-is and not take the time to find out how >to really configure it for optimum safety/functionality. >...
Just curious about all of this. How many of these various security issues go away if you are hosting your own site and there are no user logins on the box other than your own and no services running except the web server?
-- Bill Rausch, Software Development, Unix, Mac, Windows Numerical Applications, Inc. 509-943-0861 billnumerical.com
attached mail follows:
I don't host my own site so how can I put include files outside of the web root? I log on ftp and my top level IS the web root (htdocs), I can't go any higher.
- seb
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus
php.net]
Sent: 17 August 2001 05:01
To: Bob
Cc: php-general
lists.php.net
Subject: Re: [PHP] hacks we should know about
> hi i found it very helpful to know about hacks such as the below list > and was wondering if anyone had any more dumb mistakes they could tell > us before we make them. > > 1. http://www.somesite.com/source.php3?url=/etc/passwd > 2. http://www.somesite.com?page=../../../../etc/passwd > 3. not setting .inc files to be parsed by php
This is the wrong solution to securing include files. The correct solution is to block any direct access to .inc files by either putting them outside your document root or by using an Apache deny rule.
-Rasmus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]