Re: [PHP] Re: loading a db table into a php array from mysql
% different ways of connecting tables with LEFT JOIN. USING( fieldname ) % connects the table being joined, with the table listed right before it, % using the same fieldname in both. The ON syntax allows you to use % differently named fields, and/or a different table. I still don't get what a left or right or outer or inner join is... When looking up values in a second table, LEFT JOIN has two properties that make it my choice: o It lets me specify exactly how the tables are linked together. o It returns results for the first table even if there are no entries in the second table. For example, if one of my classes did not yet have a room assigned, the rest of the data will still be returned. > I've read the mysql docs for the syntax and some examples, but this is > a place where I'll need to go to outside tutorials. Do you know of > any (on the web) which will give me the background? http://www.devshed.com/Server_Side/MySQL/Join/page5.html http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=sql+join+tutorial -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using mail() for mailist list app
At 06:33 PM 1/1/03 -0500, Michael J. Pawlowsky wrote: Personally I simply get the e-mail addresses spit out to me from the database and then I input them into a application made just for bulk mailingt. You can also easily write a quick perl or shell script to send it out from a file of names and this way you can "nice" the process so as not to bog down the machine. PHP now offers a command line SAPI that lets you write these programs with PHP. Leave the names in the database, and use PHP's mail() to send the messages. It works very well. I've been using PHP at the command line for quite a while now. 4.3.0 is the first version that creates the CLI version of PHP by default. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: loading a db table into a php array from mysql
At 06:32 AM 1/1/03 -0500, David T-G wrote: I still don't get what a left or right or outer or inner join is... The reason I chose LEFT JOIN are: o You get better control over how the query is executed. o Values from the first table are returned even if there is no associated entry in the second table. For eaxample if no building or room was set on an entry in my previous query, the rest of the data will still be returned. Do you know of any (on the web) which will give me the background? http://www.devshed.com/Server_Side/MySQL/Join/page1.html http://www.devshed.com/Server_Side/MySQL/Normal http://www.devshed.com/Server_Side/MySQL/SQLJoins/page1.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating a .doc file in php
Edward Peloke wrote: Thanks Marco, So I would just create the .rtf file with php, then store it on the server and attach it to the e-mail? If most of your document is going to be the same each time, I would create the basic document in MS Word, saving it as an rtf file. Then manually edit it with a text editor (e.g. NotePad) and put in replaceable parameters marked with starting and ending tags (e.g. ##). Then your php code need only parse the file and replace dummy names (e.g. ##name##) with the actual data (e.g. Fred Bloggs). This is what I do for an application. It is a lot less work than trying to write rtf itself. Hope this helps Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] send page with https and php sessions problem
Kocnr Peter wrote: I have problem with sending pages directly(by Send->Page by E-mail...) from browser(ie6) with Outlook 2002. It tells:"The current document type can not be sent as mail.Would you like to send a Short cut instead?". The pages use php sessions and https with 128 bit encryption. I found that it is caused by the combination of https and php session. Is there a solution? I have seen you post this question before and I have not seen an answer. When nobody answers it usually means that nobody has had the problem you are encountering, or that they do not know a solution. You may get a better result by asking on a more appropriate mailing list. This appears to be an Outlook problem rather than PHP. Sorry I don't know anything which might help. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] prevent session_replay
hi I'm running PHP 4.2.3 as module with Apache 1.3.26 on OpenBSD 3.2 with the chroot turned off (as it stopped the php_mail() funtion working, but if anyone has the fix for that I will re-implement the jail again :o) I'm having some problems with sessions. I am not using cookies, as many people don't allow them to be set The main page starts a session, takes username and password, and if they are ok, it registers the users id from the db as a session variable using the $_SESSION['user_id'] = $user_id it then does a header redirect to another page, which at the moment for testing just displays the SID and all $_SESSION[vars] as the SID is being passed in the url, I am able to copy the http://url?SID from the browser window if I close the browser (which from reading the docs on sessions should end the session) and then re-open another browser (admittedly on the same machine/ip address) and post the http://url?SID back in, I get the page, and the $SESSION[vars] are still there !! it is reading them back out of the files in /tmp (if I edit these directly and paste the url?SID in, I get the new values I mannually put in !) :o( is there a official/approved method to prevent this from being done ? thankyou _scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] makeing an array
see example 2. > -Original Message- > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, 1 January 2003 11:00 PM > To: Sean Malloy; [EMAIL PROTECTED] > Subject: Re: [PHP] makeing an array > > > Your example of: > > for ($i = 0; $i < count($comment); $i++) > > Is very bad as the count will be parsed each loop. > > The count as I had it gets parsed only once. > > > Timothy Hitchens (HiTCHO) > [EMAIL PROTECTED] > > > HiTCHO | Open Platform Web Development > Consulting - Outsourcing - Training - Support > > > - Original Message - > From: "Sean Malloy" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 01, 2003 9:40 PM > Subject: RE: [PHP] makeing an array > > > > why the $x variable aswell?! > > > > for ($i = 0; $i < count($comment); $i++) > > { > > echo $comment[$i].''; > > } > > > > or even faster: > > > > $i = count($comment); > > while ($i--) > > { > > echo $comment[$i].''; > > } > > > > > -Original Message- > > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, 1 January 2003 4:41 PM > > > To: Philip J. Newman; [EMAIL PROTECTED] > > > Subject: Re: [PHP] makeing an array > > > > > > > > > Use the count like following inside to ensure that you don't > > > call on a non existent index. > > > > > > for ($i = 0, $x = count($comment); $i < $x; $i++) > > > { > > > echo $comment[$i].''; > > > } > > > > > > Why do you want to echo out $comment_1 ??? > > > > > > > > > > > > Timothy Hitchens (HiTCHO) > > > [EMAIL PROTECTED] > > > > > > > > > HiTCHO | Open Platform Web Development > > > Consulting - Outsourcing - Training - Support > > > > > > > > > - Original Message - > > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > > To: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]>; > > > <[EMAIL PROTECTED]> > > > Sent: Wednesday, January 01, 2003 3:29 PM > > > Subject: Re: [PHP] makeing an array > > > > > > > > > > So in saything that I could do this ... > > > > > > > > $s = 10 > > > > > > > > $comment[1] = '$comment_1'; > > > > $comment[2] = '$comment_2'; > > > > $comment[3] = '$comment_2'; > > > > > > > > for($i = 0; $i <= $s; $i++) { > > > > > > > > echo $comment[$i].""; > > > > > > > > } > > > > > > > > > > > > > > > > - Original Message - > > > > From: "Timothy Hitchens (HiTCHO)" <[EMAIL PROTECTED]> > > > > To: "Philip J. Newman" <[EMAIL PROTECTED]>; > > > <[EMAIL PROTECTED]> > > > > Sent: Wednesday, January 01, 2003 6:12 PM > > > > Subject: Re: [PHP] makeing an array > > > > > > > > > > > > > Example of an Array: > > > > > > > > > > $my_first_array = array(1 => 'first', 2 => 'second', 3 => > 'third'); > > > > > > > > > > You can now access these like so: > > > > > > > > > > echo $my_first_array[1]; etc etc > > > > > > > > > > of if you had this: $my_first_array = array('first_name' => > 'Philip', > > > > > 'last_name' => 'Newman'); > > > > > > > > > > You could do this: > > > > > > > > > > echo $my_first_array['first_name']; > > > > > > > > > > The thing to remember is that array's start at 0 "see below!!" (I > > > started > > > > at > > > > > 1 at the top to make it easier). > > > > > > > > > > You can also make an array like so: > > > > > > > > > > $first[] = 'Philip'; > > > > > $first[] = 'John'; > > > > > $first[] = 'Paul'; > > > > > > > > > > Now you can simply do: > > > > > > > > > > echo $first[0]; // this could output 'Philip'; > > > > > > > > > > You can then look at multi dimensional etc... > > > > > > > > > > I trust this get's you on your way. > > > > > > > > > > > > > > > Timothy Hitchens (HiTCHO) > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > HiTCHO | Open Platform Web Development > > > > > Consulting - Outsourcing - Training - Support > > > > > > > > > > > > > > > - Original Message - > > > > > From: "Philip J. Newman" <[EMAIL PROTECTED]> > > > > > To: <[EMAIL PROTECTED]> > > > > > Sent: Wednesday, January 01, 2003 2:57 PM > > > > > Subject: [PHP] makeing an array > > > > > > > > > > > > > > > > Can someone help me make an array ... > > > > > > > > > > > > I have $foo amount of loops to preform (1-20), and would > > > like to make > > > > the > > > > > > veriable work for me like $comment_1, $comment_2 etc etc. > > > > > > > > > > > > http://nz.php.net/manual/en/function.array.php makes no sence to > me > > > > after > > > > > i > > > > > > read it and read it ... > > > > > > > > > > > > help me please > > > > > > > > > > > > --- > > > > > > Philip J. Newman. > > > > > > Head Developer. > > > > > > PhilipNZ.com New Zealand Ltd. > > > > > > http://www.philipnz.com/ > > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > Mob: +64 (25) 6144012. > > > > > > Tele: +64 (9) 5769491. > > > > > > > > > > > > VitalKiwi Site: > > > > > > Philip J. Newman > > > > > > Internet Developer > > > > > > http://www.newman.net.nz/ > > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > * > > > > > > Friends are like Stars, > > > > > >
[PHP] mail attachments
I hope you all had a great New Year. Is attaching a document to an e-mail simply a matter of adding a new header in the mail function? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail attachments
Nope--it's a bit more complicated than that. However, there are a number of classes out there that can help you out with that. Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com! --- Begin Message --- I hope you all had a great New Year. Is attaching a document to an e-mail simply a matter of adding a new header in the mail function? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail attachments
Thanks Marco, I grabbed a few samples online yesterday, they had much more than just the mail attachements so I was just trying to sift through what I needed. Thanks, Eddie -Original Message- From: Marco Tabini [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 8:29 AM To: Edward Peloke Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mail attachments Nope--it's a bit more complicated than that. However, there are a number of classes out there that can help you out with that. Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prevent session_replay
It's called Session Hijacking. And that is the normal behaviour. Since you are supplying the session id it still thinks you are on the same session until it has expired. (expiry time set in php.ini) Mike *** REPLY SEPARATOR *** On 02/01/2003 at 12:48 PM scott wrote: >hi > >I'm running PHP 4.2.3 as module with Apache 1.3.26 on OpenBSD 3.2 with the >chroot turned off (as it stopped the php_mail() funtion working, but if >anyone has the fix for that I will re-implement the jail again :o) > >I'm having some problems with sessions. I am not using cookies, as many >people don't allow them to be set > >The main page starts a session, takes username and password, and if they >are >ok, it registers the users id from the db as a session variable using the >$_SESSION['user_id'] = $user_id > >it then does a header redirect to another page, which at the moment for >testing just displays the SID and all $_SESSION[vars] > >as the SID is being passed in the url, I am able to copy the http://url?SID >from the browser window > >if I close the browser (which from reading the docs on sessions should end >the session) and then re-open another browser (admittedly on the same >machine/ip address) and post the http://url?SID back in, I get the page, >and >the $SESSION[vars] are still there !! > >it is reading them back out of the files in /tmp (if I edit these directly >and paste the url?SID in, I get the new values I mannually put in !) > > :o( is there a official/approved method to prevent this from being done ? > >thankyou > >_scott > > > >-- >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
Re: [PHP] mail attachments
Yes and no You need to add a "Content-type: multipart/mixed; boundary="Some_unique_string_here)" But then you also need to encode the documants and send them in the "message" of Mail. Look for multipart MIME types on the net to get an idea. Also if you find a nice class to encode bin files let us know about it. Maybe take a look at SquirrelMail or something. They must have that class. Mike *** REPLY SEPARATOR *** On 02/01/2003 at 9:07 AM [EMAIL PROTECTED] wrote: >I hope you all had a great New Year. Is attaching a document to an e-mail >simply a matter of adding a new header in the mail function? > >Thanks, >Eddie > > >-- >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
[PHP] Re: mail attachments
Hello, On 01/02/2003 12:07 PM, Edward Peloke wrote: I hope you all had a great New Year. Is attaching a document to an e-mail simply a matter of adding a new header in the mail function? No, but if you try this class it becomes much easier than it is doing it manually: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail attachments
I use this mail class here: http://www.phpguru.org/downloads/html.mime.mail/ Very, very good PHP class, I highly recommend it. (And no I didn't write it.) =) On Thu, 2003-01-02 at 09:14, Edward Peloke wrote: Thanks Marco, I grabbed a few samples online yesterday, they had much more than just the mail attachements so I was just trying to sift through what I needed. Thanks, Eddie -Original Message- From: Marco Tabini [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 8:29 AM To: Edward Peloke Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mail attachments Nope--it's a bit more complicated than that. However, there are a number of classes out there that can help you out with that. Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP] Text repeating problem
> -Original Message- > From: Simon Hay [mailto:[EMAIL PROTECTED]] > Sent: 30 December 2002 12:49 > > I have several PHP web applications which have large text boxes (Wiki > sites etc.). Usually, they work fine, but sometimes, if a large-ish > amount of text is entered, the server seems to receive a mangled mess > which includes the full text but with a second copy of part of it > inserted somewhere at the end. You can edit the page again, > remove the > extra content and save, but it'll just get added back... I originally > suspected this must be a problem with the PHP scripts themselves, but > now find that it happens with several different independent things so > can't be that simple. Furthermore, it worked happily on my previous > setup with Apache 1.3 and a slightly older PHP. AFAIR, there have been a few bug reports of similar behaviour, and in each case it's been put down to Apache 2. I'd suggest trying Apache 1 with latest PHP 4.3.0, and see if that solves your problem -- if so, it looks like it's another PHP4/Apache2 instability. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] makeing an array
> -Original Message- > From: Sean Malloy [mailto:[EMAIL PROTECTED]] > Sent: 02 January 2003 13:35 > To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED] > Subject: RE: [PHP] makeing an array > > > see example 2. But that produces the elements in reverse order -- no use if you want them in their proper order! In whioch case, Hitcho's solution is the right and proper one (and I like the elegance of the two parallel assignments in the loop initializer clause!). > > > > -Original Message- > > > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, 1 January 2003 4:41 PM > > > > To: Philip J. Newman; [EMAIL PROTECTED] > > > > Subject: Re: [PHP] makeing an array > > > > > > > > > > > > Use the count like following inside to ensure that you don't > > > > call on a non existent index. > > > > > > > > for ($i = 0, $x = count($comment); $i < $x; $i++) > > > > { > > > > echo $comment[$i].''; > > > > } Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using mail() for mailist list app
Hello, On 01/01/2003 08:46 PM, Monty wrote: Is the PHP mail() command robust enough to use in a little mailing list app? Sure, it just calls sendmail, so it is just as robust as sendmail as long as you configure it properly. The app will basically send an HTML or Text e-mail to the member database of about 6,000 people. I'm using RedHat Linux 7.2 with PHP 4.2.2, by the way. I'm concerned I'll bog down my server if I issue the mail() command 6,000 times on our server, but, maybe it won't be a problem? Since you used RedHat Linux, the default mailer is sendmail so you need to configure the deliveries to just queue a single message without attempting to deliver them right away. You need to put all recipients in Bcc: to just need to queue a single message. It is very fast, think about just a few seconds. You probably take more than that extracting the addresses from the database. Also, although I'm sending HTML e-mail, I'm not including attachments or inline graphics (only direct hotlinks to graphics on a web server). Will mail() still work okay for this, or do I need to use one of the various PHP e-mail classes available to send HTML e-mail? Yes, but HTML messages need to have an alternative text part or else spam filters may reject it. So it is always recommended that you build your system on existing components that have been throughly tested to compose messages adequately. In that case you may want to try this class that lets you compose and send messages not only with alternative text and HTML parts but also embedded images for the HTML part if you want and attachments. Since you need to use sendmail, there is also a sub-class to make deliveries using sendmail program directly so you can set delivery mode SENDMAIL_DELIVERY_DEFERRED to eliminate the queue time. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prevent session_replay
This is how it works, but you can tie session to a specific IP (still not 100% safe) scott wrote: hi I'm running PHP 4.2.3 as module with Apache 1.3.26 on OpenBSD 3.2 with the chroot turned off (as it stopped the php_mail() funtion working, but if anyone has the fix for that I will re-implement the jail again :o) I'm having some problems with sessions. I am not using cookies, as many people don't allow them to be set The main page starts a session, takes username and password, and if they are ok, it registers the users id from the db as a session variable using the $_SESSION['user_id'] = $user_id it then does a header redirect to another page, which at the moment for testing just displays the SID and all $_SESSION[vars] as the SID is being passed in the url, I am able to copy the http://url?SID from the browser window if I close the browser (which from reading the docs on sessions should end the session) and then re-open another browser (admittedly on the same machine/ip address) and post the http://url?SID back in, I get the page, and the $SESSION[vars] are still there !! it is reading them back out of the files in /tmp (if I edit these directly and paste the url?SID in, I get the new values I mannually put in !) :o( is there a official/approved method to prevent this from being done ? thankyou _scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] makeing an array
On Wednesday 01 January 2003 01:41 pm, Timothy Hitchens (HiTCHO) wrote: > Use the count like following inside to ensure that you don't > call on a non existent index. > > for ($i = 0, $x = count($comment); $i < $x; $i++) > { > echo $comment[$i].''; > } > > Why do you want to echo out $comment_1 ??? i think he wanted to print the value of $comment_1. he had variables as $comment_# where # is in (1...n, n==20 in his example). the $comment_#s are probably fields in an HTML form and as has been discussed many times on this list, using array variables directly is better. Philip, in your HTML, instead of saying name=comment_1, you would instead say name=comment[1]. that way, you can access the variables in your PHP script as $comment[1] (depending on register_globals and other settings). alternatively, if you don't want to change to array syntax, you can use variable variables. e.g., $variable_name="comment_".nIndex; // now comment_1, for example. // assume that $comment_1 is "xxx111" echo $$variable_name ; // prints xxx111 what you did was, form the variable name as a string, then take the string and, using the variable variable syntax, ask PHP what the value was of the string which was contained in the variable "variable_name". this is a neat feature and helpful in many situations, but for readability i'd go with naming the fields as array entries "comment[1]". 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail attachments
While on the subject of Multi-part Mime Type... I use to use it alot in the past in C cgi's (only Netscape supported at the time) to give status reports when doing long processes etc. This was back in the days when Netscaped ruled It was nice, since you could have a status message updated on the center of the page. Looked elegant as opposed to having messages continually listed. Anyways I tried the other day for a bit and still could not get it to work in IE. I guess they decided never to implement Mutli-part MIME into their browser. Or is there some other MIME type it's looking for to accomplish the same thing? If you have Netscape run this in and take a look to see what I mean. \n"; print "\n"; print "$i\n"; print "\n\n\n\n"; flush(); sleep(1); } print "--$TMP--\n"; ?>
[PHP] killing child process
Hello, Running PHP 4.0.6 on RedHat 7.2. I'm writing a command line script (called scirpt.php) and am using the backtick operator to start other processes from my script. $com_response = `./other_script.php` ; or #com_response = `wget `; I can kill scirpt.php easily but that wont kill other_script.php, there would be no problem killing one process manually, but i could have many scirpts starting from the main script. Killing them all would be a task. I could prefix their name them with 'ch_' and kill all these. But thats not the solution i'm looking for. Is there a way to make a process a child, so that when the parent termintaes/is terminated the child terminates also ? thx gamin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prevent session_replay
The problem with that is, if you have a proxy farm you never know which IP might be used. For instance, if the user is on AOL, every request to the server will probably have a different IP. Mike *** REPLY SEPARATOR *** On 02/01/2003 at 3:25 PM Marek Kilimajer wrote: >This is how it works, but you can tie session to a specific IP (still >not 100% safe) > >scott wrote: > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] killing child process
Actually to kill all of them would not be hard Try something like ps -eaf | grep httpd | awk '{print $2}' That will give you all the httpd processes...pipe that into kill Mike *** REPLY SEPARATOR *** On 02/01/2003 at 8:26 PM gamin wrote: >Hello, > > Running PHP 4.0.6 on RedHat 7.2. > > I'm writing a command line script (called scirpt.php) and am using the >backtick operator to start other processes from my script. > >$com_response = `./other_script.php` ; or #com_response = `wget `; > >I can kill scirpt.php easily but that wont kill other_script.php, there >would be no problem killing one process manually, but i could have many >scirpts starting from the main script. Killing them all would be a task. I >could prefix their name them with 'ch_' and kill all these. But thats not >the solution i'm looking for. > >Is there a way to make a process a child, so that when the parent >termintaes/is terminated the child terminates also ? >thx > >gamin. > > > > > > >-- >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
RE: [PHP] makeing an array
> -Original Message- > From: Gerald Timothy Quimpo [mailto:[EMAIL PROTECTED]] > Sent: 02 January 2003 14:12 > > alternatively, if you don't want to change to array syntax, > you can use > variable variables. e.g., > > $variable_name="comment_".nIndex; // now comment_1, for example. >// assume that $comment_1 is "xxx111" > echo $$variable_name ; // prints xxx111 echo ${'comment'.$nIndex} works just as well. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Index page
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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Index page
in your http.conf file Add index.php in the list of default docs. Or if IIS in the IIS manager properties for that site. *** REPLY SEPARATOR *** On 02/01/2003 at 11:26 PM 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? > > > >-- >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
Re: [PHP] receiving XML stream as server via PHP
Hi, I thought there was only one XML standard (1.0)? I guess my question should have been, when someone commits an HTTP POST sending me raw xml data to my PHP script, I imagine PHP would store it in some global variable. What variable is that? Thanks, Kris Jimmy Brake wrote: depends on which xml standard you are using the xml-rpc is what I have been using to ACCEPT xml -- but it does have a server to accept xml http://pear.php.net/package-search.php?pkg_name=xml&bool=AND&submit=Search On Tue, 2002-12-31 at 13:20, Kristopher Yates wrote: Hi, Using PHP with cURL, I am currently able to dynamically create XML documents and HTTP POST to a remote server, receive an XML response, and parse XML as needed. What I am having trouble finding information on is doing the reverse. Basically, I am trying to create a PHP script that acts as a server, so that a remote computer can HTTP POST XML to said script and then I parse and respond in XML. Again, I already have the reverse working using CURL - so basically I have created a client and now I need to create the server. The only part I need help understanding is how do I get the XML into an array/variable when my script is hit with someone using HTTP POST to pass XML to it. I have an idea below (vague).. I had the server guy HTTP POST some XML to a script which just had I see in the HTTP Request Headers of the phpinfo() output that it received content type text/xml but nowhere do I see what was actually received (the actual xml that was sent). I thought maybe PHP would take the stuff after the header and push it into an array/variable but no such luck (argv?). I am wondering if anyone has any helpful information. I imagine something like the following psuedo code: if($HTTP_CONTENT_TYPE=="text/xml"){ //use some php function(s) to pass incoming xml stream to an array that I can then pass to my //xml parser } I hope this gives you enough information to figure out my dilema. If someone can shed a little light on this subject it would be GREATLY appreciated. Thanks, Kris [EMAIL PROTECTED] . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] receiving XML stream as server via PHP
AH! That is my ticket! Thanks. Yes, my client was posting to my "wanna be server script" with mime type text/xml. I should be able to easilly take $HTTP_RAW_POST_DATA and pass it straight on to my XML parser. I imagine, when someone posts xml, $HTTP_RAW_POST_DATA will appear as an array. Just what I need. Thanks, Kris Timothy Hitchens (HiTCHO) wrote: You can post to your server with a mimetype of "text/xml" and in your script pickup the raw post as: $HTTP_RAW_POST_DATA Then just process this string as XML and return to buffer or not. Have fun. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP Hi, Using PHP with cURL, I am currently able to dynamically create XML documents and HTTP POST to a remote server, receive an XML response, and parse XML as needed. What I am having trouble finding information on is doing the reverse. Basically, I am trying to create a PHP script that acts as a server, so that a remote computer can HTTP POST XML to said script and then I parse and respond in XML. Again, I already have the reverse working using CURL - so basically I have created a client and now I need to create the server. The only part I need help understanding is how do I get the XML into an array/variable when my script is hit with someone using HTTP POST to pass XML to it. I have an idea below (vague).. I had the server guy HTTP POST some XML to a script which just had I see in the HTTP Request Headers of the phpinfo() output that it received content type text/xml but nowhere do I see what was actually received (the actual xml that was sent). I thought maybe PHP would take the stuff after the header and push it into an array/variable but no such luck (argv?). I am wondering if anyone has any helpful information. I imagine something like the following psuedo code: if($HTTP_CONTENT_TYPE=="text/xml"){ //use some php function(s) to pass incoming xml stream to an array that I can then pass to my //xml parser } I hope this gives you enough information to figure out my dilema. If someone can shed a little light on this subject it would be GREATLY appreciated. Thanks, Kris [EMAIL PROTECTED] -- 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
Re: [PHP] killing child process
Michael J. Pawlowsky wrote: Actually to kill all of them would not be hard Try something like ps -eaf | grep httpd | awk '{print $2}' actualy it will be named only other_script.php (it doesn't go through httpd). You can execute the scripts with a dummy parameter that will be a random string and grep for that in the above command. That will give you all the httpd processes...pipe that into kill Mike *** REPLY SEPARATOR *** On 02/01/2003 at 8:26 PM gamin wrote: Hello, Running PHP 4.0.6 on RedHat 7.2. I'm writing a command line script (called scirpt.php) and am using the backtick operator to start other processes from my script. $com_response = `./other_script.php` ; or #com_response = `wget `; I can kill scirpt.php easily but that wont kill other_script.php, there would be no problem killing one process manually, but i could have many scirpts starting from the main script. Killing them all would be a task. I could prefix their name them with 'ch_' and kill all these. But thats not the solution i'm looking for. Is there a way to make a process a child, so that when the parent termintaes/is terminated the child terminates also ? thx gamin. -- 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
Re: [PHP] prevent session_replay
Scott, I think it is safe to say that there is no "official" way to prevent session hijacking like this, nor is there any way to provide absolute assurance that it cannot be done. There are several methods, however, that can make a hijack much more difficult to accomplish without adversely affecting your legitimate users. To get you going (since you are the best person to decide what extra measures to take), consider that you could store the user agent in a session variable. If you check that variable on each page (many people include a common module such as security.inc or session.inc at the top of each script or use a parent script), it will at least prevent your test of using a different browser. Of course, an attacker can still hijack the session by passing the same user agent (either by using the same browser or manually sending the HTTP erquest), but the difficulty is a bit more. Your method of testing is actually a good one. The IP address is a terrible metric for identification, so using the same IP will prevent you from trying to use that to distinguish good guy from bad guy. Just use your creativity, and you will probably be fine. The goal is to make things hard for the bad guys and easy for the good guys. Good luck. Chris --- "scott" <[EMAIL PROTECTED]> wrote: > as the SID is being passed in the url, I am able to > copy the http://url?SID from the browser window if I > close the browser (which from reading the docs on > sessions should end the session) and then re-open > another browser (admittedly on the same machine/ip > address) and post the http://url?SID back in, I get > the page, and the $SESSION[vars] are still there !! > :o( is there a official/approved method to prevent > this from being done ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] receiving XML stream as server via PHP
Hi Chris, Long time no talk to! Hope you had a good new year. Thanks for the info. My development is basically similar to SOAP and XML-RPC like that used for RSS. I'll probably get more into it [SOAP] when they [PEAR gurus] get past the beta testing stage. I am happy with what I have to work with as is for now (PHP with cURL for client side scripts and reuse all that code to create server side scripts) but definitely interested in the alternatives. Can you email me the URL to NuSOAP and the PEAR SOAP pages? Also, do you (or anyone) have any comparative information on these two methods/classes? Thanks again Chris. Good to hear from ya. Kris Boget, Chris wrote: > Using PHP with cURL, I am currently able to dynamically > create XML documents and HTTP POST to a remote server, > receive an XML response, and parse XML as needed. > What I am having trouble finding information on is doing > the reverse. Basically, I am trying to create a PHP script > that acts as a server, so You might want to look into SOAP. It sounds like it will fit your needs very well. PEAR has a SOAP implementation that's still in testing and there is a class out there called NuSOAP that's supposedly very good. I just started toying around with it recently and it seems to work very well. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] killing child process
I was just giving you an example of how to get the listing of all processes. I didn't actually think you were going to kill all your httpd processes. I was taking it for granted you would change httpd to the name of your process. Mike *** REPLY SEPARATOR *** On 02/01/2003 at 4:51 PM Marek Kilimajer wrote: >Michael J. Pawlowsky wrote: > >>Actually to kill all of them would not be hard >> >>Try something like >> >>ps -eaf | grep httpd | awk '{print $2}' >> >> >actualy it will be named only other_script.php (it doesn't go through >httpd). >You can execute the scripts with a dummy parameter that will be a random >string and grep for >that in the above command. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpinfo() and HTTP_RAW_POST_DATA
Hi, 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. Not an important issue, but curious what ye creators of PHP language opinion/thoughts on this is. Regards Kris Timothy Hitchens (HiTCHO) wrote: You can post to your server with a mimetype of "text/xml" and in your script pickup the raw post as: $HTTP_RAW_POST_DATA Then just process this string as XML and return to buffer or not. Have fun. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] HiTCHO | Open Platform Web Development Consutling - Outsourcing - Training - Support - Original Message - From: "Kristopher Yates" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 7:20 AM Subject: [PHP] receiving XML stream as server via PHP Hi, Using PHP with cURL, I am currently able to dynamically create XML documents and HTTP POST to a remote server, receive an XML response, and parse XML as needed. What I am having trouble finding information on is doing the reverse. Basically, I am trying to create a PHP script that acts as a server, so that a remote computer can HTTP POST XML to said script and then I parse and respond in XML. Again, I already have the reverse working using CURL - so basically I have created a client and now I need to create the server. The only part I need help understanding is how do I get the XML into an array/variable when my script is hit with someone using HTTP POST to pass XML to it. I have an idea below (vague).. I had the server guy HTTP POST some XML to a script which just had I see in the HTTP Request Headers of the phpinfo() output that it received content type text/xml but nowhere do I see what was actually received (the actual xml that was sent). I thought maybe PHP would take the stuff after the header and push it into an array/variable but no such luck (argv?). I am wondering if anyone has any helpful information. I imagine something like the following psuedo code: if($HTTP_CONTENT_TYPE=="text/xml"){ //use some php function(s) to pass incoming xml stream to an array that I can then pass to my //xml parser } I hope this gives you enough information to figure out my dilema. If someone can shed a little light on this subject it would be GREATLY appreciated. Thanks, Kris [EMAIL PROTECTED] -- 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
Re: [PHP] phpinfo() and HTTP_RAW_POST_DATA
That data is only populated when always_populate_raw_post_data is on (check your php.ini). Chris --- Kristopher Yates <[EMAIL PROTECTED]> 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multidimensional Array manipluation...
Hello ppl, I was trying to do something with an array...I guess you could see what I mean from the code below: $test[0] = "hey"; $test[1] = "hi"; $test[2] = "hello"; Now I want to hold various values in $test[0]["hey"] = "1" and $test[1]["hi"] = "2" and $test[2]["hello"] = "3" and then I want to use the function let's say in_array("hey", $test) and if it's found in the array I want to update the value in that array from 1 to 1+1 or anything... All of the above would be done dynamically from database, the above is just to get the Logic..I hope it's possible...I am keeping my fingers crossed... Thank You Best Regards, Dhaval _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: accelerator and Apache 2
Jochen Kaechelin wrote: Is there a free php accelerator out there which runs under Apache 2? I don't know whether PHP Accelator depends on the version of Apache (I mostly doubt it), but it's free and seems to be well maintained. Try it: http://php-accelerator.co.uk/ gerzson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] func_get_args() and call-by-reference?
Hi again, Now I did a different approach using an array as parameter and giving an array back. Strangely though it doesnt really work. Following "hack" solution works as expected: $num = pg_numrows($result); for ($i = 0; $i < $num; $i++) { $ret_arr[$i] = pg_fetch_array($result); $ret_arr[$i]["name"] = utf8_decode($ret_arr[$i]["name"]); $ret_arr[$i]["title"] = utf8_decode($ret_arr[$i]["title"]); $ret_arr[$i]["message"] = utf8_decode($ret_arr[$i]["message"]); } return $ret_arr; Following solution does not: $num = pg_numrows($result); for ($i = 0; $i < $num; $i++) { $ret_arr[$i] = pg_fetch_array($result); $ret_arr[$i] = unicode_dec($ret_arr[$i]); } return $ret_arr; function unicode_dec($arr) { foreach($arr as $key => $val) { $arr[$key] = utf8_decode($val); } return $arr; } Why does the 2nd solution not do what it is supposed to? The 2nd solution works in that it outputs correctly what is in the database but it does not do unicode decoding on the output, wheras the first solution does! I really do not know why this does not work properly! I am using php 4.2.1 TIA, Ata - Original Message - From: "Atahualpa Jones" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 02, 2003 1:27 AM Subject: [PHP] func_get_args() and call-by-reference? Hi, I try to do a function called unicode_enc() which takes a number of parameters that differ between calls. It should encode all parameters to unicode using utf8_encode($arglist[$i]). I am using Variable-length argument lists as described in the manual and tried to call the function this way: unicode_enc(&$text); but to no success. Is call-by-reference possible when using func_get_args? TIA, Ata -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt
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
Re: [PHP] Multidimensional Array manipluation...
--- Dhaval Desai <[EMAIL PROTECTED]> wrote: > $test[0] = "hey"; > $test[1] = "hi"; > $test[2] = "hello"; > > Now I want to hold various values in $test[0]["hey"] = > "1" and $test[1]["hi"] = "2" and $test[2]["hello"] = "3" Try this instead: $test["0"]["hey"] = 1; $test["1"]["hi"] = 2; $test["2"]["hello"] = 3; Also, remember that you can often learn these types of things with trial and error by using the print_r() function: print_r($test); Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multidimensional Array manipluation...
Hi, Thanx for the reply, well but what about the second part or my mail.. I want to use in_array("value", $array); and if found, I want to update the value of that variable... $test["0"]["hey"] = 1; $test["1"]["hi"] = 2; $test["2"]["hello"] = 3; I want to update $test["0"]["hey"] and set it as 1+1; I think it's possible using splice()m I don't know exactly how to use it with Multi Dimensional arrays Also is there any idea on how can we count() the values in a multi dimensional arrays... Thanx From: Chris Shiflett <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Dhaval Desai <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: Re: [PHP] Multidimensional Array manipluation... Date: Thu, 2 Jan 2003 09:04:27 -0800 (PST) --- Dhaval Desai <[EMAIL PROTECTED]> wrote: > $test[0] = "hey"; > $test[1] = "hi"; > $test[2] = "hello"; > > Now I want to hold various values in $test[0]["hey"] = > "1" and $test[1]["hi"] = "2" and $test[2]["hello"] = "3" Try this instead: $test["0"]["hey"] = 1; $test["1"]["hi"] = 2; $test["2"]["hello"] = 3; Also, remember that you can often learn these types of things with trial and error by using the print_r() function: print_r($test); Chris _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multidimensional Array manipluation...
> >$test["0"]["hey"] = 1; > >$test["1"]["hi"] = 2; > >$test["2"]["hello"] = 3; > > I want to update $test["0"]["hey"] and set it as 1+1; If you just want to increment the value: $test["0"]["hey"]++; > Also is there any idea on how can we count() the values > in a multi dimensional arrays... The function array_count_values() might give you what you want. What are you wanting to count exactly? A good reference for you online is: http://www.php.net/manual/en/ref.array.php Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multidimensional Array manipluation...
Hi, Well, I will be having something like this: $se5f2254321s65s32s65[] will hold various valus like jan_1,jan-2,jan_3,jan_4 etc and then jan_1 will hold 1, jan_2=2,, jan_3=1 etc etc... Depending on certain conditions, I want to increment the values of certain values in the array...like... for($i=0; $i<=count($se5f2254321s65s32s65); $i++) { $se5f2254321s65s32s65[$i]["jan_1"] = 1 } I want to increment it with 1 and so on for the various other values Thanx Best Regards, Dhaval From: Chris Shiflett <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: Dhaval Desai <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: [PHP] Multidimensional Array manipluation... Date: Thu, 2 Jan 2003 09:30:43 -0800 (PST) > >$test["0"]["hey"] = 1; > >$test["1"]["hi"] = 2; > >$test["2"]["hello"] = 3; > > I want to update $test["0"]["hey"] and set it as 1+1; If you just want to increment the value: $test["0"]["hey"]++; > Also is there any idea on how can we count() the values > in a multi dimensional arrays... The function array_count_values() might give you what you want. What are you wanting to count exactly? A good reference for you online is: http://www.php.net/manual/en/ref.array.php Chris _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 Jan 2003 17:55:50 -0000 Issue 1799
php-general Digest 2 Jan 2003 17:55:50 - Issue 1799 Topics (messages 129918 through 129966): help with script!! 129918 by: Karl James 129919 by: Michael J. Pawlowsky 129920 by: Justin French help with script 129921 by: Karl James 129922 by: Michael J. Pawlowsky Re: How To Delete Multiple Items Of Multiple Tables Using PHP and MySQL 129923 by: . Nilaab Re: loading a db table into a php array from mysql 129924 by: Rick Widmer 129926 by: Rick Widmer Re: Using mail() for mailist list app 129925 by: Rick Widmer 129940 by: Manuel Lemos Re: creating a .doc file in php 129927 by: Chris Hewitt Re: send page with https and php sessions problem 129928 by: Chris Hewitt prevent session_replay 129929 by: scott 129934 by: Michael J. Pawlowsky 129941 by: Marek Kilimajer 129945 by: Michael J. Pawlowsky 129953 by: Chris Shiflett Re: makeing an array 129930 by: Sean Malloy 129939 by: Ford, Mike [LSS] 129942 by: Gerald Timothy Quimpo 129947 by: Ford, Mike [LSS] mail attachments 129931 by: Edward Peloke 129932 by: Marco Tabini 129933 by: Edward Peloke 129935 by: Michael J. Pawlowsky 129936 by: Manuel Lemos 129937 by: Adam Voigt 129943 by: Michael J. Pawlowsky Re: Text repeating problem 129938 by: Ford, Mike [LSS] killing child process 129944 by: gamin 129946 by: Michael J. Pawlowsky 129952 by: Marek Kilimajer 129955 by: Michael J. Pawlowsky Index page 129948 by: thkiat 129949 by: Michael J. Pawlowsky Re: receiving XML stream as server via PHP 129950 by: Kristopher Yates 129951 by: Kristopher Yates 129954 by: Kristopher Yates phpinfo() and HTTP_RAW_POST_DATA 129956 by: Kristopher Yates 129957 by: Chris Shiflett Multidimensional Array manipluation... 129958 by: Dhaval Desai 129963 by: Chris Shiflett 129964 by: Dhaval Desai 129965 by: Chris Shiflett 129966 by: Dhaval Desai Re: accelerator and Apache 2 129959 by: Gyozo Papp 129960 by: Gyozo Papp Re: func_get_args() and call-by-reference? 129961 by: Atahualpa Jones Re: mcrypt 129962 by: J Smith Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- HYPERLINK "http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m akethewebsecure.com/~admin12/do_adduser.phps can someone take a look at this and see why this wont work. karl --- 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 --- End Message --- --- Begin Message --- Without the error message you are making it kind of tough. What's the response that you get. Also you should use long HYPERLINK >"http://host.makethewebsecure.com/~admin12/do_adduser.phps"http://host.m >akethewebsecure.com/~admin12/do_adduser.phps > > >can someone take a look at this >and see why this wont work. > >karl > >--- >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 --- End Message --- --- Begin Message --- on 02/01/03 7:54 AM, Karl James ([EMAIL PROTECTED]) wrote: > can someone take a look at this > and see why this wont work. why don't you start by telling us what's wrong, or HOW it "doesn't work"? Justin --- End Message --- --- Begin Message --- Sorry guys!!! Well im trying to add the form to my database table. Which is this link!! HYPERLINK "http://host.makethewebsecure.com/~admin12/show_adduser.html"http://host .makethewebsecure.com/~admin12/show_adduser.html then when I hit add user!!! I get this error message Added to auth_users: Access denied for user: 'kjames@localhost' to database ' ultimatefootballleague_com' Which is this site HYPERLINK "http://host.makethewebsecure.com/~admin12/do_adduser.php"http://host.ma kethewebsecure.com/~admin12/do_adduser.php --- 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 --- End Message --- --- Begin Message --- There's your answer... You do not have permission to insert into the database with that user. Contact your DBA! :-) and if that's you read the MySQL manual. Especially about the mysql.user table *** REPLY SEPARATOR *** On 01/01/2003 at 1:19 PM Karl James wrote: > >Access denied for user: 'kja
[PHP] signal handler to ignore kill of parent
Hi, i need some way for child-processes to ignore the kill of their parent. Any idea? Thanks, Thomas 'Neo' Weber --- [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 3 colums....
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 () 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 --- \n\n"; print "\n\n"; print "\n"; for ($i = 1; $i < $rows+1; $i++) { print "\n"; print "Data\n"; print "$i\n"; print "\n"; if ($i % ceil($rows / 3) == 0 ){ print "\n"; if ($i != $rows ){ print "\n"; } } } print "\n\n"; print "\n"; print "\n\n\n\n"; print ""; print ""; print "$j"; print ""; print ""; } ?> --- End --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] signal handler to ignore kill of parent
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 >--- >[EMAIL PROTECTED] >[EMAIL PROTECTED] > > >-- >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
Re: [PHP] receiving XML stream as server via PHP
> 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Index page
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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
[PHP] How to parse still images from video clips
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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in $_SERVER["PHP_SELF"]
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in $_SERVER["PHP_SELF"]
thx a lot "Johannes Schlueter" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in $_SERVER["PHP_SELF"]
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] signal handler to ignore kill of parent
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 >--- >[EMAIL PROTECTED] >[EMAIL PROTECTED] > > >-- >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
[PHP] Some questions regarding pfsocketopen()
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpinfo() and HTTP_RAW_POST_DATA
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 <[EMAIL PROTECTED]> 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. . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some questions regarding pfsocketopen()
--- Gareth Hastings <[EMAIL PROTECTED]> 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
[PHP] Timeout during SMTP operation.
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://someone:[EMAIL PROTECTED]/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, "[EMAIL PROTECTED]", $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, "[EMAIL PROTECTED]", $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; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpinfo() and HTTP_RAW_POST_DATA
--- Kristopher Yates <[EMAIL PROTECTED]> 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
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 -- testconenction.php 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:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 2:47 PM > To: Gareth Hastings; 'PHP-List' > Subject: Re: [PHP] Some questions regarding pfsocketopen() > > --- Gareth Hastings <[EMAIL PROTECTED]> 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
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. \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 \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); >?> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accelerator and Apache 2
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 <[EMAIL PROTECTED]> wrote:Is there a free php accelerator out there which runs under Apache 2? -- Jochen Kaechelin [EMAIL PROTECTED]
[PHP] Announcing open CVS for phpDocumentor project
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:[EMAIL PROTECTED]:/opt/cvsroot login don't enter a password, then cvs -z 3 -d :pserver:[EMAIL PROTECTED]:/opt/cvsroot co phpdoc Take care, Greg Beaver -- phpDocumentor 1.2.0beta due out this week! http://www.phpdoc.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
> 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/closedI 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
[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?
[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 [EMAIL PROTECTED] "0, as a number, is just as important as any other number." "; $tmp = mktime(0,0,0,10,00,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,1,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,01,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,2,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,02,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,3,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,03,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,4,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,04,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,5,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,05,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,6,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,06,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,7,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,07,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,8,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,08,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,9,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,09,1998); echo "$tmp"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
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/closedI 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timeout during SMTP operation.
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP complied code
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP complied code
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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 --- Next"; ?> file s2.php - *** 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"); >?> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
I just tried something similar, \n"; if ($p == "1") { $mysocket = pfsockopen("172.24.200.2", "1372"); echo fgets($mysocket, 255); echo "Send Data\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 "\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:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 4:32 PM > To: Gareth Hastings > Cc: [EMAIL PROTECTED] > 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 --- > >session_start(); > $sid = session_id(); > >$mysocket = pfsockopen("localhost", "80"); > >session_register("mysocket"); > >echo "Next"; > > > ?> > > > file s2.php - > > > session_start(); > > echo (isset($_SESSION['mysocket']) ? "Socket found and open" : > "Socket not found"); > > > > ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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
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:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 5:08 PM > To: [EMAIL PROTECTED] > 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
[PHP] PHP memory usage
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 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can it be doen with Array????
Bah, I meant $a[] = "0"; $a[] = "1"; $b = $a; echo $b[0]; > -Original Message- > From: Gareth Hastings [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 5:05 PM > To: 'Scott Fletcher'; [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > 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:[EMAIL PROTECTED]] > > Sent: Thursday, January 02, 2003 5:08 PM > > To: [EMAIL PROTECTED] > > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can it be doen with Array????
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" <[EMAIL PROTECTED]> wrote in message 000201c2b2ab$3bb8be30$[EMAIL PROTECTED]">news:000201c2b2ab$3bb8be30$[EMAIL PROTECTED]... > Bah, I meant > > $a[] = "0"; > $a[] = "1"; > $b = $a; > > echo $b[0]; > > > -Original Message- > > From: Gareth Hastings [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 02, 2003 5:05 PM > > To: 'Scott Fletcher'; [EMAIL PROTECTED] > > Cc: [EMAIL PROTECTED] > > 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:[EMAIL PROTECTED]] > > > Sent: Thursday, January 02, 2003 5:08 PM > > > To: [EMAIL PROTECTED] > > > 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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
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:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 5:10 PM > To: Gareth Hastings; [EMAIL PROTECTED] > 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. > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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! "; for ($r=0; $r<5; $r++){ for ($c=0; $c<7; $c++){ if ($c==0 || $c%7==0) echo ""; else if ($c%6==0) echo ""; else { echo ""; echo ""; echo "Hello" ; $i++; } //for else }// for loop c } //for loop r for ($i=1; $i<100; $i++) echo "$i\n"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Baffling output
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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! > > > echo " bgcolor=\"#FF\" bordercolor=\"#FF\">"; > > for ($r=0; $r<5; $r++){ > > for ($c=0; $c<7; $c++){ > > if ($c==0 || $c%7==0) > > echo " height=\"77\" bordercolor=\"#00\">"; else if ($c%6==0) > > echo " height=\"77\" bordercolor=\"#00\">"; > >else { > > echo " height=\"77\" border=\"1\" bordercolor=\"#00\">"; > > echo ""; > > echo "Hello" ; $i++; > > } //for else > >}// for loop c > > } //for loop r > > for ($i=1; $i<100; $i++) > > echo "$i\n"; > > ?> > > > > > -- > 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
Re: [PHP] Baffling output
--- Lightfirst <[EMAIL PROTECTED]> 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timeout during SMTP operation.
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Some questions regarding pfsocketopen()
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 :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timeout during SMTP operation.
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? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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 => 90711 0,0,0,10,00,1998 => 90711 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 => 90711 0,0,0,10,9,1998 => 907887600 0,0,0,10,09,1998 => 90711 code $tmp"; $tmp = mktime(0,0,0,10,00,1998); echo "0,0,0,10,00,1998 => $tmp"; $tmp = mktime(0,0,0,10,1,1998); echo "0,0,0,10,1,1998 => $tmp"; $tmp = mktime(0,0,0,10,01,1998); echo "0,0,0,10,01,1998 => $tmp"; $tmp = mktime(0,0,0,10,2,1998); echo "0,0,0,10,2,1998 => $tmp"; $tmp = mktime(0,0,0,10,02,1998); echo "0,0,0,10,02,1998 => $tmp"; $tmp = mktime(0,0,0,10,3,1998); echo "0,0,0,10,3,1998 => $tmp"; $tmp = mktime(0,0,0,10,03,1998); echo "0,0,0,10,03,1998 => $tmp"; $tmp = mktime(0,0,0,10,4,1998); echo "0,0,0,10,4,1998 => $tmp"; $tmp = mktime(0,0,0,10,04,1998); echo "0,0,0,10,04,1998 => $tmp"; $tmp = mktime(0,0,0,10,5,1998); echo "0,0,0,10,5,1998 => $tmp"; $tmp = mktime(0,0,0,10,05,1998); echo "0,0,0,10,05,1998 => $tmp"; $tmp = mktime(0,0,0,10,6,1998); echo "0,0,0,10,6,1998 => $tmp"; $tmp = mktime(0,0,0,10,06,1998); echo "0,0,0,10,06,1998 => $tmp"; $tmp = mktime(0,0,0,10,7,1998); echo "0,0,0,10,7,1998 => $tmp"; $tmp = mktime(0,0,0,10,07,1998); echo "0,0,0,10,07,1998 => $tmp"; $tmp = mktime(0,0,0,10,8,1998); echo "0,0,0,10,8,1998 => $tmp"; $tmp = mktime(0,0,0,10,08,1998); echo "0,0,0,10,08,1998 => $tmp"; $tmp = mktime(0,0,0,10,9,1998); echo "0,0,0,10,9,1998 => $tmp"; $tmp = mktime(0,0,0,10,09,1998); echo "0,0,0,10,09,1998 => $tmp"; ?> - Original Message - From: "Johnson, Kirk" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] "0, as a number, is just as important as any other number." "; $tmp = mktime(0,0,0,10,00,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,1,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,01,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,2,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,02,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,3,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,03,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,4,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,04,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,5,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,05,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,6,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,06,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,7,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,07,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,8,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,08,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,9,1998); echo "$tmp"; $tmp = mktime(0,0,0,10,09,1998); echo "$tmp"; ?> -- 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
RE: [PHP] mktime() and the format of the day number entry
The month behaves the same: both '08' and '09' are treated as zero by mktime(). Kirk > -Original Message- > From: Paul Roberts [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 02, 2003 4:24 PM > To: Johnson, Kirk > Cc: [EMAIL PROTECTED] > 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 => 90711 > 0,0,0,10,00,1998 => 90711 > 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 => 90711 > 0,0,0,10,9,1998 => 907887600 > 0,0,0,10,09,1998 => 90711 > > code > $tmp = mktime(0,0,0,10,0,1998); > echo "0,0,0,10,0,1998 => $tmp"; > $tmp = mktime(0,0,0,10,00,1998); > echo "0,0,0,10,00,1998 => $tmp"; > $tmp = mktime(0,0,0,10,1,1998); > echo "0,0,0,10,1,1998 => $tmp"; > $tmp = mktime(0,0,0,10,01,1998); > echo "0,0,0,10,01,1998 => $tmp"; > $tmp = mktime(0,0,0,10,2,1998); > echo "0,0,0,10,2,1998 => $tmp"; > $tmp = mktime(0,0,0,10,02,1998); > echo "0,0,0,10,02,1998 => $tmp"; > $tmp = mktime(0,0,0,10,3,1998); > echo "0,0,0,10,3,1998 => $tmp"; > $tmp = mktime(0,0,0,10,03,1998); > echo "0,0,0,10,03,1998 => $tmp"; > $tmp = mktime(0,0,0,10,4,1998); > echo "0,0,0,10,4,1998 => $tmp"; > $tmp = mktime(0,0,0,10,04,1998); > echo "0,0,0,10,04,1998 => $tmp"; > $tmp = mktime(0,0,0,10,5,1998); > echo "0,0,0,10,5,1998 => $tmp"; > $tmp = mktime(0,0,0,10,05,1998); > echo "0,0,0,10,05,1998 => $tmp"; > $tmp = mktime(0,0,0,10,6,1998); > echo "0,0,0,10,6,1998 => $tmp"; > $tmp = mktime(0,0,0,10,06,1998); > echo "0,0,0,10,06,1998 => $tmp"; > $tmp = mktime(0,0,0,10,7,1998); > echo "0,0,0,10,7,1998 => $tmp"; > $tmp = mktime(0,0,0,10,07,1998); > echo "0,0,0,10,07,1998 => $tmp"; > $tmp = mktime(0,0,0,10,8,1998); > echo "0,0,0,10,8,1998 => $tmp"; > $tmp = mktime(0,0,0,10,08,1998); > echo "0,0,0,10,08,1998 => $tmp"; > $tmp = mktime(0,0,0,10,9,1998); > echo "0,0,0,10,9,1998 => $tmp"; > $tmp = mktime(0,0,0,10,09,1998); > echo "0,0,0,10,09,1998 => $tmp"; > ?> > > > - Original Message - > From: "Johnson, Kirk" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > 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 > [EMAIL PROTECTED] > > "0, as a number, is just as important as any other number." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mktime() and the format of the day number entry
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 => 90756 0,0,0,10,05,1998 => 90756 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 -- "; $tmp = mktime(0,0,0,10,0,1998); echo "0,0,0,10,0,1998 => $tmp"; $tmp = mktime(0,0,0,10,00,1998); echo "0,0,0,10,00,1998 => $tmp"; $tmp = mktime(0,0,0,10,1,1998); echo "0,0,0,10,1,1998 => $tmp"; $tmp = mktime(0,0,0,10,01,1998); echo "0,0,0,10,01,1998 => $tmp"; $tmp = mktime(0,0,0,10,2,1998); echo "0,0,0,10,2,1998 => $tmp"; $tmp = mktime(0,0,0,10,02,1998); echo "0,0,0,10,02,1998 => $tmp"; $tmp = mktime(0,0,0,10,3,1998); echo "0,0,0,10,3,1998 => $tmp"; $tmp = mktime(0,0,0,10,03,1998); echo "0,0,0,10,03,1998 => $tmp"; $tmp = mktime(0,0,0,10,4,1998); echo "0,0,0,10,4,1998 => $tmp"; $tmp = mktime(0,0,0,10,04,1998); echo "0,0,0,10,04,1998 => $tmp"; $tmp = mktime(0,0,0,10,5,1998); echo "0,0,0,10,5,1998 => $tmp"; $tmp = mktime(0,0,0,10,05,1998); echo "0,0,0,10,05,1998 => $tmp"; $tmp = mktime(0,0,0,10,6,1998); echo "0,0,0,10,6,1998 => $tmp"; $tmp = mktime(0,0,0,10,06,1998); echo "0,0,0,10,06,1998 => $tmp"; $tmp = mktime(0,0,0,10,7,1998); echo "0,0,0,10,7,1998 => $tmp"; $tmp = mktime(0,0,0,10,07,1998); echo "0,0,0,10,07,1998 => $tmp"; $tmp = mktime(0,0,0,10,8,1998); echo "0,0,0,10,8,1998 => $tmp"; echo date("r", $tmp) . ""; $tmp = mktime(0,0,0,10,08,1998); echo "0,0,0,10,08,1998 => $tmp"; echo date("r", $tmp) . ""; $tmp = mktime(0,0,0,10,9,1998); echo "0,0,0,10,9,1998 => $tmp"; echo date("r", $tmp) . ""; $tmp = mktime(0,0,0,10,09,1998); echo "0,0,0,10,09,1998 => $tmp"; echo date("r", $tmp) . ""; $tmp = mktime(0,0,0,9,30,1998); echo "0,0,0,9,30,1998 => $tmp"; echo date("r", $tmp) . ""; $tmp = mktime(0,0,0,09,30,1998); echo "0,0,0,09,30,1998 => $tmp"; echo date("r", $tmp) . ""; ?> *** 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mktime() and the format of the day number entry
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? > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions & Security
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who can tell me the best php-base webmail?
Joskey- Squirrel Mail is pretty good- www.squirrelmail.org David - Original Message - From: <[EMAIL PROTECTED]> To: "PHP Mail List" <[EMAIL PROTECTED]> 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 >[EMAIL PROTECTED] > > > > -- > 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
Re: [PHP] How to give parameters to a console php-script?
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" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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
RE: [PHP] Code contents of a function
so put it in a if or switch statement eg if ($var){ myfunction(); } else { sumotherfunction(); } etc > -Original Message- > From: Shawn McKenzie [mailto:[EMAIL PROTECTED]] > Sent: Friday, 3 January 2003 12:18 PM > To: [EMAIL PROTECTED] > 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 > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some questions regarding pfsocketopen()
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP memory usage
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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code contents of a function
What??? I want to read the code from the function into a string! "Peter Houchin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > so put it in a if or switch statement > > eg > > if ($var){ > myfunction(); > } > else { > sumotherfunction(); > } > > etc > > > > -Original Message- > > From: Shawn McKenzie [mailto:[EMAIL PROTECTED]] > > Sent: Friday, 3 January 2003 12:18 PM > > To: [EMAIL PROTECTED] > > 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 > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Testing
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 DocumentRoot /some/path/public_html php_admin_value engine On 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" <[EMAIL PROTECTED]> To: "Jim Lucas" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> 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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions & Security
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 ([EMAIL PROTECTED]) 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php