|
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-help_at_lists.php.net
Date: Fri Jan 03 2003 - 00:08:14 CST
php-general Digest 3 Jan 2003 06:08:14 -0000 Issue 1800
Topics (messages 129967 through 130051):
signal handler to ignore kill of parent
129967 by: Thomas Weber
129969 by: Michael J. Pawlowsky
129977 by: Michael J. Pawlowsky
3 colums....
129968 by: Michael J. Pawlowsky
Re: receiving XML stream as server via PHP
129970 by: Chris Boget
Re: Index page
129971 by: Chris Hewitt
Problem in $_SERVER["PHP_SELF"]
129972 by: ªüYam
129974 by: Johannes Schlueter
129975 by: ªüYam
129976 by: Andrew Brampton
How to parse still images from video clips
129973 by: fates.attbi.com
Some questions regarding pfsocketopen()
129978 by: Gareth Hastings
129980 by: Chris Shiflett
129983 by: Gareth Hastings
129984 by: Michael J. Pawlowsky
129987 by: Gareth Hastings
129990 by: Michael J. Pawlowsky
129994 by: Michael J. Pawlowsky
129995 by: Gareth Hastings
130000 by: Michael J. Pawlowsky
130002 by: Gareth Hastings
130007 by: Michael J. Pawlowsky
130020 by: Gerald Timothy Quimpo
Re: phpinfo() and HTTP_RAW_POST_DATA
129979 by: Kristopher Yates
129982 by: Chris Shiflett
Timeout during SMTP operation.
129981 by: gilrain
129991 by: Chris Hewitt
130006 by: gilrain
130008 by: Michael J. Pawlowsky
Re: accelerator and Apache 2
129985 by: Manuel Ochoa
Announcing open CVS for phpDocumentor project
129986 by: Greg Beaver
PHP complied code
129988 by: Manuel Ochoa
129992 by: Andrew Brampton
129993 by: Kevin Stone
mktime() and the format of the day number entry
129989 by: Johnson, Kirk
130009 by: Paul Roberts
130010 by: Johnson, Kirk
130011 by: Michael J. Pawlowsky
130014 by: Michael J. Pawlowsky
130044 by: Tom Rogers
Can it be doen with Array????
129996 by: Scott Fletcher
129997 by: Gareth Hastings
129999 by: Gareth Hastings
130001 by: Scott Fletcher
PHP memory usage
129998 by: James H. Thompson
130021 by: Gerald Timothy Quimpo
130036 by: Fernando Serboncini
130042 by: James H. Thompson
Baffling output
130003 by: Lightfirst
130004 by: Joseph W. Goff
130005 by: Chris Shiflett
PHP Testing
130012 by: Jim Lucas
130013 by: Paul Marinas
130023 by: Jim Lucas
Sessions & Security
130015 by: Duncan
130025 by: Justin French
130038 by: Duncan
Re: Who can tell me the best php-base webmail?
130016 by: David Yee
Re: How to give parameters to a console php-script?
130017 by: David Yee
Code contents of a function
130018 by: Shawn McKenzie
130019 by: Peter Houchin
130022 by: Shawn McKenzie
130026 by: Gerald Timothy Quimpo
Re: mcrypt
130024 by: Jason Sheets
parse error
130027 by: Ezequiel Sapoznik
130028 by: Gerald Timothy Quimpo
130029 by: Michael J. Pawlowsky
130031 by: Dan Goodes
130041 by: John Nichel
way to insert timer / pause?
130030 by: Jeff Bluemel
130033 by: Michael J. Pawlowsky
130034 by: Andrew Brampton
130037 by: SED
130046 by: Jeff Bluemel
130047 by: Jeff Bluemel
130048 by: Jeff Bluemel
130049 by: Michael J. Pawlowsky
130050 by: Jeff Bluemel
2 servers for mail implementation
130032 by: Roger Thomas
help with form adding to database!!
130035 by: Karl James
email/time question
130039 by: Randy Johnson
130043 by: John Nichel
130045 by: Michael J. Pawlowsky
BreadCrumb Class
130040 by: Michael J. Pawlowsky
Mass-mailing method
130051 by: Cesar Aracena
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
i need some way for child-processes to ignore the kill of their parent. Any
idea?
Thanks,
Thomas 'Neo' Weber
--- thomasyoungarts.org neo
gothic-chat.de
attached mail follows:
You should get together with the the guy who's was looking for a way to kill the child processes after killing the parent. They weren't dying for him. (Which I dont understand why?)
:-)
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 7:05 PM Thomas Weber wrote:
>Hi,
>
>i need some way for child-processes to ignore the kill of their parent. Any
>idea?
>
>Thanks,
>Thomas 'Neo' Weber
>---
>thomas
youngarts.org
>neo
gothic-chat.de
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Actually let me try to be a bit more helpful... nut not much though :-)
Did you write the code for the fork();
Can you modify it? Read the fork, exec and clone man pages. This might help you a bit understand the behaviour.
If so just call exec from the forked process... this will create a new process instead of a child one. Then call exit() in your forked process.
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 7:05 PM Thomas Weber wrote:
>Hi,
>
>i need some way for child-processes to ignore the kill of their parent. Any
>idea?
>
>Thanks,
>Thomas 'Neo' Weber
>---
>thomas
youngarts.org
>neo
gothic-chat.de
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I need some sleep right now, my brain is in low gear....
Here's what I'm trying to do.
Basically have 3 HTML columns (<td></td>) printed to a web page but have them in alphabetical order from top to bottom and then continuing onto the next column. Like you would see in an index of a book.
This code works fine except for when there are 4 items (dbrows) to be displayed. ceil($rows / 3) (see below) becomes 2 so it allows two items in each colum resulting to only 2 HTML colums being displayed.
Can anyone come up with a better way to do this?
---------------- Start -------------------------------------------------------------------
<?php
for ($j=1; $j<20; $j++){ $rows = $j;
print "\n\n<!-- NEW TABLE -->\n\n";
print "<table border=\"1\"><tr><td valign=\"top\">\n\n";
print "<table>\n";
for ($i = 1; $i < $rows+1; $i++) {
print "<tr>\n"; print "<td>Data</td>\n"; print "<td>$i</td>\n"; print "</tr>\n";
if ($i % ceil($rows / 3) == 0 ){
print "</table></td>\n"; if ($i != $rows ){ print "<td valign=\"top\"><table>\n"; } } } print "</tr></table>\n\n"; print "</td></tr></table>\n";
print "\n\n<!-- Close NEW TABLE -->\n\n";
print "<p>"; print "<HR>"; print "$j"; print "<HR>"; print "<p>";
}
?>
--------------------------- End ---------------------------------------
attached mail follows:
> Can you email me the URL to NuSOAP and the PEAR SOAP pages?
I don't know much at all about the PEAR SOAP because it is still in testing. As for NuSOAP, I've just started using it myself and it seems to work well for what I've written so far. You can find NuSOAP here:
http://dietrich.ganx4.com/nusoap/index.php
> Also, do you (or anyone) have any comparative information on these two > methods/classes?
Sadly, no. In fact, I'm relatively new to SOAP. I started looking into SOAP and PHP not too long ago and read about both NuSOAP and PEAR. Since PEAR was still in testing, I decided to fool around with NuSOAP and it's been working great. Of course, since I'm still so new, I could very well be doing things ass backwards. :p
> Thanks again Chris. Good to hear from ya.
Not a problem. Hope this helps!
Chris
attached mail follows:
thkiat wrote:
>Why by only typing http://localhost/ the index.php did not show up. I have >to type http://localhost/index.php for the page to show up. How can I solve >this problem? > Assuming you are using Apache (you do not say) then when no file is specified a file witha name specified in the DirectoryIndex parameter of httpd.conf is served up, if it exists. Set the file you want shown here.
Hope this helps Chris PS Please do not cross-post. I know you did two messages, one to each group, but it ends up as the same thing.
>
attached mail follows:
Before, I was using PHP 4.2.3. There was no problem when I just use $PHP_SELF in my script... Whereas the problem is found after using PHP 4.3.0..... There is warning of my script , the warning msg is about undefined variable $PHP_SELF......however, when I try to use $_SERVER["PHP_SELF"] instead of $PHP_SELF, there is no problem.... But, that makes me a big trouble if I have to modify all of my scripts to solve this problem......Is there any idea to solve this problem, please? thx a lot for any help!
attached mail follows:
On Thursday 02 January 2003 19:30, ªüYam wrote: > There is warning of my script , the warning msg is about undefined variable > $PHP_SELF......however, when I try to use $_SERVER["PHP_SELF"] instead of > $PHP_SELF, there is no problem....
Check your register_globals settings! Either switch it on (bad) or start your scripts with $PHP_SELF = $_SERVER['PHP_SELF'] or replace all $PHP_SELF with $_SERVER['PHP_SELF']. If you don't know what register_globals is check the Manual!
johannes
attached mail follows:
thx a lot
"Johannes Schlueter" <php
schlueters.de> ¼¶¼g©ó¶l¥ó·s»D
:200301021947.16829.php
schlueters.de...
On Thursday 02 January 2003 19:30, ªüYam wrote:
> There is warning of my script , the warning msg is about undefined
variable
> $PHP_SELF......however, when I try to use $_SERVER["PHP_SELF"] instead of
> $PHP_SELF, there is no problem....
Check your register_globals settings! Either switch it on (bad) or start your scripts with $PHP_SELF = $_SERVER['PHP_SELF'] or replace all $PHP_SELF with $_SERVER['PHP_SELF']. If you don't know what register_globals is check the Manual!
johannes
attached mail follows:
As far as I'm aware you should be using $_SERVER["PHP_SELF"] instead of $PHP_SELF its been like this for a while now.
Andrew
----- Original Message -----
From: "ªüYam" <yam1234
sinaman.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 6:30 PM
Subject: [PHP] Problem in $_SERVER["PHP_SELF"]
> Before, I was using PHP 4.2.3. There was no problem when I just use > $PHP_SELF in my script... > Whereas the problem is found after using PHP 4.3.0..... > There is warning of my script , the warning msg is about undefined variable > $PHP_SELF......however, when I try to use $_SERVER["PHP_SELF"] instead of > $PHP_SELF, there is no problem.... > But, that makes me a big trouble if I have to modify all of my scripts to > solve this problem......Is there any idea to solve this problem, please? thx > a lot for any help! > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Can someone point me in the right direction on how to parse still images from video clips video information. Do the videos have a tag like mp3 where I can get the video information? I can parse mp3 info with mp3 tag using PHP but can this be done with PHP? If not then what language is best for this?
attached mail follows:
Could anyone tell me, is it possible to connect to a persistent socket after it has been opened by a different script? There is little documentation on this function. I did a quick search on google and lots of people say you can't, some say you can but its really hard and the rest go..."pf what??"
Thanks
Gareth
attached mail follows:
--- Gareth Hastings <gareth
netgs.co.uk> wrote:
> Could anyone tell me, is it possible to connect to
> a persistent socket after it has been opened by a
> different script?
Sure. Think of it like a persistent database connection in Oracle, where the listener is on socket 1521 for everyone.
The persistent part saves you from the 3-way handshake when you use the same socket on subsequent page requests. The only caveat is that you can only do one thing at a time, but this is typically handled for you at a lower level in the form of a queue. If I remember correctly, you can specify the size of the queue in your function call(s).
Chris
attached mail follows:
One last question, do you know how or what method I would use to do this via a php script? Everything I've tried fails. Like
Makeconnection.php <? $mysocket = pfsocketopen('my.server.com', '1234'); ?> --------------
testconenction.php <? fputs($mysocket, "VERSION\n"); echo fgets($mysocket, 255); ?>
if I call the makeconnection.php script and then call the testconnection right after it fails with invalid file resource error.
> -----Original Message-----
> From: Chris Shiflett [mailto:shiflett
php.net]
> Sent: Thursday, January 02, 2003 2:47 PM
> To: Gareth Hastings; 'PHP-List'
> Subject: Re: [PHP] Some questions regarding pfsocketopen()
>
> --- Gareth Hastings <gareth
netgs.co.uk> wrote:
> > Could anyone tell me, is it possible to connect to
> > a persistent socket after it has been opened by a
> > different script?
>
> Sure. Think of it like a persistent database connection in
> Oracle, where the listener is on socket 1521 for everyone.
>
> The persistent part saves you from the 3-way handshake when
> you use the same socket on subsequent page requests. The
> only caveat is that you can only do one thing at a time,
> but this is typically handled for you at a lower level in
> the form of a queue. If I remember correctly, you can
> specify the size of the queue in your function call(s).
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You will need to have everythng on the same page. Your program ends once the page does. Here are some examples straight from the manual.
<?php $fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br>\n"; } else { fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n"); while (!feof($fp)) { echo fgets ($fp,128); } fclose ($fp); } ?>
The example below shows how to retrieve the day and time from the UDP service "daytime" (port 13) in your own machine. Example 2. Using UDP connection
<?php $fp = fsockopen("udp://127.0.0.1", 13, $errno, $errstr); if (!$fp) { echo "ERROR: $errno - $errstr<br>\n"; } else { fwrite($fp,"\n"); echo fread($fp, 26); fclose($fp); } ?>
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 3:10 PM Gareth Hastings wrote:
>One last question, do you know how or what method I would use to do this >via a php script? Everything I've tried fails. Like > > >Makeconnection.php ><? > $mysocket = pfsocketopen('my.server.com', '1234'); >?> >-------------- > > >testconenction.php ><? > fputs($mysocket, "VERSION\n"); > echo fgets($mysocket, 255); >?> >
attached mail follows:
> You will need to have everythng on the same page. Your program ends once > the page does.
pfsocketopen() is persistent and stays open even after your script has finished running until either the timeout period is reached or it gets disconnected/closed....I think. I just don't know how to access it after you script ends.
attached mail follows:
Cool... Maybe I will learn something.. :-)
Well in that case (I already deleted you last mail), where are you keeping the file pointer?
You will need to register the var somewhere.. In a session perhaps?
Mike
Send me your code... I will play with it...
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 3:42 PM Gareth Hastings wrote:
>> You will need to have everythng on the same page. Your program ends >once >> the page does. > > >pfsocketopen() is persistent and stays open even after your script has >finished running until either the timeout period is reached or it gets >disconnected/closed....I think. I just don't know how to access it after >you script ends. > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Well I didnt try to write or read to it...
But this works.... But all that's telling me is that the var is there.. not if it's still open.. will leave that to you to find out... Let us know....
--------------file s1.php ---------------------------
<?php session_start(); $sid = session_id();
$mysocket = pfsockopen("localhost", "80");
session_register("mysocket");
echo "<a href=\"s2.php?PHPSESSID=$sid\">Next</a>";
?>
-------------------- file s2.php ---------------------------------
<?php
session_start();
echo (isset($_SESSION['mysocket']) ? "Socket found and open" : "Socket not found");
?>
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 4:08 PM Gareth Hastings wrote:
>The only code I've tried so far has been a simple > >makeconnection.php > ><? > $mysocket = pfsocketopen("my.server.com", "1234"); >?> > >--------------------------------------- > >testconnection.php ><? > echo (isset($mysocket) ? "Socket found and open" : "Socket not >found"); >?> >
attached mail follows:
I just tried something similar,
<? session_start(); session_register("mysocket");
echo "<pre>\n";
if ($p == "1") { $mysocket = pfsockopen("172.24.200.2", "1372"); echo fgets($mysocket, 255); echo "<a href='con.php?p=2'>Send Data</a>\n"; } else { echo (isset($mysocket) ? "It's set\n" : "Not set\n");
echo $mysocket; fputs($mysocket, "cntmpusr;tmppass\n");
//while (!feof($mysocket)) //{ // echo fgets($mysocket, sizeof($mysocket)); //} //fclose($mysocket); }
echo "</pre>\n"; ?>
this is the output I get once I've set the socket and tried to send data down it.
------------------------------------- It's set 0 Warning: fputs(): supplied argument is not a valid File-Handle resource in con.php on line 17 -------------------------------------
So I guess you can't pass sockets like that :/
> -----Original Message-----
> From: Michael J. Pawlowsky [mailto:mikejp
videotron.ca]
> Sent: Thursday, January 02, 2003 4:32 PM
> To: Gareth Hastings
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] Some questions regarding pfsocketopen()
>
>
> Well I didnt try to write or read to it...
>
> But this works.... But all that's telling me is that the var is
there..
> not if it's still open.. will leave that to you to find out... Let us
> know....
>
>
>
>
> --------------file s1.php ---------------------------
>
> <?php
> session_start();
> $sid = session_id();
>
> $mysocket = pfsockopen("localhost", "80");
>
> session_register("mysocket");
>
> echo "<a href=\"s2.php?PHPSESSID=$sid\">Next</a>";
>
>
> ?>
>
>
> -------------------- file s2.php ---------------------------------
>
> <?php
>
> session_start();
>
> echo (isset($_SESSION['mysocket']) ? "Socket found and open" :
> "Socket not found");
>
>
>
> ?>
attached mail follows:
Two comments from the manual that are interesting:
php dot net at domainofdarkness dot com 29-Jan-2001 04:26
OK, WRT to the p* functions opening a new connection when one already exists. It is my understanting that (under Apache anyways) this is on a per-process basis. If you do a 'ps auxw|grep httpd' on your server you will see more than one process. What p* does is make a p-connection on one of those processes only, the one that actually handles your request. Chances are that when you hit the page again it will be answered by a different process. I'm guessing if you keep hitting reload you'll get around to the original process again and there will be no error message or second connection open. Anyhow, this is true of all p* functions; they open not one connection per server, but one connection per server _process_.
venuti at sissa dot it 13-Sep-2001 11:48
Don't expect to be able to open a persistent connection within a script and resume it from a different script, not even if you save the value of $fp with session_register (in fact, $fp is a resource id and cannot be saved in this way). I did not find an (easy) solution to this problem.
attached mail follows:
Yes I saw those but what it made me think, what's the point of a persistent socket if you can't use it again? And that very last comment
"I did not find an (easy) solution to this problem."
to me implies there is a solution out there, it's just not easy. Well I hope there is one about. Anyway back to google :)
> -----Original Message-----
> From: Michael J. Pawlowsky [mailto:mikejp
videotron.ca]
> Sent: Thursday, January 02, 2003 5:10 PM
> To: Gareth Hastings; php-general
lists.php.net
> Subject: RE: [PHP] Some questions regarding pfsocketopen()
>
>
> Two comments from the manual that are interesting:
>
>
> php dot net at domainofdarkness dot com
> 29-Jan-2001 04:26
>
> OK, WRT to the p* functions opening a new connection when one already
> exists. It is my understanting that (under Apache anyways) this is on
a
> per-process basis. If you do a 'ps auxw|grep httpd' on your server you
> will see more than one process. What p* does is make a p-connection on
one
> of those processes only, the one that actually handles your request.
> Chances are that when you hit the page again it will be answered by a
> different process. I'm guessing if you keep hitting reload you'll get
> around to the original process again and there will be no error
message or
> second connection open. Anyhow, this is true of all p* functions; they
> open not one connection per server, but one connection per server
> _process_.
>
>
> venuti at sissa dot it
> 13-Sep-2001 11:48
>
> Don't expect to be able to open a persistent connection within a
script
> and resume it from a different script, not even if you save the value
of
> $fp with session_register (in fact, $fp is a resource id and cannot be
> saved in this way). I did not find an (easy) solution to this problem.
>
>
>
>
>
>
attached mail follows:
Well if you do find the solution please let us know. I would also like to add it to my PHP lib archive. I suppose it would be there for stuff like command line PHP.
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 5:15 PM Gareth Hastings wrote:
>Yes I saw those but what it made me think, what's the point of a >persistent socket if you can't use it again? And that very last comment > >"I did not find an (easy) solution to this problem." > >to me implies there is a solution out there, it's just not easy. Well I >hope there is one about. Anyway back to google :)
attached mail follows:
On Friday 03 January 2003 06:15 am, Gareth Hastings wrote: > Yes I saw those but what it made me think, what's the point of a > persistent socket if you can't use it again?
i think you could, after enough iterations and if the server allows, get to a point where each process has its own persistent socket. in the script, first detect if the persistent socket already exists. if it does, use it. if it doesn't, open a new persistent socket. that process now has a persistent socket that you can use.
if there is enough traffic, eventually each process will have its own persistent socket.
of course, this only works well if the server (the process monitoring the socket on the box you're opening a persistent socket to) allows it and is written to allow multiple "simultaneous" access to the service without getting corruption (it may be necessary for the server side process to have explicit communication or locking between the multiple processes spawned (or locking within the same process, if it uses select()).
NOTE: i have not tested any of the above, it's just an obvious extension to the comment about persistent sockets being bound to the particular web server process.
tiger
--
Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
Veritas liberabit vos.
Doveryai no proveryai.
attached mail follows:
Hi Chris,
I made your suggested change to php.ini and I show local value 1 and master value 1. Does it mean raw data populates the variable $HTTP_RAW_POST_DATA when this is == 1 or does it mean that raw data is visible within phpinfo() when value ==1 in php.ini file? Just curious because, though the val is now 1 in my php.ini (and I restarted apache), I dont see any data in phpinfo() output related to this var. Did I miss something?
Thanks
Kris
Chris Shiflett wrote:
>That data is only populated when
>always_populate_raw_post_data is on (check your php.ini).
>
>Chris
>
>--- Kristopher Yates <kris
2binteractive.com> wrote:
>
>
>>I was just curious, is there a reason $HTTP_RAW_POST_DATA
>>isn't included in the phpinfo() function? I would
>>imagine one could see all globals via phpinfo().. Is
>>$HTTP_RAW_POST_DATA global or is it only global if
>>globals are registered (php.ini setting)? From what I
>>can tell, this var is not global, regardless of the
>>registered_globals setting in php.ini.
>>
>>
>
>.
>
>
>
attached mail follows:
--- Kristopher Yates <kris
2binteractive.com> wrote:
> I made your suggested change to php.ini and I show local
> value 1 and master value 1. Does it mean raw data
> populates the variable $HTTP_RAW_POST_DATA when this is
> == 1 or does it mean that raw data is visible within
> phpinfo() when value ==1 in php.ini file?
Sorry, it just populates that variable (to my knowledge). I do not think it is ever included in phpinfo() anywhere, though that would be nice to have when it is on.
Chris
attached mail follows:
Hi all,
I've just finished a PHP/MySQL mailing list. Basically, I'm having problems with my sendmail function. It takes an array of e-mail addresses ($addresses) and loops through it, e-mailing each one using an SMTP class I found (the only identifying comment in it is "SMTP Class By TOMO (2001/09/14)"). The problem is, it's very slow. The typical array of addresses sent to this is 100 to 500 elements large. The actual mailing list has over 7000 members, but the e-mails are sent out to a geographical region. Ideally, though, this function should be able to handle mailing to the entire member base.
Here's the offending function (with private stuff altered). Currently, it will only send to about 50 of the addresses before Internet Explorer times out and cuts it off (perhaps five minutes or so). Note that this is without catches, so it skips to the 'else'.
If I comment out the sending part, as shown, the operation takes a split second and the log is written correctly, so I know the problem lies in the sending of the mail. The only solution I can think of is to make the user send things in chunks of 50 or so addresses, but I'd like to avoid this inconvenience if I can. Any ideas?
// Sends e-mail to the specified list of member e-mail addresses. function ncSendMail($addresses, $subject, $body) { // Delete last log file. $ftp = ftp_connect("ftp.somewhere.net"); ftp_login($ftp, "someone", "something"); ftp_delete($ftp, "/sendlog.txt"); ftp_quit($ftp);
// Create new log file.
$sendlog = fopen("ftp.somewhere.net/sendlog.txt">ftp://someone:something
ftp.somewhere.net/sendlog.txt",
"w");
fwrite($sendlog, "Last Mailing Result\r\n");
fwrite($sendlog, "Generated: ".date("m-d-Y, h:i:sa")."\r\n\r\n");
fwrite($sendlog, "The e-mail attempted is reproduced below.\r\n");
fwrite($sendlog, "Subject: ".$subject."\r\n");
fwrite($sendlog, $body."\r\n\r\n\r\n");
// Get the automail 'footer' from the 'automail' table and append it to the body. $body .= ncGetAutomail("footer");
// If there are catches, then for each member in $addresses, parse the subject and body for catches and substitute where appropriate. if ( is_string(strstr($body, "%FIRSTNAME%")) || is_string(strstr($subject, "%FIRSTNAME%")) || is_string(strstr($body, "%LASTNAME%")) || is_string(strstr($subject, "%LASTNAME%")) || is_string(strstr($body, "%EMAIL%")) || is_string(strstr($subject, "%EMAIL%")) ) { $mysql = ncConnect(); fwrite($sendlog, "Beginning to send messages...\r\n\r\n"); foreach($addresses as $address) { $this_subject = $subject; $this_body = $body; $dbresult = mysql_unbuffered_query("SELECT lname, fname FROM members WHERE email = '$address'"); $dbrow = mysql_fetch_row($dbresult); $this_subject = str_replace("%FIRSTNAME%", $dbrow[1], $this_subject); $this_subject = str_replace("%LASTNAME%", $dbrow[0], $this_subject); $this_subject = str_replace("%EMAIL%", $address, $this_subject); $this_body = str_replace("%FIRSTNAME%", $dbrow[1], $this_body); $this_body = str_replace("%LASTNAME%", $dbrow[0], $this_body); $this_body = str_replace("%EMAIL%", $address, $this_body);
$smtp = new smtp("smtp.somewhere.com");
if ($smtp->sendmail($address, "somebody
somewhere.net",
$this_subject, $this_body))
fwrite($sendlog, "Successfully sent to member
\"".$address."\".\r\n");
else
fwrite($sendlog, "Failed to send to member
\"".$address."\".\r\n");
}
fwrite($sendlog, "\r\nFinsihed sending messages.");
mysql_close($mysql);
}
// If there aren't catches, send the plain e-mail.
else
{
fwrite($sendlog, "Beginning to send messages...\r\n\r\n");
foreach($addresses as $address)
{
//$smtp = new smtp("smtp.domain-mail.com");
//if ($smtp->sendmail($address, "somebody
somewhere.net", $subject,
$body))
fwrite($sendlog, "Successfully sent to member
\"".$address."\".\r\n");
//else
// fwrite($sendlog, "Failed to send to member
\"".$address."\".\r\n");
}
fwrite($sendlog, "\r\nFinished sending messages.");
}
// Return. fclose($sendlog); return true; }
attached mail follows:
gilrain wrote:
>Hi all, > >I've just finished a PHP/MySQL mailing list. Basically, I'm having problems >with my sendmail function. It takes an array of e-mail addresses >($addresses) and loops through it, e-mailing each one using an SMTP class I >found (the only identifying comment in it is "SMTP Class By TOMO >(2001/09/14)"). The problem is, it's very slow. The typical array of >addresses sent to this is 100 to 500 elements large. The actual mailing list >has over 7000 members, but the e-mails are sent out to a geographical >region. Ideally, though, this function should be able to handle mailing to >the entire member base. > It may well be a DNS problem. If an email address resolves in DNS immediately then an email may be sent very quickly. If not, DNS timeout can be in minutes. You could try using the dig program to look for MX or A records for your email addresses.
If you have a lot of customised emails to send then trying to do them on a web page is not such a good idea. I suggest doing them via a cron/at job, where there will be no timeout.
Regards Chris
attached mail follows:
Okay, that does sound more efficient. I'd love to give this a try, but to be completely honest I haven't done much from the shell other than basic commands and managing MySQL. I do know that my host allows me to use crontab, though, and most other common *nix programs.
Could you (or any of the other readers) explain how I would go about using cron or at to do what my function is trying to do?
"Chris Hewitt" wrote: > It may well be a DNS problem. If an email address resolves in DNS > immediately then an email may be sent very quickly. If not, DNS timeout > can be in minutes. You could try using the dig program to look for MX or > A records for your email addresses. > > If you have a lot of customised emails to send then trying to do them on > a web page is not such a good idea. I suggest doing them via a cron/at > job, where there will be no timeout. > > Regards > Chris
attached mail follows:
Am I happy I'm not your hosting provider! :-) They will probably flip if they see you send out 7000 e-mails.
Anyways.... crontab -e from a shell allows you to create a cronjob.
from a shell just "man crontab"
Cheers, Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 4:39 PM gilrain wrote:
>I do know that my host allows me to use >crontab, though, and most other common *nix programs. > >Could you (or any of the other readers) explain how I would go about using >cron or at to do what my function is trying to do? > >
attached mail follows:
I recently installed the Zend Optimizer and noticed an improvement in preformance. I'm running Windows .NET Enterprise Server 2003 PHP 4.3.0 as a module Apache 2.0.43
Go to www.Zend.com
Jochen Kaechelin <jk
linux.amsjk.de> wrote:Is there a free php accelerator out there which runs under Apache 2?
-- Jochen Kaechelin jklinux.amsjk.de
attached mail follows:
Hello all,
Josh Eichorn has just finished setting up an open cvs for the phpDocumentor project (http://www.phpdoc.org). To get a current cvs build, use this command:
cvs -d :pserver:anonymous
phpdoc.org:/opt/cvsroot login
don't enter a password, then
cvs -z 3 -d :pserver:anonymous
phpdoc.org:/opt/cvsroot co phpdoc
Take care, Greg Beaver
-- phpDocumentor 1.2.0beta due out this week! http://www.phpdoc.org
attached mail follows:
I recently read a book on PHP and the author breifly said that if you compile the PHP code it would improve the performance.
Is there a way to compile the code?
attached mail follows:
If maybe you googled, or even read a message posted 4 minutes earier, you would see there are such programs as: ionCube PHP Accelerator: www.php-accelerator.co.uk Zend optimizer/encoder www.zend.com
Andrew
----- Original Message -----
From: "Manuel Ochoa" <manuel
ochoa-usa.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 8:46 PM
Subject: [PHP] PHP complied code
> > I recently read a book on PHP and the author breifly said that if you compile the PHP code it would improve the performance. > > Is there a way to compile the code? >
attached mail follows:
Actually all PHP4 code is compiled before it is executed. What the author of that book suggests is pre-compiling a script. The difference between a standard script and a pre-compiled script is the time it takes to parse the code. You might pre-compile scripts that are going to see heavy use on your server. Or you might pre-compile a very large script to avoid the inherent latency in the interpretor as an optimization step.
The only encoder I know of is Zend Encoder ($2400) at www.zend.com.
Here's the deal though. If you don't know that you need to pre-compile then chances are you don't have to. The benefits to the casual programmer are negligable.
-Kevin
----- Original Message -----
From: "Manuel Ochoa" <manuel
ochoa-usa.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 1:46 PM
Subject: [PHP] PHP complied code
> > I recently read a book on PHP and the author breifly said that if you compile the PHP code it would improve the performance. > > Is there a way to compile the code? >
attached mail follows:
OK, I am mktime() challenged. Can someone please explain these results to me?
I have some test dates in October of 1998. For the days numbered 1-7, mktime() does not care whether I have a leading zero on the day or not, I get the same timestamp regardless, e.g., both a '7' and a '07' for the day number give the same timestamp. However, for the days 8-9, I get different timestamps for each if I use '8' versus '08' and '9' versus '09'. In these latter two cases, mktime treats both '08' and '09' as '0', and it gives the same timestamp as Oct 0 1998. What's up?
The code is below if you want to have a look.
Kirk
Kirk Johnson
kjohnson
zootweb.com
"0, as a number, is just as important as any other number."
<? $tmp = mktime(0,0,0,10,0,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,00,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,1,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,01,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,2,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,02,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,3,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,03,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,4,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,04,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,5,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,05,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,6,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,06,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,7,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,07,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,8,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,08,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,9,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,09,1998); echo "$tmp<br>"; ?>
attached mail follows:
same here win 2K apache php4.21
output
0,0,0,10,0,1998 => 907110000 0,0,0,10,00,1998 => 907110000 0,0,0,10,1,1998 => 907196400 0,0,0,10,01,1998 => 907196400 0,0,0,10,2,1998 => 907282800 0,0,0,10,02,1998 => 907282800 0,0,0,10,3,1998 => 907369200 0,0,0,10,03,1998 => 907369200 0,0,0,10,4,1998 => 907455600 0,0,0,10,04,1998 => 907455600 0,0,0,10,5,1998 => 907542000 0,0,0,10,05,1998 => 907542000 0,0,0,10,6,1998 => 907628400 0,0,0,10,06,1998 => 907628400 0,0,0,10,7,1998 => 907714800 0,0,0,10,07,1998 => 907714800 0,0,0,10,8,1998 => 907801200 0,0,0,10,08,1998 => 907110000 0,0,0,10,9,1998 => 907887600 0,0,0,10,09,1998 => 907110000
code <?php $tmp = mktime(0,0,0,10,0,1998); echo "0,0,0,10,0,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,00,1998); echo "0,0,0,10,00,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,1,1998); echo "0,0,0,10,1,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,01,1998); echo "0,0,0,10,01,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,2,1998); echo "0,0,0,10,2,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,02,1998); echo "0,0,0,10,02,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,3,1998); echo "0,0,0,10,3,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,03,1998); echo "0,0,0,10,03,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,4,1998); echo "0,0,0,10,4,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,04,1998); echo "0,0,0,10,04,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,5,1998); echo "0,0,0,10,5,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,05,1998); echo "0,0,0,10,05,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,6,1998); echo "0,0,0,10,6,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,06,1998); echo "0,0,0,10,06,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,7,1998); echo "0,0,0,10,7,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,07,1998); echo "0,0,0,10,07,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,8,1998); echo "0,0,0,10,8,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,08,1998); echo "0,0,0,10,08,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,9,1998); echo "0,0,0,10,9,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,09,1998); echo "0,0,0,10,09,1998 => $tmp<br>"; ?>
----- Original Message -----
From: "Johnson, Kirk" <kjohnson
zootweb.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 8:50 PM
Subject: [PHP] mktime() and the format of the day number entry
OK, I am mktime() challenged. Can someone please explain these results to me?
I have some test dates in October of 1998. For the days numbered 1-7, mktime() does not care whether I have a leading zero on the day or not, I get the same timestamp regardless, e.g., both a '7' and a '07' for the day number give the same timestamp. However, for the days 8-9, I get different timestamps for each if I use '8' versus '08' and '9' versus '09'. In these latter two cases, mktime treats both '08' and '09' as '0', and it gives the same timestamp as Oct 0 1998. What's up?
The code is below if you want to have a look.
Kirk
Kirk Johnson
kjohnson
zootweb.com
"0, as a number, is just as important as any other number."
<? $tmp = mktime(0,0,0,10,0,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,00,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,1,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,01,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,2,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,02,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,3,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,03,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,4,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,04,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,5,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,05,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,6,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,06,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,7,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,07,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,8,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,08,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,9,1998); echo "$tmp<br>"; $tmp = mktime(0,0,0,10,09,1998); echo "$tmp<br>"; ?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
The month behaves the same: both '08' and '09' are treated as zero by mktime().
Kirk
> -----Original Message-----
> From: Paul Roberts [mailto:mail
paul-roberts.com]
> Sent: Thursday, January 02, 2003 4:24 PM
> To: Johnson, Kirk
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] mktime() and the format of the day number entry
>
>
> same here win 2K apache php4.21
>
> output
>
> 0,0,0,10,0,1998 => 907110000
> 0,0,0,10,00,1998 => 907110000
> 0,0,0,10,1,1998 => 907196400
> 0,0,0,10,01,1998 => 907196400
> 0,0,0,10,2,1998 => 907282800
> 0,0,0,10,02,1998 => 907282800
> 0,0,0,10,3,1998 => 907369200
> 0,0,0,10,03,1998 => 907369200
> 0,0,0,10,4,1998 => 907455600
> 0,0,0,10,04,1998 => 907455600
> 0,0,0,10,5,1998 => 907542000
> 0,0,0,10,05,1998 => 907542000
> 0,0,0,10,6,1998 => 907628400
> 0,0,0,10,06,1998 => 907628400
> 0,0,0,10,7,1998 => 907714800
> 0,0,0,10,07,1998 => 907714800
> 0,0,0,10,8,1998 => 907801200
> 0,0,0,10,08,1998 => 907110000
> 0,0,0,10,9,1998 => 907887600
> 0,0,0,10,09,1998 => 907110000
>
> code
> <?php
> $tmp = mktime(0,0,0,10,0,1998);
> echo "0,0,0,10,0,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,00,1998);
> echo "0,0,0,10,00,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,1,1998);
> echo "0,0,0,10,1,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,01,1998);
> echo "0,0,0,10,01,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,2,1998);
> echo "0,0,0,10,2,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,02,1998);
> echo "0,0,0,10,02,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,3,1998);
> echo "0,0,0,10,3,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,03,1998);
> echo "0,0,0,10,03,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,4,1998);
> echo "0,0,0,10,4,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,04,1998);
> echo "0,0,0,10,04,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,5,1998);
> echo "0,0,0,10,5,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,05,1998);
> echo "0,0,0,10,05,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,6,1998);
> echo "0,0,0,10,6,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,06,1998);
> echo "0,0,0,10,06,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,7,1998);
> echo "0,0,0,10,7,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,07,1998);
> echo "0,0,0,10,07,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,8,1998);
> echo "0,0,0,10,8,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,08,1998);
> echo "0,0,0,10,08,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,9,1998);
> echo "0,0,0,10,9,1998 => $tmp<br>";
> $tmp = mktime(0,0,0,10,09,1998);
> echo "0,0,0,10,09,1998 => $tmp<br>";
> ?>
>
>
> ----- Original Message -----
> From: "Johnson, Kirk" <kjohnson
zootweb.com>
> To: <php-general
lists.php.net>
> Sent: Thursday, January 02, 2003 8:50 PM
> Subject: [PHP] mktime() and the format of the day number entry
>
>
>
> OK, I am mktime() challenged. Can someone please explain
> these results to
> me?
>
> I have some test dates in October of 1998. For the days numbered 1-7,
> mktime() does not care whether I have a leading zero on the
> day or not, I
> get the same timestamp regardless, e.g., both a '7' and a
> '07' for the day
> number give the same timestamp. However, for the days 8-9, I
> get different
> timestamps for each if I use '8' versus '08' and '9' versus
> '09'. In these
> latter two cases, mktime treats both '08' and '09' as '0',
> and it gives the
> same timestamp as Oct 0 1998. What's up?
>
> The code is below if you want to have a look.
>
> Kirk
>
> Kirk Johnson
> kjohnson
zootweb.com
>
> "0, as a number, is just as important as any other number."
attached mail follows:
Well you are right.. I also get the same results... I guess you found a bug... did you look in the bug reports to see if it already exists?
Results ----------------------------------------------------------------
Thu, 2 Jan 2003 19:15:35 -0500 0,0,0,10,0,1998 => 907128000 0,0,0,10,00,1998 => 907128000 0,0,0,10,1,1998 => 907214400 0,0,0,10,01,1998 => 907214400 0,0,0,10,2,1998 => 907300800 0,0,0,10,02,1998 => 907300800 0,0,0,10,3,1998 => 907387200 0,0,0,10,03,1998 => 907387200 0,0,0,10,4,1998 => 907473600 0,0,0,10,04,1998 => 907473600 0,0,0,10,5,1998 => 907560000 0,0,0,10,05,1998 => 907560000 0,0,0,10,6,1998 => 907646400 0,0,0,10,06,1998 => 907646400 0,0,0,10,7,1998 => 907732800 0,0,0,10,07,1998 => 907732800 0,0,0,10,8,1998 => 907819200 Thu, 8 Oct 1998 00:00:00 -0400 0,0,0,10,08,1998 => 907128000 Wed, 30 Sep 1998 00:00:00 -0400
0,0,0,10,9,1998 => 907905600 Fri, 9 Oct 1998 00:00:00 -0400
0,0,0,10,09,1998 => 907128000 Wed, 30 Sep 1998 00:00:00 -0400
0,0,0,9,30,1998 => 907128000 Wed, 30 Sep 1998 00:00:00 -0400
0,0,0,09,30,1998 => 883458000 Tue, 30 Dec 1997 00:00:00 -0500
----------------- Code --------------------------
<?php
echo date("r", mktime ()); echo "<br>"; $tmp = mktime(0,0,0,10,0,1998); echo "0,0,0,10,0,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,00,1998); echo "0,0,0,10,00,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,1,1998); echo "0,0,0,10,1,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,01,1998); echo "0,0,0,10,01,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,2,1998); echo "0,0,0,10,2,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,02,1998); echo "0,0,0,10,02,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,3,1998); echo "0,0,0,10,3,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,03,1998); echo "0,0,0,10,03,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,4,1998); echo "0,0,0,10,4,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,04,1998); echo "0,0,0,10,04,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,5,1998); echo "0,0,0,10,5,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,05,1998); echo "0,0,0,10,05,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,6,1998); echo "0,0,0,10,6,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,06,1998); echo "0,0,0,10,06,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,7,1998); echo "0,0,0,10,7,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,07,1998); echo "0,0,0,10,07,1998 => $tmp<br>"; $tmp = mktime(0,0,0,10,8,1998); echo "0,0,0,10,8,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>"; $tmp = mktime(0,0,0,10,08,1998); echo "0,0,0,10,08,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>"; $tmp = mktime(0,0,0,10,9,1998); echo "0,0,0,10,9,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>"; $tmp = mktime(0,0,0,10,09,1998); echo "0,0,0,10,09,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>";
$tmp = mktime(0,0,0,9,30,1998); echo "0,0,0,9,30,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>";
$tmp = mktime(0,0,0,09,30,1998); echo "0,0,0,09,30,1998 => $tmp<br>"; echo date("r", $tmp) . "<p>";
?>
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 4:29 PM Johnson, Kirk wrote:
>The month behaves the same: both '08' and '09' are treated as zero by >mktime(). > >Kirk >
attached mail follows:
Just to add to that... what it is doing is reading it as a 0.
0,0,0,09,30,1998 => 883458000 Tue, 30 Dec 1997 00:00:00 -0500
0,0,0,0,30,1998 => 883458000 Tue, 30 Dec 1997 00:00:00 -0500
Did you see this in the manual?
"The last day of any given month can be expressed as the 0 day of the next month, not the -1 day. "
I wonder if 0 has some significance in the month also?
Ok back to work.... :-)
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 7:17 PM Michael J. Pawlowsky wrote:
>Well you are right.. I also get the same results... >I guess you found a bug... did you look in the bug reports to see if it >already exists? > > >
attached mail follows:
Hi,
Friday, January 3, 2003, 10:33:39 AM, you wrote:
MJP> Just to add to that... what it is doing is reading it as a 0.
0,0,0,09,30,1998 =>> 883458000 MJP> Tue, 30 Dec 1997 00:00:00 -0500
0,0,0,0,30,1998 =>> 883458000 MJP> Tue, 30 Dec 1997 00:00:00 -0500
MJP> Did you see this in the manual?
MJP> "The last day of any given month can be expressed as the 0 day of the next month, not the -1 day. "
MJP> I wonder if 0 has some significance in the month also?
MJP> Ok back to work.... :-)
MJP> *********** REPLY SEPARATOR ***********
MJP> On 02/01/2003 at 7:17 PM Michael J. Pawlowsky wrote:
>>Well you are right.. I also get the same results... >>I guess you found a bug... did you look in the bug reports to see if it >>already exists? >> >> >>
with a 0 at the start php will treat it as an octal base number and 08 and 09 are not legal octal values. You have to use intval() on them.
-- regards, Tom
attached mail follows:
Hi!
I know that it can be done with certain variables that can overwrite another variable. Like ....
$test = "123"; $other = "xyz";
$test = $other;
What about the Array? Can this be done?
$array_test[1] = "abc"; $array_test[2] = "jkl"; $array_test[3] = "$%(";
$other_test = $array_test;
echo $other_test[1];
Would the result be "abc"???? Does it work that way? I need something that would work with one array to a different array.
Thanks....
attached mail follows:
Yes you can simply assign arrays like
$a = "0"; $a = "1"; $b = $a;
echo $b[0];
would print
0
> -----Original Message-----
> From: Scott Fletcher [mailto:scott
abcoa.com]
> Sent: Thursday, January 02, 2003 5:08 PM
> To: php-general
lists.php.net
> Subject: [PHP] Can it be doen with Array????
>
> Hi!
>
> I know that it can be done with certain variables that can
overwrite
> another variable. Like ....
>
> $test = "123";
> $other = "xyz";
>
> $test = $other;
>
> What about the Array? Can this be done?
>
> $array_test[1] = "abc";
> $array_test[2] = "jkl";
> $array_test[3] = "$%(";
>
> $other_test = $array_test;
>
> echo $other_test[1];
>
> Would the result be "abc"???? Does it work that way? I need
> something
> that would work with one array to a different array.
>
> Thanks....
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Bah, I meant
$a[] = "0"; $a[] = "1"; $b = $a;
echo $b[0];
> -----Original Message-----
> From: Gareth Hastings [mailto:gareth
netgs.co.uk]
> Sent: Thursday, January 02, 2003 5:05 PM
> To: 'Scott Fletcher'; php-general
lists.php.net
> Cc: php-general
lists.php.net
> Subject: RE: [PHP] Can it be doen with Array????
>
> Yes you can simply assign arrays like
>
> $a = "0";
> $a = "1";
> $b = $a;
>
> echo $b[0];
>
> would print
>
> 0
>
>
> > -----Original Message-----
> > From: Scott Fletcher [mailto:scott
abcoa.com]
> > Sent: Thursday, January 02, 2003 5:08 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Can it be doen with Array????
> >
> > Hi!
> >
> > I know that it can be done with certain variables that can
> overwrite
> > another variable. Like ....
> >
> > $test = "123";
> > $other = "xyz";
> >
> > $test = $other;
> >
> > What about the Array? Can this be done?
> >
> > $array_test[1] = "abc";
> > $array_test[2] = "jkl";
> > $array_test[3] = "$%(";
> >
> > $other_test = $array_test;
> >
> > echo $other_test[1];
> >
> > Would the result be "abc"???? Does it work that way? I need
> > something
> > that would work with one array to a different array.
> >
> > Thanks....
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks! I looked it up on the php.net and I wasn't sure if I understood it, so I post it here instead. Thanks for hte response.
Scott F.
"Gareth Hastings" <gareth
netgs.co.uk> wrote in message
news:000201c2b2ab$3bb8be30$0cc818ac
exodus.netgs.co.uk...
> Bah, I meant
>
> $a[] = "0";
> $a[] = "1";
> $b = $a;
>
> echo $b[0];
>
> > -----Original Message-----
> > From: Gareth Hastings [mailto:gareth
netgs.co.uk]
> > Sent: Thursday, January 02, 2003 5:05 PM
> > To: 'Scott Fletcher'; php-general
lists.php.net
> > Cc: php-general
lists.php.net
> > Subject: RE: [PHP] Can it be doen with Array????
> >
> > Yes you can simply assign arrays like
> >
> > $a = "0";
> > $a = "1";
> > $b = $a;
> >
> > echo $b[0];
> >
> > would print
> >
> > 0
> >
> >
> > > -----Original Message-----
> > > From: Scott Fletcher [mailto:scott
abcoa.com]
> > > Sent: Thursday, January 02, 2003 5:08 PM
> > > To: php-general
lists.php.net
> > > Subject: [PHP] Can it be doen with Array????
> > >
> > > Hi!
> > >
> > > I know that it can be done with certain variables that can
> > overwrite
> > > another variable. Like ....
> > >
> > > $test = "123";
> > > $other = "xyz";
> > >
> > > $test = $other;
> > >
> > > What about the Array? Can this be done?
> > >
> > > $array_test[1] = "abc";
> > > $array_test[2] = "jkl";
> > > $array_test[3] = "$%(";
> > >
> > > $other_test = $array_test;
> > >
> > > echo $other_test[1];
> > >
> > > Would the result be "abc"???? Does it work that way? I need
> > > something
> > > that would work with one array to a different array.
> > >
> > > Thanks....
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
We have a good size PHP libary -- about 370KB of source code. Its one class with a multitude of small functions in it. just doing a require_once() on this library appears to use about 5MB of memory.(the change in VmSize in /proc/self/status)
Is this a normal ratio of PHP source code size to executable size?
-- JimJames H. Thompson jht
lava.net
attached mail follows:
On Friday 03 January 2003 05:54 am, James H. Thompson wrote: > We have a good size PHP libary -- about 370KB of source code. > Its one class with a multitude of small functions in it.
that's a huge class. is it feasible to split it into smaller classes that do smaller things?
i only ask. i haven't looked at any includes that are that big. haven't had to, i don't even use classes, i just have function libraries, each library file holding only related functions possibly with includes only for other library files that it needs itself (never including anything just because something downstream will need it, the downstream should include its own requirements itself), so i haven't tried to measure the amount of RAM something like that would eat, although 5MB for 370K of source does seem excessive, unless you've got complex data structures in there, or you're storing the all the rows of an SQL query in an array or something similar (i've seen a lot of that with programmers i work with, they store entire result sets in arrays to make them easier to work with, without considering just how much RAM such arrays would eat if the result sets are large). tiger
--
Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
Veritas liberabit vos.
Doveryai no proveryai.
attached mail follows:
I don't know if I'm talking bullshit, but don't forget that each parameter or return valeu in php, if not explicited as a pointer, it's a copy of the full parameter. This way, any
function a(myclass c) { return c; }
would create another copy of "c" in memory. Things get a bit larger when you go with linked-list like structures in classes, where you have to take really good care to don't duplicate data. If you're not taking care, then maybe 5MB is normal.
IMHO, I agree with splitting the class into smaller functions. 370KB is a big thing, that maybe useless. PHP isn't Java so you're not suposed to do a "class mysite"
[]s Fernando
"James H. Thompson" <jht
lava.net> wrote in message
news:20030102215354.63611.qmail
pb1.pair.com...
> We have a good size PHP libary -- about 370KB of source code.
> Its one class with a multitude of small functions in it.
> just doing a require_once() on this library appears to use about 5MB of
> memory.(the change in VmSize in /proc/self/status)
>
> Is this a normal ratio of PHP source code size to executable size?
>
>
> --
> Jim
>
> James H. Thompson
> jht
lava.net
>
>
attached mail follows:
> On Friday 03 January 2003 05:54 am, James H. Thompson wrote: > > We have a good size PHP libary -- about 370KB of source code. > > Its one class with a multitude of small functions in it. > > that's a huge class. is it feasible to split it into smaller classes that > do smaller things?
Its splitable to some degree, not clear how much as the functions are used in many overlapping combinations.
I didn't make it clear -- the memory is consumed before the code even executes -- just doing the require_once chews up the memory before any of the class gets used. I didn't write it, but I scanned through it and didn't see much in the way of data structures (small or large) being allocated.
Jim
attached mail follows:
Can someone explain to me why the loop that counts to 99 appears before the 5 by 5 grid in the following php code?
Thanks!
<?php
echo "<table border=\"1\" align=\"center\" width=\"100%\" bgcolor=\"#FFFFFF\" bordercolor=\"#FFFFFF\"><tr>";
for ($r=0; $r<5; $r++){
for ($c=0; $c<7; $c++){
if ($c==0 || $c%7==0)
echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" bordercolor=\"#000000\"></td>"; else if ($c%6==0)
echo "<td align=\"center\" valign=\"middle\" width=\"14%\" height=\"77\" bordercolor=\"#000000\"></td></tr><tr>";
else {
echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" border=\"1\" bordercolor=\"#000000\">";
echo "<div align=\"center\"><font size=\"1\"></font></div>";
echo "Hello" ; $i++;
} //for else
}// for loop c
} //for loop r
for ($i=1; $i<100; $i++)
echo "$i<br>\n";
?>
attached mail follows:
Try viewing the source that is generated in html and I bet you will find
that it is broken html code.
----- Original Message -----
From: "Lightfirst" <dreiff
avenew.com>
To: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 4:25 PM
Subject: [PHP] Baffling output
> Can someone explain to me why the loop that counts to 99 appears before the > 5 by 5 grid in the following php code? > > Thanks! > > <?php > > echo "<table border=\"1\" align=\"center\" width=\"100%\" > bgcolor=\"#FFFFFF\" bordercolor=\"#FFFFFF\"><tr>"; > > for ($r=0; $r<5; $r++){ > > for ($c=0; $c<7; $c++){ > > if ($c==0 || $c%7==0) > > echo "<td align=\"center\" valign=\"middle\" width=\"15%\" > height=\"77\" bordercolor=\"#000000\"></td>"; else if ($c%6==0) > > echo "<td align=\"center\" valign=\"middle\" width=\"14%\" > height=\"77\" bordercolor=\"#000000\"></td></tr><tr>"; > > else { > > echo "<td align=\"center\" valign=\"middle\" width=\"15%\" > height=\"77\" border=\"1\" bordercolor=\"#000000\">"; > > echo "<div align=\"center\"><font size=\"1\"></font></div>"; > > echo "Hello" ; $i++; > > } //for else > > }// for loop c > > } //for loop r > > for ($i=1; $i<100; $i++) > > echo "$i<br>\n"; > > ?> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
--- Lightfirst <dreiff
avenew.com> wrote:
> Can someone explain to me why the loop that counts to 99
> appears before the 5 by 5 grid in the following php code?
There is a good chance that the problem is that your HTML table is screwed up. Make sure you close your row and table; it wasn't in the code you provided.
If that doesn't fix it, check to ensure that you have the correct number of cells per row.
Chris
attached mail follows:
checking return emails..
attached mail follows:
:)
Paul Marinas Technical Support RDS Craiova
Phone: +402-51-410-194 Mobile: +407-22-451-439 Fax: +402-51-416-579 www.rdsnet.ro .....................................................
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such a case, you should destroy this message and kindly notify the sender by reply e-mail.
On Thu, 2 Jan 2003, Jim Lucas wrote:
> checking return emails.. >
attached mail follows:
Well, I have been chaning different settings the past few days and noticed that my messages had not been posted to the board. Finally got it going.
But here is my question, now that my email IS working.
can you override the engine setting in the virtual host block
I am running Apache 1.3.26 & PHP 4.2.2
ie:
in the global area of the httpd.conf file I put php_admin_value engine Off
and then do the following for my VirtualHost blocks
<VirtualHost *> DocumentRoot /some/path/public_html php_admin_value engine On </VirturalHost>
When I do this. PHP doesn't parse the files.
It just prints the php code in the sent page.
Is this possible, can it be done, and if so, how?
Jim
----- Original Message -----
From: "Paul Marinas" <paulm
SGI.rdscv.ro>
To: "Jim Lucas" <phplist
zonedzero.net>
Cc: <php-general
lists.php.net>
Sent: Thursday, January 02, 2003 4:33 PM
Subject: Re: [PHP] PHP Testing
> :) > > Paul Marinas > Technical Support > RDS Craiova > > > Phone: +402-51-410-194 > Mobile: +407-22-451-439 > Fax: +402-51-416-579 > www.rdsnet.ro > ..................................................... > > Privileged/Confidential Information may be contained in this message. If you > are not the addressee indicated in this > message (or responsible for delivery of the message to such person), you may > not copy or deliver this message to > anyone. In such a case, you should destroy this message and kindly notify > the sender by reply e-mail. > > On Thu, 2 Jan 2003, Jim Lucas wrote: > > > checking return emails.. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi,
i am currently working with sessions and how to secure them as much as possible. In an older script of mine, i used session_is_registered() to take care of this, but according to the manual: "If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), ..." - i can't use this anymore. Well, so i wondered: how do you or would you make sure that s.o. won't be able to hijack the session? Also any recommended URLs about this matter are more than welcome as well :)
I am currently only checking the IP, but i read about issues with AOL users about this, since it can happen that their IP changes while browsing the site. S.o. mentioned checking the referer and so making sure, the script comes from the own server, but when using redirects or stuff like that (or the browser doesn't support this properly - as read in the php manual), then this isn't 100% working as well.
So, start nuking me with your comments ;)
Regards, Duncan
attached mail follows:
Hi,
There's actually another thread on this topic at the moment... quick summary:
1. you can't rely on the IP address 2. you can't rely on the referrer
It's been suggested on the list that you could record the user agent into the session, and check against that -- keeping in mind that the user agent may be null, and that this would not prevent someone with an identical useragent from hijacking the session... it's more like an added layer of protection :)
Check out the recent thread "prevent session_replay"
Justin
on 03/01/03 11:36 AM, Duncan (php-general
ring-wraith.com) wrote:
> Hi, > > i am currently working with sessions and how to secure them as much as > possible. > In an older script of mine, i used session_is_registered() to take care > of this, but according to the manual: "If you are using $_SESSION (or > $HTTP_SESSION_VARS), do not use session_register(), ..." - i can't use > this anymore. > Well, so i wondered: how do you or would you make sure that s.o. won't > be able to hijack the session? > Also any recommended URLs about this matter are more than welcome as well :) > > I am currently only checking the IP, but i read about issues with AOL > users about this, since it can happen that their IP changes while > browsing the site. > S.o. mentioned checking the referer and so making sure, the script comes > from the own server, but when using redirects or stuff like that (or the > browser doesn't support this properly - as read in the php manual), then > this isn't 100% working as well. > > So, start nuking me with your comments ;) > > Regards, > Duncan >
attached mail follows:
Ah,
thanks a lot. I will add my 2 cents in there then :)
Regards, Duncan
Justin French wrote:
>Hi,
>
>There's actually another thread on this topic at the moment... quick
>summary:
>
>1. you can't rely on the IP address
>2. you can't rely on the referrer
>
>It's been suggested on the list that you could record the user agent into
>the session, and check against that -- keeping in mind that the user agent
>may be null, and that this would not prevent someone with an identical
>useragent from hijacking the session... it's more like an added layer of
>protection :)
>
>Check out the recent thread "prevent session_replay"
>
>Justin
>
>
>on 03/01/03 11:36 AM, Duncan (php-general
ring-wraith.com) wrote:
>
>
>
>>Hi,
>>
>>i am currently working with sessions and how to secure them as much as
>>possible.
>>In an older script of mine, i used session_is_registered() to take care
>>of this, but according to the manual: "If you are using $_SESSION (or
>>$HTTP_SESSION_VARS), do not use session_register(), ..." - i can't use
>>this anymore.
>>Well, so i wondered: how do you or would you make sure that s.o. won't
>>be able to hijack the session?
>>Also any recommended URLs about this matter are more than welcome as well :)
>>
>>I am currently only checking the IP, but i read about issues with AOL
>>users about this, since it can happen that their IP changes while
>>browsing the site.
>>S.o. mentioned checking the referer and so making sure, the script comes
>>from the own server, but when using redirects or stuff like that (or the
>>browser doesn't support this properly - as read in the php manual), then
>>this isn't 100% working as well.
>>
>>So, start nuking me with your comments ;)
>>
>>Regards,
>>Duncan
>>
>>
>>
>
>
>
>
>
>
attached mail follows:
Joskey- Squirrel Mail is pretty good-
www.squirrelmail.org
David
----- Original Message -----
From: <joskey
lianluo.com>
To: "PHP Mail List" <php-general
lists.php.net>
Sent: Monday, December 02, 2002 4:30 AM
Subject: [PHP] Who can tell me the best php-base webmail?
> Thank you for reading my mail!
> ----------------------------------------------------------
> Who can tell me the best php-base webmail?
> I want a webmail for my mail server,
> give me a suggest, please!
> ----------------------------------------------------------
> Joskey Liaus
> joskey
monline.com.cn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Martin- the command line switches are stored in the $_SERVER['argv'] array. E.g.
php -q myscript.php4 1000
The value of $_SERVER['argv'][1] in the myscript.php4 script would be 1000.
David
----- Original Message -----
From: "Martin Thoma" <martin
radiok2r.de>
To: <php-general
lists.php.net>
Sent: Monday, December 02, 2002 5:40 AM
Subject: [PHP] How to give parameters to a console php-script?
> Hello! > > I start a console app with > > php myscript.php4 (just prints "ok"). > > How can I give parameters to it? I tried: > php myscript.php4 myparameter > php myscript.php4?myparameter > php myscript.php4?param=myparameter > > But always php just returns without doing nothing (not even giving an > error or printing "Ok"!) I'm using PHP 4.2.3. on Windows2000). > > Martin > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I have a script with some functions and within the script I want to read the code from one of the functions into a string.
Example:
function myfunction() { echo "something"; echo "something else"; someotherfunction(); }
I want to read:
echo "something"; echo "something else"; someotherfunction();
into a string.
Any ideas??? TIA -Shawn
attached mail follows:
so put it in a if or switch statement
eg
if ($var){ myfunction(); } else { sumotherfunction(); }
etc
> -----Original Message-----
> From: Shawn McKenzie [mailto:nospam
mckenzies.net]
> Sent: Friday, 3 January 2003 12:18 PM
> To: php-general
lists.php.net
> Subject: [PHP] Code contents of a function
>
>
> I have a script with some functions and within the script I want
> to read the
> code from one of the functions into a string.
>
> Example:
>
> function myfunction() {
> echo "something";
> echo "something else";
> someotherfunction();
> }
>
> I want to read:
>
> echo "something";
> echo "something else";
> someotherfunction();
>
> into a string.
>
> Any ideas??? TIA
> -Shawn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
What??? I want to read the code from the function into a string!
"Peter Houchin" <php
vfsa.com.au> wrote in message
news:DPEPKCNEFOKBCNNANCIPAEHGDDAA.php
vfsa.com.au...
> so put it in a if or switch statement
>
> eg
>
> if ($var){
> myfunction();
> }
> else {
> sumotherfunction();
> }
>
> etc
>
>
> > -----Original Message-----
> > From: Shawn McKenzie [mailto:nospam
mckenzies.net]
> > Sent: Friday, 3 January 2003 12:18 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Code contents of a function
> >
> >
> > I have a script with some functions and within the script I want
> > to read the
> > code from one of the functions into a string.
> >
> > Example:
> >
> > function myfunction() {
> > echo "something";
> > echo "something else";
> > someotherfunction();
> > }
> >
> > I want to read:
> >
> > echo "something";
> > echo "something else";
> > someotherfunction();
> >
> > into a string.
> >
> > Any ideas??? TIA
> > -Shawn
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
attached mail follows:
On Friday 03 January 2003 09:17 am, Shawn McKenzie wrote: > I have a script with some functions and within the script I want to read > the code from one of the functions into a string.
you'd probably have to fopen/fgets or file, and then parse for the function start and end and read the contents. i don't know of any functions in PHP that will let you do this automatically so you'll probably have to do this by hand. or pass it off to an external parsing program (written with whatever you prefer, flex and bison?) which returns the contents.
sorry, i know that's not much help. but it looks like you'll have to do this the hard way. you don't have to do a full parse though if all you want is the text. you just need to identify function bodies, where the function body starts and ends, how to associate the function body with the function name, etc. you could probably do this even with just some basic text processing code instead of writing something using a lexer and parser. although the full lexer/parser path might be better (you can probably still avoid lexing or parsing most of the rest of the language).
out of curiousity. what do you need this for? :) tiger
--
Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
Veritas liberabit vos.
Doveryai no proveryai.
attached mail follows:
Actually you should be able to get mcrypt working with PHP on Windows (mcrypt is not distributed with PHP because of the legal issues surrounding exporting encryption).
If you visit the PHP manual page for mcrypt at http://www.php.net/manual/en/ref.mcrypt.php you will see the following under Requirements:
Windows users will find all the needed compiled mcrypt binaries here (http://ftp.proventum.net/pub/php/win32/misc/mcrypt/).
You should be able to add this as a php extension in your windows php.ini file and then mcrypt functions should be available to you under windows, there is no need to use other software.
I'm glad to see mcrypt support for windows because it finally allows me to use my favorite PHP encryption library between both platforms.
Jason
On Thu, 2003-01-02 at 10:02, J Smith wrote: > > As I've said a bunch of times, I hate plugging my own software, but you can > try cryptopp-php, which should provide all the encryption you need, and it > works on both UNIX and Windows. > > http://www.tutorbuddy.com/software/ > > J > > > Alex Piaz wrote: > > > As far as I know, there is no mcrypt windows version. You´ll have to try > > to compile it yourself. And don´t ask me how because I don´t know:-) > > > > A sugestion: If you can, change to linux. It´s better and it´s Free. > > > > Regards > > > > Alex > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi! I am receiving a parse error in the following code. The file is located at http://www.historiadelpais.com.ar/ppal_bio.php
Anyone can help me?
Thanks!
Ezequiel
<html>
<head> <title>Biografias</title> </head> <body background="images/StyleGreenMarble_Bg.jpg"> <?php $db = mysql_connect("localhost", user, password); mysql_select_db(efemerides,$db); $response = mysql_query("select * from biografias where indice=1", $db); while($row = mysql_fetch_array($response));
echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" width="274" height="43"></p>"); print "<img src=\" " . $row["banner_nombre"] . "\">"; echo("<div align="center">"); echo("<center>"); echo("<table border="1" width="500" height="25">"); echo("<tr>"); echo("<td width="500" height="25">"); echo("<div align="left">"); echo("<table border="0" width="125" height="27">"); echo("<tr>"); echo("<td width="125" height="27"></td>"); echo("</tr>"); echo("</table>"); echo("</div>"); echo("<p>");
print($row["texto"] ."<br>\n");
echo("</td>"); echo("</tr>"); echo("</table>"); echo("</center>"); echo("</div>"); }
?>
</div>
</html>
attached mail follows:
On Friday 03 January 2003 10:27 am, Ezequiel Sapoznik wrote: > echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" > width="274" height="43"></p>");
you have embedded double quotes inside a string delimited by double quotes. use single quotes to delimit the string (since nothing inside is a variable).
or escape your internal double quotes with a backspace, e.g.
echo (" internal double \"quotes\" should be escaped");
note: if you have ssh or console access to your server (or to a testing box), you can always run the command line php interpreter to see what syntax errors there are. e.g.,
php -l syntaxErrorTest.php
will show you syntax errors in there.
tiger
--
Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
Veritas liberabit vos.
Doveryai no proveryai.
attached mail follows:
You need to esape your quotes in the HTML as in
echo("<table border="0" width="125" height="27">");
should be
echo("<table border=\"0\" width=\"125\" height=\"27\">");
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 11:27 PM Ezequiel Sapoznik wrote:
>Hi! >I am receiving a parse error in the following code. The file is located at >http://www.historiadelpais.com.ar/ppal_bio.php > >Anyone can help me? > >Thanks! > >Ezequiel > ><html> > ><head> ><title>Biografias</title> ></head> ><body background="images/StyleGreenMarble_Bg.jpg"> > <?php > $db = mysql_connect("localhost", user, password); > mysql_select_db(efemerides,$db); > $response = mysql_query("select * from biografias where indice=1", $db); > while($row = mysql_fetch_array($response)); > > > echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" >width="274" height="43"></p>"); > print "<img src=\" " . $row["banner_nombre"] . "\">"; > echo("<div align="center">"); > echo("<center>"); > echo("<table border="1" width="500" height="25">"); > echo("<tr>"); > echo("<td width="500" height="25">"); > echo("<div align="left">"); > echo("<table border="0" width="125" height="27">"); > echo("<tr>"); > echo("<td width="125" height="27"></td>"); > echo("</tr>"); > echo("</table>"); > echo("</div>"); > echo("<p>"); > > print($row["texto"] ."<br>\n"); > > echo("</td>"); > echo("</tr>"); > echo("</table>"); > echo("</center>"); > echo("</div>"); > } > >?> > > ></div> > ></html> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Or, another option is to use single-quotes in the HTML:
echo("<table border='0' width='125' height='27'>");
That way you can include variables in there if you see fit (since the string itself is still double-quoted), and you don't have to worry about escpaing the double-quotes.
-Dan
On Thu, 2 Jan 2003, Michael J. Pawlowsky wrote:
> You need to esape your quotes in the HTML > as in > > echo("<table border="0" width="125" height="27">"); > > should be > > echo("<table border=\"0\" width=\"125\" height=\"27\">"); > > > Mike > > > > > *********** REPLY SEPARATOR *********** > > On 02/01/2003 at 11:27 PM Ezequiel Sapoznik wrote: > > >Hi! > >I am receiving a parse error in the following code. The file is located at > >http://www.historiadelpais.com.ar/ppal_bio.php > > > >Anyone can help me? > > > >Thanks! > > > >Ezequiel > > > ><html> > > > ><head> > ><title>Biografias</title> > ></head> > ><body background="images/StyleGreenMarble_Bg.jpg"> > > <?php > > $db = mysql_connect("localhost", user, password); > > mysql_select_db(efemerides,$db); > > $response = mysql_query("select * from biografias where indice=1", $db); > > while($row = mysql_fetch_array($response)); > > > > > > echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" > >width="274" height="43"></p>"); > > print "<img src=\" " . $row["banner_nombre"] . "\">"; > > echo("<div align="center">"); > > echo("<center>"); > > echo("<table border="1" width="500" height="25">"); > > echo("<tr>"); > > echo("<td width="500" height="25">"); > > echo("<div align="left">"); > > echo("<table border="0" width="125" height="27">"); > > echo("<tr>"); > > echo("<td width="125" height="27"></td>"); > > echo("</tr>"); > > echo("</table>"); > > echo("</div>"); > > echo("<p>"); > > > > print($row["texto"] ."<br>\n"); > > > > echo("</td>"); > > echo("</tr>"); > > echo("</table>"); > > echo("</center>"); > > echo("</div>"); > > } > > > >?> > > > > > ></div> > > > ></html> > > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >
-- Regards,Dan Goodes PlanetMirror Admin
http://planetmirror.com/ admin
planetmirror.com
attached mail follows:
You have numerous errors in that code. Your DB connection line is messed up, the username and password either need to be a quoted string, a variable representing that string, or a constant. Your database selection needs to be quoted. You need to escape out the double quotes that you want to print out to the document....or just clean it up a bit....
<html> <head> <title>Biografias</title> </head> <body background="images/StyleGreenMarble_Bg.jpg"> <?php NEEDS FIXING --> $db = mysql_connect("localhost", user, password); NEEDS FIXING --> mysql_select_db(efemerides,$db); $response = mysql_query("select * from biografias where indice=1", $db); while($row = mysql_fetch_array($response)); ?> <p align="center"><img border="0" src="images/banner_chico_bio.jpg width="274" height="43"></p> <img src="<?php echo ( $row["banner_nombre"] ); ?>"> <div align="center"> <center>"); <table border="1" width="500" height="25">"); <tr> <td width="500" height="25"><div align="left"> <table border="0" width="125" height="27"> <tr> <td width="125" height="27"> </td> </tr> </table> </div> <p> <?php ehco ( $row["texto"] ); ?> </td> </tr> </table> </center> </div> <?php } ?> </div> </html>
Ezequiel Sapoznik wrote: > Hi! > I am receiving a parse error in the following code. The file is located at > http://www.historiadelpais.com.ar/ppal_bio.php > > Anyone can help me? > > Thanks! > > Ezequiel > > <html> > > <head> > <title>Biografias</title> > </head> > <body background="images/StyleGreenMarble_Bg.jpg"> > <?php > $db = mysql_connect("localhost", user, password); > mysql_select_db(efemerides,$db); > $response = mysql_query("select * from biografias where indice=1", $db); > while($row = mysql_fetch_array($response)); > > > echo("<p align="center"><img border="0" src="images/banner_chico_bio.jpg" > width="274" height="43"></p>"); > print "<img src=\" " . $row["banner_nombre"] . "\">"; > echo("<div align="center">"); > echo("<center>"); > echo("<table border="1" width="500" height="25">"); > echo("<tr>"); > echo("<td width="500" height="25">"); > echo("<div align="left">"); > echo("<table border="0" width="125" height="27">"); > echo("<tr>"); > echo("<td width="125" height="27"></td>"); > echo("</tr>"); > echo("</table>"); > echo("</div>"); > echo("<p>"); > > print($row["texto"] ."<br>\n"); > > echo("</td>"); > echo("</tr>"); > echo("</table>"); > echo("</center>"); > echo("</div>"); > } > > ?> > > > </div> > > </html> > > >
-- By-Tor.com It's all about the Rush http://www.by-tor.com
attached mail follows:
if there a command, or a way I can put say a 5 second, or a 10 second pause which will make it so it will output x amount of html, and then continue? or if I can pause it will it not display any of the html until the entire script has ran?
attached mail follows:
I'm not sure I totally understand... but...
to pause... sleep(10); i.e. 10 second pause Everything stops... not just output
you can buffer everything and only output it when you want....
look at ob_start
But a warning... your server or the clients might change the expexted behaviour.
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 7:56 PM Jeff Bluemel wrote:
>if there a command, or a way I can put say a 5 second, or a 10 second >pause >which will make it so it will output x amount of html, and then continue? >or if I can pause it will it not display any of the html until the entire >script has ran? > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I beleive you can use output buffering to stop anything from being displayed until the very last moment. Or you can code your page with tables. I know IE wont' render a table until the last </table> (I beleive), so this could stop your html from showing.
Or if there is going to be a long pause, you could make a intermediate page that displays this will take minute. This page would have a meta refresh that keeps refreshing itself checking the status of your job. Once the job is complete on the next refresh it will notice the job is done and voila display the results.
Andrew
----- Original Message -----
From: "Jeff Bluemel" <jeff
domintcom.com>
To: <php-general
lists.php.net>
Sent: Friday, January 03, 2003 2:56 AM
Subject: [PHP] way to insert timer / pause?
> if there a command, or a way I can put say a 5 second, or a 10 second pause > which will make it so it will output x amount of html, and then continue? > or if I can pause it will it not display any of the html until the entire > script has ran? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Sure, just read the following:
http://www.php.net/manual/en/function.sleep.php
As a reply for your second question, you can always assign the output to a variable and echo the variable in the end of the script.
Regards, Sumarlidi E. Dadason
SED - Graphic Design
_________________________________
Tel: 896-0376, 461-5501
E-mail: sed
sed.is
website: www.sed.is
-----Original Message-----
From: Jeff Bluemel [mailto:jeff
domintcom.com]
Sent: 3. janúar 2003 02:57
To: php-general
lists.php.net
Subject: [PHP] way to insert timer / pause?
if there a command, or a way I can put say a 5 second, or a 10 second pause which will make it so it will output x amount of html, and then continue? or if I can pause it will it not display any of the html until the entire script has ran?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
thanks Sed
"Sed" <sed
sed.is> wrote in message
news:014d01c2b2d7$86935330$fe78a8c0
mamma...
Sure, just read the following:
http://www.php.net/manual/en/function.sleep.php
As a reply for your second question, you can always assign the output to a variable and echo the variable in the end of the script.
Regards, Sumarlidi E. Dadason
SED - Graphic Design
_________________________________
Tel: 896-0376, 461-5501
E-mail: sed
sed.is
website: www.sed.is
-----Original Message-----
From: Jeff Bluemel [mailto:jeff
domintcom.com]
Sent: 3. janúar 2003 02:57
To: php-general
lists.php.net
Subject: [PHP] way to insert timer / pause?
if there a command, or a way I can put say a 5 second, or a 10 second pause which will make it so it will output x amount of html, and then continue? or if I can pause it will it not display any of the html until the entire script has ran?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
thanks for the reply Mike...
Jeff
"Michael J. Pawlowsky" <mikejp
videotron.ca> wrote in message
news:200301022212030574.02502EBA
relais.videotron.ca...
>
> I'm not sure I totally understand... but...
>
> to pause... sleep(10); i.e. 10 second pause Everything stops... not
just output
>
> you can buffer everything and only output it when you want....
>
> look at ob_start
>
> But a warning... your server or the clients might change the expexted
behaviour.
>
>
> Mike
>
>
>
> *********** REPLY SEPARATOR ***********
>
> On 02/01/2003 at 7:56 PM Jeff Bluemel wrote:
>
> >if there a command, or a way I can put say a 5 second, or a 10 second
> >pause
> >which will make it so it will output x amount of html, and then continue?
> >or if I can pause it will it not display any of the html until the entire
> >script has ran?
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
attached mail follows:
Andrew,
my application is of customer service tries to recharge the balance on a pin, and it is over their charge limit (the customer service personnel) then I was thinking I would display a header for a few seconds telling them the recharge failed, and why. however, I think I will just out it in highlighted text instead (and flashing if I can figure that out).
Jeff
"Andrew Brampton" <andrew
bramp.freeserve.co.uk> wrote in message
news:002b01c2b2d6$37fba7a0$4fc40650
andrew...
> I beleive you can use output buffering to stop anything from being
displayed
> until the very last moment. Or you can code your page with tables. I know
IE
> wont' render a table until the last </table> (I beleive), so this could
stop
> your html from showing.
>
> Or if there is going to be a long pause, you could make a intermediate
page
> that displays this will take minute. This page would have a meta refresh
> that keeps refreshing itself checking the status of your job. Once the job
> is complete on the next refresh it will notice the job is done and voila
> display the results.
>
> Andrew
> ----- Original Message -----
> From: "Jeff Bluemel" <jeff
domintcom.com>
> To: <php-general
lists.php.net>
> Sent: Friday, January 03, 2003 2:56 AM
> Subject: [PHP] way to insert timer / pause?
>
>
> > if there a command, or a way I can put say a 5 second, or a 10 second
> pause
> > which will make it so it will output x amount of html, and then
continue?
> > or if I can pause it will it not display any of the html until the
entire
> > script has ran?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
attached mail follows:
Thank god the <blink> tag in HTML was removed. Don't know how long you've been working on sites, but I started at the same time the first NSCA Mosaic browser came out. About 10 years now.
They had <blink></blink> back then, and everyone starting using it just about everywhere! Imagine trying to read complete pages that were blinking.
The first HTML chats would allow tags inserted... so someone would open a <blink> tag and not close it to make the whole page blink.
Anyways... the way I would do it today is to make an animated gif with the text blinking and just load that.
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 9:52 PM Jeff Bluemel wrote:
>highlighted text instead (and flashing if I can figure that out).
attached mail follows:
thats a good idea Mike... thanks for the suggestion.
"Michael J. Pawlowsky" <mikejp
videotron.ca> wrote in message
news:200301030001040219.02B3FC1F
relais.videotron.ca...
>
>
> Thank god the <blink> tag in HTML was removed.
> Don't know how long you've been working on sites,
> but I started at the same time the first NSCA Mosaic browser came out.
About 10 years now.
>
> They had <blink></blink> back then, and everyone starting using it just
about everywhere!
> Imagine trying to read complete pages that were blinking.
>
> The first HTML chats would allow tags inserted...
> so someone would open a <blink> tag and not close it to make the whole
page blink.
>
> Anyways... the way I would do it today is to make an animated gif with the
text blinking and just load that.
>
> Mike
>
>
>
>
> *********** REPLY SEPARATOR ***********
>
> On 02/01/2003 at 9:52 PM Jeff Bluemel wrote:
>
>
> >highlighted text instead (and flashing if I can figure that out).
>
>
>
attached mail follows:
dear all, i have 2 servers that were *given* to me to setup and implement webmail solution for our client. i have done some groundwork in terms of the backend applications that are needed to do this.
what i wanted to know is, how best can i distribute the backend applications between those 2 servers to achieve a balance and fast response. can i go like this:
server A -------- ldap courier-imap
server B -------- apache php qmail
for mysql, i have an existing server that i will use for database queries. appreciate your kind advice.
best rgds. roger
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
attached mail follows:
Hey guys, I cant figure out what’s wrong with this code. Im sure its syntax can some one take a look at it and Help me out What im trying to do is create a form for sign up. So that the values will be added to the table in the databse.. For log in purposes. Thanks Karl Here is the code. HYPERLINK "http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m akethewebsecure.com/~admin12/do_adduser.phps
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002
attached mail follows:
Here is what i need to do. I have a form where a user will submit, email address, email text and a time like 11:15pm and at 11:15pm the email is supposed to be sent out. any ideas on how i can make this happen automatically??? Randy
attached mail follows:
Running Linux / UNIX?
man crontab
Make a php script for command line use.
Randy Johnson wrote: > Here is what i need to do. > > > > I have a form where a user will submit, email address, email text and a time > like 11:15pm and at 11:15pm the email is supposed to be sent out. any > ideas on how i can make this happen automatically??? > > > > > > Randy > >
-- By-Tor.com It's all about the Rush http://www.by-tor.com
attached mail follows:
Well a few ways you can do it... how precise does it need to be?
You can have PHP write the mails to files with the time to be sent in then or in the filename; like somerandomstring.200301021545 Run a script from cron that would look at the files, parse the time and if it's time to send them just direct them into sendmail.
If you cant get to cron or to write scripts on your server. You can always put some include in a busy page of your site. Put it at the end after a flush call. But of course in someone wants his mail at 03:00 and you donrt have much traffic it might be late. It can check for the files and mail the contents if it needs to.
Might also be otherways but that's one.
Hope this helps...
Mike
*********** REPLY SEPARATOR ***********
On 02/01/2003 at 10:48 PM Randy Johnson wrote:
>Here is what i need to do.
>
>I have a form where a user will submit, email address, email text and a >time > like 11:15pm and at 11:15pm the email is supposed to be sent out. any >ideas on how i can make this happen automatically???
>
>
>Randy > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I was wondering if anyone had a good BreadCrumb class. If not I will write my own, but thought surely there must be many out there. But quick searches only brought up "Poof" which is more than I want.
Thanks, Mike
attached mail follows:
Hi all,
I did a registration page for a customer, and now I'm trying to develop a way for him to send an e-mail once in a while to the people registered with him. I did something (shown below) and everything seems to be ok, but the e-mail never reaches... Can someone find the problem or maybe point me to something already done to send multiple e-mails as BCC???
Thanks in advance,
$query = "SELECT * FROM mararegistro2 ORDER BY lname"; $result = mysql_query($query) or die (mysql_errno()); $num_rows = mysql_num_rows($result);
for ($x=0; $x < $num_rows; $x++) { $row = mysql_fetch_array($result); $bcc .= $row[email]."; "; }
$myname = "".$name.""; $myemail = "".$email."";
$contactemail = $bcc;
$message = "".$mes.""; $subject = "".$subject."";
$headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$myname." <".$myemail.">\r\n"; $headers .= "Bcc: ".$contactemail."\r\n"; $headers .= "Reply-To: ".$myname." <".$myemail.">\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Mailer: Joyeria Mara";
$mail = mail("", $subject, $message, $headers);
Cesar L. Aracena
icaam
icaam.com.ar
caracena
infovia.com.ar
(0299) 156-356688
Neuquén (8300) Capital
Argentina
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]