OSEC

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 6 Sep 2003 02:26:08 -0000 Issue 2280

php-general-digest-helplists.php.net
Date: Fri Sep 05 2003 - 21:26:08 CDT


php-general Digest 6 Sep 2003 02:26:08 -0000 Issue 2280

Topics (messages 161763 through 161838):

Re: Email to database
        161763 by: Enda Nagle
        161764 by: Jay Blanchard
        161765 by: Enda Nagle

POST security
        161766 by: bob pilly
        161767 by: Chris Shiflett
        161773 by: Dan Anderson

Java based HTML editor
        161768 by: Todd Cary
        161770 by: Raditha Dissanayake
        161771 by: Chris Hubbard
        161802 by: Dan Phiffer

Re: using fwrite to create PHP files
        161769 by: Chris Hubbard
        161813 by: CPT John W. Holmes
        161815 by: Chris Sherwood
        161816 by: Chris Sherwood

Re: How can I get IP of ppp0?
        161772 by: Dan Anderson

mySQL overhead: Tweaking Scripts for Speed
        161774 by: Dan Anderson
        161775 by: Chris Sherwood
        161776 by: Chris Shiflett
        161783 by: CPT John W. Holmes
        161785 by: Dan Anderson
        161790 by: CPT John W. Holmes

Using rand() for 10 digit numbers????
        161777 by: Scott Fletcher
        161780 by: Robert Cummings
        161784 by: Jay Blanchard
        161793 by: Scott Fletcher
        161794 by: Scott Fletcher
        161797 by: Jay Blanchard
        161806 by: Scott Fletcher
        161810 by: Scott Fletcher
        161818 by: Curt Zirzow

[Thoughts About This] [Newbie Guide] For the benefit of new members
        161778 by: Joe Harman

Remove vars from memory?
        161779 by: \[cz\]Emo
        161781 by: murugesan
        161789 by: Tyler Lane
        161817 by: Curt Zirzow

Re: URGENT: how to make a global "server temporarily down" page?
        161782 by: Chris W. Parker

PHP code generation
        161786 by: Chris Hubbard
        161796 by: Scott Fletcher
        161798 by: Chris Hubbard

Re: mysql Pattern Matching
        161787 by: CPT John W. Holmes
        161814 by: Curt Zirzow

Re: Upgrade to 4.3, mysql functions not working
        161788 by: Wouter van Vliet
        161791 by: Jay Blanchard
        161821 by: Curt Zirzow
        161826 by: Wouter van Vliet

Virus Detected by Network Associates, Inc. Webshield SMTP V4.5
        161792 by: postmaster.fzk.de

PHP 4.3.3 compile error
        161795 by: Adam Williams

Parse error?
        161799 by: Mike Zornek

previous and next link
        161800 by: phpu
        161801 by: Chris Shiflett
        161804 by: phpu
        161807 by: Jay Blanchard
        161811 by: Chris Shiflett

Very interesting.....
        161803 by: Scott Fletcher
        161805 by: Jay Blanchard
        161808 by: Scott Fletcher
        161809 by: Jay Blanchard
        161812 by: Scott Fletcher
        161820 by: Jay Blanchard
        161822 by: Scott Fletcher

[SOLVED] Re: [PHP] Parse error?
        161819 by: Mike Zornek
        161832 by: Mike Migurski

Opening Zip Files in Linux
        161823 by: John Ryan
        161824 by: John Herren
        161836 by: John Ryan
        161837 by: Richard D. Marriner II

dl() problem
        161825 by: Alex
        161829 by: Curt Zirzow
        161833 by: Curt Zirzow

global array, can't assign values from variables
        161827 by: Chris Edwards
        161828 by: CPT John W. Holmes
        161831 by: Curt Zirzow

Re: global array, can't assign values from variables SOLVED
        161830 by: Chris Edwards

Re: Display after a certain date
        161834 by: John Taylor-Johnston

Maximum amount of variables in a session?
        161835 by: Richard D. Marriner II

Notices - Variable not defined
        161838 by: Leonie

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Jay,

The $to variable is enda.naglenightsol.net
Then the emails are pulled from the database in the following order:
email1, email2, email3

The result is:
enda.naglenightsol.net ­ gets a copy of each message (fine since its the
$to address for each mail)
email1 ­ gets a copy of each message
email2 ­ gets his message and the one for email3
email3 ­ gets his own message

Any ideas?

Enda
--

 On 9/5/03 2:29 PM, "Jay Blanchard" <jay.blanchardniicommunications.com>
wrote:

> [snip]
> Is there something like MoveNext I should use for the mail function?
> If I put the $headers in the while loop it just keeps adding to the
> $headers
> instead of sending each mail separately as I want it to.
>
> ......
>> > while($row = mysql_fetch_array($result1))
>> > {
>> > $headers .= "MIME-Version: 1.0\r\n";
>
> [/snip]
>
> I just noticed this....change the first header varaible line to
>
> $headers = "MIME-Version: 1.0\r\n";
>
> You are concatting the headers each time instead of resetting them

- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
endanightsol.net
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -

attached mail follows:


[snip]
email1 - gets a copy of each message
email2 - gets his message and the one for email3
email3 - gets his own message
[/snip]

Did you change that header line as recommended?

attached mail follows:


Its working ok now ­ I changed the error in the headers, but I had added in
another BCC item which was causing the repeated emails.

Working great now Jay ­ thanks a mil for your help!

Regards

Enda
--

On 9/5/03 2:59 PM, "Jay Blanchard" <jay.blanchardniicommunications.com>
wrote:

> [snip]
> email1 - gets a copy of each message
> email2 - gets his message and the one for email3
> email3 - gets his own message
> [/snip]
>
> Did you change that header line as recommended?

- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
endanightsol.net
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -

attached mail follows:


Hi all, i know this isnt strictly a php question but
thought you would be a good group to ask because of
your experience.

Is there any security issues with passing data via the
POST method from a webserver to a different webserver
running ssl. For example:

webserver1

<form name='form1' method='POST'
action='https://webserver2/login.php'>
<input type='hidden' value='lalala' name='data'>
</form>
and then just using <?$data=$_POST[data];?> on
webserver 2 to retrieve the data?

Thanks for any help in advance.

________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

attached mail follows:


--- bob pilly <bobpillyyahoo.co.uk> wrote:
> Is there any security issues with passing data via the
> POST method from a webserver to a different webserver
> running ssl.

There are always security concerns, regardless of your approach. Nothing is
perfect. However, sending data over an SSL connection offers a very high level
of security.

> For example:
>
> webserver1
>
> <form name='form1' method='POST'
> action='https://webserver2/login.php'>
> <input type='hidden' value='lalala' name='data'>
> </form>
> and then just using <?$data=$_POST[data];?> on
> webserver 2 to retrieve the data?

I'm not sure if it is relevant to your task, but you might like to know that
the client, not the Web server, is who sends the POST request to "webserver2".

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


Be careful about hidden variables and form variables. A clever user can
create a new form with custom edited fields and ACTION="yoursite.com"

For instance, if you keep a hidden variable:

<INPUT TYPE=HIDDEN NAME='authorization_bool' VALUE='FALSE'>

It's not very hard for a computer saavy person to create a new form
where it says:

<INPUT TYPE=HIDDEN NAME='authorization_bool' VALUE='TRUE'>

And circumvent your authorization.

-Dan

On Fri, 2003-09-05 at 10:32, bob pilly wrote:
> Hi all, i know this isnt strictly a php question but
> thought you would be a good group to ask because of
> your experience.
>
> Is there any security issues with passing data via the
> POST method from a webserver to a different webserver
> running ssl. For example:
>
> webserver1
>
> <form name='form1' method='POST'
> action='https://webserver2/login.php'>
> <input type='hidden' value='lalala' name='data'>
> </form>
> and then just using <?$data=$_POST[data];?> on
> webserver 2 to retrieve the data?
>
> Thanks for any help in advance.
>
>
>
> ________________________________________________________________________
> Want to chat instantly with your online friends? Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk

attached mail follows:


I would like to have a HTML editor on a Web site so the user can create
HTML based text. Google brings up too many matches when I type in
"Browser HTML editor Java" that do not match my needs. Does anyone have
a suggestion?

Todd
--

attached mail follows:


Yes java newsgroups :-)
but seriously there is a good on at sourceforge.

