php-general Digest 21 Apr 2001 08:56:43 -0000 Issue 640

Topics (messages 49596 through 49651):

Sessions and header-redirect
        49596 by: Scott
        49619 by: Plutarck

PERL vs. PHP
        49597 by: Jason Caldwell
        49598 by: Steve Lawson
        49599 by: Butler, Shaun
        49602 by: ..s.c.o.t.t.. [gts]
        49605 by: ..s.c.o.t.t.. [gts]
        49607 by: Rasmus Lerdorf
        49608 by: Alec Smith
        49609 by: ..s.c.o.t.t.. [gts]
        49611 by: Rasmus Lerdorf
        49618 by: Plutarck
        49648 by: Jason Caldwell

--enable-trans-sid
        49600 by: Boget, Chris
        49601 by: Boget, Chris
        49604 by: Martín Marqués

Re: session_register()
        49603 by: Martín Marqués

Re: Use of special characters in filenames results in IE problems
        49606 by: Dan Lowe

Another easy question!
        49610 by: Anthony Daniels
        49612 by: ..s.c.o.t.t.. [gts]

Re: `AM_PROG_LIBTOOL' not found in library
        49613 by: Kelly Cochran

Re: Add data to three tables at once from one form
        49614 by: Godd

Re: Databases and HTML forms
        49615 by: Godd

Re: Headers sent by - need to clear screen - help me
        49616 by: Plutarck

Re: SOMEONE SHOOT ME!!!
        49617 by: Christopher Riordan
        49620 by: Christopher Riordan

Re: This should be simple...
        49621 by: Plutarck

Re: Site Sesions: Online/off...
        49622 by: Plutarck

Re: PHPSESSID in session
        49623 by: Plutarck

PHP Books
        49624 by: Michael C
        49625 by: Jeff Oien
        49631 by: Dddogbruce \(.home.com\)

Problems with pattern matching
        49626 by: Alec Smith
        49629 by: Jack Dempsey

imap_fetchbody
        49627 by: Martin Oust
        49628 by: Martin Oust

I'm a moron.  So?
        49630 by: Dddogbruce \(.home.com\)
        49641 by: CC Zona

TheCasino.com: You have been removed!
        49632 by: support.thecasino.com
        49633 by: Jack Dempsey

MySQL, PHP low-load problems
        49634 by: Kees Hoekzema
        49638 by: Rasmus Lerdorf

mysql_free_result
        49635 by: Randy Johnson
        49639 by: Rasmus Lerdorf
        49640 by: Randy Johnson
        49642 by: Rasmus Lerdorf

Weekly Salary for PHP/MySQL or PostgreSQL Programmer
        49636 by: Jason Lotito

I don't get it ... suddenly my script doesn't work ...
        49637 by: Tim Thorburn

Re: fflush() function
        49643 by: Yasuo Ohgaki

Re: Uninstalling PHP
        49644 by: Yasuo Ohgaki

Re: Advanced Help Needed
        49645 by: Yasuo Ohgaki

Re: Mail form error in script
        49646 by: Yasuo Ohgaki

Output graphic or other download file to client's browser
        49647 by: Jason Lam

Recursive Childs
        49649 by: Natasha

Re: ENUM or SET and PHP
        49650 by: Christian Reiniger

imap
        49651 by: Martin Oust

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


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


Does anyone know of a way to use sessions and still be able to redirect with
the header function. In the code below I test for the existence of the
PHPSESSID and send the user to register if it doesn't exist. If it does
exist I start a session to retrieve the session variables then call a class
that tests for other conditions. If the test is successful then I try to
redirect which fails because (as I understand it) session_start has already
sent headers.
I really don't like putting links on pages that say "Click here to continue"
so I'm looking for a solution. Any ideas?

<?
if (!isset($PHPSESSID)){
    header("Location:http://www.blah.com/register.php");
}
session_start();
if ($action == "update"){
    include("../includes/update_class.php");
    $my=new update_listing();
    header("Location:http://www.blah.com mem_welcome.php?sid=$PHPSESSID");
}
?>

JS Plauche





Nope, you can use header() after starting a session.

This works fine, even if a session is already started:

session_start();

header("Location: http://www.fbi.gov");


Creapy, but it works.

You see, when a "header" is sent, it's not actually "sent". PHP collects all
headers and fills out a header table, which it sends to the webserver once
the script ends or when the first piece of data is sent to the browser
(whichever comes first).

That's why you can make 10 calls to header and all of them will work.

If you are getting the "headers already sent error" it's most likely because
you unknowingly sent data to the user's browser. But you'd get one of those
"headers already sent" messages. Are you getting one of those?

Note: People can append a PHPSESSID onto the end of your url to make you
think a session is already started. Also when you destroy a session, the
browser still likes to send the session ID to you. So checking for only the
existance of PHPSESSID to see if the user has logged in or at least tried to
is a bad idea. You should probably check for the existance of a variable
inside that session. To see if they've attempted to login (even if you do
that anyway, it's a good idea not to bother with something like if
(!$PHPSESSID)).



--
Plutarck
Should be working on something...
...but forgot what it was.


"Scott" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone know of a way to use sessions and still be able to redirect
with
> the header function. In the code below I test for the existence of the
> PHPSESSID and send the user to register if it doesn't exist. If it does
> exist I start a session to retrieve the session variables then call a
class
> that tests for other conditions. If the test is successful then I try to
> redirect which fails because (as I understand it) session_start has
already
> sent headers.
> I really don't like putting links on pages that say "Click here to
continue"
> so I'm looking for a solution. Any ideas?
>
> <?
> if (!isset($PHPSESSID)){
>     header("Location:http://www.blah.com/register.php");
> }
> session_start();
> if ($action == "update"){
>     include("../includes/update_class.php");
>     $my=new update_listing();
>     header("Location:http://www.blah.com mem_welcome.php?sid=$PHPSESSID");
> }
> ?>
>
> JS Plauche
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






If I know PHP will I *basically* know PERL?  Looking at some PERL code... it
looks nearly identical.

Thanks.
Jason







No, you won't.

PHP is has very similar syntax to c/c++ and perl but the concepts are
extremely different.

SL.


----- Original Message -----
From: "Jason Caldwell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2001 3:10 PM
Subject: [PHP] PERL vs. PHP


> If I know PHP will I *basically* know PERL?  Looking at some PERL code...
it
> looks nearly identical.
>
> Thanks.
> Jason
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





maybe for basics but in general no way, I think going the other way, from 
Perl to PHP is a much easier transition.

- Shaun

On Friday 20 April 2001 17:10, Jason Caldwell wrote:
> If I know PHP will I *basically* know PERL?  Looking at some PERL code...
> it looks nearly identical.
>
> Thanks.
> Jason




PHP was started as a suite of perl programs... it is heavily
influenced by perl.  if you understand PHP and are comfortable
with it, you should not have any problems learning Perl.

there are some very important differences between the two
languages that you need to keep your eyes open for, 
things like variable scoping (perl vars are global by default)
and variable prefixes

        @varname = array
        $varname[1] = item in the array

        %varname = hash (assoc. array)
        $varname{'name'} = element of the hash.

PHP kind-of smoothes over the perl approach to variables
and makes *everything* $varname, $varname[1], $varname['name']


IMO, perl allows you greater control over a number of 
things that PHP doesn't address, but that's mainly becuase
perl is older and has had more time to  build up funcitonality
and also becuase perl's focus is larger than web-based projects
(so you can use perl to do some things that you probably cant
do in PHP, like create daemons and servers)

all in all, if you know and love PHP, you'll probably find a
friendly home in Perl.  :)




i program in both PHP/Perl, and the concepts are
extremely similar... 

granted, there are some similarities to C++,
but by far, the largest contributor to PHP's
language design has been Perl.


> -----Original Message-----
> From: Steve Lawson [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] PERL vs. PHP
> 
> No, you won't.
> 
> PHP is has very similar syntax to c/c++ and perl but the concepts are
> extremely different.
> 
> SL.





> PHP was started as a suite of perl programs... it is heavily
> influenced by perl.  if you understand PHP and are comfortable
> with it, you should not have any problems learning Perl.

Not quite.  I prototyped the initial parser with a Perl program (pre
version 1), but the "suite" as you call it was all written in C.

-Rasmus





Perl to PHP is proving to be no big deal for me. I've only just started
looking at PHP 3 days ago, and am already generating production code. PHP
to Perl would most likely be a harder move since you'd have to add quite a
few new concepts to your knowledgebase.

In general, I'd have to say that PHP is a far easier language to use
overall.


On Fri, 20 Apr 2001, Butler, Shaun wrote:

> maybe for basics but in general no way, I think going the other way, from
> Perl to PHP is a much easier transition.
>
> - Shaun
>
> On Friday 20 April 2001 17:10, Jason Caldwell wrote:
> > If I know PHP will I *basically* know PERL?  Looking at some PERL code...
> > it looks nearly identical.
> >
> > Thanks.
> > Jason
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





ahhh... sorry.
i thought the history of PHP was a bunch of perl scripts
that were used to keep track of website statistics or
somethign.... guess i was wrong.

but since you replied, can i ask what influenced you most
when developing PHP?  

personally, i see perl influence everywhere in PHP,
but maybe i'm just not familiar enough with C
to recognize a lot of C influence.

> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] PERL vs. PHP
> 
> 
> > PHP was started as a suite of perl programs... it is heavily
> > influenced by perl.  if you understand PHP and are comfortable
> > with it, you should not have any problems learning Perl.
> 
> Not quite.  I prototyped the initial parser with a Perl program (pre
> version 1), but the "suite" as you call it was all written in C.
> 
> -Rasmus





> but since you replied, can i ask what influenced you most
> when developing PHP?

Whenever I couldn't decide what sort of syntax to use I copied C

-Rasmus





"Basically", yes. And I do mean "basically".

The languages have the same "basic" sort of syntax and you can make a perl
script look almost exactly like a PHP script and vice-versa.

However that means _only_ that it is easier to learn one after learning the
other.

The paradox is that Perl gurus write awful PHP code. PHP gurus write awful
Perl code.

If you are going to write something in a certain language, you _must_ write
it as a programmer of that language. PHP and Perl look a lot alike, but if
you try and write them the same you will never be good at either of them.

Wizard level code of either PHP or Perl really isn't even the least bit
similar. Good perl code stuffs a whole ton of activity into a very small
space. You can check if a string is empty, run regex on it to remove certain
data, then split it and stick it into a tailor-made associative array on
just a few lines.

Try and write PHP code like that and you might as well eat your keyboard.
PHP isn't "perl, just a little better". (people trying to write PHP like it
was Java perhaps worse, though. If they use a class to check a variable for
truth, they're probably a Java programmer ;)


Just remember: Square Peg, Square Hole.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message
9bq8h0$n78$[EMAIL PROTECTED]">news:9bq8h0$n78$[EMAIL PROTECTED]...
> If I know PHP will I *basically* know PERL?  Looking at some PERL code...
it
> looks nearly identical.
>
> Thanks.
> Jason
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Ramus Lerdof,

Are you the Ramus that created PHP?

If so, just want to say -- THANKS! -- PHP is the coolest thing since Delphi
!!!

Really Love it!

Jason



"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > PHP was started as a suite of perl programs... it is heavily
> > influenced by perl.  if you understand PHP and are comfortable
> > with it, you should not have any problems learning Perl.
>
> Not quite.  I prototyped the initial parser with a Perl program (pre
> version 1), but the "suite" as you call it was all written in C.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






I wasn't able to find this in the docs, so could someone
tell me exactly how --enable-trans-sid is supposed to work
behind the scenes?

Why would this option work and transmit the SID for
this url:

<a href="/interactive/secure_frame.php?sourcePage=<? echo urlencode(
"/interactive/direct_apply/resident.php" ); ?>" target="_top">here</a>

while it won't for this url:

<a href="/interactive/direct_apply/resident.php" target="_top">here</a>

It makes no sense to me...
Any help would be greatly appreciated!!

Chris




> I wasn't able to find this in the docs, so could someone
> tell me exactly how --enable-trans-sid is supposed to work
> behind the scenes?
> Why would this option work and transmit the SID for
> this url:
> while it won't for this url:
> It makes no sense to me...
> Any help would be greatly appreciated!!

Never mind...  I know what's happening.
Please accept my apologies.  My brain is mush today... :(

Chris




On Sáb 21 Abr 2001 00:27, Boget, Chris wrote:
> > I wasn't able to find this in the docs, so could someone
> > tell me exactly how --enable-trans-sid is supposed to work
> > behind the scenes?
> > Why would this option work and transmit the SID for
> > this url:
> > while it won't for this url:
> > It makes no sense to me...
> > Any help would be greatly appreciated!!
>
> Never mind...  I know what's happening.
> Please accept my apologies.  My brain is mush today... :(

Hey, never mind! It's Friday!!! :-)

Saludos... ;-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




On Vie 20 Abr 2001 18:15, Wade wrote:
> I am registering a number of variables. Can I combine them into one
> session_register, such as session_register("one", "two" ... "n")?

Well, the manuals say YES!

Saludos... :-)

-- 
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        [EMAIL PROTECTED]
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------




rawurlencode() - http://php.net/rawurlencode

<?php
  $str = 'Oplæg';
  print $str . '<br>';
  $enc = rawurlencode($str);
  print $enc . '<br>';
?>

 -dan

Previously, Floyd Piedad said:
> 
> I discovered a bug in my program for uploading files, which stores the
> filename in the database in order to create a link for it on the web page in
> the future.  The bug is when the filename makes use of special characters
> (e.g. Oplæg).  When I create a link to the file, the link works with
> Netscape.  With IE however, it says that file is not found.  I discovered that
> if I use the "encoded" version of the file name ("Opl%e6g") it works on both
> IE and Netscape.  What function or code is used to convert to this format?

-- 
If carpenters made buildings the way programmers make programs, the first
woodpecker to come along would destroy all of civilization.
                                -Weinberg's Second Law




Hello,

I really like how this group responds quickly.  Here is another minor problem I am 
facing.

My programmers are in Romania and have shut down shop for the weekend.  Well, I am in 
somewhat of a dilema.  I have a MySql database and php enhanced admin. 
section on my site.  The problem I am having is that the maximum character amount that 
my programmers have put on three different variables is too low.  I need to increase 
these considerably.  Is there an easy way to do this?  If am not too familiar with 
telenet, if that is what I must use, however, I can learn if given detailed 
instructions.  

Please help!

Thank you,

Anthony Daniels

PS  I am pretty familiar with how varibales work, but I am not to knowledgeable about 
the syntax.  If spelled out, I can do it. Thanks again.





it depends.

is it a char restriction that MySQL is placing on you?
e.g. a TINYTEXT field type can only contain 255 chars,
whereas a TEXT type can contain 16MB (or something like that)

if it's a PHP restriction, you'll have to wade thru
PHP scripts to find the function that checks the
length, and alter that function.

however, if it's a MySQL limitation, all you need to
do is log into the MysQL server and issue some
ALTER TABLE statements
http://mysql.com/doc/A/L/ALTER_TABLE.html


> -----Original Message-----
> From: Anthony Daniels [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 20, 2001 6:12 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Another easy question!
> 
> 
> Hello,
> 
> I really like how this group responds quickly.  Here is another minor 
> problem I am facing.
> 
> My programmers are in Romania and have shut down shop for the weekend.  
> Well, I am in somewhat of a dilema.  I have a MySql database and php 
> enhanced admin. 
> section on my site.  The problem I am having is that the maximum character 
> amount that my programmers have put on three different variables is too 
> low.  I need to increase 
> these considerably.  Is there an easy way to do this?  If am not too 
> familiar with telenet, if that is what I must use, however, I can learn if 
> given detailed instructions.  
> 
> Please help!
> 
> Thank you,
> 
> Anthony Daniels
> 
> PS  I am pretty familiar with how varibales work, but I am not to 
> knowledgeable about the syntax.  If spelled out, I can do it. Thanks again.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





        Ok, now I have no idea.  I'd suggest grabbing the latest RC or waiting
for the release at this point.  CVS versions require a bunch of tools to
generate files (autoconf, libtool, etc.).  The RC and releases come with
the generated files.  There appears to be some odd problem with you
build environment.  What it is, I don't know.

Pablo Sabatino wrote:
> 
> I deleted php4 and downladed the software again from the cvs and compiled
> it.
> This is the error message when executed ./make
> 
> gmake: *** [zend_language_parser.c] Violación de segmento
> pablo@pablito:~/php4/Zend > cd ..
> pablo@pablito:~/php4 > gmake
> Making all in Zend
> gmake[1]: Entering directory `/home/pablo/php4/Zend'
> bison -y -p zend -v -d ./zend_language_parser.y -o zend_language_parser.c
> gmake[1]: *** [zend_language_parser.c] Violación de segmento
> gmake[1]: Leaving directory `/home/pablo/php4/Zend'
> gmake: *** [all-recursive] Error 1
> pablo@pablito:~/php4 >
> 
> The version bison is:  1.28 and this messages is from ./configure [args]
> The system operating is SUSE 6.4.
> 
> Configuring Zend
> checking bison version... 1.28 (ok)
> checking for limits.h... (cached) yes
> checking for malloc.h... yes
> checking for string.h... (cached) yes
> checking for unistd.h... (cached) yes
> checking for stdarg.h... (cached) yes
> checking for sys/types.h... (cached) yes
> checking for signal.h... (cached) yes
> checking for unix.h... (cached) no
> checking for dlfcn.h... yes
> checking for size_t... (cached) yes
> checking return type of signal handlers... void
> checking for dlopen in -ldl... (cached) yes
> checking for dlopen... (cached) yes
> checking for uint... yes
> checking for ulong... yes
> checking for vprintf... (cached) yes
> checking for 8-bit clean memcmp... yes
> checking for working alloca.h... (cached) yes
> checking for alloca... (cached) yes
> checking for memcpy... (cached) yes
> checking for strdup... (cached) yes
> checking for getpid... yes
> checking for kill... yes
> checking for strtod... yes
> checking for strtol... yes
> checking for finite... yes
> checking for fpclass... no
> checking whether sprintf is broken... (cached) no
> checking for finite... (cached) yes
> checking for isfinite... no
> checking for isinf... yes
> checking for isnan... yes
> checking whether fp_except is defined... no
> checking whether to enable experimental ZTS... no
> checking whether to enable inline optimization for GCC... no
> checking whether to enable a memory limit... no
> checking whether to enable Zend debugging... no
> checking for inline... inline
> 
> what the matter???
> Could resolve it?
> 
> Please, help me!
> 
> Thanks pablo!
> 
> > From: "Kelly Cochran" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, April 19, 2001 6:41 PM
> > Subject: Re: [PHP] `AM_PROG_LIBTOOL' not found in library
> >
> >
> >         You'll likely have to do a make distclean in the root PHP dir as well.
> > Without that, make is probably finding the zend_ini_parser.c that your
> > old bison created from zend_ini_parser.y, and therefore doesn't
> > regenerate it.  Or you could probably also simply 'touch
> > Zend/zend_ini_parser.y' and that should also cause make to regen the .c
> > file.  Either that, or you could simply nuke the whole dir, and checkout
> > from CVS again doing the './buildconf; ./configure <args>; make' cycle
> > again.

