|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 19 Jun 2003 19:57:45 -0000 Issue 2127
php-general-digest-help
lists.php.net
Date: Thu Jun 19 2003 - 14:57:45 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 19 Jun 2003 19:57:45 -0000 Issue 2127
Topics (messages 152122 through 152225):
Re: Empty session directory
152122 by: Marek Kilimajer
regex - delimiter problem
152123 by: Armand Turpel
unique random id
152124 by: Awlad Hussain
152129 by: Dustin Pate
152148 by: esctoday.com | Wouter van Vliet
152154 by: CPT John W. Holmes
152199 by: Don Read
Array Sorting
152125 by: Ashley M. Kirchner
152126 by: Marek Kilimajer
152127 by: Mark Clarkstone
152131 by: Ashley M. Kirchner
152132 by: Marek Kilimajer
152133 by: Marek Kilimajer
152134 by: Ashley M. Kirchner
Spellchecking using PHP on WinXP?
152128 by: Murray Wells
152147 by: Lowell Allen
Trapping PHP Errors
152130 by: Gary Ogilvie
152153 by: CPT John W. Holmes
Re: one corrupted image and imagecreatefromjpeg
152135 by: Daniel
152140 by: Marek Kilimajer
[Newman] Passing an image through a php file.
152136 by: Mark Tehara
152137 by: Awlad Hussain
152152 by: CPT John W. Holmes
Help me compose myself... I'm about to kill Microsoft....
152138 by: Daniel
152139 by: Awlad Hussain
152141 by: Daniel
152142 by: Daniel
typecasting .. easy?
152143 by: Roy W
152144 by: Jon Haworth
152145 by: bbonkosk.tampabay.rr.com
152146 by: Awlad Hussain
[CFP] The gathering: International PHP Conference 2003 fall edition
152149 by: Björn Schotte
Re: Validating a "money" input
152150 by: Mike Mannakee
STRANGE : SELECT OK on Localhost, OK within Dreamweaver, OK on phpmyadmin on site, BUT NOT OK on webpage???????HELP
152151 by: WMB
Re: Session Vars
152155 by: CPT John W. Holmes
php https file download
152156 by: Henning Sittler
152157 by: CPT John W. Holmes
152158 by: Henning Sittler
Empty Page problems
152159 by: Gary Ogilvie
152161 by: CPT John W. Holmes
152164 by: Gary Ogilvie
Re: cannot configure SMTP_port....
152160 by: Giuliano
152162 by: CPT John W. Holmes
GD library update
152163 by: Yury B.
152166 by: Andrei BEJENARU
template engine
152165 by: Niels Uhlendorf
152167 by: Andrei BEJENARU
Why Fatal Error: Allowed memory size ...
152168 by: Tony Arcucci
Why Fatal Error ?
152169 by: Tony Arcucci
152170 by: Jay Blanchard
152172 by: Tony Arcucci
152220 by: Leif K-Brooks
Re: Why Fatal Error ?[Scanned]
152171 by: Michael Egan
152173 by: Tony Arcucci
call-time pass-by-reference feature really deprecated?
152174 by: dorgon
152185 by: Jason Wong
152186 by: rush
152187 by: dorgon
152189 by: dorgon
152194 by: Bobby Patel
152197 by: dorgon
152198 by: Jason Wong
152200 by: dorgon
exec(), passthru()
152175 by: Mignon Hunter
152182 by: Jason Wong
header(); Issue
152176 by: SpyProductions Support Team
152179 by: Esteban Fernandez
152193 by: Mike At Spy
Re: Another hosting question....
152177 by: Guru Geek
152195 by: Paul Chvostek
Processing Form Data /w $_POST
152178 by: Kyle Babich
152180 by: Henning Sittler
152181 by: Bobby Patel
152183 by: Kyle Babich
152184 by: Bobby Patel
152188 by: Dan Joseph
152191 by: Bobby Patel
Version Independent Sessions?
152190 by: Lee Herron QCS
152196 by: dorgon
Re: picture help
152192 by: Edward Peloke
switch structure...
152201 by: Dan Joseph
152203 by: Chris Boget
152204 by: R'twick Niceorgaw
152205 by: Dan Joseph
152209 by: Chris Boget
exec() and passthru()
152202 by: Mignon Hunter
152211 by: Jason Wong
152215 by: Alberto Ferrer
152216 by: Mignon Hunter
152223 by: Jason Wong
error handling
152206 by: Mignon Hunter
152207 by: Jason Wong
152214 by: Mignon Hunter
152217 by: CPT John W. Holmes
file downloading
152208 by: Roberts, Mark (Tulsa)
152219 by: Bobby Patel
PHP header and odbc struggle with MS-SQL 2003...
152210 by: Scott Fletcher
Convert KB to MB?
152212 by: MIKE YRABEDRA
152213 by: Mike Migurski
152224 by: Brent Baisley
Re: two php installations
152218 by: Terje Torkelsen
PHP processing for .html files
152221 by: Joshua Chapman
Migrating pre-4.1 code to a post-4.1 server with register_globals on
152222 by: Johnson, Kirk
Month loop
152225 by: drparker
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:
No, that's what garbage colector is here for. Everytime you call
session_start(), there is session.gc_probability(from php.ini) %
probability the directory gets cleaned up.
Iván Díaz wrote:
> Hi everyone!
>
> I would like to know if I need to empty from time to time the directory
> where the session files are stored. I'm running windows nt4.0 and Apache.
>
> Thanks in advance.
>
>
>
attached mail follows:
Some delimiters chars don't work under windows.
Ex.:
"°[a-z]?°"
works on linux but on windows you get a warning:
Warning: Unknown modifier '?' in ........ on line xx
"/[a-z]?/"
works on both systems
So my question is: Are there similar problems in other functions or
circumstances where such chars pose a problem?
Thanks,
Armand
attached mail follows:
How do i generate a unique random number?
thanks
awlad
attached mail follows:
<?php
$sid = '';
mt_srand ((double) microtime() * 1000000);
$Puddle 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for($index
{
$sid .= substr($Puddle, (mt_rand()%(strlen($Puddle))), 1);
}
?>
That should work.
"Awlad Hussain" <php
sheridan-phoenix.com> wrote in message
news:004b01c3363f$5e745e30$0600a8c0
GATEWAY...
How do i generate a unique random number?
thanks
awlad
attached mail follows:
check the manual on the rand(); function ..
If you want to make sure this number is unique .. create an array storing
all the numbers you've used once and do some nice tricks with a loop and
stuff untill you get a nice unique random number ... like this:
<?php
$UsedValues = Array();
function GetRandomNumber() {
while( $Rand = round( rand(0, 1000000000000000) ) ) {
# Using round() to round the float returned by rand()
if (!in_array($Rand, $UsedValues)) return $Rand;
array_push($UsedValues, $Rand);
}
};
?>
-----Oorspronkelijk bericht-----
Van: Awlad Hussain [mailto:php
sheridan-phoenix.com]
Verzonden: donderdag 19 juni 2003 10:47
Aan: php-general
lists.php.net
Onderwerp: [PHP] unique random id
How do i generate a unique random number?
thanks
awlad
attached mail follows:
> How do i generate a unique random number?
You can use rand(), but there's no guarantee it'll be unique unless you
remember every number you've ever generated
---John Holmes...
attached mail follows:
On 19-Jun-2003 Awlad Hussain wrote:
> How do i generate a unique random number?
>
http://www.php.net/manual/en/function.uniqid.php
Regards,
--
Don Read dread
texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
I have an array that looks like this:
$i = 0;
$item[$i] = array( 'link' => 'http://...',
'image' => '/images/image.jpg',
'title' => 'some title',
'price' => '$14.00',
'cat' => 'Frames',
'author' => 'Pinochio',
'artist' => '',
'asin' => '010101',
'manufacturer' => 'Post'
); $i++;
$item[$i] = array( 'link' => 'http://...',
'image' => '/images/something.jpg',
'title' => 'this is fun',
'price' => '$2.99',
'cat' => 'Card',
'author' => 'Mickey',
'artist' => '',
'asin' => '1116221',
'manufacturer' => 'Kraft'
); $i++;
etc., etc.
I would like to sort $items based on the manufacturer of each array
within. So that, in the above example, the second one would come before
the first. Is there a way to do that?
--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
attached mail follows:
Use usort. This function should do the work:
function cmp ($a, $b) {
if ($a['manufacturer'] == $b['manufacturer']) return 0;
return ($a['manufacturer'] > $b['manufacturer']) ? -1 : 1;
}
Ashley M. Kirchner wrote:
>
> I have an array that looks like this:
>
> $i = 0;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/image.jpg',
> 'title' => 'some title',
> 'price' => '$14.00',
> 'cat' => 'Frames',
> 'author' => 'Pinochio',
> 'artist' => '',
> 'asin' => '010101',
> 'manufacturer' => 'Post'
> ); $i++;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/something.jpg',
> 'title' => 'this is fun',
> 'price' => '$2.99',
> 'cat' => 'Card',
> 'author' => 'Mickey',
> 'artist' => '',
> 'asin' => '1116221',
> 'manufacturer' => 'Kraft'
> ); $i++;
> etc., etc.
>
>
> I would like to sort $items based on the manufacturer of each array
> within. So that, in the above example, the second one would come before
> the first. Is there a way to do that?
>
attached mail follows:
I found this Great PHP Starter site check it out
http://www.htmlite.com/PHPintro.php
"Ashley M. Kirchner" <ashley
pcraft.com> wrote in message
news:3EF179E6.6030309
pcraft.com...
>
> I have an array that looks like this:
>
> $i = 0;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/image.jpg',
> 'title' => 'some title',
> 'price' => '$14.00',
> 'cat' => 'Frames',
> 'author' => 'Pinochio',
> 'artist' => '',
> 'asin' => '010101',
> 'manufacturer' => 'Post'
> ); $i++;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/something.jpg',
> 'title' => 'this is fun',
> 'price' => '$2.99',
> 'cat' => 'Card',
> 'author' => 'Mickey',
> 'artist' => '',
> 'asin' => '1116221',
> 'manufacturer' => 'Kraft'
> ); $i++;
> etc., etc.
>
>
> I would like to sort $items based on the manufacturer of each array
> within. So that, in the above example, the second one would come before
> the first. Is there a way to do that?
>
> --
> H| I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
>
>
attached mail follows:
Marek Kilimajer wrote:
> Use usort. This function should do the work:
Hey thanks! That worked like a charm, once I figured out that
making the comparison < instead of > I would get an ascending sort
instead of the descending one. Now, can I do multiple sorts? Like,
sort on "cat" first, "manufacturer" next, and "title last"? Here's the
array structure again:
$i = 0;
$item[$i] = array( 'link' => 'http://...',
'image' => '/images/image.jpg',
'title' => 'some title',
'price' => '$14.00',
'cat' => 'Frames',
'author' => 'Pinochio',
'artist' => '',
'asin' => '010101',
'manufacturer' => 'Post'
); $i++;
$item[$i] = array( 'link' => 'http://...',
'image' => '/images/something.jpg',
'title' => 'this is fun',
'price' => '$2.99',
'cat' => 'Card',
'author' => 'Mickey',
'artist' => '',
'asin' => '1116221',
'manufacturer' => 'Kraft'
); $i++;
...etc., etc.
--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
attached mail follows:
Yes, simply don't return 0 when the manufacturers are equal, but
continue with other checks:
function cmp ($a, $b) {
if ($a['cat'] == $b['cat']) {
// return 0; -- not anymore, but go on to compare manuf.
if ($a['manufacturer'] == $b['manufacturer']) {
if ($a['title'] == $b['title']) {
// even title is the same, return 0
return 0;
}
return ($a['title'] > $b['title']) ? -1 : 1;
}
return ($a['manufacturer'] > $b['manufacturer']) ? -1 : 1;
}
return ($a['cat'] > $b['cat']) ? -1 : 1;
}
Ashley M. Kirchner wrote:
> Marek Kilimajer wrote:
>
>> Use usort. This function should do the work:
>
>
> Hey thanks! That worked like a charm, once I figured out that making
> the comparison < instead of > I would get an ascending sort instead of
> the descending one. Now, can I do multiple sorts? Like, sort on "cat"
> first, "manufacturer" next, and "title last"? Here's the array
> structure again:
>
> $i = 0;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/image.jpg',
> 'title' => 'some title',
> 'price' => '$14.00',
> 'cat' => 'Frames',
> 'author' => 'Pinochio',
> 'artist' => '',
> 'asin' => '010101',
> 'manufacturer' => 'Post'
> ); $i++;
> $item[$i] = array( 'link' => 'http://...',
> 'image' => '/images/something.jpg',
> 'title' => 'this is fun',
> 'price' => '$2.99',
> 'cat' => 'Card',
> 'author' => 'Mickey',
> 'artist' => '',
> 'asin' => '1116221',
> 'manufacturer' => 'Kraft'
> ); $i++;
> ...etc., etc.
>
attached mail follows:
BTW, this is what I always receive when mailing you:
Final-Recipient: RFC822; ashley
pcraft.com
Action: failed
Status: 5.7.1
Remote-MTA: DNS; serpico.pcraft.com
Diagnostic-Code: SMTP; 554 5.7.1 Original message rejected due to high
SPAM score: 97.4
Last-Attempt-Date: Thu, 19 Jun 2003 11:36:23 +0200 (CEST)
attached mail follows:
Marek Kilimajer wrote:
> BTW, this is what I always receive when mailing you:
>
> Diagnostic-Code: SMTP; 554 5.7.1 Original message rejected due to high
> SPAM score: 97.4
Hrm, yes. Has to do with your .sk domain I'm sure. Bloody
automatic filters.
Thanks for the function, it works as expected. Now let me go kick
those filters...
--
H| I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
attached mail follows:
Hi All,
As I understand it Aspell / Pspell don't work under PHP on the WinXP
platform. Just wondering if anyone knows of an alternative that does
(for use with Apache server, if that's important)?
Much warmth,
Murray
http://www.planetthoughtful.org
Building a thoughtful planet,
one snide comment at a time...
* Worried that you might have missed something amazingly amazing on
PlanetThoughtful?
* Join the newsletter and you'll know for certain you haven't!
* http://www.planetthoughtful.org/html/ptnewsletter.php
attached mail follows:
> From: "Murray Wells" <planetthoughtful
bigpond.com>
>
> As I understand it Aspell / Pspell don't work under PHP on the WinXP
> platform. Just wondering if anyone knows of an alternative that does
> (for use with Apache server, if that's important)?
Not a PHP solution, but I can recommend the Java-based JSpell spell checker
if you've got Tomcat on Apache and you're OK with *absolutely no support*
installing. <http://www.jspell.com/>
--
Lowell Allen
attached mail follows:
Hi everyone,
How do I trap a PHP error and display my own error message instead?
I have two PHP scripts - one that creates tables on MSSQL and one that
deletes tables on MSSQL. I wish to capture the message that appears if
the user attempts to create tables that already exist, or delete ones
that do not exist.
Thanks in advance
Gary
attached mail follows:
> How do I trap a PHP error and display my own error message instead?
>
> I have two PHP scripts - one that creates tables on MSSQL and one that
> deletes tables on MSSQL. I wish to capture the message that appears if
> the user attempts to create tables that already exist, or delete ones
> that do not exist.
http://us2.php.net/manual/en/function.set-error-handler.php
---John Holmes...
attached mail follows:
Since it seems noone has an easy answer for this, I thought I'd give advise
to find it manually a little quicker.
How about moving half the images to another directory and check if the bad
jpeg is among the remaining half, then remove half of those, then half of
those, etc. You should be able to find it fairly quickly even though you
have thousands of pictures.
=)
"Hatem Ben" <reflex_news
yahoo.fr> wrote in message
news:001601c335da$14294ee0$9c64a8c0
a8j7w2...
Hey all,
I have one corrupted image in a list of thoughsand of images, and the
program stop with this message
Corrupt JPEG data: bad huffman code
Any idea to ignore this image and continue ? i cannot detect which image is
corrupted and imagecreatefromjpeg return true
thank you,
Hatem
attached mail follows:
Try to use output buffer. Turn buffering on, and after each
imagecreatefromjpeg() call check to see if there is some output waiting.
Hatem Ben wrote:
> Hey all,
>
> I have one corrupted image in a list of thoughsand of images, and the program stop with this message
>
> Corrupt JPEG data: bad huffman code
>
> Any idea to ignore this image and continue ? i cannot detect which image is corrupted and imagecreatefromjpeg return true
>
>
>
> thank you,
>
> Hatem
>
>
>
>
attached mail follows:
I would like to pass an image throught http://server/newman/ImageTEST/image.php
1. I need the headers (Assuming) <? header("Content-type: image/jpeg"); ?> would make the computer think its a image file.
2. load the image using fopen ("d://crushme//images//1.jpg", "r");
<?php
header("Content-type: image/jpeg");
fopen ("d://crushme//images//1.jpg", "r");
?>
The image "http://server/newman/ImageTEST/image.php" cannot be displayed, because it contains errors.
This returns this error (above)
Yes 1. Image is in the right location.
Yes 2. I'm stuck.
Any Suggestions would be very good.
/ Mark /
attached mail follows:
try this:
<?php
header("Content-type: image/jpeg");
fopen ("d:/crushme/images/1.jpg", "r");
?>
----- Original Message -----
From: "Mark Tehara" <me
philipsdomain.com>
To: "PHP" <php-general
lists.php.net>
Sent: Thursday, June 19, 2003 10:58 AM
Subject: [PHP] [Newman] Passing an image through a php file.
I would like to pass an image throught
http://server/newman/ImageTEST/image.php
1. I need the headers (Assuming) <? header("Content-type: image/jpeg"); ?>
would make the computer think its a image file.
2. load the image using fopen ("d://crushme//images//1.jpg", "r");
<?php
header("Content-type: image/jpeg");
fopen ("d://crushme//images//1.jpg", "r");
?>
The image "http://server/newman/ImageTEST/image.php" cannot be displayed,
because it contains errors.
This returns this error (above)
Yes 1. Image is in the right location.
Yes 2. I'm stuck.
Any Suggestions would be very good.
/ Mark /
attached mail follows:
> try this:
> <?php
>
> header("Content-type: image/jpeg");
> fopen ("d:/crushme/images/1.jpg", "r");
Just my opinion, but maybe you should try reading the file and echoing the
data instead of just opening it. :)
---John Holmes...
> I would like to pass an image throught
> http://server/newman/ImageTEST/image.php
>
> 1. I need the headers (Assuming) <? header("Content-type: image/jpeg");
?>
> would make the computer think its a image file.
> 2. load the image using fopen ("d://crushme//images//1.jpg", "r");
>
>
> <?php
>
> header("Content-type: image/jpeg");
> fopen ("d://crushme//images//1.jpg", "r");
>
> ?>
>
>
> The image "http://server/newman/ImageTEST/image.php" cannot be displayed,
> because it contains errors.
>
> This returns this error (above)
>
> Yes 1. Image is in the right location.
> Yes 2. I'm stuck.
>
> Any Suggestions would be very good.
attached mail follows:
ARGH!
I'm losing my marbles here! I'm developing a small CMS for IE, but IE is
teasing me! It insists on using its cached files instead of those I'm
working on. I've set the cache size to 0, "Check for newer versions of
stored pages:" to "Every visit to the page", and even put this at the top of
my PHP scripts:
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s", filemtime(
$_SERVER['SCRIPT_FILENAME'] ) ) . " GMT" );
It just keeps on using the cached files! WHY?!??! I'm in TEARS here!
Heeeeelp!!!
attached mail follows:
try something like this, not sure if this what you want....
create a random value like
$random = rand();
then attach it to the each page.. like
index.php?random=$random
good luck
----- Original Message -----
From: "Daniel" <php-newsgroups
rhesusb.com>
To: <php-general
lists.php.net>
Sent: Thursday, June 19, 2003 11:34 AM
Subject: [PHP] Help me compose myself... I'm about to kill Microsoft....
> ARGH!
>
> I'm losing my marbles here! I'm developing a small CMS for IE, but IE is
> teasing me! It insists on using its cached files instead of those I'm
> working on. I've set the cache size to 0, "Check for newer versions of
> stored pages:" to "Every visit to the page", and even put this at the top
of
> my PHP scripts:
>
> header( "Last-Modified: " . gmdate( "D, d M Y H:i:s", filemtime(
> $_SERVER['SCRIPT_FILENAME'] ) ) . " GMT" );
>
> It just keeps on using the cached files! WHY?!??! I'm in TEARS here!
> Heeeeelp!!!
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Thanks for the advice, but that would mean I'd have to change the way the
code works, and that would a bit much, I think... I was hoping for some
registry editing or a little utility or something...
But thanks =)
Daniel
"Awlad Hussain" <php
sheridan-phoenix.com> wrote in message
news:00c001c3364f$92df4d50$0600a8c0
GATEWAY...
> try something like this, not sure if this what you want....
> create a random value like
> $random = rand();
>
> then attach it to the each page.. like
>
> index.php?random=$random
>
> good luck
>
> ----- Original Message -----
> From: "Daniel" <php-newsgroups
rhesusb.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, June 19, 2003 11:34 AM
> Subject: [PHP] Help me compose myself... I'm about to kill Microsoft....
>
>
> > ARGH!
> >
> > I'm losing my marbles here! I'm developing a small CMS for IE, but IE is
> > teasing me! It insists on using its cached files instead of those I'm
> > working on. I've set the cache size to 0, "Check for newer versions of
> > stored pages:" to "Every visit to the page", and even put this at the
top
> of
> > my PHP scripts:
> >
> > header( "Last-Modified: " . gmdate( "D, d M Y H:i:s", filemtime(
> > $_SERVER['SCRIPT_FILENAME'] ) ) . " GMT" );
> >
> > It just keeps on using the cached files! WHY?!??! I'm in TEARS here!
> > Heeeeelp!!!
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
Okay, I think I'll have to kill myself...
I can't believe I am this stupid, but it turned out I was working on a copy
of the file, not the real one. D'OH!!!
Sorry, guys!
Daniel
"Daniel" <php-newsgroups
rhesusb.com> wrote in message
news:20030619104740.9524.qmail
pb1.pair.com...
> Thanks for the advice, but that would mean I'd have to change the way the
> code works, and that would a bit much, I think... I was hoping for some
> registry editing or a little utility or something...
>
> But thanks =)
>
> Daniel
>
>
> "Awlad Hussain" <php
sheridan-phoenix.com> wrote in message
> news:00c001c3364f$92df4d50$0600a8c0
GATEWAY...
> > try something like this, not sure if this what you want....
> > create a random value like
> > $random = rand();
> >
> > then attach it to the each page.. like
> >
> > index.php?random=$random
> >
> > good luck
> >
> > ----- Original Message -----
> > From: "Daniel" <php-newsgroups
rhesusb.com>
> > To: <php-general
lists.php.net>
> > Sent: Thursday, June 19, 2003 11:34 AM
> > Subject: [PHP] Help me compose myself... I'm about to kill Microsoft....
> >
> >
> > > ARGH!
> > >
> > > I'm losing my marbles here! I'm developing a small CMS for IE, but IE
is
> > > teasing me! It insists on using its cached files instead of those I'm
> > > working on. I've set the cache size to 0, "Check for newer versions of
> > > stored pages:" to "Every visit to the page", and even put this at the
> top
> > of
> > > my PHP scripts:
> > >
> > > header( "Last-Modified: " . gmdate( "D, d M Y H:i:s", filemtime(
> > > $_SERVER['SCRIPT_FILENAME'] ) ) . " GMT" );
> > >
> > > It just keeps on using the cached files! WHY?!??! I'm in TEARS here!
> > > Heeeeelp!!!
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
attached mail follows:
$amount is a calculated number
If $amount equals for example 52., how do I get that to print as "52.00"
similarly, if amount = 52.5 how do I get that to print as "52.50"
Thanks!
(looked at all sort of type casting manual stuff to no avail)
attached mail follows:
Hi Roy,
> If $amount equals for example 52., how do I get
> that to print as "52.00" similarly, if amount =
> 52.5 how do I get that to print as "52.50"
Have a look at the number_format() function, it should do what you want.
It'll also add commas to break up any thousands in your number (you can
bypass that if you like).
Cheers
Jon
attached mail follows:
This is really a formatting issue, not type casting, so loook in those areas of
the manual. Perhaps start around:
http://us2.php.net/manual/en/function.printf.php
-Brad
> $amount is a calculated number
>
> If $amount equals for example 52., how do I get that to print as "52.00"
> similarly, if amount = 52.5 how do I get that to print as "52.50"
>
> Thanks!
> (looked at all sort of type casting manual stuff to no avail)
>
attached mail follows:
try
$formatted = number_format($amount,2);
----- Original Message -----
From: "Roy W" <php
wiegmann.net>
To: <php-general
lists.php.net>
Sent: Thursday, June 19, 2003 12:41 PM
Subject: [PHP] typecasting .. easy?
> $amount is a calculated number
>
> If $amount equals for example 52., how do I get that to print as "52.00"
> similarly, if amount = 52.5 how do I get that to print as "52.50"
>
> Thanks!
> (looked at all sort of type casting manual stuff to no avail)
>
attached mail follows:
Hi folks,
International PHP Conference 2003 is coming! From 11/02 to 11/05
Frankfurt/Main, Germany, will be the hot-spot of the PHP world
where another issue of the traditional PHP Conference will take
place.
We're now calling for papers and contributions to this unique
event. Whether you're running a quite interesting PHP business
or have something to say about the last technical things regarding
PHP5, just come up and submit your paper.
You can find the Call for Papers at
< http://www.phpconference.de/2003/cfp_en.php >
If you have any questions regarding the programme, just mail to
chair03
phpconference.de. Questions regarding marketing activities
or organisational issues should go to orga03
phpconference.de
-*-
PHP Open Source Exhibition
As you might know, there's always been a commercial exhibiton
place at the International PHP Conference 2003. This time we also
invite every PHP OpenSource project to present themselves at the
exhibition of the International PHP Conference *for free*. For
example, at the Amsterdam's Intl PHP Conference spring edition
this year projects like PEAR, Weaverslave or SQLite used the chance
to broaden their audience at this unique event.
If you want to join us, just write an e-mail to Frank Stepan at
fstepan
entwickler.com
With regards,
Björn Schotte (Conference chair)
attached mail follows:
is_float()
Mike
"Todd Cary" <todd
aristesoftware.com> wrote in message news:3EF0D3D0.5020304
aristesoftware.com...
What is the best way to validate a "money" input? For example, 3452.67 versus 3452..67.
Todd
--
attached mail follows:
Following select statement works OK on Localhost, OK within Dreamweaver
test, OK on phpmyadmin on site, BUT NOT OK on webpage.
It's the IF part where it states if(m.matchtypeid < 3, etc....
Here on the webpage itself it shows the 'in-/uitschrijven' or 'gesloten'
bit on those lines where it shouldn't , and just can't figure out why,
they do not show when testing with sqlyog on local pc, within
dreamweaver mx test module, withing phpmyadmin on site. STRANGE
STRANGE!!!
Any brains around who can help me please!
Thanks,
Martin
SELECT distinct m.id, m.naam,
left(m.startingtime,5) as starttijd ,
if(isqualifying,'Ja','') as Q,
date_format(playingdate,'%d-%m') as datumpje,
mt.naam as soort,
if(playingdate < FROM_DAYS( TO_DAYS( NOW( )) + 21),
if(m.matchtypeid < 3
,
if(playingdate > FROM_DAYS( TO_DAYS( NOW( )) + 9)
,
'in-/uitschrijven'
,
'Gesloten'
)
,
''
)
,
''
)as inschrijven,
if(f.matchid = m.id, 'Startlijst',
if(wi.zoekcode='$details[1]','Ingeschreven',
date_format(if(playingdate < FROM_DAYS( TO_DAYS( NOW( )) + 9),
'',
FROM_DAYS( TO_DAYS( playingdate ) -21)),'%d-%m'))) as enu
FROM match1 as m
left outer join matchtype mt on mt.id = m.matchtypeid
left outer join flight f on f.matchid = m.id
left outer join wedstrijdinschrijvingen wi on wi.matchid = m.id
and wi.zoekcode='$details[1]'
WHERE playingdate > ( NOW( )- 3 )
ORDER BY playingdate
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=mysql
freebsd.csie.nctu.edu.tw
attached mail follows:
> setting up some pages to allow users to log in, and store their userID in
a
> session var.
> for development purposes, i've installed AMP on my windows box.
>
> -everything parses fine
> -register globals is on.
>
> problem: session vars do not seem to be carrying over pages, even when i
set
> the session_id to initial value.
>
> i start the session and save the variable:
>
> session_start();
>
> $PHPSESSID=session_id();
>
> $_SESSION['userID'] = $userID; //i've checked and $userID DOES contain a
> value: 1
> //If i echo $_SESSION['userID']; then it prints 1.
>
>
> header("Location: nextpage.php?PHPSESSID=$PHPSESSID");
>
> exit;
>
>
> on nextpage.php:
>
> session_start();
>
> session_id($PHPSESSID);
Please note the second sentence in this direct quote from the manual:
If id is specified, it will replace the current session id. session_id()
needs to be called before session_start() for that purpose. Depending on the
session handler, not all characters are allowed within the session id. For
example, the file session handler only allows characters in the range a-z,
A-Z and 0-9!
Thank you.
---John Holmes...
attached mail follows:
Hello everyone,
Apache 2.0.40
PHP 4.2.2
Linux
I have a single php script for downloading requested files. It works
beautifully on http over port 80. It does NOT work at all over https on
port 443. I am using the exact same script (the very same file) for both
http and https connections. Apache has the +StdEnvVars enabled for all
files and dirs under the https site. Forms and cookies are working
normally, as are redirect headers. But for some reason, the headers for
file downlaods are not working at all over ssl.
I am really only testing this with IE 6 right now.
What am I missing? What else can I check for?
---- d.php ----
function d() {
$fsp = '/mydir/myfile.exe';
$mimetype='application/octect-stream'; $encoding='binary';
//echo basename($fsp).filesize($fsp); return;
//header('Location: https://my.site.com/');
header('Content-Type: '.$mimetype);
header('Content-Length: '.filesize($fsp));
header('Content-Disposition: attachment;
filename="'.basename($fsp).'"');
header('Content-Transfer-Encoding: '.$encoding);
readfile($fsp);
return;
} // end d()
d();
---- d.php ----
I call this only after a user clicks a link on a second page. Uncommenting
the line starting with echo out puts the expected basename and filesize.
Uncommenting the line starting with header successfully redirects to the
correct url. Leaving both the above lines commented, the user is prompted
with a open / save dialog but the filename showing is now the script name,
the filesize is missing, and clicking open or save shows a file tansfer
window that does nothing.
I have also tried testing this script with curl on linux. Here's the
output. I noticed the Content-Length header is missing!
---- curl output ----
[user
server]# curl https://my.site.com/d.php --head
HTTP/1.1 200 OK
Date: Wed, 18 Jun 2003 18:45:24 GMT
Server: Apache/2.0.40 (Red Hat Linux)
Accept-Ranges: bytes
X-Powered-By: PHP/4.2.2
Set-Cookie: PHPSESSID=ca805f9f0318a53e72abacf6db8fa677; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-Disposition: attachment; filename="myfile.exe"
Content-Transfer-Encoding: binary
Connection: close
Content-Type: application/octect-stream
---- curl output ----
What's going on here? Thanks in advance for any help you can offer!!
Henning Sittler
www.inscriber.com
attached mail follows:
> Apache 2.0.40
> PHP 4.2.2
> Linux
>
> I have a single php script for downloading requested files. It works
> beautifully on http over port 80. It does NOT work at all over https on
> port 443. I am using the exact same script (the very same file) for both
> http and https connections. Apache has the +StdEnvVars enabled for all
> files and dirs under the https site. Forms and cookies are working
> normally, as are redirect headers. But for some reason, the headers for
> file downlaods are not working at all over ssl.
>
> I am really only testing this with IE 6 right now.
Read here:
http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=session.cache_limiter+https&q=b
---John Holmes...
attached mail follows:
Beautiful, that worked immediately! Thanks for your very quick and super
helpful reply, John.
The solution is to change the session.cache_limiter to none in php.ini.
Henning Sittler
www.inscriber.com
-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000
charter.net]
Sent: Thursday, June 19, 2003 9:39 AM
To: Henning Sittler; php-general
lists.php.net
Subject: Re: [PHP] php https file download
> Apache 2.0.40
> PHP 4.2.2
> Linux
>
> I have a single php script for downloading requested files. It works
> beautifully on http over port 80. It does NOT work at all over https on
> port 443.
Read here:
http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=session.cache_limiter+
https&q=b
---John Holmes...
attached mail follows:
Hello everyone,
Can anyone tell me what is wrong with my PHP script? I am trying to add
information to an MSSQL database from a separate HTM file. The script it
as follows:
<?php
$myEmployeeName=$_GET['name'];
$myEmployeeDept=$_GET['department'];
$myEmployeeNotes=$_GET['notes'];
$myEmployeeCTP=$_GET['ctp_op'];
$myServer = "192.92.0.248";
$myUser = "repro";
$myPass = "repro";
$myDB = "repro";
error_reporting(E_ALL);
print ("<p class=\"text\"><b>Attempting To Connect To MSSQL -
</b><br><br>");
$s =
mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't Connect To SQL Server On $myServer<br>");
print ("<u>Stage 2</u><br>");
$d =
mssql_select_db($myDB, $s)
or die("Couldn't Open Database $myDB<br>");
#this is the create bit
print ("Connected - Attempting To Create Employee...<br>");
if ($mYEmployeeCTP == "on") {
$query = "INSERT INTO users (name, department, notes, ctp_op)
VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'Y')";
$result = mssql_query($query)
or die("Creating Employee Failed");
} else {
$query = "INSERT INTO users (name, department, notes, ctp_op)
VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'N')";
$result = mssql_query($query)
or die("Creating Employee Failed");
}
print ("Employee Added To Database<br><br>");
print ("<a href=\"index.htm\" class=\"link\">Go back to index</a></p>");
?>
Thanks in advance
attached mail follows:
> Can anyone tell me what is wrong with my PHP script? I am trying to add
> information to an MSSQL database from a separate HTM file. The script it
> as follows:
How about you tell us what the problem is? What is the result of this
script? What are you expecting the result to be? Take away the
symbols so
you'll see errors if there are any. Add some debugging to track the progress
through the script....
---John Holmes...
> <?php
>
> $myEmployeeName=$_GET['name'];
> $myEmployeeDept=$_GET['department'];
> $myEmployeeNotes=$_GET['notes'];
> $myEmployeeCTP=$_GET['ctp_op'];
>
> $myServer = "192.92.0.248";
> $myUser = "repro";
> $myPass = "repro";
> $myDB = "repro";
>
> error_reporting(E_ALL);
>
> print ("<p class=\"text\"><b>Attempting To Connect To MSSQL -
> </b><br><br>");
>
> $s =
mssql_connect($myServer, $myUser, $myPass)
> or die("Couldn't Connect To SQL Server On $myServer<br>");
>
> print ("<u>Stage 2</u><br>");
>
> $d =
mssql_select_db($myDB, $s)
> or die("Couldn't Open Database $myDB<br>");
>
> #this is the create bit
> print ("Connected - Attempting To Create Employee...<br>");
>
> if ($mYEmployeeCTP == "on") {
> $query = "INSERT INTO users (name, department, notes, ctp_op)
> VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'Y')";
>
> $result = mssql_query($query)
> or die("Creating Employee Failed");
>
> } else {
>
> $query = "INSERT INTO users (name, department, notes, ctp_op)
> VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes', 'N')";
>
> $result = mssql_query($query)
> or die("Creating Employee Failed");
>
> }
>
> print ("Employee Added To Database<br><br>");
>
> print ("<a href=\"index.htm\" class=\"link\">Go back to index</a></p>");
>
> ?>
attached mail follows:
I don't know what the problem is. I have used this script before with
MSSQL with no problems - only this morning in fact. I am VERY new to PHP
so I am still trying to get the hang on it.
-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000
charter.net]
Sent: 19 June 2003 15:07
To: Gary Ogilvie; php-general
lists.php.net
Subject: Re: [PHP] Empty Page problems
> Can anyone tell me what is wrong with my PHP script? I am trying to
add
> information to an MSSQL database from a separate HTM file. The script
it
> as follows:
How about you tell us what the problem is? What is the result of this
script? What are you expecting the result to be? Take away the
symbols
so
you'll see errors if there are any. Add some debugging to track the
progress
through the script....
---John Holmes...
> <?php
>
> $myEmployeeName=$_GET['name'];
> $myEmployeeDept=$_GET['department'];
> $myEmployeeNotes=$_GET['notes'];
> $myEmployeeCTP=$_GET['ctp_op'];
>
> $myServer = "192.92.0.248";
> $myUser = "repro";
> $myPass = "repro";
> $myDB = "repro";
>
> error_reporting(E_ALL);
>
> print ("<p class=\"text\"><b>Attempting To Connect To MSSQL -
> </b><br><br>");
>
> $s =
mssql_connect($myServer, $myUser, $myPass)
> or die("Couldn't Connect To SQL Server On $myServer<br>");
>
> print ("<u>Stage 2</u><br>");
>
> $d =
mssql_select_db($myDB, $s)
> or die("Couldn't Open Database $myDB<br>");
>
> #this is the create bit
> print ("Connected - Attempting To Create Employee...<br>");
>
> if ($mYEmployeeCTP == "on") {
> $query = "INSERT INTO users (name, department, notes, ctp_op)
> VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes',
'Y')";
>
> $result = mssql_query($query)
> or die("Creating Employee Failed");
>
> } else {
>
> $query = "INSERT INTO users (name, department, notes, ctp_op)
> VALUES ('$myEmployeeName', '$myEmployeeDept', '$myEmployeeNotes',
'N')";
>
> $result = mssql_query($query)
> or die("Creating Employee Failed");
>
> }
>
> print ("Employee Added To Database<br><br>");
>
> print ("<a href=\"index.htm\" class=\"link\">Go back to
index</a></p>");
>
> ?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi Other PHP Users,
i am trying to send mail from a script, but i receive these error message:
Warning: mail() [function.mail]: Failed to connect to mailserver at
"localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
or use ini_set() in c:\apacheserver\apache\htdocs\work-net\serial.php on
line 295
I have PHP + Apache + MySql and work in "localhost" on a win98 machine. how
can i set it?
Thank you in advance,
Giuliano
attached mail follows:
> i am trying to send mail from a script, but i receive these error message:
>
> Warning: mail() [function.mail]: Failed to connect to mailserver at
> "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
> or use ini_set() in c:\apacheserver\apache\htdocs\work-net\serial.php on
> line 295
>
> I have PHP + Apache + MySql and work in "localhost" on a win98 machine.
how
> can i set it?
Have you tried doing what the error message suggests? Setting the SMTP value
in php.ini or through ini_set()? I assume you're coming through some ISP and
do not have your own SMTP server running, so you'd set the SMTP settting in
php.ini to the SMTP server of your ISP.
---John Holmes...
attached mail follows:
Hi,
I need to use function imagecreatetruecolor() in my script but it
doesn't work on my local apache+php+mysql on XP server. It works fine
on the real server though but i need to play with it around. What do
I need to do to get it work? from docs I understand I need gd 2.0.1
or higher, well how to get it and how to install?
Thank you,
Yury
<>< <>< <>< <>< God is our provider ><> ><> ><> ><>
http://www.body-builders.org/
attached mail follows:
"Yury B ." <www
body-builders.org> wrote in message
news:3EF1E266.13844.6CDFD85
localhost...
> Hi,
> I need to use function imagecreatetruecolor() in my script but it
> doesn't work on my local apache+php+mysql on XP server. It works fine
> on the real server though but i need to play with it around. What do
> I need to do to get it work? from docs I understand I need gd 2.0.1
> or higher, well how to get it and how to install?
>
> Thank you,
>
> Yury
The gd library is shipped with the PHP distribution, so you should simply
upgrade to version 4.3.1 or 4.3.2.
You must download the big zip distribution, as it has all the needed
libraries.
Follow the instructions in the install readme file and you should have no
problems.
Andrei BEJENARU
attached mail follows:
Hi,
Since I don't want to continue with Smarty I started with an own
(little) template engine. In this first try it should only replace
{for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs
INTEGER times.
This mission was sent to the function "loop" in this file:
http://www.offucia.org/pages/template-engine/source.php?file=engine.php
In this file I try to work with it
http://www.offucia.org/pages/template-engine/source.php?file=test.php
But the file loop() cannot be found and theres this mistake error:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
'$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26
Line 26 is this one:
$template = preg_replace("!{for loops=(.*)} (.*)
{/for}!U",code($1,$2),$template);
Many thx 4 help
Niels Uhlendorf
attached mail follows:
You must use
$template = preg_replace("!{for loops=(.*)}(.*){/for}!U", code('\\1','\\2'),
$template);
since the references are of the form \\n
Andrei BEJENARU
"Niels Uhlendorf" <yushu
offucia.org> wrote in message
news:20030619142149.72856.qmail
pb1.pair.com...
> Hi,
>
> Since I don't want to continue with Smarty I started with an own
> (little) template engine. In this first try it should only replace
> {for loops=INTEGER} ... {/for} through a trivial FOR-loop which runs
> INTEGER times.
>
> This mission was sent to the function "loop" in this file:
> http://www.offucia.org/pages/template-engine/source.php?file=engine.php
>
> In this file I try to work with it
> http://www.offucia.org/pages/template-engine/source.php?file=test.php
>
> But the file loop() cannot be found and theres this mistake error:
> Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or
> '$' in /www/htdocs/v035923/pages/template-engine/engine.php on line 26
>
> Line 26 is this one:
> $template = preg_replace("!{for loops=(.*)} (.*)
> {/for}!U",code($1,$2),$template);
>
>
>
> Many thx 4 help
> Niels Uhlendorf
>
attached mail follows:
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
attached mail follows:
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
attached mail follows:
[snip]
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
[/snip]
Because there is not enough memory to allocate to?
Jay
attached mail follows:
This is the result of free
[root
mail webmin]# free
total used free shared buffers cached
Mem: 513936 444256 69680 0 157168 135476
-/+ buffers/cache: 151612 362324
Swap: 779104 0 779104
I think that memory is enough, or not ?
"Jay Blanchard" <jay.blanchard
niicommunications.com> ha scritto nel
messaggio news:C8F323573C030A448F3E5A2B6FE2070B0101F831
nemesis...
[snip]
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
[/snip]
Because there is not enough memory to allocate to?
Jay
attached mail follows:
Tony Arcucci wrote:
>Why this error ( Linux Redhat 8.0, PHP 4.2.2):
>
> Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
>allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
>
> Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
>allocate 131 bytes) in Unknown on line 0
>
>In PHP.INI memory_limit id 60M.
>
>
>
>
>
>
I've had this error caused by PHPA before. Are you using it?
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
attached mail follows:
Tony,
It might be that somewhere in your code there is a loop or while structure that has an error. This is running endlessly until you run out of memory which is when you see the error message.
Check the structures within the code to ensure that they are correct.
HTH,
Michael Egan
-----Original Message-----
From: Tony Arcucci [mailto:tarcucci
apsnet.it]
Sent: 19 June 2003 15:33
To: php-general
lists.php.net
Subject: [PHP] Why Fatal Error ?[Scanned]
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Michael,
this is the line:
array_push($ret, $tmp[0]);
But is very strange, till yesterday phpadmin ( a software for xmail server)
worked fine, not reboot or other was done.
After the error, I changed memory_limit from 8 to 60 to resolve, but with 8M
yesterday worked fine.
Sorry for my english and thank you in advance.
"Michael Egan" <MEgan
3tc.org.uk> ha scritto nel messaggio
news:9926D602EE82FB4FB203E442253043C41F1A2D
snip-exch.snipdom.co.uk...
Tony,
It might be that somewhere in your code there is a loop or while structure
that has an error. This is running endlessly until you run out of memory
which is when you see the error message.
Check the structures within the code to ensure that they are correct.
HTH,
Michael Egan
-----Original Message-----
From: Tony Arcucci [mailto:tarcucci
apsnet.it]
Sent: 19 June 2003 15:33
To: php-general
lists.php.net
Subject: [PHP] Why Fatal Error ?[Scanned]
Why this error ( Linux Redhat 8.0, PHP 4.2.2):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
I just got a warning message on a system using php version 4.3.1:
<snip>
Warning: Call-time pass-by-reference has been deprecated - argument
passed by value; If you would like to pass it by reference, modify the
declaration of [runtime function name](). If you would like to enable
call-time pass-by-reference, you can set allow_call_time_pass_reference
to true in your INI file. However, future versions may not support this
any longer.
</snip>
This msg does not appear on my machine running php 4.3.2. Maybe it's
because of the different configuration?
Will the pass-by-reference feature really be dropped?! Many software
design patterns wouldn't be possible anymore! It's an essential feature.
The config of the system throwing the warning is:
'./configure' '--with-mysql=/usr/local/mysql/'
'--with-apache=../apache_1.3.27/' '--enable-track-vars'
'--with-config-file-path=/etc/' '--with-imap=/usr/local/imap-2001a'
'--with-gettext' '--with-exec-dir=/usr/local/typo3sh/bin'
'--with-gd=/usr/local/typo3sh' '--with-jpeg-dir' '--with-png-dir'
'--with-tiff-dir' '--with-ttf=/usr/local/typo3sh' '--with-zlib=yes'
'--enable-gd-nativ-ttf' '--enable-ftp' '--with-xml'
/dorgon
attached mail follows:
On Thursday 19 June 2003 23:53, dorgon wrote:
> I just got a warning message on a system using php version 4.3.1:
>
> <snip>
> Warning: Call-time pass-by-reference has been deprecated - argument
> passed by value; If you would like to pass it by reference, modify the
> declaration of [runtime function name](). If you would like to enable
> call-time pass-by-reference, you can set allow_call_time_pass_reference
> to true in your INI file. However, future versions may not support this
> any longer.
> </snip>
>
> This msg does not appear on my machine running php 4.3.2. Maybe it's
> because of the different configuration?
Maybe, there's a setting for this in php.ini.
> Will the pass-by-reference feature really be dropped?! Many software
> design patterns wouldn't be possible anymore! It's an essential feature.
"pass-by-reference" has not been dropped, it is "Call-time pass-by-reference"
which is being deprecated.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
GIVE: Support the helpless victims of computer error.
*/
attached mail follows:
"Dorgon" <dorgon
users.sf.net> wrote in message
news:20030619155405.52922.qmail
pb1.pair.com...
> Will the pass-by-reference feature really be dropped?! Many software
> design patterns wouldn't be possible anymore! It's an essential feature.
I think call-pass-by-reference is going away, but pass-by-reference is going
to be default in PHP5.
rush
--
http://www.templatetamer.com/
attached mail follows:
> Maybe, there's a setting for this in php.ini.
yes. there is:
>>declaration of [runtime function name](). If you would like to enable
>>call-time pass-by-reference, you can set
>>allow_call_time_pass_reference to true in your INI file.
> "pass-by-reference" has not been dropped, it is "Call-time pass-by-reference"
> which is being deprecated.
so call-time pass-by-reference is giving parameters as reference to
functions, e.g.
function returnObjectToAccumulator(&$obj) {...}
If this feature is really dropped, how would you implement
ConnectionPools for DB-connections for instance, or any classes
managing a set of object and providing them by returning references?
many OOP design patterns (primarily adopted from java) would not be
possible anymore. I think this would be worth talking about.
Is there any plausible reason for that decision?
/dorgon
attached mail follows:
whats the difference?
call-time-pass... is function callMe(&$obj) {...}
and pass-by-ref is "return &$obj" ?
I'm not sure if I got you.
tx
dorgon
Rush wrote:
> "Dorgon" <dorgon
users.sf.net> wrote in message
> news:20030619155405.52922.qmail
pb1.pair.com...
>
>>Will the pass-by-reference feature really be dropped?! Many software
>>design patterns wouldn't be possible anymore! It's an essential feature.
>
>
> I think call-pass-by-reference is going away, but pass-by-reference is going
> to be default in PHP5.
>
> rush
> --
> http://www.templatetamer.com/
>
>
>
attached mail follows:
Isn't Call-time pass-by-reference the following
$variable = myFunction1(&$x); Where
myFunction1() is defined as function myFunction1($x)
Where as pass-be-reference is called as
$variable = myFunction2($x); Where is defined as function myFunction2
(&$Obj);
I think the latter is better anyways, because the caller shouldn't know the
internals of the function, so you don't know if the function will copy the
argument and use that instead.
"Dorgon" <dorgon
users.sf.net> wrote in message
news:20030619171207.28015.qmail
pb1.pair.com...
> > Maybe, there's a setting for this in php.ini.
>
> yes. there is:
> >>declaration of [runtime function name](). If you would like to enable
> >>call-time pass-by-reference, you can set
> >>allow_call_time_pass_reference to true in your INI file.
>
> > "pass-by-reference" has not been dropped, it is "Call-time
pass-by-reference"
> > which is being deprecated.
>
> so call-time pass-by-reference is giving parameters as reference to
> functions, e.g.
>
> function returnObjectToAccumulator(&$obj) {...}
>
> If this feature is really dropped, how would you implement
> ConnectionPools for DB-connections for instance, or any classes
> managing a set of object and providing them by returning references?
>
> many OOP design patterns (primarily adopted from java) would not be
> possible anymore. I think this would be worth talking about.
>
> Is there any plausible reason for that decision?
>
> /dorgon
>
attached mail follows:
I think you are absolutely right.
thanx!
I'll fix it and see if the warning still remains.
/Dorgon
Bobby Patel wrote:
> Isn't Call-time pass-by-reference the following
>
> $variable = myFunction1(&$x); Where
> myFunction1() is defined as function myFunction1($x)
>
> Where as pass-be-reference is called as
> $variable = myFunction2($x); Where is defined as function myFunction2
> (&$Obj);
>
> I think the latter is better anyways, because the caller shouldn't know the
> internals of the function, so you don't know if the function will copy the
> argument and use that instead.
>
> "Dorgon" <dorgon
users.sf.net> wrote in message
> news:20030619171207.28015.qmail
pb1.pair.com...
>
>>>Maybe, there's a setting for this in php.ini.
>>
>>yes. there is:
>> >>declaration of [runtime function name](). If you would like to enable
>> >>call-time pass-by-reference, you can set
>> >>allow_call_time_pass_reference to true in your INI file.
>>
>>
>>>"pass-by-reference" has not been dropped, it is "Call-time
>>
> pass-by-reference"
>
>>>which is being deprecated.
>>
>>so call-time pass-by-reference is giving parameters as reference to
>>functions, e.g.
>>
>>function returnObjectToAccumulator(&$obj) {...}
>>
>>If this feature is really dropped, how would you implement
>>ConnectionPools for DB-connections for instance, or any classes
>>managing a set of object and providing them by returning references?
>>
>>many OOP design patterns (primarily adopted from java) would not be
>>possible anymore. I think this would be worth talking about.
>>
>>Is there any plausible reason for that decision?
>>
>>/dorgon
>>
>
>
>
attached mail follows:
On Friday 20 June 2003 01:11, dorgon wrote:
> > Maybe, there's a setting for this in php.ini.
>
> yes. there is:
Yes, I know there is ;-) The 'maybe' is maybe you have it set different on the
two systems.
> >>declaration of [runtime function name](). If you would like to enable
> >>call-time pass-by-reference, you can set
> >>allow_call_time_pass_reference to true in your INI file.
> >
> > "pass-by-reference" has not been dropped, it is "Call-time
> > pass-by-reference" which is being deprecated.
>
> so call-time pass-by-reference is giving parameters as reference to
> functions, e.g.
>
> function returnObjectToAccumulator(&$obj) {...}
>
> If this feature is really dropped, how would you implement
> ConnectionPools for DB-connections for instance, or any classes
> managing a set of object and providing them by returning references?
>
> many OOP design patterns (primarily adopted from java) would not be
> possible anymore. I think this would be worth talking about.
>
> Is there any plausible reason for that decision?
"Call-time pass-by-reference"
=============================
function doo($i_may_or_may_not_be_a_reference) {
$i_may_or_may_not_be_a_reference++;
}
$i = 1;
doo($i);
echo $i; // 1
doo(&$i);
echo $i; // 2
// here doo() is not defined to have parameters passed by reference. The
decision on whether to pass by reference is made at run-time, hence call-time
pass-by-reference. It is this behaviour which is being deprecated.
So in the newer versions of PHP if call-time pass-by-reference is disabled and
you wish to pass parameters by reference you'll have to define your functions
accordingly:
function doo(&$i_am_passed_by_reference) { ... }
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Federal grants are offered for... research into the recreation
potential of interplanetary space travel for the culturally disadvantaged.
*/
attached mail follows:
Thanks for the explanation.
Yes, let us drop call-time pass-by-reference!! I'm with you. ;-)
/dorgon
Jason Wong wrote:
> On Friday 20 June 2003 01:11, dorgon wrote:
>
>>>Maybe, there's a setting for this in php.ini.
>>
>>yes. there is:
>
>
> Yes, I know there is ;-) The 'maybe' is maybe you have it set different on the
> two systems.
>
>
>> >>declaration of [runtime function name](). If you would like to enable
>> >>call-time pass-by-reference, you can set
>> >>allow_call_time_pass_reference to true in your INI file.
>>
>>>"pass-by-reference" has not been dropped, it is "Call-time
>>>pass-by-reference" which is being deprecated.
>>
>>so call-time pass-by-reference is giving parameters as reference to
>>functions, e.g.
>>
>>function returnObjectToAccumulator(&$obj) {...}
>>
>>If this feature is really dropped, how would you implement
>>ConnectionPools for DB-connections for instance, or any classes
>>managing a set of object and providing them by returning references?
>>
>>many OOP design patterns (primarily adopted from java) would not be
>>possible anymore. I think this would be worth talking about.
>>
>>Is there any plausible reason for that decision?
>
>
> "Call-time pass-by-reference"
> =============================
> function doo($i_may_or_may_not_be_a_reference) {
> $i_may_or_may_not_be_a_reference++;
> }
>
> $i = 1;
> doo($i);
> echo $i; // 1
> doo(&$i);
> echo $i; // 2
>
> // here doo() is not defined to have parameters passed by reference. The
> decision on whether to pass by reference is made at run-time, hence call-time
> pass-by-reference. It is this behaviour which is being deprecated.
>
> So in the newer versions of PHP if call-time pass-by-reference is disabled and
> you wish to pass parameters by reference you'll have to define your functions
> accordingly:
>
> function doo(&$i_am_passed_by_reference) { ... }
>
attached mail follows:
hello all,
I am trying to use either of the functions above to execute a compiled c
program on linux. The command line works with ./a.out (a.out being the
filename). Both my test.php and the exe are in the same directory.
I've tried combinations of all the following. Thx Mignon
<?
error_reporting (E_ALL);
error_reporting (E_ERROR | E_WARNING | E_PARSE);
echo "Here it comes:";
$var1 = exec(a.out);
echo $var1;//produces:Here it comes:
//tried "a.out"'a.out'"./a.out"'./a.out'
//./a.out
*******************************************
$var = passthru(a.out, $ret);
echo $var;//produces:(nothing)
echo $ret;//produces: 127
**********************************
$var2 = system(a.out);
echo $var2; //produces:(nothing)
******************************
$var6 = "./a.out";
$var7 = exec($var6, $var_array[], $ret_var);
echo $var7;//produces:(nothing)
echo $var_array[];//produces:Array
echo $ret_var;//produces:127
echo $var6;//produces:(nothing)
*******************************************
$var3 = exec('./a.out', $var_array[], $ret_var);
echo $var3;//produces:Here it comes
attached mail follows:
On Friday 20 June 2003 00:11, Mignon Hunter wrote:
> I am trying to use either of the functions above to execute a compiled c
> program on linux. The command line works with ./a.out (a.out being the
> filename). Both my test.php and the exe are in the same directory.
> I've tried combinations of all the following. Thx Mignon
What exactly do you want to do? exec() & passthru() have different uses. Do
you want to capture the output of the program? The exit value? Or what?
When running external programs from PHP I find that it helps to specify the
full path to the program. And you have made sure that you have the right
permissions to execute said program?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Valerie: Aww, Tom, you're going maudlin on me ...
Tom: I reserve the right to wax maudlin as I wane eloquent ...
-- Tom Chapin
*/
attached mail follows:
I have this in a script:
header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");
It works fine elsewhere in the script without the variables. Does anyone
know if php 4.06 has issues with this? Or am I making a boneheaded mistake
here?
$Relative is from an include, and outputs fine. :)
Thanks!
:)
-Mike
attached mail follows:
Try
header("Location: ".$Relative."/outstanding.php?pdd=1&pddid=".$poid."");
EF.
"Spyproductions Support Team" <support
spyproductions.com> escribió en el
mensaje news:GKEFLEHIPEGIFEECKBNEEEPCLGAA.support
spyproductions.com...
>
> I have this in a script:
>
> header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");
>
> It works fine elsewhere in the script without the variables. Does anyone
> know if php 4.06 has issues with this? Or am I making a boneheaded
mistake
> here?
>
> $Relative is from an include, and outputs fine. :)
>
> Thanks!
>
> :)
>
> -Mike
>
>
attached mail follows:
I'll give one of the suggestions a whirl (or both). I do have this same
sort of thing on a different server with a more recent version of PHP -
which is why I thought it might be a version issue. :)
-Mike
> -----Original Message-----
> From: Esteban Fernandez [mailto:efernandez
tecsol.cl]
> Sent: Thursday, June 19, 2003 12:41 PM
> To: php-general
lists.php.net
> Subject: [PHP] Re: header(); Issue
>
>
> Try
>
> header("Location: ".$Relative."/outstanding.php?pdd=1&pddid=".$poid."");
>
> EF.
>
>
> "Spyproductions Support Team" <support
spyproductions.com> escribió en el
> mensaje news:GKEFLEHIPEGIFEECKBNEEEPCLGAA.support
spyproductions.com...
> >
> > I have this in a script:
> >
> > header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");
> >
> > It works fine elsewhere in the script without the variables.
> Does anyone
> > know if php 4.06 has issues with this? Or am I making a boneheaded
> mistake
> > here?
> >
> > $Relative is from an include, and outputs fine. :)
> >
> > Thanks!
> >
> > :)
> >
> > -Mike
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Dear List,
I'll say it again, after viewing ALL of these 'hosting question' posts....If
you want really good, reliable, dependable service AND an excellent
combination of M