Todd Cary wrote:

> I would like to have a HTML editor on a Web site so the user can
> create HTML based text. Google brings up too many matches when I type
> in "Browser HTML editor Java" that do not match my needs. Does anyone
> have a suggestion?
>
> Todd
> --

--
http://www.radinks.com/upload/
Drag And Drop file Upload with Progress Bar.

attached mail follows:


I recommend htmlarea, it's javascript, not java.
http://www.interactivetools.com/products/htmlarea/
there's a couple similar scripts available.
chris
  -----Original Message-----
  From: Todd Cary [mailto:toddaristesoftware.com]
  Sent: Friday, September 05, 2003 6:48 AM
  To: php-generallists.php.net
  Subject: [PHP] Java based HTML editor

  I would like to have a HTML editor on a Web site so the user can create
HTML based text. Google brings up too many matches when I type in "Browser
HTML editor Java" that do not match my needs. Does anyone have a
suggestion?

  Todd
  --

attached mail follows:


Assuming you mean that the user isn't typing HTML code (like an online IDE),
you might want to take a look at:

http://www.bris.ac.uk/is/projects/cms/ttw/ttw.html#os

Best,
-Dan

"Todd Cary" <toddaristesoftware.com> wrote in message
news:3F58A21C.1060101aristesoftware.com...
> I would like to have a HTML editor on a Web site so the user can create
> HTML based text. Google brings up too many matches when I type in
> "Browser HTML editor Java" that do not match my needs. Does anyone have
> a suggestion?
>
> Todd
> --
>

----------------------------------------------------------------------------
----

> I would like to have a HTML editor on a Web site so the user can create
HTML based text. Google brings up too many matches when I type in "Browser
HTML editor Java" that do not match my needs. Does anyone have a
suggestion?
>
> Todd
> --
>

attached mail follows:


Vince,
You also need to escape the $, so instead of
." if ($_GET......
use
." if (\$_GET.....

You may have to escape the single quotes.

I have written two pretty lame code generators. The first one did not use
"templates", the second one does. You've got the lines of code in your
"builder" script. I recommend moving those lines of code out, and put them
into a template, then use str_replace() to change the template as/where
needed.
chris

-----Original Message-----
From: Vince LaMonica [mailto:vjlsoceco.uci.edu]
Sent: Friday, September 05, 2003 1:20 AM
To: PHP-General
Subject: [PHP] using fwrite to create PHP files

Hi all,

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:

$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." <?php \n"
." if ($_GET['preview'] == \"y\") { \n"
."
readfile(\"http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id&
preview=y\"); \n"
." } else { \n"
."
readfile(\"http://www.foo.bar/${'sitename'}.display?${'sitename'}id=$new_id\
"); \n"
." } \n"
." ?>";

write($new_file, $new_file_content);
fclose($new_file);

Note that $sitename is defined earlier in the script.

I know that $new_id and $sitename get expanded, as I tried this:

$new_file_content = "hello world. Look at my ${'sitename'}.display and my
$new_id";

and the new file was created with the above text and the two vars
expanded. My problem lies in the fact that I need to put "<?php" tags
inside the contents of $new_file_content. I'm not sure how to do that w/o
generating lots of errors. As you can see in my above example, I've tried
to escape the double quotes, but that didn't seem to help. PHP insists on
processing the "if" line instead of ignoring it.

I'm running 4.3.3 under apache 1.3.28.

Any help would be most appreciated!

/vjl/

--
Vince LaMonica UC Irvine, School of Social Ecology
 W3 Developer <*> 116 Social Ecology I, Irvine, CA 92697
 vjluci.edu http://www.seweb.uci.edu/techsupport

 Tower: "Delta Zulu Romeo, turn right now and report your heading."
 Pilot: "Wilco. 341, 342, 343, 344, 345..."

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

attached mail follows:


Vince LaMonica wrote:

> I wish to use fwrite() to create a small PHP file. So far, when I attempt
> to do this, php parses the contents of the file that fwrite needs to
> create. Eg, I have this:
>
> $new_id = mysql_insert_id();
> // create brand new file
> $new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
> $new_file_content = "\n"
> ." <?php \n"
> ." if ($_GET['preview'] == \"y\") { \n"

You need to escape the dollar signs in your string.

." if (\$_GET['preview'] == \"y\") { \n"

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


this is a sample of what I do when I need to write a php file

$stringtowrite = "<?PHP\n// Bulletin Board
forum\n$"."ForumId=".$tabletofind.";\n";

    $stringtowrite .=
"$"."ForumActive='1';\n$"."ForumName='".$sportname."';\n";

    $stringtowrite .= "$"."ForumDescription='".$sportname." forum';\n";

    $stringtowrite .= "$"."ForumConfigSuffix='';\n";

    $stringtowrite .= "$"."ForumFolder='0';\n";

    $stringtowrite .= "$"."ForumParent='0';\n";

    $stringtowrite .= "$"."ForumLang='lang/english.php';\n";

--- and so on until finally

$fd=fopen($final_destination,"w") or die ("file won't open");
    /*if ($fd===false)
    {
        echo "file create failed";
        exit();
        //return;
    } */
    fwrite($fd,$stringtowrite);
    fclose($fd);

<-- snip -->
> Vince LaMonica wrote:
>
> > I wish to use fwrite() to create a small PHP file. So far, when I
attempt
> > to do this, php parses the contents of the file that fwrite needs to
> > create. Eg, I have this:
> >
> > $new_id = mysql_insert_id();
> > // create brand new file
> > $new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
> > $new_file_content = "\n"
> > ." <?php \n"
> > ." if ($_GET['preview'] == \"y\") { \n"
>
> You need to escape the dollar signs in your string.
>
> ." if (\$_GET['preview'] == \"y\") { \n"
>
> --
> ---John Holmes...
<-- snip -->

Chris Sherwood

attached mail follows:


this is a sample of what I do when I need to write a php file

$stringtowrite = "<?PHP\n// Bulletin Board
forum\n$"."ForumId=".$tabletofind.";\n";

    $stringtowrite .=
"$"."ForumActive='1';\n$"."ForumName='".$sportname."';\n";

    $stringtowrite .= "$"."ForumDescription='".$sportname." forum';\n";

    $stringtowrite .= "$"."ForumConfigSuffix='';\n";

    $stringtowrite .= "$"."ForumFolder='0';\n";

    $stringtowrite .= "$"."ForumParent='0';\n";

    $stringtowrite .= "$"."ForumLang='lang/english.php';\n";

--- and so on until finally

$fd=fopen($final_destination,"w") or die ("file won't open");
    /*if ($fd===false)
    {
        echo "file create failed";
        exit();
        //return;
    } */
    fwrite($fd,$stringtowrite);
    fclose($fd);

<-- snip -->
> Vince LaMonica wrote:
>
> > I wish to use fwrite() to create a small PHP file. So far, when I
attempt
> > to do this, php parses the contents of the file that fwrite needs to
> > create. Eg, I have this:
> >
> > $new_id = mysql_insert_id();
> > // create brand new file
> > $new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
> > $new_file_content = "\n"
> > ." <?php \n"
> > ." if ($_GET['preview'] == \"y\") { \n"
>
> You need to escape the dollar signs in your string.
>
> ." if (\$_GET['preview'] == \"y\") { \n"
>
> --
> ---John Holmes...
<-- snip -->

Chris Sherwood

attached mail follows:


> [snip]
> How can I get IP Address from my connection ppp0 or ppp1 in Linux? What
> 's the function?
> [/snip]

Well, you can (if I'm not mistaken) create PHP modules using C++. You
could also create shell scripts you could exec(). PHP isn't really
meant to be a server control though. So anything you do should be
really beefy security. (i.e. make sure any idiot can't just go to your
web site, pass in a get, and change the settings of your ethernet. :-D
)

-Dan

attached mail follows:


I'm trying to figure out ways to tweak my scripts for performance.

I've figured out that all mySQL queries should use indexed ids for
speed. (For anyone who doesn't know: mySQL indexes fields with PRIMARY
KEY, UNIQUE, or AUTO_INCREMENT in them. This means they're stored in
binary trees internally, so access time is negligible for an INT PRIMARY
KEY AUTO_INCREMENT).

But how much overhead is there in:

$link = mysql_connect($hostname,$username,$password) or die("");
$db = mysql_select_db($database,$link) or die("");

Would it be beneficial to run a single one at the beginning of every
script? Currently I have a bunch of functions each with their own
calls.

Best Regards,

Dan

attached mail follows:


check this out dan

It may help

http://www.mysql.com/doc/en/EXPLAIN.html

----- Original Message -----
From: "Dan Anderson" <danmathjunkies.com>
To: "PHP List" <php-generallists.php.net>
Sent: Friday, September 05, 2003 8:38 AM
Subject: [PHP] mySQL overhead: Tweaking Scripts for Speed

> I'm trying to figure out ways to tweak my scripts for performance.
>
> I've figured out that all mySQL queries should use indexed ids for
> speed. (For anyone who doesn't know: mySQL indexes fields with PRIMARY
> KEY, UNIQUE, or AUTO_INCREMENT in them. This means they're stored in
> binary trees internally, so access time is negligible for an INT PRIMARY
> KEY AUTO_INCREMENT).
>
> But how much overhead is there in:
>
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");
>
> Would it be beneficial to run a single one at the beginning of every
> script? Currently I have a bunch of functions each with their own
> calls.
>
> Best Regards,
>
> Dan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


--- Dan Anderson <danmathjunkies.com> wrote:
> I've figured out that all mySQL queries should use indexed ids for
> speed. (For anyone who doesn't know: mySQL indexes fields with ...

You can create an index yourself:

KEY [index_name] (index_col_name,...)

Find more on this page:

http://www.mysql.com/doc/en/CREATE_TABLE.html

> But how much overhead is there in:
>
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");

This much:

|------------------|

> Would it be beneficial to run a single one at the beginning of every
> script? Currently I have a bunch of functions each with their own
> calls.

Of course. One call is faster than a bunch of calls.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


From: "Dan Anderson" <danmathjunkies.com>
> But how much overhead is there in:
>
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");
>
> Would it be beneficial to run a single one at the beginning of every
> script? Currently I have a bunch of functions each with their own
> calls.

You should only "connect" once in your script. It's usually in an include
file to make things easy.

While multiple connections will just return the first connection, anyhow,
why do the extra work, right?

---John Holmes...

attached mail follows:


> While multiple connections will just return the first connection, anyhow,
> why do the extra work, right?

Yes that was what I was thinking. But I was also thinking that I would
need to global the $link and $db variables and run mysql_query() with
them in options. So I'm wondering how much work coding it will save.
Or will it default to the mysql connection active in the main program?

-Dan

attached mail follows:


From: "Dan Anderson" <danmathjunkies.com>

> > While multiple connections will just return the first connection,
anyhow,
> > why do the extra work, right?
>
> Yes that was what I was thinking. But I was also thinking that I would
> need to global the $link and $db variables and run mysql_query() with
> them in options. So I'm wondering how much work coding it will save.
> Or will it default to the mysql connection active in the main program?

It'll default. You only need to pass $link and $db to mysql_query() and the
other functions when you have multiple connections open to multiple
databases at the same time (something that is rarely needed).

---John Holmes...

attached mail follows:


Hi!

    I looked at the rand() at php.net which spoke about min and max random
number. So, I use rand(0,9999999999) to get a 10 digit random number but it
only return an 1 digit random number that is displayed at '0'. So, I tried
rand(0,9999) with 4 digit random number and got the random number. So, why
does it not work with 10 digit numbers?

Scott F.

attached mail follows:


It probably wraps the standard C rand() function which only takes an
unsigned integer which is usually 16 bits.

Cheers,
Rob.

On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> Hi!
>
> I looked at the rand() at php.net which spoke about min and max random
> number. So, I use rand(0,9999999999) to get a 10 digit random number but it
> only return an 1 digit random number that is displayed at '0'. So, I tried
> rand(0,9999) with 4 digit random number and got the random number. So, why
> does it not work with 10 digit numbers?
>
> Scott F.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'

attached mail follows:


[snip]
    I looked at the rand() at php.net which spoke about min and max
random
number. So, I use rand(0,9999999999) to get a 10 digit random number
but it
only return an 1 digit random number that is displayed at '0'. So, I
tried
rand(0,9999) with 4 digit random number and got the random number. So,
why
does it not work with 10 digit numbers?
[/snip]

How may tests did you run? I just did this ....

901,476,090
1,161,662,632
1,133,163,790
116,198,549
862,072,958
160,284,836
368,780,044
1,561,820,920
1,407,692,572
1,480,574,886
473,849,932
380,642,419
167,966,462
466,661,331
1,266,542,359
160,809,301
215,539,845
85,493,351
103,799,041
950,218,662
417,076,793
1,190,550,903
658,771,070
1,388,939,508
1,357,822,101

with this....

<?php
$i=25;
while($i > 0){
        $random=rand (0,99999999999999999);
        echo number_format($random, 0, '', ',')."\n";
        $i--;
}
?>

attached mail follows:


How interesting. Yours work while mine doesn't. All I did was ..

--snip--
$randomNumber = rand(0,9999999999);
echo $randomNumber;
--snip--

What PHP version do you use? I only have version 4.3.1 on the machine.

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B02A1D2nemesis...
[snip]
    I looked at the rand() at php.net which spoke about min and max
random
number. So, I use rand(0,9999999999) to get a 10 digit random number
but it
only return an 1 digit random number that is displayed at '0'. So, I
tried
rand(0,9999) with 4 digit random number and got the random number. So,
why
does it not work with 10 digit numbers?
[/snip]

How may tests did you run? I just did this ....

901,476,090
1,161,662,632
1,133,163,790
116,198,549
862,072,958
160,284,836
368,780,044
1,561,820,920
1,407,692,572
1,480,574,886
473,849,932
380,642,419
167,966,462
466,661,331
1,266,542,359
160,809,301
215,539,845
85,493,351
103,799,041
950,218,662
417,076,793
1,190,550,903
658,771,070
1,388,939,508
1,357,822,101

with this....

<?php
$i=25;
while($i > 0){
$random=rand (0,99999999999999999);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

attached mail follows:


Could be....

"Robert Cummings" <robertwocmud.org> wrote in message
news:1062780933.7427.17.camelblobule.suds...
> It probably wraps the standard C rand() function which only takes an
> unsigned integer which is usually 16 bits.
>
> Cheers,
> Rob.
>
> On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> > Hi!
> >
> > I looked at the rand() at php.net which spoke about min and max
random
> > number. So, I use rand(0,9999999999) to get a 10 digit random number
but it
> > only return an 1 digit random number that is displayed at '0'. So, I
tried
> > rand(0,9999) with 4 digit random number and got the random number. So,
why
> > does it not work with 10 digit numbers?
> >
> > Scott F.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> .---------------------------------------------.
> | Worlds of Carnage - http://www.wocmud.org |
> :---------------------------------------------:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the |
> | stuff of nightmares grasp for your soul. |
> `---------------------------------------------'

attached mail follows:


[snip]
What PHP version do you use? I only have version 4.3.1 on the machine.
[/snip]

Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
posted on your machine?

<?php
$i=25;
while($i > 0){
$random=rand (0,99999999999999999);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

attached mail follows:


Very Interesting. I tried your code on my machine and I got this...

--snip--
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--snip--

Weird... I other quick question. What the heck is going on?

Scott F.

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B01AFA7A9nemesis...
[snip]
What PHP version do you use? I only have version 4.3.1 on the machine.
[/snip]

Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
posted on your machine?

<?php
$i=25;
while($i > 0){
$random=rand (0,99999999999999999);
echo number_format($random, 0, '', ',')."\n";
$i--;
}
?>

attached mail follows:


Continue(ing) of this replying go into the title, 'Very Interesting'.

"Scott Fletcher" <scottabcoa.com> wrote in message
news:20030905182043.9297.qmailpb1.pair.com...
> Very Interesting. I tried your code on my machine and I got this...
>
> --snip--
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0
0
> 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> --snip--
>
> Weird... I other quick question. What the heck is going on?
>
> Scott F.
>
>
> "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
> news:C8F323573C030A448F3E5A2B6FE2070B01AFA7A9nemesis...
> [snip]
> What PHP version do you use? I only have version 4.3.1 on the machine.
> [/snip]
>
> Did this on a 4.2.1 and a 4.3...no probs. Have you tried the code I
> posted on your machine?
>
> <?php
> $i=25;
> while($i > 0){
> $random=rand (0,99999999999999999);
> echo number_format($random, 0, '', ',')."\n";
> $i--;
> }
> ?>

attached mail follows:


* Thus wrote Scott Fletcher (scottabcoa.com):
> How interesting. Yours work while mine doesn't. All I did was ..
>
> --snip--
> $randomNumber = rand(0,9999999999);
> echo $randomNumber;
> --snip--
>
> What PHP version do you use? I only have version 4.3.1 on the machine.

I believe its the OS he's using. to avoid this use mt_rand()
instead since this one is more efficient and system INdependent.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Great guide here Ma Siva Kumar... I am a little guilty of not doing
this, actually recently too... As I think most of us are at one point or
another... Although I would like to add alittle something, maybe just
alittle guidance for newbies and seasoned professionals like yourself!

1. Helping those newbies out there helps promote PHP & Opensource
stuff... This is HUGE... Even if we have to hold someones hand through
the first steps.

2. Most of understand the descriptions and explinations on the PHP.nt
site... But sometimes they are alittle vague (seldom though)... And most
people see them as very very technical... And they need some people to
translate for them...

3. Tutorials are a great way to learn PHP... There is so much out there.
I am by no means an advance PHP programmer... But more of an
intermediate one... Often I do go through tutorials, but still am left a
little puzzled... So I ask people on these mailinglist for
clarification... I found that people here have a wealth of knowledge to
make people like me(RIGHT BRAINERS) understand... Heck if it wasn't for
some of these guys here, I would still be trying to understand
arrays....

Bravo Ma Siva Kumar... Good guide...

Cheers!
Joe

> -----Original Message-----
> From: techleatherlink.net [mailto:techleatherlink.net]
> Sent: Monday, September 01, 2003 12:33 AM
> To: PHP Mailing List
> Subject: [PHP] [Newbie Guide] For the benefit of new members
>
>
> =========================================================
> This message is for the benefit of new subscribers and those
> new to PHP.
> Those who do not want to be bothered just filter out the
> [Newbie Guide]
> mails. Please feel free to add more points and send to the
> list. ==========================================================
> 1. If you have any queries/problems about PHP try
> http://www.php.net/manual/en
> first. You can download a copy and use it offline also.
>
> 2. If you can not get answer here try http://www.google.com next. Try
> searching for "php YOUR QUERY" and you may be lucky to get an
> answer within
> the first 10 results.
>
> 3. Glancing through the list archive at
> http://marc.theaimsgroup.com/?l=php-general , you can find
> many of the
> common topics discussed repeatedly and can get your answer from those
> discussions.
>
> 4. If you are stuck with a script and do not understand what
> is wrong, instead
> of posting the whole script, try doing some research
> yourself. One useful
> trick is to print the variable/sql query using print or echo
> command and
> check whether you get what you expected.
>
> After diagnosing the problem, send the details of your
> efforts (following
> steps 1,2 & 3) and ask for help in the list.
>
> 5. Provide a clear descriptive subject line. Avoid general
> subjects like
> "Help!!", "A Question" etc. Especially avoid blank subjects.
>
> 6. When you want to start a new topic, open a new mail and
> enter the mailing
> list address php-generallists.php.net instead of replyting
> to an existing
> thread and replacing the subject and body with your message.
>
> 7. PHP is a server side scripting language. Whatever
> processing PHP does takes
> place BEFORE the output reaches the client. Therefore, it is
> not possible to
> access the users' computer related information (OS, screen
> size etc) using
> PHP. You need to go for Java Script and ask the question in a
> Java Script
> list.
>
> 8. It's always a good idea to post back to the list once
> you've solved your problem. People usually add [SOLVED] to
> the subject line of their email when posting solutions. By
> posting your solution you're helping the next person with the
> same question. [contribued by Chris W Parker]
>
> 9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
> [contributed by Jay Blanchard)
>
> Hope you have a good time programming with PHP.
>
> Best regards,
>
> --
> Ma Siva Kumar,
> ================================================
> INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
> BSG LeatherLink,
> Chennai.
> Ph: +91 44 55191757
> URL : http://www.leatherlink.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Hi all.
Will PHP remove variables from memory when script will NOT use them in rest
of code?
for example:

<?php
$tmp=true;
if ($tmp) // here is $tmp used last time, will it be removed from memory?
...
... // $tmp is NOT in the rest of code
...
...
?>

or I must use allways unset()?

Thanx

Emo

attached mail follows:


You must use unset()

-Murugesan

----- Original Message -----
From: "Robert Cummings" <robertwocmud.org>
To: "Scott Fletcher" <scottabcoa.com>
Cc: <php-generallists.php.net>
Sent: Friday, September 05, 2003 10:25 PM
Subject: Re: [PHP] Using rand() for 10 digit numbers????

> It probably wraps the standard C rand() function which only takes an
> unsigned integer which is usually 16 bits.
>
> Cheers,
> Rob.
>
> On Fri, 2003-09-05 at 12:34, Scott Fletcher wrote:
> > Hi!
> >
> > I looked at the rand() at php.net which spoke about min and max
random
> > number. So, I use rand(0,9999999999) to get a 10 digit random number
but it
> > only return an 1 digit random number that is displayed at '0'. So, I
tried
> > rand(0,9999) with 4 digit random number and got the random number. So,
why
> > does it not work with 10 digit numbers?
> >
> > Scott F.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> .---------------------------------------------.
> | Worlds of Carnage - http://www.wocmud.org |
> :---------------------------------------------:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the |
> | stuff of nightmares grasp for your soul. |
> `---------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Fri, 2003-09-05 at 09:38, [cz]Emo wrote:
> Hi all.
> Will PHP remove variables from memory when script will NOT use them in rest
> of code?
> for example:
>
> <?php
> $tmp=true;
> if ($tmp) // here is $tmp used last time, will it be removed from memory?
> ...
> ... // $tmp is NOT in the rest of code
> ...
> ...
> ?>
>
> or I must use allways unset()?
>
yes, you must use unset() to remove a variable, otherwise it will stay
for the duration of the script.

> Thanx
>
> Emo
--
Tyler Lane <tlanelyrical.net>
Lyrical Communications

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/WMUGnV+u8RFxEIMRAi9rAJ9p7AI92E7WNCpAd+AHo1HFo3N6zgCfXItz
lUWUue/3R0aMADg3D1gC8/E=
=SVMJ
-----END PGP SIGNATURE-----

attached mail follows:


* Thus wrote murugesan (mukeshgcthotpop.com):
> You must use unset()

How you keep doing this, I have no clue. but your subject and content has
nothing to do with the thread or quoted content.

Please reply and quote the proper messages with the proper subject
so it doesn't confuse people.

>
> -Murugesan
>
> ----- Original Message -----
> From: "Robert Cummings" <robertwocmud.org>
> To: "Scott Fletcher" <scottabcoa.com>
> Cc: <php-generallists.php.net>
> Sent: Friday, September 05, 2003 10:25 PM
> Subject: Re: [PHP] Using rand() for 10 digit numbers????
> [...]

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


David Robley <mailto:robleydozemail.com.au>
    on Friday, September 05, 2003 5:59 AM said:

> Well, no - I am sure you can do it with an entry in .htaccess in the
> server root.

Yeah, like a rewrite rule.

RewriteRule ^*$ down.html

Chris.

attached mail follows:


I'm working on a code generation project. Is there anyone on the list who
has experience building these things, and, would like to discuss
architecture/patterns/structure of code generation off-list?

Chris Hubbard
chriswildcharacters.com
www.wildcharacters.com
425 481 2020

php based web application development

Y! hoponpopontoponmoponcopyahoo.com
MSN another_ganeshahotmail.com
AIM ganeshacph

attached mail follows:


What are the example of code generation project? Are you referring to the
generation of the random characters?

"Chris Hubbard" <chriswildcharacters.com> wrote in message
news:AMEHIMKKMFIMCOJPPEEEKEPNCEAA.chriswildcharacters.com...
> I'm working on a code generation project. Is there anyone on the list who
> has experience building these things, and, would like to discuss
> architecture/patterns/structure of code generation off-list?
>
>
> Chris Hubbard
> chriswildcharacters.com
> www.wildcharacters.com
> 425 481 2020
>
> php based web application development
>
> Y! hoponpopontoponmoponcopyahoo.com
> MSN another_ganeshahotmail.com
> AIM ganeshacph

attached mail follows:


No, not random character generation.

Currently the application I'm working does the following:
1. from an array that defines HTML components (like a table row, input
field, file upload, etc), and,
2. from an array that defines PHP components (like sql queries, file
upload, assigning values to variables, etc), and,
3. a library of HTML components (like the HTML to display; a table row, a
search box, a text area, etc),
4. take all three of the above and do a (fairly) complex suite of
str_replaces and then file writes, output .php and .tpl files, resulting in
a (hopefully) functional application.

Primary advantage:
as the application developer (as distinct from the code generation
developer), you only have to build arrays. The arrays can be built from
HTML forms, or XML, or ...?

Secondary advantage:
if you need to build multiple instances of the application with minor
changes, it's trivial to build and maintain.

Tertiary advantage:
you have a common "framework" (though not technically a framework) for all
deployed applications. It's relatively easy to "upgrade" the applications,
or swap out sections of the code with improved code.

chris

-----Original Message-----
From: Scott Fletcher [mailto:scottabcoa.com]
Sent: Friday, September 05, 2003 9:30 AM
To: php-generallists.php.net
Subject: [PHP] Re: PHP code generation

What are the example of code generation project? Are you referring to the
generation of the random characters?

"Chris Hubbard" <chriswildcharacters.com> wrote in message
news:AMEHIMKKMFIMCOJPPEEEKEPNCEAA.chriswildcharacters.com...
> I'm working on a code generation project. Is there anyone on the list who
> has experience building these things, and, would like to discuss
> architecture/patterns/structure of code generation off-list?
>
>
> Chris Hubbard
> chriswildcharacters.com
> www.wildcharacters.com
> 425 481 2020
>
> php based web application development
>
> Y! hoponpopontoponmoponcopyahoo.com
> MSN another_ganeshahotmail.com
> AIM ganeshacph

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

attached mail follows:


From: "Ralph Guzman" <ralph213sbcglobal.net>

> Is there an advantage or difference in running FIND_IN_SET() instead of
> LIKE?

Actually no, I guess there isn't. Neither one will use an index.

mysql> desc test;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| b | varchar(50) | | MUL | | |
+-------+-------------+------+-----+---------+-------+
1 row in set (0.01 sec)

mysql> explain select * from test where b like '%two%';
+-------+--------+---------------+------+---------+------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+--------+---------------+------+---------+------+------+-------+
| test | system | NULL | NULL | NULL | NULL | 1 | |
+-------+--------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)

mysql> explain select * from test where find_in_set('two',b);
+-------+--------+---------------+------+---------+------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+--------+---------------+------+---------+------+------+-------+
| test | system | NULL | NULL | NULL | NULL | 1 | |
+-------+--------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)

---John Holmes...

attached mail follows:


* Thus wrote CPT John W. Holmes (holmes072000charter.net):
> From: "Ralph Guzman" <ralph213sbcglobal.net>
>
>
> > Is there an advantage or difference in running FIND_IN_SET() instead of
> > LIKE?
>
> Actually no, I guess there isn't. Neither one will use an index.

There will be a slight diffence in the resuls though, depending on
the term searched and the contents

id field
--- ------
 1 one,two
 2 fooone,footwo
 3 onefoo,twofoo

>
> mysql> explain select * from test where b like '%two%';

select id from test where b like '%two%'

id
---
 1
 2
 3

> mysql> explain select * from test where find_in_set('two',b);

select id from test where find_in_set('two',b);

id
---
1

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Hi Folks,

I've got a (in my eyes) very strange behaviour from my RedHat Linux 9.0 box.
I needed to upgrade my PHP version to 4.3, since that's the version on the
production server and well .. test and production should match pretty good
;). Since self compiling didn't work. All errors with apxs and stuff. And I
just found out about the new RH9 version with php4.3 I decided to get the
packages from that distribution into my test server.

Started with downloading the php packages. Ended up installing 20+ packages
because of all dependences. From httpd->mod_perl->Perl, pam, sendmail even.
Glibc of course. All seemed quite well. And from the commandline it works
quite well. PHP files get parsed through apache, but somehow it fatals on
"undefined function mysql_select". I've tried restarting apache a coupla
times. Restarted mysql a coupla times. Even rebooted the server a coupla
times. Installed the new mysql package. But nothing works. The mysql
functions stay undefined.

From the commandline it all works normally, though..

(ow, now suddenly the error changed to just "Error 500, Internal server
error")

thanks for any help ..

--- some info ---

=== errors from error_log ===
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
OnUpdateBool in Unknown on line 0

=== rpm -qa | grep php
php-4.3.2-7
php-ldap-4.3.2-7
php-pgsql-4.3.2-7
php-mysql-4.3.2-7

=== rpm -qa | grep mysql
mysql-3.23.57-1
php-mysql-4.3.2-7
mysql-server-3.23.57-1

=== rpm -qa | grep httpd
httpd-2.0.47-4
httpd-manual-2.0.40-21.3
redhat-config-httpd-1.0.1-18

attached mail follows:


[snip]
"undefined function mysql_select".
[/snip]

mysql_select by itself isn't a function. Are you using other code to
define this function? Or are you just using shorthand here?

[snip]
=== errors from error_log ===
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
OnUpdateInt in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
OnUpdateBool in Unknown on line 0
[/snip]

Are those libs in place? Just checking...

attached mail follows:


* Thus wrote Wouter van Vliet (wouteresctoday.com):
> Hi Folks,
>
> I've got a (in my eyes) very strange behaviour from my RedHat Linux 9.0 box.
> I needed to upgrade my PHP version to 4.3, since that's the version on the
> production server and well .. test and production should match pretty good
> ;). Since self compiling didn't work. All errors with apxs and stuff. And I
> just found out about the new RH9 version with php4.3 I decided to get the
> packages from that distribution into my test server.
>
> Started with downloading the php packages. Ended up installing 20+ packages
> because of all dependences. From httpd->mod_perl->Perl, pam, sendmail even.
> Glibc of course. All seemed quite well. And from the commandline it works
> quite well. PHP files get parsed through apache, but somehow it fatals on
> "undefined function mysql_select". I've tried restarting apache a coupla
> times. Restarted mysql a coupla times. Even rebooted the server a coupla
> times. Installed the new mysql package. But nothing works. The mysql
> functions stay undefined.

It sounds like you're having problems using the rpm package system.
I would suggest you ask these questions over on redhat for support
on using rpm's.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


No I'm not using a shorthand or other code to define the function .. I just
typed select instead of connect. ;)

