Re: [PHP] Update db with $_POST

2005-03-16 Thread Danny Brow
On Wed, 2005-03-16 at 16:50 +1000, Ligaya Turmelle wrote: assuming you are using PEAR DB - $result = $db-query(UPDATE items SET (item_name, item_desc, item_price, extraprice) VALUES (?,?,?,?) WHERE item_id = 3, array($_POST['title'], $_POST['description'], $_POST['price'],

[PHP] Re: Log out button

2005-03-16 Thread M. Sokolewicz
William Stokes wrote: Hello, Again this might be more of a HTML quetion. If so sorry about that. Anyway I was just trying to make a log out button to a page. It should end a session or/and close browser window. (Closing browser ends the session as well I think? no ) All variable values are

[PHP] Object Destruction in PHP5

2005-03-16 Thread Arjun Jain
Hi everyone, When is the object destroyed which is created in a PHP5 script? Suppose i say: ?php $m = new MyClass; $m-fun1('abcd'); $m-fun2(); ? Then why is the destructor not called when my script ends? Can it be called explicitly? If yes, how? Thanking you in advance, Regards aj --

[PHP] Re: is_a() against instanceof

2005-03-16 Thread Jason Barnett
Christian Stadler wrote: Eli schrieb: - ($cls instanceof ClassName) *requires* from ClassName to be declared, and generates a fatal error when ClassName is not declared. How about if (class_exists('ClassName') AND $cls instanceof ClassName) { ... } Regards, Christian Stadler Nice

Re: [PHP] Reading posted form variables

2005-03-16 Thread Jochem Maas
Simon Allison wrote: Hey, Obviously this has something to do with the quotation marks in the a href statement, however I am new to php and my attempts using addslashes and stripslashes have failed. I would be most grateful if anyone could help me. addslashes() and stripslashes() won't

[PHP] Re: Ad software

2005-03-16 Thread pete M
check www.hotscripts.com Ryan A wrote: Hey, I am looking for a software that just lists adverts... eg: Like ebay but without the bidding Requirements are simple, so simple that i am sure something like this exists and i dont have to write it myself: 0.They must register first then... 1.offer the

Re: [PHP] Auto logout

2005-03-16 Thread trlists
For the basic logout, it's very easy. Store a session variable which is the last active time. Initialize it to the current time when the user logs in. Each time a page loads, start the session and check current time against the last active time. If the difference is over the limit, display

RE: [PHP] Question about shortening a string

2005-03-16 Thread Kim Madsen
-Original Message- From: Steve Slater [mailto:[EMAIL PROTECTED] Sent: Saturday, March 12, 2005 5:29 PM $name_array = explode( ,$name); $short_name = $name_array[0] . end($name_array); And a dozen other ways to do it I'm sure. I just finished a project with a mess of pattern matching

[PHP] Strange PHP5 message

2005-03-16 Thread aka MacGuru
Hi, I have PHP 5.03 running on SuSE 9.2. Some code working fine in PHP 4.3x now throws a message: Notice: serialize() [function.serialize]: __sleep should return an array only containing the names of instance-variables to serialize. in ANVphpApp.php on line 840 Anyone knows what is the

RE: [PHP] php 4 php 5

2005-03-16 Thread Kim Madsen
-Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 4:05 AM That's why I'd like to stick with apache2 + php5 default and apache2+php4 just for a single site hosted (the one that uses imp). See my previous message describing the ProxyPass

[PHP] How to access any function of a any class?

2005-03-16 Thread pf
Hello. Please consider this: class A { function A($Cont){ $this-Container= $Cont; } function A_1(){ $this-Container-objB-B_1(somehing); } } class B { function B($Cont){ $this-Container= $Cont; } function B_1(){ //anything } } class Container{

[PHP] date() function help

2005-03-16 Thread John Eggen
I am writing an application to allow users to enter weekly data and am storing the data based on the year and the ISO week number. The data will be reported on a monthly basis and therefore I need a way to find the ISO week number for the first full week of the month (Monday-Sunday) and the ISO

[PHP] Log out button

2005-03-16 Thread William Stokes
Hello, Again this might be more of a HTML quetion. If so sorry about that. Anyway I was just trying to make a log out button to a page. It should end a session or/and close browser window. (Closing browser ends the session as well I think?) All variable values are deleted when browser is

[PHP] MIME Types

2005-03-16 Thread Mikey
Sunny mornings to you all! Does anyone on this NG know off of the top of their heads what the correct MIME type is for a CSV file? The closest I have found on my google is the application/msexcel type, but this spawns Excel when viewing the file, and I do not want this behaviour. TIA,

[PHP] RE: MIME Types [fixed]

2005-03-16 Thread Mikey
The closest I have found on my google is the application/msexcel type, but this spawns Excel when viewing the file, and I do not want this behaviour. Not sure what is happening with the list this morning, but it is eerily quiet! Anyway, a little bit of tinkering and I found that the answer

[PHP] XPath Query Exressions and Quote Characters

2005-03-16 Thread C Drozdowski
I've got a problem with quote characters and building XPath query expressions (PHP 5.0.3). What do I need to do to get them to work? I've tried various encoding functions but cannot figure it out. Given this expression, if $id contains one or more double quotes, an error is thrown. $query =

Re: [PHP] MIME Types

2005-03-16 Thread Chris Ramsay
On Wed, 16 Mar 2005 11:01:29 -, Mikey [EMAIL PROTECTED] wrote: Sunny mornings to you all! Does anyone on this NG know off of the top of their heads what the correct MIME type is for a CSV file? What I've always used is: Content-type: application/octet-stream The closest I have found

[PHP] Re: Log out button

2005-03-16 Thread Jason Barnett
M. Sokolewicz wrote: William Stokes wrote: Hello, Again this might be more of a HTML quetion. If so sorry about that. Anyway I was just trying to make a log out button to a page. It should end a session or/and close browser window. (Closing browser ends the session as well I think? no

Re: [PHP] Object Destruction in PHP5

2005-03-16 Thread Jochem Maas
Arjun Jain wrote: Hi everyone, When is the object destroyed which is created in a PHP5 script? Suppose i say: ?php $m = new MyClass; $m-fun1('abcd'); $m-fun2(); unset($m); // this fires $m-__destruct() if it exists. ? Then why is the destructor not called when my script ends? Can it be it is

[PHP] Ensure only one instance of a script is running

2005-03-16 Thread Shaun
Hi, I have a script that inserts data from files uploaded to our server. I need to make sure that only one instance of this script runs at anyone time, can anyone tell me how I can do this? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Ensure only one instance of a script is running

2005-03-16 Thread Jay Blanchard
[snip] I have a script that inserts data from files uploaded to our server. I need to make sure that only one instance of this script runs at anyone time, can anyone tell me how I can do this? [/snip] Don't run another instance. ba-dump ching! Ok, here is a quick and dirty way to do it, have

Re: [PHP] OT - C programming

2005-03-16 Thread Brian
To understand the *'s just google for c pointer tutorial, you're likely to find alot of helpful material. On Tue, 15 Mar 2005 11:37:26 -0500, Jason Barnett [EMAIL PROTECTED] wrote: Rasmus Lerdorf wrote: Jason Barnett wrote: Jay Blanchard wrote: ... In the end you are probably much

[PHP] Re: Strange PHP5 message

2005-03-16 Thread Jason Barnett
Andrei Verovski wrote: ... Notice: serialize() [function.serialize]: __sleep should return an array only containing the names of instance-variables to serialize. in ANVphpApp.php on line 840 Anyone knows what is the problem? Exactly what the notice says ;) basically __sleep is used so that

Re: [PHP] warning question about mysql sessions concurrency

2005-03-16 Thread Marek Kilimajer
Josh Whiting wrote: I've been trying to switch to MySQL-based session storage instead of the native PHP session storage. In doing so, I've run into a lot of code on the web that exhibits a serious flaw regarding concurrent requests from the same client. All the code I've seen has glossed over

RE: [PHP] Ensure only one instance of a script is running

2005-03-16 Thread Robert Cummings
On Wed, 2005-03-16 at 11:12, Jay Blanchard wrote: [snip] I have a script that inserts data from files uploaded to our server. I need to make sure that only one instance of this script runs at anyone time, can anyone tell me how I can do this? [/snip] Don't run another instance. ba-dump

[PHP] Re: XPath Query Exressions and Quote Characters

2005-03-16 Thread Jason Barnett
C Drozdowski wrote: ... $query = '//book/chapter' . '[EMAIL PROTECTED]:id=' . $id . ']'; First of all check the XPath documentation: http://www.w3.org/TR/xpath http://www.w3.org/TR/xpath#path-abbrev AFAIK your expression above is the way to build this query. Give us a link to the XML doc if

[PHP] Encrypted 2.5+M files do upload, but don't create a record when stored as LongBlobs (PHP/Apache/MySQL)

2005-03-16 Thread Steven Altsman
Files under 2.5 megs will go into the database just fine, any thing over that will return the page without errors, but will not be injected into the database. Not even a record is created. Edited PHP.INI to allow up to 40M of data to be uploaded. Set the script timeout to be 9000 seconds. Set

Re: [PHP] How to access any function of a any class?

2005-03-16 Thread pf
[EMAIL PROTECTED] wrote: Hello. Please consider this: class A { function A($Cont){ you obviously didn't RTFM about php5's new features, migration issues etc. why do I say that? well it because you are using a '' each time you assign an object. thats not how its done in php5 -

Re: [PHP] OT - C programming

2005-03-16 Thread Philip Olson
For a nice introduction to extension writing, read this article: Part I: Introduction to PHP and Zend http://zend.com/php/internals/extension-writing1.php As well as the various README files found within the php source files: http://cvs.php.net/php-src/ And let's not forget about

[PHP] Re: Ensure only one instance of a script is running

2005-03-16 Thread Raj Shekhar
Jay Blanchard [EMAIL PROTECTED] writes: [snip] I have a script that inserts data from files uploaded to our server. I need to make sure that only one instance of this script runs at anyone time, can anyone tell me how I can do this? [/snip] Don't run another instance. ba-dump ching!

RE: [PHP] Re: Ensure only one instance of a script is running

2005-03-16 Thread Mikey
[snip] Unluckily, this will not prevent a race condition. The only file operations that are guaranteed to be atomic are mkdir() and symlink(). Try to create the directory and see if it fails. Also remember to rmdir() the lock directory before exiting How about grabbing the output from

[PHP] [SOLVED] Re: [PHP] OT - C programming

2005-03-16 Thread Jason Barnett
Philip Olson wrote: For a nice introduction to extension writing, read this article: Part I: Introduction to PHP and Zend http://zend.com/php/internals/extension-writing1.php Bookmarked for future reference. Looking forward to the next several parts in this series... As well as the

[PHP] Re: Ensure only one instance of a script is running

2005-03-16 Thread Raj Shekhar
Mikey [EMAIL PROTECTED] writes: How about grabbing the output from `ps -ax` and looping thourhgthe results to see if your script is being run? Again the problem is of atomicity. This is a multi step process - do a ps -aux - do a grep on the output - start script processing What if second

[PHP] session.use_trans_sid Question

2005-03-16 Thread Al
What are the pros and cons of session.use_trans_sid ON and OFF Just moved our site from one which had the php.ini, session.use_trans_sid=OFF to one with it ON Sure looks ugly having the PHPSESSID showing up for visitors. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] opt-in mail list best practice

2005-03-16 Thread Todd Trent
I’ve created an email script that retrieves email addresses from a mysql database. Currently I’m grabbing the email addresses and putting them in the mail header’s Cc: or Bcc: section in comma delimited format. I do have sendmail on the current server so I’m using the mail function to send the

[PHP] Re: PHP Classes

2005-03-16 Thread Jason Barnett
You know... we talked about this several times before. Please search the archives for the PHP list's answers. Hint: STFA tutorial class object -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-generalw=2 STFM |

[PHP] Re: Embed PHP

2005-03-16 Thread Jason Barnett
Patric Stout wrote: Currently I am trying to get embed PHP to work. A nice C-application that can handle PHP-scripts. I hope this is the right place to ask question about it... This is a fine place to start. Note: I personally don't really know the answer to this question, but perhaps I can

Re: [PHP] file/array manipulation[RESOLVED]

2005-03-16 Thread Mignon Hunter
Got it - never mind instead of $new_array = array($line_split[0] = $line_split[1] ); it's $new_array = array($line_split[0] , $line_split[1] ); But I'm still not sure how it works so well... Ok I got this to work but I'm not sure how -- and am having trouble

[PHP] PHP Classes

2005-03-16 Thread Phil Neeb
Greets, I've gone through the PHP Manual a few times now, reading about classes, but really, what's written there doesn't make a whole lot of sense to me. I know a lot, if not the vast majority, of PHP programmers use classes, so I was wondering if some of you could explain them to me. What

Re: [PHP] file/array manipulation

2005-03-16 Thread Mignon Hunter
Ok I got this to work but I'm not sure how -- and am having trouble re-producing the data: My script I have so far is: $lines = file('test2.csv'); foreach ($lines as $line) { $line_split = explode(,, $line); if(!(empty($line_split[0]) ) ){ //echo I'm not empty;

[PHP] Re: XPath Query Exressions and Quote Characters

2005-03-16 Thread C Drozdowski
It's just a coincidence that I used xml:id as part of my query expression. If I use following code method to build my expression: $query = '//book/chapter[section=' . $section . ']'; or say $query = '//book/[EMAIL PROTECTED]' . $title . ']'; I get an Invalid Predicate... error when either the

[PHP] Re: session.use_trans_sid Question

2005-03-16 Thread Jason Barnett
Al wrote: What are the pros and cons of session.use_trans_sid ON and OFF Just moved our site from one which had the php.ini, session.use_trans_sid=OFF to one with it ON Sure looks ugly having the PHPSESSID showing up for visitors. Thanks PRO: - makes life easier when session cookie isn't

[PHP] Embed PHP

2005-03-16 Thread Patric Stout
Currently I am trying to get embed PHP to work. A nice C-application that can handle PHP-scripts. I hope this is the right place to ask question about it... First of all, there is very poor documentation about this subject on the web. Even the Zend-docs are outdated. This doesn't make it

Re: [PHP] php 4 php 5

2005-03-16 Thread Rasmus Lerdorf
Kim Madsen wrote: -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 4:05 AM That's why I'd like to stick with apache2 + php5 default and apache2+php4 just for a single site hosted (the one that uses imp). See my previous message describing

RE: [PHP] opt-in mail list best practice

2005-03-16 Thread Chris W. Parker
Todd Trent mailto:[EMAIL PROTECTED] on Wednesday, March 16, 2005 12:46 PM said: - Opt-in list could be less than 100 or in the 1000's. [snip] I've been googling all day and have found mailing classes, libraries, and scripts none of which seem to be documented very well or let me build

Re: [PHP] warning question about mysql sessions concurrency

2005-03-16 Thread Josh Whiting
On Wed, Mar 16, 2005 at 06:59:43PM +0100, Marek Kilimajer wrote: SO, does anyone have some code that uses MySQL to replace PHP's native session storage that also correctly handles this concurrency problem? Ideally I'd like to see just a set of functions that can be used with

Re: [PHP] incrementing a number from a text file

2005-03-16 Thread Kurt Yoder
On Mar 15, 2005, at 11:24 AM, Richard Lynch wrote: BAD (probably): Select blablabla FROM t1,t2,t3 WHERE customers LIKE '%$s%' OR name LIKE '%$s%' OR domain LIKE '%$s%' OR email LIKE '%$s%' OR log LIKE '%$s%' AND t1.id = t2.t1_id AND t1.id = t3.t1_id GOOD (usually): Select blablabla FROM t1,t2,t3

Re: [PHP] opt-in mail list best practice

2005-03-16 Thread Jeff Schmidt
Todd Trent wrote: This works fine for a few test emails. What I would like to know is what is considered best practice considering the following things: - This could be hosted on shared hosting server. - Opt-in list could be less than 100 or in the 1000s. - May need a way to track sending

[PHP] PHP source code formatter for OS X

2005-03-16 Thread DuSTiN KRySaK
Does anyone know of a PHP source code formatter to clean up sloppy code that runs on OS X? d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: recommending a PHP book?

2005-03-16 Thread freaky . irish
Try this: http://www.free-itebooks.com/php-mysql-free-itebooks/ and maybe you'll find ebook you're looking for -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Seleting records

2005-03-16 Thread Simon Allison
Hello, My news table has a year field as such Year 2000 2000 2001 2001 2003 2005 2005 I was wondering if you could select from this table so you only get one of each year, so the output would be 2000 2001 2003 2005 Is this possible, I was trying to think of

[PHP] Re: Seleting records

2005-03-16 Thread David Robley
Simon Allison wrote: Hello, My news table has a year field as such Year 2000 2000 2001 2001 2003 2005 2005 I was wondering if you could select from this table so you only get one of each year, so the output would be 2000 2001

[PHP] obscure error message - PHP Notice: (null)(): Permission denied (errflg=2) in Unknown on line 0

2005-03-16 Thread Zinovi Boyadjiev
Hello, I am getting this strange error while developing imap mail to mysql inporting script : PHP Notice: (null)(): Permission denied (errflg=2) in Unknown on line 0 I am getting it at the end of the script execution without affecting any actual script functionality. I am using PHP 4.3.10

[PHP] FreeBSD php upgrade oddity - can't load dynamic libraries

2005-03-16 Thread Al Arzaga
I'm running FreeBSD 5.2.1, and last night I cvsupped to the latest ports. This afternoon, I proceeded to upgrade PHP from 5.0.1 to 5.0.3. But I kept getting these errors when restarting apache that it could not find various shared libraries in /usr/local/lib/php/20041030 I see that I'm supposed to

[PHP] showing the decimal places

2005-03-16 Thread ross
when I define a number as $number = 2.00 then echo it the number shows as 2. How can I get the two zeros to show? This is not in any of my books but a fairly easy solution I'll bet! R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Session time out

2005-03-16 Thread Jacques
What is the life time of a PHP session object (variable)? Which conditional test can I perform to check if the session object has timed out? Jacques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Session time out

2005-03-16 Thread yangshiqi
In your php.ini, session.gc_maxlifetime=1440; Best regards, Yang Shiqi -Original Message- From: Jacques [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 1:48 PM To: php-general@lists.php.net Subject: [PHP] Session time out What is the life time of a PHP session object

RE: [PHP] showing the decimal places

2005-03-16 Thread Rob Agar
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] when I define a number as $number = 2.00 then echo it the number shows as 2. How can I get the two zeros to show? This is not in any of my books but a fairly easy solution I'll bet! the function you want is called sprintf (s for

[PHP] [Fwd: db to xml using php]

2005-03-16 Thread K Karthik
---BeginMessage--- can anyone help me to write from db to xml using php. if there is any site please do refer me. thanks, karthik ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] db to xml using php

2005-03-16 Thread K Karthik
can anyone help me to write from db to xml using php. if there is any site please do refer me. thanks, karthik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] showing the decimal places

2005-03-16 Thread Kim Madsen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 1:21 AM when I define a number as $number = 2.00 then echo it the number shows as 2. How can I get the two zeros to show? Are You _sure_ the var is declared as a float? Have a look

RE: [PHP] PHP Classes

2005-03-16 Thread Kim Madsen
-Original Message- From: Phil Neeb [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 16, 2005 8:58 PM I've gone through the PHP Manual a few times now, reading about classes, but really, what's written there doesn't make a whole lot of sense to me. I know a lot, if not the vast