-- -
Kelly Cochran  <[EMAIL PROTECTED]>
Technical Staff - funschool.com Corporation




you have the idea.

Just add the other sql statements and run it again. (Just multiply the
script by 3) or you can use a loop to add the next sql to run eg.
$sql1= "insert statement 1";
$sql2="insert statement 2";
$sql3= "insert statement 3";

for ($i=0; $i<3; $i++)
    {
$qryno = '$sql' + $i
$result = mysql_db_query($dbname, $qryno);
    }


try that or something alongs that line should work. of course you can always
refer to teh help files.



>
> How do I set up the insert statement?
>
>    $query = "INSERT INTO $table VALUES ('$menu_id', '$server',
> '$menunumber', '$menuname')";
>
>  $result = mysql_db_query($dbname, $query);
>
> <form enctype="multipart/form-data" method="post"
>                             action="<?php echo $PHP_SELF ?>">
>
> Anyting special I have to do with the form submit?
> <INPUT type="submit" name="submenu" value="submenu">
> <INPUT type=reset value="Reset">
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Just Kinda code it up







Short answer: no.


If you can't just put your error information before you write information to
the screen you will need to use the ob_* family of functions. Clean the
information you've printed so far, then just print out the error information
to the screen.


--
Plutarck
Should be working on something...
...but forgot what it was.