And yep, I can both stat and vim ;) those libs.

 -> -----Oorspronkelijk bericht-----
 -> Van: Jay Blanchard [mailto:jay.blanchardniicommunications.com]
 -> Verzonden: vrijdag 5 september 2003 19:21
 -> Aan: Wouter van Vliet; PHP General
 -> Onderwerp: RE: [PHP] RH9.0: Upgrade to 4.3, mysql functions not working
 ->
 ->
 -> [snip]
 -> "undefined function mysql_select".
 -> [/snip]
 ->
 -> mysql_select by itself isn't a function. Are you using other code to
 -> define this function? Or are you just using shorthand here?
 ->
 -> [snip]
 -> === errors from error_log ===
 -> PHP Warning: Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/ldap.so' - /usr/lib/php4/ldap.so: undefined symbol:
 -> OnUpdateInt in Unknown on line 0
 -> PHP Warning: Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
 -> OnUpdateInt in Unknown on line 0
 -> PHP Warning: Unknown(): Unable to load dynamic library
 -> '/usr/lib/php4/pgsql.so' - /usr/lib/php4/pgsql.so: undefined symbol:
 -> OnUpdateBool in Unknown on line 0
 -> [/snip]
 ->
 -> Are those libs in place? Just checking...
 ->
 ->

attached mail follows:


Network Associates WebShield SMTP V4.5 on fzkmail2 detected virus W32/Sobig.fMM in
attachment document_9446.pif from <php-generallists.php.net> and it was Cleaned and
Quarantined.

attached mail follows:


Hello,

I'm trying to compile PHP 4.3.3. My configure is:

./configure --enable-track-vars --without-mysql --with-mail
--with-apxs2=/usr/local/apache2/bin/apxs --with-informix

and when doing make I get:

[rootarchivesnew php-4.3.3]# make
/bin/sh /root/php-4.3.3/libtool --silent --preserve-dup-deps
--mode=compile gcc -I/usr/informix/incl/esql -Iext/informix/
-I/root/php-4.3.3/ext/informix/ -DPHP_ATOM_INC -I/root/php-4.3.3/include
-I/root/php-4.3.3/main -I/root/php-4.3.3 -I/root/php-4.3.3/Zend
-I/root/php-4.3.3/ext/xml/expat -I/root/php-4.3.3/TSRM -g -O2
-prefer-pic -c /root/php-4.3.3/ext/informix/ifx.c -o ext/informix/ifx.lo
/root/php-4.3.3/ext/informix/ifx.ec: In function `zm_info_ifx':
/root/php-4.3.3/ext/informix/ifx.ec:402: parse error before '/' token
/root/php-4.3.3/ext/informix/ifx.ec:3127:17: operator '<' has no left
operand
make: *** [ext/informix/ifx.lo] Error 1

I'm not a programmer, so any advice on why its breaking on making the
informix code and how to fix it would be appreciated. Thanks!

                        Adam

attached mail follows:


I'm trying to give PEAR a try and am currently following it's tutorial at:
http://pear.php.net/manual/en/package.database.db.intro-fetch.php

Now when I put this code into a PHP file I get a parse error on line 49
which has:

while ($row = $result->fetchRow()) {

I don't see what would cause the error, maybe the object syntax? I'm new to
PHP objects so little help.

~ Mike
--
Mike Zornek
Extreme geek in training
http://MikeZornek.com

attached mail follows:


I have this code and I wanna display only 10 records on page. For the rest of them I wanna use a "next" link(or a previous link).
Please tell me hoe can I do that.
 

$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql);
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {

     print ' <tr><td>'.$row['nume_categorie'].'</td></tr>';
      
}

 

attached mail follows:


--- phpu <phpugo.ro> wrote:
> I have this code and I wanna display only 10 records on page.

Use the LIMIT clause in your select statement:

http://www.mysql.com/doc/en/SELECT.html

Hope that helps.

Chris

==Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


I've tried but i don't know how to put it in my script. And also i don't know how to display it in page. Here is my script and I hope you could help me with this one.
thanks

$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql);
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {

     print ' <tr><td>'.$row['nume_categorie'].'</td></tr>';
      
}

attached mail follows:


[snip]
I've tried but i don't know how to put it in my script. And also i don't
know how to display it in page. Here is my script and I hope you could
help me with this one.
thanks
[/snip]

Google is SO cool!!! :)
http://www.onlamp.com/pub/a/php/2000/11/02/next_previous.html

Have a pleasant and productive day!

attached mail follows:


--- phpu <phpugo.ro> wrote:
> I've tried but i don't know how to put it in my script.

Here is your SQL statement (between the quotes):

> $sql = "SELECT * FROM categorie";

Add a LIMIT clause to that statement. The syntax is described at the URL I sent
you.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

attached mail follows:


I tried your code on this machine and I got this...

--snip--
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
--snip--

attached mail follows:


[snip]
I tried your code on this machine and I got this...

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.....
[/snip]

What is your numeric precesion set to in the php.ini?

attached mail follows:


There isn't one in php.ini. Could this be the problem?

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B01AFA7AAnemesis...
[snip]
I tried your code on this machine and I got this...

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.....
[/snip]

What is your numeric precesion set to in the php.ini?

attached mail follows:


[snip]
There isn't one in php.ini. Could this be the problem?
[/snip]

Look for these lines in your php.ini

; The number of significant digits displayed in floating point numbers.
precision = 14

What is precision equal to?

attached mail follows:


It is not there, so I added it and restarted Apache. Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file from
php.net and compile it. Then compile Apache, had it take in PHP. So, when
it was done, there is never a php.ini there. So, I create one and add some
of hte coding into php.ini file. This is for the Unix machine. The only
scripting I have in php.ini so far is ...

--snip--
mcrypt.algorithms_dir =
/usr/local/lib/source_libmcrypt-2.5.3/modules/algorithms
mcrypt.modes_dir = /usr/local/lib/source_libmcrypt-2.5.3/modules/modes

#sendmail_path = /usr/sbin/sendmail -t -i -f webmasterxxxxxxx.xxx

precision = 14
--snip--

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B01AFA7ACnemesis...
[snip]
There isn't one in php.ini. Could this be the problem?
[/snip]

Look for these lines in your php.ini

; The number of significant digits displayed in floating point numbers.
precision = 14

What is precision equal to?

attached mail follows:


[snip]
It is not there, so I added it and restarted Apache. Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file
from
php.net and compile it. Then compile Apache, had it take in PHP. So,
when
it was done, there is never a php.ini there. So, I create one and add
some
of hte coding into php.ini file. This is for the Unix machine. The
only
scripting I have in php.ini so far is ...
[/snip]

You should have 2 or 3 php.ini files....usually

php.ini-dist
php.ini-optimized
php.ini-recommended

(from the command line 'locate php.ini')

You pick the one that you want to use and copy it into /etc/apache while
renaming it php.ini. My current php.ini file is comprised of 775 lines
of information and directives. As I understand it the .ini is not
required, and probaly is not affecting the rand on your machine.

attached mail follows:


Will do that once I get a newer PHP version. No time for it right now. :-)

The workaround to rand() I did was to use it twice and add up the result.
For ex.

--snip--
$randomNumberLeft = rand(0,99999);
$randomNumberRight = rand(0,99999);
$randomNumber = $randomNumberLeft.$randomNumberRight;

echo $randomNumber.
--snip--

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B02A1D3nemesis...
[snip]
It is not there, so I added it and restarted Apache. Still got the same
result.

How is PHP is built into Apache was done by downloading the tar.gz file
from
php.net and compile it. Then compile Apache, had it take in PHP. So,
when
it was done, there is never a php.ini there. So, I create one and add
some
of hte coding into php.ini file. This is for the Unix machine. The
only
scripting I have in php.ini so far is ...
[/snip]

You should have 2 or 3 php.ini files....usually

php.ini-dist
php.ini-optimized
php.ini-recommended

(from the command line 'locate php.ini')

You pick the one that you want to use and copy it into /etc/apache while
renaming it php.ini. My current php.ini file is comprised of 775 lines
of information and directives. As I understand it the .ini is not
required, and probaly is not affecting the rand on your machine.

attached mail follows:


On 9/5/03 1:50 PM, "Mike Zornek" <listguymikezornek.com> wrote:

> I'm trying to give PEAR a try and am currently following it's tutorial at:
> http://pear.php.net/manual/en/package.database.db.intro-fetch.php
>
> Now when I put this code into a PHP file I get a parse error on line 49
> which has:
>
> while ($row = $result->fetchRow()) {
>
> I don't see what would cause the error, maybe the object syntax? I'm new to
> PHP objects so little help.
>
> ~ Mike

Ok, the reason I was getting this error seems to be related to Safari on OS
X. When I copy code segments in Safari and paste them in BBEdit they
generally looked ok, although there were extra spaces inserted in some
places. I then turned on show invisible characters and it made it even more
clear that something was up.

I'll detail it more later in my blog and then forward it to apple in a bug
report. For now I'll move to Mozilla for this.

~ Mike
--
Mike Zornek
Extreme geek in training
http://MikeZornek.com

attached mail follows:


>Ok, the reason I was getting this error seems to be related to Safari on
>OS X. When I copy code segments in Safari and paste them in BBEdit they
>generally looked ok, although there were extra spaces inserted in some
>places. I then turned on show invisible characters and it made it even
>more clear that something was up.

BBedit has a feature called 'zap gremlins' which can help you seek and
destroy non-printing characters that cause problems. I always found this
to be an issue when copying from flash to bbedit - there would always be
null character stuck at the end, which would stop the script cold at that
point.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html

attached mail follows:


This is kinda off topic, well.. depending on the answer.

I downloaded a ZIP file to my server, and want to open it. My version of PHP
wasnt compiled with the Zip uncompressing functions, otherwise Id do it with
php, so I was wondering if there was a linux-x86 binary that just opens zip
files????!

attached mail follows:


John Ryan wrote:
> This is kinda off topic, well.. depending on the answer.
>
> I downloaded a ZIP file to my server, and want to open it. My version of PHP
> wasnt compiled with the Zip uncompressing functions, otherwise Id do it with
> php, so I was wondering if there was a linux-x86 binary that just opens zip
> files????!

Try unzip :)

attached mail follows:


ive spent the last 2 hours looking for a solution. i was going to recompile
php with zip support for one file. THANK YOU!
"John Herren" <johnd2interactive.com> wrote in message
news:20030905200017.91800.qmailpb1.pair.com...
> John Ryan wrote:
> > This is kinda off topic, well.. depending on the answer.
> >
> > I downloaded a ZIP file to my server, and want to open it. My version of
PHP
> > wasnt compiled with the Zip uncompressing functions, otherwise Id do it
with
> > php, so I was wondering if there was a linux-x86 binary that just opens
zip
> > files????!
>
> Try unzip :)

attached mail follows:


Umm, I believe somebody already answered...
unzip is what you need...

----- Original Message -----
From: "John Ryan" <celticfciol.ie>
To: <php-generallists.php.net>
Sent: Friday, September 05, 2003 4:00 PM
Subject: [PHP] Re: Opening Zip Files in Linux

> ive spent the last 2 hours looking for a solution. i was going to
recompile
> php with zip support for one file. THANK YOU!
> "John Herren" <johnd2interactive.com> wrote in message
> news:20030905200017.91800.qmailpb1.pair.com...
> > John Ryan wrote:
> > > This is kinda off topic, well.. depending on the answer.
> > >
> > > I downloaded a ZIP file to my server, and want to open it. My version
of
> PHP
> > > wasnt compiled with the Zip uncompressing functions, otherwise Id do
it
> with
> > > php, so I was wondering if there was a linux-x86 binary that just
opens
> zip
> > > files????!
> >
> > Try unzip :)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Hello..

Is there a way of setting the extension_dir by not modifying php.ini ?

i've tried with

ini_set("extension_dir","/home/alexcos/www/phps");
dl("first_module.so");
Warning: Unable to load dynamic library '/usr/lib/php4/first_module.so'

then , i've tried setting the extension_dir in a .htaccess file..
still , the same result..

i have developed a small module , but I can't use it..
my site is hosted on an service provider , and they don't allow me to copy the module to extension_dir or to change the php.ini..

what should I do ?

Thanks

    Alex

attached mail follows:


* Thus wrote Alex (alexcoshome.ro):
> Hello..
>
> Is there a way of setting the extension_dir by not modifying php.ini ?
>
> i've tried with
>
> ini_set("extension_dir","/home/alexcos/www/phps");
>
> then , i've tried setting the extension_dir in a .htaccess file..
> still , the same result..

according to ini_set() documentation, extension_dir can only be set
in php.ini or apache.conf

   http://php.net/ini_set

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


* Thus wrote Alex (alexcoshome.ro):
> I saw...:(
>
> And what should I do ?

I'm assuming that this is on some hosting site. You can contact
them to see if they are willing to work with you on being able to
load a custom module.

As the hosting company, they most likely wont have you just enable
any module you want (especially a custom one) because you can
override a lot of security issues within a php module.

> ----- Original Message -----
> From: "Curt Zirzow" <php-generalzirzow.dyndns.org>
> Sent: Friday, September 05, 2003 11:16 PM
> Subject: Re: [PHP] dl() problem
>
>
> >
> > according to ini_set() documentation, extension_dir can only be set
> > in php.ini or apache.conf
> >
> > http://php.net/ini_set
> >
> >

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Hi

I'm just going to give the code and output. It should be self explanatory.
The array, $criteria, is having the issue. I don't know what it's doing. I
cannot seem to assign the value from the $data variable to the
$criteria[index] value. You will see some attempts to debug the situation
which leads me to more puzzlement.

CODE:

// run when cdata is found
function characterDataHandler($parser, $data)
  {
  switch( $GLOBALS['currentTag'] )
    {
    case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
= $data;*/break;
    case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
"junk";/*$data;*/break;
    case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
    case "MAXSTAY" : $GLOBALS['criteria']['maxstay'] = $data; break;
    case "MINRENT" : $GLOBALS['criteria']['minrent'] = $data; break;
    case "MAXRENT" : $GLOBALS['criteria']['maxrent'] = $data; break;
    case "RENTINC" : $GLOBALS['criteria']['rentinc'] = $data; break;
    case "MINBEDS" : $GLOBALS['criteria']['minbeds'] = $data; break;
    case "MAXBEDS" : $GLOBALS['criteria']['maxbeds'] = $data; break;
    case "PROPCOUNT" : $GLOBALS['criteria']['propcount'] = $data; break;
    default: break;
    }
  }

....
....

echo "<pre>\n";
print_r($criteria);
echo "</pre>\n";

OUTPUT:
9/6/2003
Array
(
    [maxstartdate] => junk
    [minstay] =>

    [maxstay] =>

    [minrent] =>

    [maxrent] =>

    [rentinc] =>

    [minbeds] =>

    [maxbeds] =>

    [propcount] =>

)
Thanks.--
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
chris.edwardsobinet.com
http://www.OuterBanksInternet.com

attached mail follows:


Chris Edwards wrote:

> I'm just going to give the code and output. It should be self explanatory.
> The array, $criteria, is having the issue. I don't know what it's doing. I
> cannot seem to assign the value from the $data variable to the
> $criteria[index] value. You will see some attempts to debug the situation
> which leads me to more puzzlement.
>
> CODE:
>
> // run when cdata is found
> function characterDataHandler($parser, $data)
> {
> switch( $GLOBALS['currentTag'] )
> {
> case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
> = $data;*/break;
> case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
> "junk";/*$data;*/break;
> case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
[snip]
>
> echo "<pre>\n";
> print_r($criteria);
> echo "</pre>\n";
>
>
> OUTPUT:
> 9/6/2003
> Array
> (
> [maxstartdate] => junk
> [minstay] =>
[snip]

$data is empty. How are you calling this function?

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


* Thus wrote Chris Edwards (chris.edwardsobinet.com):
> Hi
>
> I'm just going to give the code and output. It should be self explanatory.
> The array, $criteria, is having the issue. I don't know what it's doing. I
> cannot seem to assign the value from the $data variable to the
> $criteria[index] value. You will see some attempts to debug the situation
> which leads me to more puzzlement.

This code can't be clearly evaluated, There are several things that
can be wrong

>
> CODE:
>
> switch( $GLOBALS['currentTag'] )
> {
> case "MINSTARTDATE" : echo $data;/*$GLOBALS['criteria']['minstartdate']
> = $data;*/break;
> case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
> "junk";/*$data;*/break;
> case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
> case "MAXSTAY" : $GLOBALS['criteria']['maxstay'] = $data; break;
> case "MINRENT" : $GLOBALS['criteria']['minrent'] = $data; break;
> case "MAXRENT" : $GLOBALS['criteria']['maxrent'] = $data; break;
> case "RENTINC" : $GLOBALS['criteria']['rentinc'] = $data; break;
> case "MINBEDS" : $GLOBALS['criteria']['minbeds'] = $data; break;
> case "MAXBEDS" : $GLOBALS['criteria']['maxbeds'] = $data; break;
> case "PROPCOUNT" : $GLOBALS['criteria']['propcount'] = $data; break;
> default: break;
> }

global $currentTag may be:
  not assigned
  not all uppercase
  have a leading or trailing space
  not be one of the 'case' values

$data is empty.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Hi

$data is not empty. It's obvious from the :
> > OUTPUT:
> > 9/6/2003

Anyways, it is overwriting itself because of begin and start tags. I didn't
realize that.
Thanks.
--
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
chris.edwardsobinet.com
http://www.OuterBanksInternet.com

----- Original Message -----
From: "John W. Holmes" <holmes072000charter.net>
To: "Chris Edwards" <chris.edwardsobinet.com>
Cc: <php-generallists.php.net>
Sent: Friday, September 05, 2003 4:11 PM
Subject: Re: [PHP] global array, can't assign values from variables

> Chris Edwards wrote:
>
> > I'm just going to give the code and output. It should be self
explanatory.
> > The array, $criteria, is having the issue. I don't know what it's
doing. I
> > cannot seem to assign the value from the $data variable to the
> > $criteria[index] value. You will see some attempts to debug the
situation
> > which leads me to more puzzlement.
> >
> > CODE:
> >
> > // run when cdata is found
> > function characterDataHandler($parser, $data)
> > {
> > switch( $GLOBALS['currentTag'] )
> > {
> > case "MINSTARTDATE" : echo
$data;/*$GLOBALS['criteria']['minstartdate']
> > = $data;*/break;
> > case "MAXSTARTDATE" : $GLOBALS['criteria']['maxstartdate'] =
> > "junk";/*$data;*/break;
> > case "MINSTAY" : $GLOBALS['criteria']['minstay'] = $data; break;
> [snip]
> >
> > echo "<pre>\n";
> > print_r($criteria);
> > echo "</pre>\n";
> >
> >
> > OUTPUT:
> > 9/6/2003
> > Array
> > (
> > [maxstartdate] => junk
> > [minstay] =>
> [snip]
>
>
> $data is empty. How are you calling this function?
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Jay,
I should have though of that. Thanks.

"Jay Blanchard" <jay.blanchardniicommunications.com> wrote:
><?php
>$display_start = "2003-10-01";
>$display_end = "2003-10-31";
>if((date("Y-m-d") >= $display_start) && (date("Y-m-d") <=
>$display_end)){
> print($stuff);
>}
>?>

Cesar: Is your server is set up correctly? In your httpd.conf file, add .html you can use php in html files:

    <IfModule mod_php4.c>
        AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html
        AddType application/x-httpd-php-source .phps
    </IfModule>
    <IfModule mod_php3.c>
        AddType application/x-httpd-php3 .php3
        AddType application/x-httpd-php3-source .phps
    </IfModule>
    <IfModule mod_php.c>
        AddType application/x-httpd-php .phtml
    </IfModule>

Cesar Aracena wrote:

> If you could just change the file extension to .php to be accord to this
> forum...

attached mail follows:


Hey everyone...

 I am creating a project for a web hosting control panel and just wondering
if there is a limit to the amount of variables I can store in a session? If
I have too many variables will it create an uneccassary strain on my server?
What is an average amount of variables that a session should have.

I have a good knowledge of basic PHP but have never worked with sessions
before. This project is a learning project and a project because I have yet
to find what I'm looking for in hosting control panels.

Richard Marriner
Maingear Networks
http://www.maingear.net

attached mail follows:


I have this code:

 if (!$path) {
  $path = getPath();
 }

Sometimes $path is set (there are forms on the page that can change it).
When the page is first displayed:

Notice: Undefined variable: path in e:\program/ etc...
It then gives a reference to the line: if (!$path) {

Is there a way to get rid of this annoying notice?

Cheers
Leonie