"Michael Champagne" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I don't know if I'm wording this right.
>
> I have a display_error function in PHP that I want to generate a screen
with
> some information about the error, send us email, etc.  The problem is that
> sometimes it's called after the headers have been sent and in the middle
of a
> page.  Is there a way to 'clear' the screen and putup the error stuff?
>
> Thanks!
>
> Mike
>
>
>
> ******************************************************************
> This communication is for informational purposes only.  It is not
> intended as an offer or solicitation for the purchase or sale of
> any financial instrument or as an official confirmation of any
> transaction, unless specifically agreed otherwise.  All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without
> notice.  Any comments or statements made herein do not
> necessarily reflect the views or opinions of Capital Institutional
> Services, Inc.  Capital Institutional Services, Inc. accepts no
> liability for any errors or omissions arising as a result of
> transmission.  Use of this communication by other than intended
> recipients is prohibited.
> ******************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






First off get php4.04p1 second you will need to hack the module code in
apache before running configure. in src/modules/php4. edit the
libphp4.modules file. and change c-client4 to c-client then rebuild apache.
you should be all set then. for some reason c-client4 doesn't work. I just
figured it out myself :)


Chris




""Rick Kukiela"" <[EMAIL PROTECTED]> wrote in message
000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]">news:000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]...
> Ok,
>
> I cant comprehend why php/apache is so freakin impossible to compile with
> IMAP support?!? what is going on?
>
> Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and complied
> it and put the includes in the appropriate places, then i followed the php
> installation instructions so i go into my apache src directory and do a
>
> ./configure
>
> then I go into my php src directory and do a
>
./configure --with-mysql --with-imap --with-apache=../apache_1.3.19 --enable
> -track-vars
>
> this works fine.
>
> I do the make; make install
>
> works fine,
>
> cd ../apache_1.3.19
>
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
> bphp4.a
>
> This is what happens. Can some one please tell me why this is happening
and
> what I can do to work arround it?
>
> Configuring for Apache, Version 1.3.19
>  + using installation path layout: Apache (config.layout)
>  + activated php4 module (modules/php4/libphp4.a)
> Creating Makefile
> Creating Configuration.apaci in src
> Creating Makefile in src
>  + configured for OpenBSD platform
>  + setting C compiler to gcc
>  + setting C pre-processor to gcc -E
>  + checking for system header files
>  + adding selected modules
>     o php4_module uses ConfigStart/End
>  + checking sizeof various data types
>  + doing sanity check on compiler and options
> ** A test compilation with your Makefile configuration
> ** failed.  The below error output from the compilation
> ** test will give you an idea what is failing. Note that
> ** Apache requires an ANSI C Compiler, such as gcc.
>
> cd ..;
>
gcc  -I/usr/local/src/php-4.0.3pl1 -I/usr/local/src/php-4.0.3pl1/main -I/usr
>
/local/src/php-4.0.3pl1/main -I/usr/local/src/php-4.0.3pl1/Zend -I/usr/local
>
/src/php-4.0.3pl1/Zend -I/usr/local/src/php-4.0.3pl1/TSRM -I/usr/local/src/p
>
hp-4.0.3pl1/TSRM -I/usr/local/src/php-4.0.3pl1 -DUSE_EXPAT -I./lib/expat-lit
> e -DNO_DL_NEEDED `./apaci`     -o helpers/dummy
>
helpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules
> /php4 -lmodphp4  -lc-client  -lresolv -lm  -lresolv
> ftl_unix.c:29: Undefined symbol `_mm_fatal' referenced from text segment
> auth_md5.c:101: Undefined symbol `_mm_login' referenced from text segment
> auth_pla.c:59: Undefined symbol `_mm_log' referenced from text segment
> auth_pla.c:69: Undefined symbol `_mm_login' referenced from text segment
> auth_log.c:63: Undefined symbol `_mm_login' referenced from text segment
> env_unix.c:976: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:993: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:999: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1048: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1054: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1149: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1161: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1206: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:0: More undefined symbol _mm_log refs follow
> unix.c:306: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:328: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:346: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:433: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:574: Undefined symbol `_mm_flags' referenced from text segment
> unix.c:690: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:715: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:747: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:791: Undefined symbol `_mm_notify' referenced from text segment
> unix.c:807: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:810: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:847: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:896: Undefined symbol `_mm_notify' referenced from text segment
> unix.c:953: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:957: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:0: More undefined symbol _mm_nocritical refs follow
> unix.c:1165: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:1930: Undefined symbol `_mm_diskerror' referenced from text segment
> unix.c:2050: Undefined symbol `_mm_diskerror' referenced from text segment
> mail.c:980: Undefined symbol `_mm_status' referenced from text segment
> mail.c:1357: Undefined symbol `_mm_flags' referenced from text segment
> mail.c:2066: Undefined symbol `_mm_flags' referenced from text segment
> mail.c:2130: Undefined symbol `_mm_searched' referenced from text segment
> mail.c:2133: Undefined symbol `_mm_searched' referenced from text segment
> mail.c:2293: Undefined symbol `_mm_notify' referenced from text segment
> mail.c:2783: Undefined symbol `_mm_exists' referenced from text segment
> mail.c:2811: Undefined symbol `_mm_expunged' referenced from text segment
> mail.o: Undefined symbol `_mm_dlog' referenced from data segment
> dummy.c:200: Undefined symbol `_mm_lsub' referenced from text segment
> dummy.c:201: Undefined symbol `_mm_lsub' referenced from text segment
> dummy.c:204: Undefined symbol `_mm_lsub' referenced from text segment
> dummy.c:357: Undefined symbol `_mm_list' referenced from text segment
> dummy.c:637: Undefined symbol `_mm_notify' referenced from text segment
> smtp.c:506: Undefined symbol `_mm_dlog' referenced from text segment
> smtp.c:559: Undefined symbol `_mm_dlog' referenced from text segment
> smtp.c:585: Undefined symbol `_mm_dlog' referenced from text segment
> collect2: ld returned 1 exit status
> *** Error code 1
>
> Stop in /usr/local/src/apache_1.3.19/src/helpers (line 39 of Makefile).
> ======== Error Output for sanity check ========
> ============= End of Error Report =============
>
>  Aborting!
>
>
> I am losing my mind... please help :)
>
> Thanks,
> Rick
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Just a quick addemdum. run the configure normaly on php4, then edit the
config.status and config_var.mk file. then you won't need to edit the files
anywhere else. make the same change as I mentioned before the c-client4 to
c-client. then run make make install then compile apache and you should be
all set :)


Chris

""Christopher Riordan"" <[EMAIL PROTECTED]> wrote in message
9bqfn3$onp$[EMAIL PROTECTED]">news:9bqfn3$onp$[EMAIL PROTECTED]...
> First off get php4.04p1 second you will need to hack the module code in
> apache before running configure. in src/modules/php4. edit the
> libphp4.modules file. and change c-client4 to c-client then rebuild
apache.
> you should be all set then. for some reason c-client4 doesn't work. I just
> figured it out myself :)
>
>
> Chris
>
>
>
>
> ""Rick Kukiela"" <[EMAIL PROTECTED]> wrote in message
> 000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]">news:000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]...
> > Ok,
> >
> > I cant comprehend why php/apache is so freakin impossible to compile
with
> > IMAP support?!? what is going on?
> >
> > Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and
complied
> > it and put the includes in the appropriate places, then i followed the
php
> > installation instructions so i go into my apache src directory and do a
> >
> > ./configure
> >
> > then I go into my php src directory and do a
> >
>
./configure --with-mysql --with-imap --with-apache=../apache_1.3.19 --enable
> > -track-vars
> >
> > this works fine.
> >
> > I do the make; make install
> >
> > works fine,
> >
> > cd ../apache_1.3.19
> >
>
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
> > bphp4.a
> >
> > This is what happens. Can some one please tell me why this is happening
> and
> > what I can do to work arround it?
> >
> > Configuring for Apache, Version 1.3.19
> >  + using installation path layout: Apache (config.layout)
> >  + activated php4 module (modules/php4/libphp4.a)
> > Creating Makefile
> > Creating Configuration.apaci in src
> > Creating Makefile in src
> >  + configured for OpenBSD platform
> >  + setting C compiler to gcc
> >  + setting C pre-processor to gcc -E
> >  + checking for system header files
> >  + adding selected modules
> >     o php4_module uses ConfigStart/End
> >  + checking sizeof various data types
> >  + doing sanity check on compiler and options
> > ** A test compilation with your Makefile configuration
> > ** failed.  The below error output from the compilation
> > ** test will give you an idea what is failing. Note that
> > ** Apache requires an ANSI C Compiler, such as gcc.
> >
> > cd ..;
> >
>
gcc  -I/usr/local/src/php-4.0.3pl1 -I/usr/local/src/php-4.0.3pl1/main -I/usr
> >
>
/local/src/php-4.0.3pl1/main -I/usr/local/src/php-4.0.3pl1/Zend -I/usr/local
> >
>
/src/php-4.0.3pl1/Zend -I/usr/local/src/php-4.0.3pl1/TSRM -I/usr/local/src/p
> >
>
hp-4.0.3pl1/TSRM -I/usr/local/src/php-4.0.3pl1 -DUSE_EXPAT -I./lib/expat-lit
> > e -DNO_DL_NEEDED `./apaci`     -o helpers/dummy
> >
>
helpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules
> > /php4 -lmodphp4  -lc-client  -lresolv -lm  -lresolv
> > ftl_unix.c:29: Undefined symbol `_mm_fatal' referenced from text segment
> > auth_md5.c:101: Undefined symbol `_mm_login' referenced from text
segment
> > auth_pla.c:59: Undefined symbol `_mm_log' referenced from text segment
> > auth_pla.c:69: Undefined symbol `_mm_login' referenced from text segment
> > auth_log.c:63: Undefined symbol `_mm_login' referenced from text segment
> > env_unix.c:976: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:993: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:999: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1048: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1054: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1149: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1161: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1206: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:0: More undefined symbol _mm_log refs follow
> > unix.c:306: Undefined symbol `_mm_critical' referenced from text segment
> > unix.c:328: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:346: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:433: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:574: Undefined symbol `_mm_flags' referenced from text segment
> > unix.c:690: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:715: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:747: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:791: Undefined symbol `_mm_notify' referenced from text segment
> > unix.c:807: Undefined symbol `_mm_critical' referenced from text segment
> > unix.c:810: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:847: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:896: Undefined symbol `_mm_notify' referenced from text segment
> > unix.c:953: Undefined symbol `_mm_critical' referenced from text segment
> > unix.c:957: Undefined symbol `_mm_nocritical' referenced from text
segment
> > unix.c:0: More undefined symbol _mm_nocritical refs follow
> > unix.c:1165: Undefined symbol `_mm_critical' referenced from text
segment
> > unix.c:1930: Undefined symbol `_mm_diskerror' referenced from text
segment
> > unix.c:2050: Undefined symbol `_mm_diskerror' referenced from text
segment
> > mail.c:980: Undefined symbol `_mm_status' referenced from text segment
> > mail.c:1357: Undefined symbol `_mm_flags' referenced from text segment
> > mail.c:2066: Undefined symbol `_mm_flags' referenced from text segment
> > mail.c:2130: Undefined symbol `_mm_searched' referenced from text
segment
> > mail.c:2133: Undefined symbol `_mm_searched' referenced from text
segment
> > mail.c:2293: Undefined symbol `_mm_notify' referenced from text segment
> > mail.c:2783: Undefined symbol `_mm_exists' referenced from text segment
> > mail.c:2811: Undefined symbol `_mm_expunged' referenced from text
segment
> > mail.o: Undefined symbol `_mm_dlog' referenced from data segment
> > dummy.c:200: Undefined symbol `_mm_lsub' referenced from text segment
> > dummy.c:201: Undefined symbol `_mm_lsub' referenced from text segment
> > dummy.c:204: Undefined symbol `_mm_lsub' referenced from text segment
> > dummy.c:357: Undefined symbol `_mm_list' referenced from text segment
> > dummy.c:637: Undefined symbol `_mm_notify' referenced from text segment
> > smtp.c:506: Undefined symbol `_mm_dlog' referenced from text segment
> > smtp.c:559: Undefined symbol `_mm_dlog' referenced from text segment
> > smtp.c:585: Undefined symbol `_mm_dlog' referenced from text segment
> > collect2: ld returned 1 exit status
> > *** Error code 1
> >
> > Stop in /usr/local/src/apache_1.3.19/src/helpers (line 39 of Makefile).
> > ======== Error Output for sanity check ========
> > ============= End of Error Report =============
> >
> >  Aborting!
> >
> >
> > I am losing my mind... please help :)
> >
> > Thanks,
> > Rick
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






RTFM






...there, feel better now? *always happy to help* :)


--
Plutarck
Should be working on something...
...but forgot what it was.


"Joseph Koenig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Right on. That did it. I probably should have been RTFM'ed for that one
> :) I knew there was a simple solution.
>
> Joe
>
> Alexander Wagner wrote:
> >
> > Joseph Koenig wrote:
> > > <INPUT TYPE ="text" blab blab VALUE = "Here's the text "in quotes"">
> > > Well, obviously there's a problem with that. The form field will show
> > > "Here's the text " and then thinks it ends. Is there any way to get
> > > around this, other than stripping out her quotes? Thanks,
> >
> > http://php.net/htmlentities
> >
> > regards
> > Wagner
> >
> > --
> > "A conference is a gathering of important people who singly can do
> > nothing, but together can decide that nothing can be done."
> > Fred Allen (1894-1956)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






If you want to make it easy on yourself, convert it into a timestamp (unix
preferably). Then all you have to do is:

$dif = time() - $last_access_time;

if ($dif > 3600)
{
    echo "The user has been inactive for more than an hour.";
}

That's if you want to make it easy on yourself. If you're a masochist I
suppose you could play around with mktime()  :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""Richard"" <[EMAIL PROTECTED]> wrote in message
9bpbf3$fc$[EMAIL PROTECTED]">news:9bpbf3$fc$[EMAIL PROTECTED]...
> Greetings. (the thread was too far down to be read by anyone)
>
>     I am having some problems with the code itself! I have done like so,
> that whenever peopel wishes to see the "onliners", I start a function
called
> DelOld(). This will not decrease server speed, nor create conflicts when
> writing to temporary files and so forth.
>     Now, I tried to gather the following into an exploded array:
>
>     // the date output
>     $date_output = date("Y-m-d-H-i-A");
>
>     As you see, I've seperated all with a "-" so I can simply call [0],
[1],
> [2],... if I want something. Now, How can I compare if a user is away for
> like 10 minutes, or 30 minutes? I have a function called
> GetLoggDateofUser($Username) which will retreive the  $date_output, but
with
> colons and spaces, like so:
>     date("Y-m-d H:i A").
>
>     Do you or anyone else have any suggestions?
>
> - Richard
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






If the user's browser does not support the session cookie like it should,
PHP will automatically "rewrite" your url's and add "?PHPSESSID=".

So you don't need to force PHPSESSID to be sent, but you could always just
add ?PHPSESSID= onto all the urls you want.

It's just really ugly that way.


--
Plutarck
Should be working on something...
...but forgot what it was.


""nicuc.ac.jp"" <[EMAIL PROTECTED]> wrote in message
9bp4n3$7uk$[EMAIL PROTECTED]">news:9bp4n3$7uk$[EMAIL PROTECTED]...
> I use session in my Shopping cart program.
> start with
>
>     session_start() ;
>
> and register the value with
>
>     session_register('uid') ;
>
> when I want to pass the session value to another page I use
>
> echo "<a href='somepage.php'>click</a>" ;
>
>
> In 'somepage.php' I try to echo $uid  the output that correct
> My question is why my url not contain like
>
> http://aaa.com/somepage.php?PHPSESSID= blah... blah..
>
> It's not show like above just show like below
>
> http://aaa.com/somepage.php
>
> and it's work... ?
>
>
> Is this because session send  cookies to the browser ?
> How could I do if I need to force session not sent the cookies to user ?
>
>
> Any comment would be appriciated.
>
>
> --
> Yang
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Hello
Could I get a recommendation on some good starting PHP books?
Thanks

-- 
Later Days:)
Michael Clesceri

""Perfection (in design) is achieved not when there is nothing more to add, but rather 
when there is nothing more to take away."




Here are some recommendations:
http://www.webdesigns1.com/php/books.php
Jeff Oien
 
> Hello
> Could I get a recommendation on some good starting PHP books?
> Thanks
> 
> -- 
> Later Days:)
> Michael Clesceri
> 
> ""Perfection (in design) is achieved not when there is nothing 
> more to add, but rather when there is nothing more to take away."
> 




PHP4 - written by Chris Ullman (and some others.  It has 5 pictures on the front...)







I'm attempting to get something like the following to match anything from 
aol.com so that I can handle AOL users differently than users from other 
ISPs:

    $hostname = gethostbyaddr($REMOTE_ADDR);

    if (eregi(".*\.aol\.com.*", $hostname))
    {
        echo $hostname;
        echo "AOHell user";
    }
    else
    {
        echo $hostname;
        echo "Not on AOHell";
    }

However, the else condition is always the one which is always executed. Any 
ideas why? I'll admit to being somewhat weak when it comes to regular 
expressions.

Thanks,
Alec





i got the echo of "AOHell user" to appear with this...
i'd look at what remote addr returns and check and see if that works with
your regexp.......

jack

$hostname = "www.aol.com";

    if (eregi(".*\.aol\.com.*", $hostname))
    {
        echo $hostname;
        echo "AOHell user";
    }
    else
    {
        echo $hostname;
        echo "Not on AOHell";
    }

-----Original Message-----
From: Alec Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 9:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems with pattern matching


I'm attempting to get something like the following to match anything from
aol.com so that I can handle AOL users differently than users from other
ISPs:

    $hostname = gethostbyaddr($REMOTE_ADDR);

    if (eregi(".*\.aol\.com.*", $hostname))
    {
        echo $hostname;
        echo "AOHell user";
    }
    else
    {
        echo $hostname;
        echo "Not on AOHell";
    }

However, the else condition is always the one which is always executed. Any
ideas why? I'll admit to being somewhat weak when it comes to regular
expressions.

Thanks,
Alec


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






documentation:

string imap_fetchbody (int imap_stream, int msg_number, string part_number)

what is the different part_numbers i should and could use?






documentation:

string imap_fetchbody (int imap_stream, int msg_number, string part_number)

what is the different part_numbers i should and could use?






Alrighty.  I'm baack!  Anyways, I seem to be having stupid little
problems, al of which are driving me insane.  I'll feel really
stupid when you tell me the problem.  A friend told me something about
"seeding" for random() but I didn't find anything on that.

This is the HTML section...

<HTML>
<HEAD>
<TITLE>Horse Race v.1</TITLE>
</HEAD>
<BODY>
Welcome to horse racing v.1.  This is a simple PHP game where you can
train, race and win money for your animals.  Eventually I'll make it a
whole barn with feeding and horses, and costs, age, breeding.  So on.
But for now, this is just a simple game.<br><br>

Enter six names of horses.
<FORM ACTION="horse.php" METHOD="post">
Name1 : <INPUT TYPE="text" NAME="name1" size="24"><BR>
Name2 : <INPUT TYPE="text" NAME="name2" size="24"><BR>
Name3 : <INPUT TYPE="text" NAME="name3" size="24"><BR>
Name4 : <INPUT TYPE="text" NAME="name4" size="24"><BR>
Name5 : <INPUT TYPE="text" NAME="name5" size="24"><BR>
Name6 : <INPUT TYPE="text" NAME="name6" size="24"><BR>
<input type="submit" name="submitNms" value="race them!">
</FORM>
<center>Good luck!
</BODY>
</HTML>

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

This is the PHP...

<?
$name1 = "$n1";
$name1 = "$n2";
$name3 = "$n3";
$name4 = "$n4";
$name5 = "$n5";
$name6 = "$n6";
$randomHorse = rand($name1, $name6);
$randomStrides = rand(1, 10);
echo "$randomHorse won the race by $randomStrides !  Congratulations.";
?>


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

And I feel stupid.  <g>

-Owen





In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Dddogbruce \(@home.com\)") wrote:

> A friend told me something about
> "seeding" for random() but I didn't find anything on that.

Umm, where did you look?  'Cuz the manual page on rand()--the function 
which you are using to generate the random number--mentions it right at the 
outset, with a link, sample code...

http://php.net/manual/en/function.rand.php
http://php.net/manual/en/function.srand.php

-- 
CC






http://www.TheCasino.com: Better Than Life! (tm)
Since 1999 - Now With 100% "Buffer Bonuses" On All Deposits!!

Dear [EMAIL PROTECTED],

This email is to confirm that we have "removed" you from our mailing 
list - per your request!  

You will no longer be considered for TheCasino.com Monhtly Prize Drawings.

Please let us know if we can be of further assistance.


The Support Staff
TheCasino.com, Corp.
[EMAIL PROTECTED]
http://www.theCasino.com




aww shucks, now i won't be a millionaire.........

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 10:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] TheCasino.com: You have been removed!




http://www.TheCasino.com: Better Than Life! (tm)
Since 1999 - Now With 100% "Buffer Bonuses" On All Deposits!!

Dear [EMAIL PROTECTED],

This email is to confirm that we have "removed" you from our mailing 
list - per your request!  

You will no longer be considered for TheCasino.com Monhtly Prize Drawings.

Please let us know if we can be of further assistance.


The Support Staff
TheCasino.com, Corp.
[EMAIL PROTECTED]
http://www.theCasino.com

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







Hi all,

Live is strange sometimes, and so is this error we have here.
I have a large forum (more then 300.000 pageviews a day) running.
We are using php-4.04pl1 (with the Zend/zend_list.c file patched)
and we are using MySQL 3.23.36-log.

We are using the following piece of code to connect to the dbase:

if(!mysql_pconnect($db[$no]["host"],$db[$no]["user"],$db[$no]["pass"])){
  if(!mysql_connect($db[$no]["host"],$db[$no]["user"],$db[$no]["pass"])){
    die(error(55));

under normal circumstances this is running normal, not to much
error #55's. But, when the load on the forum is lowering, the ammount of
errors is increasing. This is very annoying (i mean, under high-load it is
working perfect, but at nights when the load is low you'll get error after
error.

as example:
hour    #errors
 19   56
 20   45
 21   60
 22   49
 23   41
 0   65
 1   105
 2   146
 3   304
 4   277  (4:00 ~ 4:50)
error we receive:
2006: MySQL server has gone away

The configuration i use:

http://gathering.tweakers.net:
FreeBSD Arshia.webmagix.net 4.3-BETA FreeBSD 4.3-BETA #0:
running on an Tbird 1GHz with 512MB ram

MySQL 3.23.36 server is running on an dual PIII-1 GHz with 1.5G ram

php-config:
./configure --with-apache=../apache_1.3.19 --enable-track-vars \
--enable-magic-quotes --with-gd=/usr/local --with-mysql --with-zlib=../zlib-
1.1.3


I still don't know who is wrong, PHP or MySQL, i hope some of you
can give me more clarity in this strange behauvior.

tia,
Kees Hoekzema
[EMAIL PROTECTED]
http://gathering.tweakers.net





> We are using the following piece of code to connect to the dbase:
>
> if(!mysql_pconnect($db[$no]["host"],$db[$no]["user"],$db[$no]["pass"])){
>   if(!mysql_connect($db[$no]["host"],$db[$no]["user"],$db[$no]["pass"])){
>     die(error(55));

Could you explain why you are connecting like that?  Failing over from a
pconnect to a connect doesn't make much sense to me.

> php-config:
> ./configure --with-apache=../apache_1.3.19 --enable-track-vars \
> --enable-magic-quotes --with-gd=/usr/local --with-mysql --with-zlib=../zlib-
> 1.1.3

To be perfectly safe, I would compile PHP against the version of the mysql
client library that matches your server.  ie. install the mysql client
library on your web server machine and build PHP using --with-mysql=/path

--with-mysql by itself will use the generic PHP-bundled mysql client
library which should theoretically work with all versions of MySQL, but
since you are seeing problems it would be a place to start.

-Rasmus





Does php release the memory used by the result set when it is done
executing?

if so why should I use mysql_free_result()


Thanks

Randy





> Does php release the memory used by the result set when it is done
> executing?

Correct

> if so why should I use mysql_free_result()

In case you are making multiple queries within the same script and want to
keep your runtime memory usage low.

-Rasmus





Does the Mysql_free_result slow down the script at all?

Randy

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 20, 2001 8:49 PM
To: Randy Johnson
Cc: Php-General
Subject: Re: [PHP] mysql_free_result


> Does php release the memory used by the result set when it is done
> executing?

Correct

> if so why should I use mysql_free_result()

In case you are making multiple queries within the same script and want to
keep your runtime memory usage low.

-Rasmus






> Does the Mysql_free_result slow down the script at all?

Sure, calling the function will be slower than not calling it.  But not
significantly since the same operation will happen automatically.  The
difference being that you have the option of controlling exactly when you
want it to happen.

-Rasmus





Question: A PHP/MySQL or PostgreSQL Programmer.  How much per week (In
american money) is a good price range for a small but promising startup to
pay said programmer per week?  Understanding everyone has their own opinions
on this matter, if you could include the salary and the reasoning why?
Also, other things to consider.

I am asking this because a recent venture of mine seems to be panning out,
and if it goes as projected will take off rather quickly, and I will need to
hire people on either a contract basis or full time basis, and I am just
looking to see where salary stands (don't want to overpay and lose profit,
but don't want to underpay and insult anyone).

Thanks
Jason Lotito
www.NewbieNetwork.net
Where those who can, teach;
and those who can, learn.





Hi,

I have a PHP script that I wrote several months ago which allows a user to 
enter information into a MySQL database through a basic web form - it 
worked very well.  However, since then I had a system crash - luckily I 
made a backup of the script days before the crash.

My problem is, that now the script generates errors which were not present 
before.  I've gone over it twice, even re-coded it just now, and still I 
get the same errors.

Currently, I am using Win2k Pro, MySQL 3.23.33 and PHP4.0.4pl1 installed as 
CGI.

Interestingly, when I try to run this script on my RH7.0 Linux box with 
MySQL 3.22.32 and PHP3.0.18 it does not generate these errors.  I have this 
system setup with older versions of MySQL and PHP as those are the versions 
that my hosting service uses.

Could someone please look over my code and tell me where I'm going wrong??

Thank you

-Tim

The errors I get are as follows:
Warning: Undefined variable: submit in index.php3 on line 17

Warning: Undefined variable: delete in index.php3 on line 37

Warning: Undefined variable: id in index.php3 on line 51

Warning: Undefined variable: id in 
E:\WebPages\2001\AtikokanInfo\Web\www.atikokaninfo.com\htdocs\aedc\comcal\mcx\webmonkey.php3
 
on line 83

Here is the script which I am attempting to use:

<html>

<body>



<?php



$db = mysql_connect("localhost", "user", "passwd");

mysql_select_db("edoinfo",$db);



if ($submit) {

   // here if no ID then adding else we're editing

   if ($id) {

     $sql = "UPDATE comcal001 SET 
eventCategory='$eventCategory',eventName='$eventName',eventLocation='$eventLocation',eventCity='$eventCity',eventState='$eventState',eventCountry='$eventCountry',eventTime='$eventTime',eventAMPM='$eventAMPM',eventDuration='$eventDuration',eventMonth='$eventMonth',eventDay='$eventDay',eventDate='$eventDate',eventYear='$eventYear',eventC1Fname='$eventC1Fname',eventC1Lname='$eventC1Lname',eventC2Fname='$eventC2Fname',eventC2Lname='$eventC2Lname',eventACphone='$eventACphone',eventPhone='$eventPhone',eventACfax='$eventACfax',eventFax='$eventFax',eventACcell='$eventACcell',eventCell='$eventCell',eventEmail='$eventEmail',eventWeb='$eventWeb',eventDetails='$eventDetails',entryDate='$entryDate'
 
WHERE id=$id";

   } else {

     $sql = "INSERT INTO comcal001 
(eventCategory,eventName,eventLocation,eventCity,eventState,eventCountry,eventTime,eventAMPM,eventDuration,eventMonth,eventDay,eventDate,eventYear,eventC1Fname,eventC1Lname,eventC2Fname,eventC2Lname,eventACphone,eventPhone,eventACfax,eventFax,eventACcell,eventCell,eventEmail,eventWeb,eventDetails,entryDate)
 
VALUES 
('$eventCategory','$eventName','$eventLocation','$eventCity''$eventState','$eventCountry','$eventTime','$eventAMPM','$eventDuration','$eventMonth','$eventDay','$eventDate','$eventYear','$eventC1Fname','$eventC1Lname','$eventC2Fname','$eventC2Lname','$eventACphone','$eventPhone','$eventACfax','$eventFax','$eventACcell','$eventCell','$eventEmail','$eventWeb','$eventDetails','$entryDate')";

   }

   // run SQL against the DB

   $result = mysql_query($sql);

   echo "Record updated/edited!<p>";

} elseif ($delete) {

         // delete a record

     $sql = "DELETE FROM comcal001 WHERE id=$id";

     $result = mysql_query($sql);

     echo "$sql Record deleted!<p>";

} else {

   // this part happens if we don't press submit

   if (!$id) {

     // print the list if there is not editing

     $result = mysql_query("SELECT * FROM comcal001",$db);

     while ($myrow = mysql_fetch_array($result)) {

       printf("<a href=\"%s?id=%s\">%s %s</a> \n", $PHP_SELF, $myrow["id"], 
$myrow["eventCategory"], $myrow["eventName"]);

           printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", 
$PHP_SELF, $myrow["id"]);

     }

   }



   ?>

   <P>

   <a href="<?php echo $PHP_SELF?>">ADD A RECORD</a>

   <P>

   <form method="post" action="<?php echo $PHP_SELF?>">

   <?php



   if ($id) {

     // editing so select a record

     $sql = "SELECT * FROM comcal001 WHERE id=$id";

     $result = mysql_query($sql);

     $myrow = mysql_fetch_array($result);

     $id = $myrow["id"];

     $eventCategory = $myrow["eventCategory"];

     $eventName = $myrow["eventName"];

     $eventLocation = $myrow["eventLocation"];

     $eventCity = $myrow["eventCity"];

     $eventState = $myrow["eventState"];

     $eventCountry = $myrow["eventCountry"];

     $eventTime = $myrow["eventTime"];

     $eventAMPM = $myrow["eventAMPM"];

     $eventDuration = $myrow["eventDuration"];

     $eventMonth = $myrow["eventMonth"];

     $eventDay = $myrow["eventDay"];

     $eventDate = $myrow["eventDate"];

     $eventYear = $myrow["eventYear"];

     $eventC1Fname = $myrow["eventC1Fname"];

     $eventC1Lname = $myrow["eventC1Lname"];

     $eventC2Fname = $myrow["eventC2Fname"];

     $eventACphone = $myrow["eventACphone"];

     $eventPhone = $myrow["eventPhone"];

     $eventACfax = $myrow["eventACfax"];

     $eventFax = $myrow["eventFax"];

     $eventACcell = $myrow["eventACcell"];

     $eventCell = $myrow["eventCell"];

     $eventEmail = $myrow["eventEmail"];

     $eventWeb = $myrow["eventWeb"];

     $eventDetails = $myrow["eventDetails"];

     $entryDate = $myrow["entryDate"];

     // print the id for editing



     ?>

     <input type=hidden name="id" value="<?php echo $id ?>">

     <?php

   }



   ?>

   Category: <input type="Text" name="eventCategory" value="<?php echo 
$eventCategory ?>"><br>

   Event Name: <input type="Text" name="eventName" value="<?php echo 
$eventName ?>"><br>

   Location: <input type="Text" name="eventLocation" value="<?php echo 
$eventLocation ?>"><br>

   City: <input type="Text" name="eventCity" value="<?php echo $eventCity 
?>"><br>

   State: <input type="Text" name="eventState" value="<?php echo 
$eventState ?>"><br>

   Country: <input type="Text" name="eventCountry" value="<?php echo 
$eventCountry ?>"><br>

   Time: <input type="Text" name="eventTime" value="<?php echo $eventTime 
?>"><br>

   AM/PM: <input type="Text" name="eventAMPM" value="<?php echo $eventAMPM 
?>"><br>

   Duration: <input type="Text" name="eventDuration" value="<?php echo 
$eventDuration ?>"><br>

   Month: <input type="Text" name="eventMonth" value="<?php echo 
$eventMonth ?>"><br>

   Day: <input type="Text" name="eventDay" value="<?php echo $eventDay ?>"><br>

   Date: <input type="Text" name="eventDate" value="<?php echo $eventDate 
?>"><br>

   Year: <input type="Text" name="eventYear" value="<?php echo $eventYear 
?>"><br>

   Contact 1 First Name: <input type="Text" name="eventC1Fname" 
value="<?php echo $eventC1Fname ?>"><br>

   Contact 1 Last Name: <input type="Text" name="eventC1Lname" value="<?php 
echo $eventC1Lname ?>"><br>

   Contact 2 First Name: <input type="Text" name="eventC2Fname" 
value="<?php echo $eventC2Fname ?>"><br>

   Contact 2 Last Name: <input type="Text" name="eventC2Lname" value="<?php 
echo $eventC2Lname ?>"><br>

   Phone: (<input type="Text" name="eventACphone" value="<?php echo 
$eventACphone ?>">) <input type="Text" name="eventPhone" value="<?php echo 
$eventPhone ?>"><br>

   Fax: (<input type="Text" name="eventACfax" value="<?php echo $eventACfax 
?>">) <input type="Text" name="eventFax" value="<?php echo $eventFax ?>"><br>

   Cell: (<input type="Text" name="eventACcell" value="<?php echo 
$eventACcell ?>">) <input type="Text" name="eventCell" value="<?php echo 
$eventCell ?>"><br>

   Email: <input type="Text" name="eventEmail" value="<?php echo 
$eventEmail ?>"><br>

   Web: <input type="Text" name="eventWeb" value="<?php echo $eventWeb ?>"><br>

   Details: <input type="Text" name="eventDetails" value="<?php echo 
$eventDetails ?>"><br>

   Entry Date: <input type="Text" name="entryDate" value="<?php echo 
$entryDate ?>"><br>

   <input type="Submit" name="submit" value="Enter information">

   </form>



<?php



}



?>



</body>

</html>






It will do the same thing as standard C lib.
How about take a look at C reference?

Basically, all output is buffered by OS. It's just tells write to file if data,
associated with the file pointer/descriptor, is in buffer.
You will see why this function is useful, if you  'tail -f' while writing data
into file.

Regards,
--
Yasuo Ohgaki


"Thomas Deliduka" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This function:
>
> http://www.php.net/manual/en/function.fflush.php
>
> Has no example on how you would code with it. Does anyone know?
>
> It mentions "buffered output" how do you buffer output?
> --
>
> Thomas Deliduka
> IT Manager
>      -------------------------
> New Eve Media
> The Solution To Your Internet Angst
> http://www.neweve.com/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





You are supposed to uninstall(delete) files by yourself.
Locations of files are depend on your config.

Take a look at your Makefile(s).

Regards,
--
Yasuo Ohgaki


"Maron Kristófersson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello!

I want to uninstall PHP and Apache but I installed them according to the
quick install instructions on the PHP site.  The reason I'm uninstalling
is because I want to reinstall both of them via RPM.

I've tried make uninstall (not sure if that's the right syntax) but it
doesn't work.  Anybody that can give me quick clear instructions?

My system is Redhat 7.1.

Regards,

Maron Kristófersson
Reykjavik
Iceland






Try latest CVS snapshot, you might find what's wrong. (Make sure you set
error_reporting to E_ALL)
http://snaps.php.net

Regards,
--
Yasuo Ohgaki


""Marc Davenport"" <[EMAIL PROTECTED]> wrote in message
002201c0c91e$d4f96590$5d3e04d8@marcd">news:002201c0c91e$d4f96590$5d3e04d8@marcd...
I need some help figuring something out that my host denies is his problem.

I have a suspicion that only someone who has run into this problem once before
has the answer.

I have this form which posts to a PHP file.  Sometimes I pass a file along.
This was info for a database and a picture along with it.   This worked fine for
the longest time.  Now it does not.
when I post a file in the form I recieve an "Cannot Find Server".  When there
isnt a file posted then the form works fine.  I dont understand because I
recieve no PHP generated error messages, but rather a problem finding the site
entirely.

Has anyone ever seen this?

Help would be much
Marc Davenport






<?php_track_vars?> is depreciated under current PHP. See NEWS file in source. Regards, -- Yasuo Ohgaki ""John Silverio"" <[EMAIL PROTECTED]> wrote in message 9bne0n$pug$[EMAIL PROTECTED]">news:9bne0n$pug$[EMAIL PROTECTED]... > Whenever I try to mail a form I receive this message: > > Warning: <?php_track_vars?> is no longer supported - please use the > track_vars INI directive instead in > /mnt/web/guide/corvettebuyers/www/do_sendfeedback.php on line 1 > > The form is on a UNIX server with PHP installed. The INI directive has me > confused? Thank you. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >



Hello!

I am trying to develop a web site where some files and images are private, I am using 
session to auth. user. 

I would like to know how I can send some local files to the client so that others 
without the access to the web site will not be able to download. 

How would I stream the local image (jpg) files over to client? I know how to stream it 
the normal way, just don't know how I can stream it to some and not others.

Anyone have suggestions on this one?

Jason Lam




Hiya,

This is something that I'm not able to figure out :

I am building something like a Yahoo! directry. I wanted to display a "new" image 
infront of a category, like Yahoo! does.

But I want to show this even if the main category may not have any new link, but a 
category in that might have, so like that...

like hotscripts.com too, so i thought if someone could tell me how to use get all the 
children :

ID | NAME | PARENT
1    X      0
2    Y      1
3    Z      2
4    A      2
5    F      1
6    G      5
if i want to get all children of 1, i want to get 2, 3, 4, 5, 6!

how do i get this, thanks!




On Friday 20 April 2001 19:13, Jason Caldwell wrote:
> Actually did that... plus sacrificed several small rodents, rubbing
> their internal organs all over the manual... in hopes that the PHP Gods
> would be kind and giving.... went into a cave for 12 years, then came
> back out ... having learned and understood much... but still no SET or
> ENUM.
>
> I've since burned the manual, and tattooed PHP on my forehead.

Well, then unless the burning didn't produce smoke forming the letters 
"language.types.enum.html" I'd say PHP still doesn't support these.

>> Print out the PHP manual, place it on the altar of your local church,
>> run around it 42 times dressed in ritual aborigine war fashion,
>> sacrifice the caffeine-rich fruits of a south american plant by
>> crushing them and pouring boiling water over the resulting dust.
>>
>> And when you're done with that, take the manual and read it.
>>
>> Thus you will find enlightenment.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds.

- http://www.google.com/search?q=e




documentasion:

string imap_fetchbody (int imap_stream, int msg_number, string part_number
[, flags flags])

how can i exploit the different part_numbers??? what do hey stand for?




Reply via email to