php-general Digest 19 Feb 2008 16:05:46 -0000 Issue 5302
php-general Digest 19 Feb 2008 16:05:46 - Issue 5302 Topics (messages 269587 through 269628): Re: mysql input 269587 by: Robert Cummings 269589 by: Bastien Koert 269590 by: Shawn McKenzie 269591 by: Robert Cummings 269598 by: Richard Heyes 269600 by: Nathan Rixham 269601 by: Zoltán Németh 269602 by: Nathan Rixham 269603 by: Nathan Rixham 269617 by: Bastien Koert 269619 by: Bastien Koert 269621 by: Nathan Rixham Re: More than one values returned? 269588 by: Bastien Koert 269597 by: Nathan Rixham 269608 by: tedd 269613 by: Andrés Robinet Call PHP script from MySQL 269592 by: Mário Gamito 269593 by: Zoltán Németh 269594 by: Colin Guthrie 269596 by: Nathan Rixham 269604 by: Mário Gamito 269620 by: Colin Guthrie 269622 by: Sancar Saran Re: www. not working 269595 by: Christoph 269599 by: Børge Holen 269627 by: Philip Thompson fopen never ends? 269605 by: Paul van Brouwershaven 269606 by: Nathan Rixham 269610 by: Paul van Brouwershaven System errno in PHP 269607 by: Michal Maras 269609 by: Stut 269611 by: Michal Maras 269612 by: Michal Maras Hiding all browser toolbars - how? 269614 by: Matty Sarro 269615 by: Jay Blanchard 269616 by: Thiago Pojda Re: Question about cURL, and iFrames... 269618 by: Jason Pruim 269626 by: Daniel Brown js to php help 269623 by: tedd 269624 by: Nathan Rixham 269625 by: Nathan Rixham 269628 by: tedd 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] -- ---BeginMessage--- On Mon, 2008-02-18 at 23:05 -0500, nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? mysql_real_escape_string() Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' ---End Message--- ---BeginMessage--- mysql_real_escape_string() addslashes() htmlentities() take your pick bastien From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 18 Feb 2008 23:05:10 -0500 Subject: [PHP] mysql input I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ ---End Message--- ---BeginMessage--- nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() ---End Message--- ---BeginMessage--- On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote: mysql_real_escape_string() addslashes() htmlentities() take your pick That's a bad answer. If he's using MySQL then he SHOULD use mysql_real_escape_string(). None of the other functions will fully protect him from malicious input. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' ---End Message--- ---BeginMessage--- Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... -- Richard Heyes
[PHP] Re: Call PHP script from MySQL
Mário Gamito wrote: Hi, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( How can I do this ? Any help would be appreciated. Could be that a Trigger does what you want? http://dev.mysql.com/doc/refman/5.0/en/triggers.html But I'd suspect that you probably want to use a MySQL function to do this: e.g. SELECT SYSTEM('/usr/bin/php /path/to/my/script'); I'm not 100% sure if such a function exists, but if not it's would be a fairly trivial UDF to implement: http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html I'd be very careful tho', as creating such a UDF opens up a potential minefield for SQL injection attacks!! If it's only one script you want to execute, then it would be better to create a specific function that calls that and only that and doesn't accept arguments and doesn't have any nasty side affects if it's run in an ad-hoc manner. There may be better solutions and it may be that this could be implemented in other way if you look at it differently. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Call PHP script from MySQL
Mário Gamito wrote: Hi, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( How can I do this ? Any help would be appreciated. Warm Regards, Mário Gamito Mário, I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) Many Regards Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new features automatic and free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Call PHP script from MySQL
Hi, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( How can I do this ? Any help would be appreciated. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
Robert Cummings wrote: On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote: On Monday 18 February 2008, Nick Stinemates wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. You mean you've never had a function like getCoordinates()? Or getUsers(), or any other of a zillion perfectly valid and reasonable functions that return multiple values as an array? Wow, how odd! Cheers, Rob. getCoordinates() would return a Point object getUsers() would return a Group object... Not rocket science ;) I wouldn't consider an array of user objects to be multiple things. I consider it a single aggregate thing, and return arrays all the time. That's conceptually different from wanting two separate return values from a function, which is indeed conceptually icky. Yes, an aggregate is comprised of multiple things usually. Hence when decomposing the concept you are indeed returning multiple values-- both points of view are valid. If you receive a parcel of 100 pens. I can say, has the parcel arrived yet (one entity) or have the pens arrived yet (multiple entities). At any rate, the O.P. wanted to return multiple values called $x and $y. It seems quite reasonable to assume he was returning something akin to coordinates but didn't know how to do so by binding them in an aggregating structure such as an array, or if you wish, an object. Cheers, Rob. seriously, whats wrong with returning an array? half the standard php functions return array's, therefore at least half of php has been designed badly..? ps: when working with co-ordinates / GIS data you should really be using wkb data instead, it's much faster. [unpack] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Call PHP script from MySQL
2008. 02. 19, kedd keltezéssel 21.08-kor Mário Gamito ezt írta: Hi, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( How can I do this ? I think from MySQL you can not call outside applications. greets Zoltán Németh Any help would be appreciated. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta: Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); as I remember its also in SPL. $whatever = new MySqlCommandUnFucker($command); $whatever-unFuck(); :D greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fopen never ends?
Paul van Brouwershaven wrote: When you run the folling script, it will never ends? I have seen this more then once, I know that there is no service running at the target host, but why is the script not printing the failed message? It's only with a few ip-number I have this problem. if ($fp = fopen('https://81.23.227.9', 'rb', false)) { echo ok; } else { echo failed; } Best Regards, Paul van Brouwershaven I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based host header in the request. Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. Many Regard Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Nathan Rixham wrote: Zoltán Németh wrote: 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta: Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); as I remember its also in SPL. $whatever = new MySqlCommandUnFucker($command); $whatever-unFuck(); :D greets Zoltán Németh ?php class MySqlCommandUnFucker { public function _unfucker($toUnFuck) { if(function_exists('get_magic_quotes_gpc')) { if (get_magic_quotes_gpc()) { $in = stripslashes($toUnFuck); } } return $in; } public function unFuck($fucked) { if(function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($this-_unfucker($fucked)); } else { return $fucked; } } } ? usage: $unfucker = new MySqlCommandUnFucker; $sql = $unfucker -unFuck($sql); :) apologies! a slight correction for nihilism (the class does work..) usage: $unfucker = new MySqlCommandUnFucker; $sql = INSERT INTO tablename (varcol) VALUES ('; $sql .= $unfucker-unFuck($myfuckedvariable); $sql .= '); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Call PHP script from MySQL
Hi Nathan, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page. I need to insert the password field with the correct hash (vpopmail). So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Zoltán Németh wrote: 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta: Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); as I remember its also in SPL. $whatever = new MySqlCommandUnFucker($command); $whatever-unFuck(); :D greets Zoltán Németh ?php class MySqlCommandUnFucker { public function _unfucker($toUnFuck) { if(function_exists('get_magic_quotes_gpc')) { if (get_magic_quotes_gpc()) { $in = stripslashes($toUnFuck); } } return $in; } public function unFuck($fucked) { if(function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($this-_unfucker($fucked)); } else { return $fucked; } } } ? usage: $unfucker = new MySqlCommandUnFucker; $sql = $unfucker -unFuck($sql); :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
On Tuesday 19 February 2008 10:43:04 Christoph wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? thnx, Chris nah, just word from a non literate -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen never ends?
When you run the folling script, it will never ends? I have seen this more then once, I know that there is no service running at the target host, but why is the script not printing the failed message? It's only with a few ip-number I have this problem. if ($fp = fopen('https://81.23.227.9', 'rb', false)) { echo ok; } else { echo failed; } Best Regards, Paul van Brouwershaven -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] System errno in PHP
Hello everybody Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. By
Re: [PHP] More than one values returned?
At 6:06 PM -0800 2/18/08, Nick Stinemates wrote: Thats a good example, and a good reason for passing values by Reference instead of by Value. I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. That really depends upon what your functions are doing. If they are calculating variables that are related but independent upon each other (like x, y, z coordinates) it makes perfect sense to return more than value. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fopen never ends?
Nathan Rixham wrote: I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based host header in the request. I know that my browser is also waiting a long time, but strange that there is no timeout in fopen? My scripts are getting stuck and eventually they will hang my server. (when I start a new job every x minutes) Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. fsockopen has no context and with stream_socket_client I have no timeout but stream_context_get_options is not returning the right data $options = stream_context_get_options($fp); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System errno in PHP
Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] More than one values returned?
-Original Message- From: Nathan Rixham [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 5:17 AM To: php-general@lists.php.net Subject: Re: [PHP] More than one values returned? Robert Cummings wrote: On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote: On Monday 18 February 2008, Nick Stinemates wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. You mean you've never had a function like getCoordinates()? Or getUsers(), or any other of a zillion perfectly valid and reasonable functions that return multiple values as an array? Wow, how odd! Cheers, Rob. getCoordinates() would return a Point object getUsers() would return a Group object... Not rocket science ;) I wouldn't consider an array of user objects to be multiple things. I consider it a single aggregate thing, and return arrays all the time. That's conceptually different from wanting two separate return values from a function, which is indeed conceptually icky. Yes, an aggregate is comprised of multiple things usually. Hence when decomposing the concept you are indeed returning multiple values-- both points of view are valid. If you receive a parcel of 100 pens. I can say, has the parcel arrived yet (one entity) or have the pens arrived yet (multiple entities). At any rate, the O.P. wanted to return multiple values called $x and $y. It seems quite reasonable to assume he was returning something akin to coordinates but didn't know how to do so by binding them in an aggregating structure such as an array, or if you wish, an object. Cheers, Rob. seriously, whats wrong with returning an array? half the standard php functions return array's, therefore at least half of php has been designed badly..? ps: when working with co-ordinates / GIS data you should really be using wkb data instead, it's much faster. [unpack] So returning multiple values is a bad thing? How about Matlab for which it is such a common thing to use multiple return values, and they even have names? function [x, y] = myvectorfun(A, t) x = A*cos(t); y = A*sin(t); end Regards, Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hiding all browser toolbars - how?
[snip] Greetings everyone! I am currently working on a web application (aren't we all?). The main page which users will look at is simply a login prompt, and upon logging in a new browser window will be launched. I would like that window to have no browser bars, etc so all of the space taken up by the window is dedicated to the app. I know this can be done in ASP (my company's software does it) but I am curious if its possible or not with PHP? If not, maybe javascript? Any advice at all would be wonderful, thanks![/snip] It will either be JavaScript or starting the browser in a kiosk mode -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about cURL, and iFrames...
On Feb 18, 2008, at 9:19 AM, Dan Joseph wrote: On Feb 15, 2008 9:43 AM, Jason Pruim [EMAIL PROTECTED] wrote: I am trying to think through something, I am writing a simple proxy script for my own knowledge and to simplify my life :) What I want to do is bring in multiple website by going to 1 webpage (Think RSS for the entire website) have all the links work properly, login to the pages etc. etc. etc. I think I can do this with cURL which can pull the page in and display it properly, but I'm wondering if I should be displaying in an iFrame to keep my navigation links at the top to go around my site? Well, I think the short answer to that is Yes, curl can do what you want. You could pull in the page with curl, then go thru it and populate form fields, then display it. You wouldn't need an iframe, you'd just pull it in with curl, run thru and populate the fields, then display the finished product on the screen. One thing you may also want to keep in mind is that I think you'd have to go through and fix the image links and url links if they don't have the full url path in the html. Hey Dan, Thanks for the response. Do you think that there is a better way to pull in another webpage other then curl? I mean, could I simply include 'HTTP://www.mykillersite.com'; and have all the link work? I'll have to try that in a little bit when I get some development time and see how it works... -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql input
I agree, but they all provide some level of handling just might not be the 'most correct' way of handling it bastien Subject: RE: [PHP] mysql input From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; php-general@lists.php.net Date: Mon, 18 Feb 2008 23:31:21 -0500 On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote: mysql_real_escape_string() addslashes() htmlentities() take your pick That's a bad answer. If he's using MySQL then he SHOULD use mysql_real_escape_string(). None of the other functions will fully protect him from malicious input. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' _
Re: [PHP] System errno in PHP
Hi I am asking about errno for Filesystems functions like fopen, fread, fclose, ... On 19/02/2008, Stut [EMAIL PROTECTED] wrote: Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors. -Stut -- http://stut.net/
[PHP] Hiding all browser toolbars - how?
Greetings everyone! I am currently working on a web application (aren't we all?). The main page which users will look at is simply a login prompt, and upon logging in a new browser window will be launched. I would like that window to have no browser bars, etc so all of the space taken up by the window is dedicated to the app. I know this can be done in ASP (my company's software does it) but I am curious if its possible or not with PHP? If not, maybe javascript? Any advice at all would be wonderful, thanks! -Matthew
RES: [PHP] Hiding all browser toolbars - how?
quote [snip] Greetings everyone! I am currently working on a web application (aren't we all?). The main page which users will look at is simply a login prompt, and upon logging in a new browser window will be launched. I would like that window to have no browser bars, etc so all of the space taken up by the window is dedicated to the app. I know this can be done in ASP (my company's software does it) but I am curious if its possible or not with PHP? If not, maybe javascript? Any advice at all would be wonderful, thanks![/snip] It will either be JavaScript or starting the browser in a kiosk mode /quote As said, that's not up to php (server-side) but to HTML/JavaScript (client-side). But if you want to hide the address bar, remember that in Firefox3 and IE7 that's not possible (AFAIK). -- 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] js to php help
Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? Thanks in advance for any suggestions. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Call PHP script from MySQL
Mário Gamito wrote: Hi Nathan, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page. I need to insert the password field with the correct hash (vpopmail). So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it. Assuming there is no way to calculate the hash in ASP.net/C# then you could almost certainly create a pure C mysql UDF that can calculate it in a function and leave PHP and double insert stuff out and allow any MySQL client to claculate the hash See my earlier post for UDF details. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Bastien Koert wrote: thats awesome bastien To: php-general@lists.php.net Date: Tue, 19 Feb 2008 11:21:02 + From: [EMAIL PROTECTED] Subject: Re: [PHP] Re: mysql input Zoltán Németh wrote: 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta: Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); as I remember its also in SPL. $whatever = new MySqlCommandUnFucker($command); $whatever-unFuck();:Dgreets Zoltán Németh ?php class MySqlCommandUnFucker { public function _unfucker($toUnFuck) { if(function_exists('get_magic_quotes_gpc')) { if (get_mag ic_quotes_gpc()) { $in = stripslashes($toUnFuck); } } return $in; } public function unFuck($fucked) { if(function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($this-_unfucker($fucked)); } else { return $fucked; } } } ? usage: $unfucker = new MySqlCommandUnFucker; $sql = $unfucker -unFuck($sql); :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ :) although $in should be $toUnFuck; just can't be bothered chanign a mock class again! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: mysql input
thats awesome bastien To: php-general@lists.php.net Date: Tue, 19 Feb 2008 11:21:02 + From: [EMAIL PROTECTED] Subject: Re: [PHP] Re: mysql input Zoltán Németh wrote: 2008. 02. 19, kedd keltezéssel 11.03-kor Nathan Rixham ezt írta: Richard Heyes wrote: Shawn McKenzie wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() Hrmph, I can't seem to find that in the manual... it's been depricated I heard in favour of unfuck(); as I remember its also in SPL. $whatever = new MySqlCommandUnFucker($command); $whatever-unFuck();:D greets Zoltán Németh ?php class MySqlCommandUnFucker { public function _unfucker($toUnFuck) { if(function_exists('get_magic_quotes_gpc')) { if (get_magic_quotes_gpc()) { $in = stripslashes($toUnFuck); } } return $in; } public function unFuck($fucked) { if(function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($this-_unfucker($fucked)); } else { return $fucked; } } } ? usage: $unfucker = new MySqlCommandUnFucker; $sql = $unfucker -unFuck($sql); :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _
Re: [PHP] Question about cURL, and iFrames...
On Feb 19, 2008 9:44 AM, Jason Pruim [EMAIL PROTECTED] wrote: Hey Dan, Thanks for the response. Do you think that there is a better way to pull in another webpage other then curl? I mean, could I simply include 'HTTP://www.mykillersite.com'; and have all the link work? I'll have to try that in a little bit when I get some development time and see how it works... You could include, file_get_contents(), implode(), et cetera, but the links will only work on your local site if a variety of conditions are true. Including: a.) Relative linking b.) Non-protected content c.) Static content or dynamic content that does not rely on a private database d.) You can preg_replace() the '/href=(.*)/Ui' tags, but then matching conditions and writing out everything to expect (or not to expect) may be going beyond the scope of what you're trying to do. I don't know I just read the end of the thread myself. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js to php help
Nathan Rixham wrote: tedd wrote: Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? Thanks in advance for any suggestions. Cheers, tedd This is really a JS issue but.. check the snippet of your code below: Calendar.setup({ inputField :f_date_e, // id of the input field }); input type=hidden value=f_trigger_e name=show_e looks to me like if your input should be input type=hidden value= id=date_e name=date / Regards Cool the Gang edit: (damn c+p) ..should be input type=hidden value= id=f_date_e name=f_date_e / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
On Feb 19, 2008 4:43 AM, Christoph [EMAIL PROTECTED] wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? No, they're properly-configured FQDNs. They're just irrelevant examples to the context in which Rich was relaying to the OP. Picture a server where the A records or CNAMEs don't exist for the www. alias. Or, conversely, where the only way to access the domain is by using the www. alias. Those, Christoph, are some of the things incompetent sysops do and on a surprisingly frequent basis. Take the website of the wonderful Commonwealth of Pennsyltucky for example: Doesn't Work Works - --- dot.state.pa.us www.dot.state.pa.us lcb.state.pa.us www.lcb.state.pa.us psp.state.pa.us www.psp.state.pa.us -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System errno in PHP
I am now using filesystem functions fopen, fread, fclose, ... On 19/02/2008, Stut [EMAIL PROTECTED] wrote: Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors. -Stut -- http://stut.net/
Re: [PHP] System errno in PHP
Michal Maras wrote: I am now using filesystem functions fopen, fread, fclose, ... On 19/02/2008, Stut [EMAIL PROTECTED] wrote: Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors. -Stut -- http://stut.net/ http://php.net/fopen -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hiding all browser toolbars - how?
On Feb 19, 2008 9:10 AM, Matty Sarro [EMAIL PROTECTED] wrote: Greetings everyone! I am currently working on a web application (aren't we all?). The main page which users will look at is simply a login prompt, and upon logging in a new browser window will be launched. I would like that window to have no browser bars, etc so all of the space taken up by the window is dedicated to the app. JavaScript. Google: window.open(). I know this can be done in ASP (my company's software does it) but I am curious if its possible or not with PHP? Anything ASP can do, PHP can do better. ;-) just not that. No server-side language (PHP, Perl, Java, ASP, any CGIs, Python, et cetera) can control client-side parameters. At least not as of now, and I don't really see a need forcing that to change. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
Filter the data $data = str_replace(', , $data); I am sure there are many ways to filter the data before insert. (If you are SURE you have A.D.D. then it wont matter what I say to you.) Rick B. On Feb 18, 2008 11:24 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() That has thrown E_DEPRECATED since PHP 4.1. RTFM, n00b. ;-D -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- 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] MySQL Stored Procedures
I want to thank all who helped me on this issue. My Problem was when I tried to return a parameter to the C++ script. CREATE PROCEDURE `tracinsert`(CaldNumber varchar(12), CaldTime varchar(50), CallerID varchar(12)) BEGIN INSERT INTO IncCalls (CaldNumber, CaldTime, CallerID) VALUES (CaldNumber, CaldTime, CallerID); SELECT Introp FROM CaNumbers WHERE PNumber = CaldNumber; END I just did not get the fact that the Select feature returned the parameter data automactically without being declared. The script above works, my only wish was that more people wrote more articles about the proper structure. Yes I understand this has NOTHING to do with php but it will one day. Rick B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Call PHP script from MySQL
Hello, you may call external php script someting like that $val = asp's_fopen(http://www.example.com/calculate.php?var=password_field); php // calculate.php echo correct hash (vpopmail); ? Regards Sancar On Wednesday 20 February 2008 01:58:48 Mário Gamito wrote: Hi Nathan, Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page. I need to insert the password field with the correct hash (vpopmail). So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
Nathan Rixham wrote: Robert Cummings wrote: On Mon, 2008-02-18 at 21:09 -0600, Larry Garfield wrote: On Monday 18 February 2008, Nick Stinemates wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. You mean you've never had a function like getCoordinates()? Or getUsers(), or any other of a zillion perfectly valid and reasonable functions that return multiple values as an array? Wow, how odd! Cheers, Rob. getCoordinates() would return a Point object getUsers() would return a Group object... Not rocket science ;) I wouldn't consider an array of user objects to be multiple things. I consider it a single aggregate thing, and return arrays all the time. That's conceptually different from wanting two separate return values from a function, which is indeed conceptually icky. Yes, an aggregate is comprised of multiple things usually. Hence when decomposing the concept you are indeed returning multiple values-- both points of view are valid. If you receive a parcel of 100 pens. I can say, has the parcel arrived yet (one entity) or have the pens arrived yet (multiple entities). At any rate, the O.P. wanted to return multiple values called $x and $y. It seems quite reasonable to assume he was returning something akin to coordinates but didn't know how to do so by binding them in an aggregating structure such as an array, or if you wish, an object. Cheers, Rob. seriously, whats wrong with returning an array? half the standard php functions return array's, therefore at least half of php has been designed badly..? ps: when working with co-ordinates / GIS data you should really be using wkb data instead, it's much faster. [unpack] What's wrong with it? Hmm.. Half of PHP functions DO return arrays, I'll grant you that. The reason? It's untyped. If PHP were a typed language, and it still returned arrays for a lot, I definitely think it would be designed poorly. At any rate, returning an array from your Objects increases the burden and shifts it to the client of your API. For instance, if we take an example mentioned above *getUsers()* which returned an arbitrary number of User objects you could potentially use it like this. userupdater.php ?php $x = Users::getUsers($somefilter) foreach ($x as $user) { $user-update(); } ? Keep in mind. You'll have to rewrite that functionality in multiple areas. As opposed to: ?php $x = Users::getGroup($somegroup); // returns a group of users $x-update(); // can be reused wherever instead of having to loop through every user on the client side. ? I hope you can see past my (basic) example to understand where I am headed with this. -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql input
On Feb 18, 2008 11:24 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? -e Have you tried: dont_fuck_up_my_mysql_command() That has thrown E_DEPRECATED since PHP 4.1. RTFM, n00b. ;-D -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js to php help
At 3:23 PM + 2/19/08, Nathan Rixham wrote: Nathan Rixham wrote: tedd wrote: Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? This is really a JS issue but.. check the snippet of your code below: Getting variables from js to php is at least half a php issue. looks to me like if your input should be input type=hidden value= id=f_date_e name=f_date_e / Nathan: Yeah, I was hoping for something like that as well. But, your suggestion doesn't work -- see here: http://www.webbytedd.com/a/calendar1/index.php I tried all sorts of different combinations, but couldn't get anything to work. I believe that I'm close, but I thought someone here might have experience doing this. I just don't want to start all over with DOM scripting and figure out how to do it that way. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
On Feb 19, 2008, at 3:43 AM, Christoph wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? thnx, Chris I don't think he was referring to sub-domains. IMO, www.games.yahoo.com would be ridiculous. =D ~Philip Personally, most of my web applications do not have to factor 13.7 billion years of space drift in to the calculations, so PHP's rand function has been great for me... ~S. Johnson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about cURL, and iFrames...
On Feb 19, 2008 9:44 AM, Jason Pruim [EMAIL PROTECTED] wrote: Thanks for the response. Do you think that there is a better way to pull in another webpage other then curl? I mean, could I simply include 'HTTP://www.mykillersite.com http://www.mykillersite.com/'; and have all the link work? I'll have to try that in a little bit when I get some development time and see how it works... The links probably wouldn't work. What is going to happen is this: you pull in www.google.com Now people are looking at www.mykillersite.com and they are seeing Google's content. If you scrubbed all the hyperlinks and replaced google.com with mykillersite.com, when they clicked on the Advertising link, they'd end up on www.mykillerlink.com/intl//ads/ instead, which would 404 of course unless you created that too. -- -Dan Joseph Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
[PHP] Thread Safety
Not quite sure if this is the right list, but here I am... I'm trying to use zend platform and it requires the Thread Safety option set to off. I just compiled php and I can't find what argument to build php that way, what am I missing? PHP 4.4.8 Thanks! Atenciosamente, http://www.softpartech.com.br/ www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros
[PHP] Re: js to php help
tedd wrote: Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? Thanks in advance for any suggestions. Cheers, tedd This is really a JS issue but.. check the snippet of your code below: Calendar.setup({ inputField :f_date_e, // id of the input field }); input type=hidden value=f_trigger_e name=show_e looks to me like if your input should be input type=hidden value= id=date_e name=date / Regards Cool the Gang -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread Safety
On Feb 19, 2008 12:00 PM, Thiago Pojda [EMAIL PROTECTED] wrote: Not quite sure if this is the right list, but here I am... I'm trying to use zend platform and it requires the Thread Safety option set to off. I just compiled php and I can't find what argument to build php that way, what am I missing? To modify thread safety options, unfortunately it requires a full reconfiguration and recompilation of the binaries. There's no INI setting, it's compiled right into the core. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] js to php help
On Feb 19, 2008, at 712AM, tedd wrote: Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? Have you tried placing the form before the Calendar.setup() calls? Seems like I had to do that when I used that javascript calendar widget. Brady -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread Safety
On Feb 19, 2008 1:21 PM, Thiago Pojda [EMAIL PROTECTED] wrote: I was expecting that. I just compiled it to enable oci8 module and the source is ready for modifications. :) Isn't there any argument you pass to ./configure to disable Thread Safety? I didn't find any and neither google or php-install list answer anything. Don't quote me on this, and I'll defer to someone that may know better than I in this case, but I believe that you can pass '--enable-thread-safety' to ./configure to enable it (default), so I'd imagine '--disable-thread-safety' would be the flag to send. You may want to try subscribing to the php-install list (go to http://php.net/mailing-lists.php). I'm CC'ing your email to that list in hopes that someone there can better help you. ORIGINAL MESSAGE Not quite sure if this is the right list, but here I am... I'm trying to use zend platform and it requires the Thread Safety option set to off. I just compiled php and I can't find what argument to build php that way, what am I missing? PHP 4.4.8 -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Thread Safety
I was expecting that. I just compiled it to enable oci8 module and the source is ready for modifications. :) Isn't there any argument you pass to ./configure to disable Thread Safety? I didn't find any and neither google or php-install list answer anything. Thanks. -Mensagem original- De: Daniel Brown [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 19 de fevereiro de 2008 15:16 Para: Thiago Pojda Cc: php-general@lists.php.net Assunto: Re: [PHP] Thread Safety On Feb 19, 2008 12:00 PM, Thiago Pojda [EMAIL PROTECTED] wrote: Not quite sure if this is the right list, but here I am... I'm trying to use zend platform and it requires the Thread Safety option set to off. I just compiled php and I can't find what argument to build php that way, what am I missing? To modify thread safety options, unfortunately it requires a full reconfiguration and recompilation of the binaries. There's no INI setting, it's compiled right into the core. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Call PHP script from MySQL
On Tue, February 19, 2008 5:58 pm, Mário Gamito wrote: Is it possible to call from within MySQL an external PHP script ? I've read MySQL Stored Procedure Programming from O'Reilly but found nothing :( I'd really like to see an example of why you need this functionality, if that'd be okay. Not to judge, just to learn :) I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page. I need to insert the password field with the correct hash (vpopmail). So, after the first insert leaving the password field blank, I need to invoke a PHP script that calculates the hash and then insert it. Finding a correct implementation of the hash in ASP.NET/C# will probably be MUCH easier and more maintainable. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unable to unset reference
Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --- ? $x = new stdClass(); $x-a = 'ayayaye'; $b[0] = $x; unset($b[0]); var_dump($x); ? Expected result: NULL Actual result: -- object(stdClass)#1 (1) { [a]= string(7) ayayaye } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hiding all browser toolbars - how?
With target and JS, yes. It's not PHP. It's not even ASP. It's just HTML and JavaScript. On Tue, February 19, 2008 8:10 am, Matty Sarro wrote: Greetings everyone! I am currently working on a web application (aren't we all?). The main page which users will look at is simply a login prompt, and upon logging in a new browser window will be launched. I would like that window to have no browser bars, etc so all of the space taken up by the window is dedicated to the app. I know this can be done in ASP (my company's software does it) but I am curious if its possible or not with PHP? If not, maybe javascript? Any advice at all would be wonderful, thanks! -Matthew -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System errno in PHP
On Tue, February 19, 2008 7:13 am, Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. If you use exec() you can get that as a returned value for the third arg. If you just mean out of the existing environment, almost for sure it's there in something kinda obvious like $errno or somesuch... vardump($_ENV) will probably show it. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RES: [PHP-INSTALL] Re: [PHP] Thread Safety
-Mensagem original- quote. De: Daniel Brown [mailto:[EMAIL PROTECTED] Assunto: [PHP-INSTALL] Re: [PHP] Thread Safety On Feb 19, 2008 1:21 PM, Thiago Pojda [EMAIL PROTECTED] wrote: I was expecting that. I just compiled it to enable oci8 module and the source is ready for modifications. :) Isn't there any argument you pass to ./configure to disable Thread Safety? I didn't find any and neither google or php-install list answer anything. Don't quote me on this, and I'll defer to someone that may know better than I in this case, but I believe that you can pass '--enable-thread-safety' to ./configure to enable it (default), so I'd imagine '--disable-thread-safety' would be the flag to send. You may want to try subscribing to the php-install list (go to http://php.net/mailing-lists.php). I'm CC'ing your email to that list in hopes that someone there can better help you. /quote ./configure --disable-thread-safety did not do the trick, neither did --with-tsrm-pthreads=no. I've tried php-install mailing list and no1 answered. Going trougth configure script, there are some places with thread_safe arguments, but messing around didn't help me much. Perhaps something to do with apxs2? This is the default configure I need to run, where I'm trying to add no TS commands: ./configure --with-oci8-instant-client=/oracle/instantclient --with-apxs2=/usr/bin/apxs2 ORIGINAL MESSAGE Not quite sure if this is the right list, but here I am... I'm trying to use zend platform and it requires the Thread Safety option set to off. I just compiled php and I can't find what argument to build php that way, what am I missing? PHP 4.4.8 -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about cURL, and iFrames...
Jason Pruim wrote: Happy friday to all of you! May the Beer[1] flow freely from the kegs to your lips after work! I am trying to think through something, I am writing a simple proxy script for my own knowledge and to simplify my life :) What I want to do is bring in multiple website by going to 1 webpage (Think RSS for the entire website) have all the links work properly, login to the pages etc. etc. etc. I think I can do this with cURL which can pull the page in and display it properly, but I'm wondering if I should be displaying in an iFrame to keep my navigation links at the top to go around my site? Another thing that I'm trying to figure out, is if you can automacially fill in usernames/passwords if you can find the name of the box it goes in? simply put... txtUsername = $_POST['Username']; will that fill it in on the remote site? Anyone ever done anything like this that I could look at some code for? I keep searching for stuff like PHP Proxy, and get all of these sites that ARE proxy's... Not quite what I want... Thanks for looking! [1]Or coke, Pepsi, Liquor, etc. etc. etc -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] So it looks like iframes. That's the only way to not break links, images etc... -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System errno in PHP
PHP catches all thsoe and prints nifty error message. I presume the error number is in the guts somewhere, and could be exposed easily enough if you worked at it... But I don't think there is any kind of variable today with it in there. php_errmsg used to have the error message in it, but that depends on php.ini setting, and seems to be passe these days... On Tue, February 19, 2008 7:36 am, Michal Maras wrote: I am now using filesystem functions fopen, fread, fclose, ... On 19/02/2008, Stut [EMAIL PROTECTED] wrote: Michal Maras wrote: Coud somebody tell me if it is possible to get integer value of variable which name in C is errno end in perl $!. I am PHP beginner so I am sorry if question is 'stupid'. What function are you calling where you expect to get a system error? Check the manual page for that function - it will tell you how to detect errors. -Stut -- http://stut.net/ -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
On Tue, February 19, 2008 3:43 am, Christoph wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? No, those are the examples of people who did it on purpose. But there are tons of sites where www.example.com does not resolve to example.com, and for no good reason -- Just sheer ignorance on the part of whomever set up example.com These far outnumber the folks such as your example. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql input
On Mon, February 18, 2008 10:05 pm, nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? http://php.net/mysql_real_escape_string Google for SQL injection for (way) more info. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql input
On Mon, February 18, 2008 10:19 pm, Bastien Koert wrote: mysql_real_escape_string() Yes. addslashes() No, not right for different charsets. See above. htmlentities() Completely and wildly inappropriate. Might as well use a cannon to slice a tomato. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
These new kids have no respect. ;-P On Feb 19, 2008 2:33 PM, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, February 19, 2008 3:43 am, Christoph wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? No, those are the examples of people who did it on purpose. But there are tons of sites where www.example.com does not resolve to example.com, and for no good reason -- Just sheer ignorance on the part of whomever set up example.com These far outnumber the folks such as your example. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unable to unset reference
Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --- ? $x = new stdClass(); $x-a = 'ayayaye'; $b[0] = $x; unset($b[0]); var_dump($x); ? Expected result: NULL Actual result: -- object(stdClass)#1 (1) { [a]= string(7) ayayaye } So if you unset a reference you are dereferencing it. If you want to unset both, then unset the object, in this case $x. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
Christoph [EMAIL PROTECTED] wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? thnx, Chris No, these are examples of ones set up specifically for specific purposes. Just like http://lonewolf.homelinux.net/ can actually resolve correctly when www is placed at the front due to my settings. However a site like http://nc4h.org actually NEEDS to have the www in the front because the sysadmins haven't corrected a known issue for 3 years now. But the point is, there are a number of sites which don't have a www in the front for a specific and valid reason, and other times where the sysadmins are just morons. Making any site re-direct to www as a cause is just overhead not needed, either your site works correctly or you talk with your sysadmin about getting the records corrected and the server correct to respond to requests in any flavor for your site's specific needs. And if you do it right, you use the server to mod_rewrite the url and you are golden. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unable to unset reference
Shawn McKenzie wrote: Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --- ? $x = new stdClass(); $x-a = 'ayayaye'; $b[0] = $x; unset($b[0]); var_dump($x); ? Expected result: NULL Actual result: -- object(stdClass)#1 (1) { [a]= string(7) ayayaye } So if you unset a reference you are dereferencing it. If you want to unset both, then unset the object, in this case $x. -Shawn Actually dereference was obviously the wrong word. You are actually just destroying the reference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: unable to unset reference
Shawn McKenzie wrote: Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --- ? $x = new stdClass(); $x-a = 'ayayaye'; $b[0] = $x; unset($b[0]); var_dump($x); ? Expected result: NULL Actual result: -- object(stdClass)#1 (1) { [a]= string(7) ayayaye } So if you unset a reference you are dereferencing it. If you want to unset both, then unset the object, in this case $x. -Shawn Ignore everything that I have said or may say, I'm completely wrong :-( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: unable to unset reference
Shawn McKenzie [EMAIL PROTECTED] wrote: Shawn McKenzie wrote: Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? if you don't think so can you think of something different to destroy both of them like I don't know, destroy($obejctsreference) Regards. Reproduce code: --- ? $x = new stdClass(); $x-a = 'ayayaye'; $b[0] = $x; unset($b[0]); var_dump($x); ? Expected result: NULL Actual result: -- object(stdClass)#1 (1) { [a]= string(7) ayayaye } So if you unset a reference you are dereferencing it. If you want to unset both, then unset the object, in this case $x. -Shawn Ignore everything that I have said or may say, I'm completely wrong :-( Sure Shawn, you're just trying to increase your rankings for this week... ;) Personally, objects are a b!tch to use, but I'm gradually working myself to the point of having to learn and play nice with them. Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On 2/18/08, Robert Cummings [EMAIL PROTECTED] wrote: I'd just return arrays unless I had a specific need for incurring object overhead for such simple datatypes. w0rd. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On 2/18/08, Nick Stinemates [EMAIL PROTECTED] wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. Yeah, that's probably why most popular scripting languages support it. In Ruby: def foo 1, 2 end a, b = foo In Python: def foo return 1, 2 a, b = foo In Perl: sub foo { return (1, 2); } (my $a, my $b) = foo; -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thread Safety
Hi, Wednesday, February 20, 2008, 3:00:28 AM, you wrote: TP Not quite sure if this is the right list, but here I am... TP TP I'm trying to use zend platform and it requires the Thread Safety option set TP to off. TP TP I just compiled php and I can't find what argument to build php that way, TP what am I missing? TP TP PHP 4.4.8 TP TP TP Thanks! --disable-zts should do it -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] js to php help
At 10:18 AM -0800 2/19/08, Brady Mitchell wrote: On Feb 19, 2008, at 712AM, tedd wrote: Hi gang: I have a date picker in javascript working, but I need to take the date selections to php. Here's the link and code: http://www.webbytedd.com/a/calendar/index.php How can I get what is selected in javascript to POST? Have you tried placing the form before the Calendar.setup() calls? Seems like I had to do that when I used that javascript calendar widget. Brady Brady: Bingo!!! We have a winner. It now works. Strange stuff. Many thanks. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
At 4:57 PM -0600 2/19/08, Greg Donald wrote: On 2/18/08, Nick Stinemates [EMAIL PROTECTED] wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. Yeah, that's probably why most popular scripting languages support it. In Ruby: def foo 1, 2 end a, b = foo In Python: def foo return 1, 2 a, b = foo In Perl: sub foo { return (1, 2); } (my $a, my $b) = foo; For completeness sake, this is pretty much the same in PHP: function test() { return array(1,2); } list($a,$b) = test(); works as above. Works fine with complex arrays as well: function test() { return array(1,array('a','b')); } list($a,$b) = test(); steve -- +--- my people are the people of the dessert, ---+ | Steve Edberghttp://pgfsun.ucdavis.edu/ | | UC Davis Genome Center[EMAIL PROTECTED] | | Bioinformatics programming/database/sysadmin (530)754-9127 | + said t e lawrence, picking up his fork + -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unable to unset reference
Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. I doubt the php-dev's will ever allow something like that, seems rather dangerous to me. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? No, it's not meant to (and I doubt it will change). Why do you want it to do that? What is the original problem you're trying to solve? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Stored Procedures
my only wish was that more people wrote more articles about the proper structure. You mean like the example on the mysql website? http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: fopen never ends?
Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. fsockopen has no context Maybe I'm missing something but it returns a resource just like fopen. http://php.net/fsockopen -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unable to unset reference
Hence my previous gibberish, I would expect a reference to be destroyed when the object is, but obviously it's not. It has nothing specifically to do with objects, it's all about how references are handled. $ php -a Interactive mode enabled ?php $a = '12345'; $b = $a; unset($a); var_dump($b); string(5) 12345 Sara Goleman will explain it much better than I can: http://blog.libssh2.org/index.php?/archives/51-Youre-being-lied-to..html ie - it's by design and will (probably) not change. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session destruction problem
Hi, Below you'll find my code. I think now that the problem is in my algorithm, because the is created anytime the page is refreshed. But i don't know how to check if the client was logged out or it is a real new connexion to the page. As you will see one can click on logout, then press the back button of the browser, and then refresh the page, but he is still connected. I would like to help me fixe that. Here is the code: ---index.php-- //the first page where the user enters his login and password !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=../styles/style.css media=screen / titleLogin page/title /head body form name = manage action = manage.php method=post div style = padding-top: 40px; padding-bottom: 40px;height = 100%; centertable width = 100% cellspacing=10 trtd width = 50% align = rightLogin/tdtd width = 50% align = leftinput type=text name=login //td/tr trtd width = 50% align = rightPassword/tdtd width = 50% align = leftinput type=password name=password //td/tr /table input type=submit name=connect value = Connect/ br/br/br/ /center /form /body /html - manage.php //where the form posts data and here is where the session is created ?php session_start(); $sessionid = session_id(); $referer = @$HTTP_REFERER; if (isset($_REQUEST['connect'])){ $passwd = addslashes($_POST['password']); $login = addslashes($_POST['login']); require_once ../../../includes/connexion.php; $sql = mysql_query(SELECT * FROM user WHERE login ='.$login.' and password = '.$passwd.') or die(Incorrect username or password.); $result = mysql_fetch_array($sql); if (($result[0] != null)) { $_SESSION['sessioname'] = $_POST['login']; } else Header (Location: ./index.php); mysql_close(); } else if(!isset($_SESSION['sessioname'])) { Header (Location: ./index.php); } ? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=utf-8 / /head body ?php if(isset( $_SESSION['sessioname'])) { echo $_SESSION['sessioname'] ; echo , . session_id(); echo , a href = 'logout.php'Log Out/a nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;; } else echo a href = 'index.php'Login/a nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;; ? /body /html logout.php -- ?php session_start(); unset($_SESSION[sessioname]); $_SESSION = array(); session_destroy(); header(location: index.php); ? --- Richard Lynch [EMAIL PROTECTED] wrote: On Sat, February 16, 2008 2:31 pm, Adil Drissi wrote: I need help with sessions. I have a simple authentification relying only on sessions (i don't use cookies). Do you mean that you are also using the no_cookie setting in PHP and using the URL to pass around the session ID? Or jut that you don't use extra cookies on top of the one PHP uses by default? After the user submits his username and password, the script checks if that corresponds to a record in a mysql table. If this is the case $_SESSION['sessioname'] = $_POST['login'];. the $_SESSION['sessioname'] is checked in subsequent pages to see if the user is connected or not. The problem is after the user logs out, and after that uses the previous button of the browser he becomes connected. How can i prevent this please. If the URL has the old session ID, and you aren't destroying it completely somehow, then they'll be logged in once they go back to the URL with the session ID. ?php session_start(); unset($_SESSION[sessioname]); session_destroy(); header(location: index.php); ? If you want to destroy the session completely, use: $_SESSION = array(); to wipe out ALL the session data. Also, on *some* browsers, sending the cookies session_start (if you are using cookies) and the Location: header with an INCOMPLETE URL means the browser will screw up. Use the COMPLETE URL in your header(Location) And use a capital L in Location, as well, to be totally kosher, I think. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List
Re: [PHP] unable to unset reference
Chris wrote: Sylvain Rabot wrote: Hello, First of all I would like to know if one day we will be able to unset $this into a class in order to destroy the object. It could really be useful to prevent big memory usage. I doubt the php-dev's will ever allow something like that, seems rather dangerous to me. As it can't be done I tried to unset an object by unsetting a reference of this object but it has no effect on the object but only on the reference. Should unset destroy the reference itself and the object ??? No, it's not meant to (and I doubt it will change). Why do you want it to do that? What is the original problem you're trying to solve? Hence my previous gibberish, I would expect a reference to be destroyed when the object is, but obviously it's not. -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] xpath question
Hey guys, I have a form accepting a KML file from users and from there I want to draw polylines based on a KML file's PlacemarkerLineStringcoordinates element. The problem I am having is that sometimes the KML file can have a documentfolder or folderdocument or none of the above, or any number of random scenarios in the KML file making it hard to parse. To deal with this randomness I'm using an xpath and I think I have it right but it just wont work... the code: $result = $xml-xpath('Placemark/LineString/coordinates'); An the particular XML file I am trying to pull from looks like: ?xml version=1.0 encoding=UTF-8? kml xmlns=http://earth.google.com/kml/2.1; Document namecoehilltotweed.kml/name Style id=lineStyle LineStyle color6417/color width6/width /LineStyle /Style Folder name23-SEP-06/name Snippet maxLines=2 /Snippet description![CDATA[table trtdbDistance/b 139.0 mi /td/tr trtdbMin Alt/b 451.4 ft /td/tr trtdbMax Alt/b 1168.9 ft /td/tr /table]]/description Placemark namePath/name styleUrl#lineStyle/styleUrl LineString tessellate1/tessellate coordinates -77.827985,44.851878,311.109985 -77.827021,44.852114,313.993896 -77.827213,44.8506760001,313.513306 -77.827792,44.850955,313.513306 -77.830389,44.8533370001,315.916504 -77.833114,44.858379,317.358643 -77.8319330001,44.858508,313.993896 /coordinates /LineString /Placemark /Folder /Document /kml Any ideas why this won't work? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] classes
On Mon, February 18, 2008 2:25 pm, nihilism machine wrote: if i declare an instance of a class in the top of my php file, then have html, then later on user $myClassInstance-myMethod(); -- myMethod() does not execute, only when i have the instantiation of the class right before the call to the method does it work. any ideas? Your HTML must have some PHP code in there that is wiping out the instance somehow... There's no specific rule that you can't call a method after outputting some HTML, though it's usually a bad separation of logic and presentation. Unless, of course, the method call IS a presentation... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What community software package gets your vote? PHPfox etc...
Hello everyone. I'm not sure what the budget is but, obviously inexpensive would be nice. Someone turned me on to PHPfox. Yet I don't have any others to compare it to. If you all would be so kind as to put a shout out and vote on your favorite, I'd be very grateful. Extendability would also be nice along with customization in terms of design. Much Appreciation, T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Feb 19, 2008 5:23 PM, Steve Edberg [EMAIL PROTECTED] wrote: For completeness sake, this is pretty much the same in PHP: function test() { return array(1,2); } list($a,$b) = test(); Yup, just a few more keystrokes is all. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: open a secondary window/tab in the browser from php
On Mon, February 18, 2008 1:04 pm, Shawn McKenzie wrote: julian wrote: Hi, I have an application that along filling in some forms, it produces a pdf file, as confirmation of all entered data. I want to send this pdf file to a different window/tab of the browser, so it is displayed and can latter be printed. In the mean time, the original window contains a confirmation message, to continue with the work flow. I would like to do this without use of JavaScript Any combination of headers ?? Any hints appreciated. JCG AFAIK you must use javascript. The two scenarios I see are: 1. Your form uses target=_blank to open the PDF and there is some onsubmit javascript that updates your form. 2. Your form updates itself when submitted and there is some onsubmit javascript to open the PDF in a new window. Actually, I think a PDF can have an action at the launch that opens up a web page... I vaguely remember this... But maybe I'm just imagining it... Or it could be that I'm thinking of an FDF which *has* to open up a PDF URL to function. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: fopen never ends?
On Tue, February 19, 2008 5:49 pm, Chris wrote: Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. fsockopen has no context Maybe I'm missing something but it returns a resource just like fopen. http://php.net/fsockopen And you can control its timeout for OPENING with an ini_set of that one timeout setting. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protected ZIP file with password
You can dig out what 127 means from perror, or you can just go with the usual suspects of paths and permissions. PHP does not run as you from the command line and does not use your shell and does not have your environment. Use FULL PATH everywhere. E.g.: exec(/usr/bin/zip /home/www/bastos.com/example/files/, $output, $error); Also make sure the PHP User has read/write access to whatever it needs to do the job. And be VERY CAREFUL about who else then has access because of this!!! For ultimate geekiness, you can install a custom PHP extension I wrote to print out the error message matching 127: http://l-i-e.com/perror :-) On Mon, February 18, 2008 12:57 pm, Petrus Bastos wrote: Hey folks, I got access to exec method for test! But, it's not working... :( the function returns 127 and don't create the zip file, I've tested on Linux command tool and works! Do you have any idea why didn't work? Thanks again and sorry for the inconvenience, Petrus Bastos. On Feb 18, 2008 2:37 PM, Nick Stinemates [EMAIL PROTECTED] wrote: Petrus Bastos wrote: Richard, Unfortunately, I can't get out of the zip password rut because the destination system read only this file format. I can't change the destination system. Thanks, Petrus. On Feb 18, 2008 2:11 PM, Richard Lynch [EMAIL PROTECTED] wrote: On Mon, February 18, 2008 5:59 am, Petrus Bastos wrote: Thanks again for your worry. So, let's go, here goes my situation. I'm exporting data to another system. That system have an option to be feed by a password protected zip file. The export activity will be occur in this way: the user will generate the file on my application and will put this file into that another system. So, I need generate that file. Maybe one solution is to generate the file unzipped and determine that user should zip the file with password on his Windows or Linux operating system. But, I can't let that responsibility on user hands. So, because that I need to generate the file already protected. Perhaps you could use SCP (or SSH tunneling) to transfer the file from system to system, so that it need not ever be visible to the outside world, and thus not need the rather lame zip password. Another option would be to take the whole file and 2-way encrypt it with a public/private key pair, and install the private key on the receiving server. In other words, get out of the zip password rut, and protect the file some other way. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? Sounds like a creative challenge... this is what makes programmers problem solvers. You can write the code, you have the knowledge.. and then you get requirements like this one. How annoying! I found out some interesting information researching your issue. It seems that encryption by password is actually not built in to ZIP itself, but was an implementation detail apps like WinZip added to the mix. Because of that, the original ZIP libs don't have any notions of password protection. It seems like this isn't a language specific issue, either. I think it's time to get creative, Petros. You're in a bind, and I assume you need to get this done, so you have the following options (in the order I would do it in..) - Turn on exec() - You can use/modify an app I wrote (in python) which accepts UDP packets and executed commands based off of it. You can strip out the really insecure things and just accept 'zip' commands. The lib/app is really small and lightweight. There are no dependencies outside of I think 3 python modules. If I couldn't turn on exec(), this is the route I would go. - Use some form of file/directory montoring + zip. - Pass the request on to an environment that has zip() -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What community software package gets your vote? PHPfox etc...
On Feb 19, 2008 8:41 PM, TS [EMAIL PROTECTED] wrote: Hello everyone. I'm not sure what the budget is but, obviously inexpensive would be nice. Someone turned me on to PHPfox. Yet I don't have any others to compare it to. If you all would be so kind as to put a shout out and vote on your favorite, I'd be very grateful. What about security? Do you care if it has a large number of publicly disclosed exploits in it's past? That'd be the first thing to come to (my) mind if I were about to put code someone else wrote on my web server. For example: http://search.securityfocus.com/swsearch?sbm=%2Fmetaname=alldocquery=phpfoxx=0y=0 Two exploits doesn't seem bad, but in what time span were they? Something to think about. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protected ZIP file with password
On Mon, February 18, 2008 4:16 pm, Shawn McKenzie wrote: In your php code you'll need the full path to biblioteca.php and to t.zip and the web user will need write permissions to the dir where you create t.zip. nitpik: The user needs write permission to just t.zip Unless zip does something funky with temp files within the directory containing t.zip or something weird-o like that? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Protected ZIP file with password
Use exec() and get any output that may be happening. I also suspect that the PATH you are using isn't a TRUE path, but some hacked up thing from your webhost. Look at the output of ?php phpinfo();? in biblioteca and see what PHP thinks is the current working directory. I had one webhost where some kind of chroot jail thingie made the paths look completely different in FTP, shell and PHP... On Mon, February 18, 2008 4:32 pm, Petrus Bastos wrote: I've tried without success... system(/usr/local/bin/zip -P /.automount/ipojuca/export/homeg03/golapa/public_html/mapdenguepe128/site/php/biblioteca/t.zip /.automount/ipojuca/export/homeg03/golapa/public_html/mapdenguepe128/site/php/biblioteca/biblioteca.php,$ret_val); On Feb 18, 2008 7:16 PM, Shawn McKenzie [EMAIL PROTECTED] wrote: In your php code you'll need the full path to biblioteca.php and to t.zip and the web user will need write permissions to the dir where you create t.zip. -Shawn Petrus Bastos wrote: Wolf, I'm sure actually working from the command line. /usr/local/bin/zip -P t.zip biblioteca.php adding: biblioteca.php (deflated 73%) On Feb 18, 2008 6:37 PM, Wolf [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Petrus Bastos [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Actually, I don't know anything about FreeBSD. I never used this system. But, here my zip command works fine at command line, why doesn't works with PHP? ! -- SNIP -- Have you talked with your server admins about the use of zip? Sounds like you have an environment set up by a blind monkey. Are you sure the command is actually working from the command line? What is the command and output? Wolf -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting tab delimited file to CSV
On Mon, February 18, 2008 12:08 pm, Graham Cossey wrote: proceed accordingly... My biggest gripe with tab delimited files is that they are quite a bit bigger than comma delimited files so I may have to split the large files I receive into smaller 'chunks' to allow them to be uploaded. This is not making sense... A tab-delimited file wil have a TAB character \t instead of comma , A tab WITHIN the data then needs escaping as \t or somesuch. But commas to not need escaping with quotes. And quotes don't need escaping with double-quotes. So tab-delimited should be a TINY bit smaller or the same size. Perhaps your users are just uploading more data. One thing I have noticed is that the files I create in my PHP script (The script breaks a large file into smaller files of 25,000 records/rows each.) when opened in Excel (by double-clicking the file in Windows Explorer) came up with an unrecognised file format message for all files except the first. If you ignore this message the tab delimited files open OK but the comma separated ones do not. The except the first made me think that there may be something hidden at the beginning of the file to say what type of data follows. Some CSV files include a header line with the names of the fields in the first line. This is less common in tab-delimited, but not unheard of. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xpath question
On Feb 19, 2008 8:13 PM, RJO [EMAIL PROTECTED] wrote: Hey guys, I have a form accepting a KML file from users and from there I want to draw polylines based on a KML file's PlacemarkerLineStringcoordinates element. The problem I am having is that sometimes the KML file can have a documentfolder or folderdocument or none of the above, or any number of random scenarios in the KML file making it hard to parse. To deal with this randomness I'm using an xpath and I think I have it right but it just wont work... the code: $result = $xml-xpath('Placemark/LineString/coordinates'); An the particular XML file I am trying to pull from looks like: ?xml version=1.0 encoding=UTF-8? kml xmlns=http://earth.google.com/kml/2.1; Document namecoehilltotweed.kml/name Style id=lineStyle LineStyle color6417/color width6/width /LineStyle /Style Folder name23-SEP-06/name Snippet maxLines=2 /Snippet description![CDATA[table trtdbDistance/b 139.0 mi /td/tr trtdbMin Alt/b 451.4 ft /td/tr trtdbMax Alt/b 1168.9 ft /td/tr /table]]/description Placemark namePath/name styleUrl#lineStyle/styleUrl LineString tessellate1/tessellate coordinates -77.827985,44.851878,311.109985 -77.827021,44.852114,313.993896 -77.827213,44.8506760001,313.513306 -77.827792,44.850955,313.513306 -77.830389,44.8533370001,315.916504 -77.833114,44.858379,317.358643 -77.8319330001,44.858508,313.993896 /coordinates /LineString /Placemark /Folder /Document /kml Any ideas why this won't work? Thanks! It's the namespace. I'm not positive (I can't test on this computer) but try this: $result = $xml-xpath(*[local-name()='Placemark' and namespace-uri()='http://earth.google.com/kml/2.1']/*[local-name()='LineString' and namespace-uri()='http://earth.google.com/kml/2.1']/*[local-name()='coordinates' and namespace-uri()='http://earth.google.com/kml/2.1']); That may be a little off, but that's the idea, anyway. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
Greg Donald wrote: On 2/18/08, Nick Stinemates [EMAIL PROTECTED] wrote: I have found, however, that if I ever need to return /multiple/ values, it's usually because of bad design and/or the lack of proper encapsulation. Yeah, that's probably why most popular scripting languages support it. In Ruby: def foo 1, 2 end a, b = foo In Python: def foo return 1, 2 a, b = foo In Perl: sub foo { return (1, 2); } (my $a, my $b) = foo; -- Greg Donald http://destiney.com/ Support != good design habits. Please read my other post which explains the reasoning. -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] www. not working
On Tuesday 19 February 2008, Daniel Brown wrote: On Feb 19, 2008 4:43 AM, Christoph [EMAIL PROTECTED] wrote: Don't do that. Some sites may or may not use www. for whatever reason... Usually screwed-up A-name records by incompetent sysadmins, but there it is... Really? So games.yahoo.com blogreport.salon.com mirror1.downloads.com are examples of screwed up records by incompetent sysadmins? No, they're properly-configured FQDNs. They're just irrelevant examples to the context in which Rich was relaying to the OP. Picture a server where the A records or CNAMEs don't exist for the www. alias. Or, conversely, where the only way to access the domain is by using the www. alias. Those, Christoph, are some of the things incompetent sysops do and on a surprisingly frequent basis. I see, so because I have garfieldtech.com and www.garfieldtech.com pointing to two entirely different servers in different states because I want them to do different things, I'm an incompetent sysop. Thanks, good to know. DNS was used for a lot of things long before the web came around, ya know. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What community software package gets your vote? PHPfox etc...
Well security is an issue always IMHO. However, there's no full proof security. I'm hoping for the groups expertise while voting on this to consider all of these things of course. In other words, picking the lesser evil is where I'm stand with your previous question. Thankyou for your comment. -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 9:51 PM To: php-general@lists.php.net Subject: Re: [PHP] What community software package gets your vote? PHPfox etc... On Feb 19, 2008 8:41 PM, TS [EMAIL PROTECTED] wrote: Hello everyone. I'm not sure what the budget is but, obviously inexpensive would be nice. Someone turned me on to PHPfox. Yet I don't have any others to compare it to. If you all would be so kind as to put a shout out and vote on your favorite, I'd be very grateful. What about security? Do you care if it has a large number of publicly disclosed exploits in it's past? That'd be the first thing to come to (my) mind if I were about to put code someone else wrote on my web server. For example: http://search.securityfocus.com/swsearch?sbm=%2Fmetaname=alldocquery=phpfo xx=0y=0 Two exploits doesn't seem bad, but in what time span were they? Something to think about. -- Greg Donald http://destiney.com/ -- 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] More than one values returned?
On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote: Support != good design habits. So you presume to have better design habits than the many language designers who implemented parallel assignment in their respective language? Right. http://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Parallel_assignment Please read my other post which explains the reasoning. Your reasoning is shit. min, max = 0, 0 is beautiful. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: fopen never ends?
Paul van Brouwershaven wrote: Nathan Rixham wrote: I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based host header in the request. I know that my browser is also waiting a long time, but strange that there is no timeout in fopen? My scripts are getting stuck and eventually they will hang my server. (when I start a new job every x minutes) Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue. fsockopen has no context and with stream_socket_client I have no timeout but stream_context_get_options is not returning the right data $options = stream_context_get_options($fp); Check out the first Note: section on this page. http://us3.php.net/manual/en/function.stream-socket-client.php First thing it tells you is that you can set a timeout for the connection using stream_set_timeout(). I know this can be done. I am running a PHP daemon that that acts as both a server and a client. Jim Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What community software package gets your vote? PHPfox etc...
On Tue, 2008-02-19 at 23:21 -0500, TS wrote: On Feb 19, 2008 8:41 PM, TS [EMAIL PROTECTED] wrote: Hello everyone. I'm not sure what the budget is but, obviously inexpensive would be nice. Someone turned me on to PHPfox. Yet I don't have any others to compare it to. If you all would be so kind as to put a shout out and vote on your favorite, I'd be very grateful. How about Chisimba? http://avoir.uwc.ac.za It is free (GPL) and has all the features of PHPFox and more. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Feb 19, 2008 11:52 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote: Support != good design habits. So you presume to have better design habits than the many language designers who implemented parallel assignment in their respective language? Right. http://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Parallel_assignment Please read my other post which explains the reasoning. Your reasoning is shit. dAAmn dude :D i agree though, being able to return multiple values from a function has nothing to do with good or bad design of a language. in fact if a language doesnt have support for it, likely it would not be in widespread use as is php. and also, nick, for the record, it has nothing to do with being strongly or weakly typed. take a look at c++, java, and .net; all strongly typed and all have pass-by-reference; thats what its for ;) and i dont want to act like the first person who said it because, C.R. Vegelin, said it first in this thread. (sorry ive been way busy lately :)) but to op, yes, you can of course return an aggregate structure, but there are many times where it is appropriate to use pass-by-reference instead, because, read: thats what the mechanism is designed for :) let me furnish you with the most common example i can think of. suppose you have a method that is returning a boolean status, but you want to get some data back out of it as well. then you have it return a boolean value, and toss a pass-by-reference parameter in there, eg. /** * do some crazy crap to some dudes account */ function doCrazyCrapToAccount($accountId, $someCrazyNewCrapOnTheAccount) { $wasSuccess = false; /// potentially alter $wasSuccess ... /// drop something meaningful in $someCrazyNewCrapOnTheAccount ... return $wasSuccess; } // then $accountId = 5; $crazyNewCrapOnAccount = null; if(doCrazyCrapToAccount($accountId, $crazyNewCrapOnAccount)) { echo $crazyNewCrapOnAccount; } and i was doing that in c++ back in o, 99' so yeah; nothing to do w/ loose typing, totally relevant; and thats technically how you return multiple values from a function, because lets face it; an aggregate is well, one thing, that just so happens to contain things, but again; its just one thing ;) -nathan
[PHP] unsure how to do this any help appreciated
To Whom this may Concern, Basically what im try to do is this (please bear with me im a php noob) require a remote file, if its blank then instead display a comment or another file (which ever is easier) Example: *_if http://launcher.worldofwarcraft.com/alert; contains nothing or contains Not Found or 404 error, display Sorry no updates at this time or No server notices at this time or include blah.php, otherwise display _**_http://launcher.worldofwarcraft.com/alert._* Because the source is remotely updated, the information contained at this address is beyond my control, so i need this to control what is said on my end I'm not sure how to get this one to work Any help would be appreciated or a direction to where to find something that will help me, Pixmyster Guild Master Synergy Of Triumphalism Horde - Spinebreaker - US Realm World Of Warcraft Guild Website: www.synergyoftriumphalism.com Email: [EMAIL PROTECTED]
Re: [PHP] More than one values returned?
Nathan Nobbe wrote: On Feb 19, 2008 11:52 PM, Greg Donald [EMAIL PROTECTED] wrote: On Feb 19, 2008 9:27 PM, Nick Stinemates [EMAIL PROTECTED] wrote: Support != good design habits. So you presume to have better design habits than the many language designers who implemented parallel assignment in their respective language? Right. http://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Parallel_assignment Please read my other post which explains the reasoning. Your reasoning is shit. dAAmn dude :D i agree though, being able to return multiple values from a function has nothing to do with good or bad design of a language. in fact if a language doesnt have support for it, likely it would not be in widespread use as is php. and also, nick, for the record, it has nothing to do with being strongly or weakly typed. take a look at c++, java, and .net; all strongly typed and all have pass-by-reference; thats what its for ;) and i dont want to act like the first person who said it because, C.R. Vegelin, said it first in this thread. (sorry ive been way busy lately :)) but to op, yes, you can of course return an aggregate structure, but there are many times where it is appropriate to use pass-by-reference instead, because, read: thats what the mechanism is designed for :) let me furnish you with the most common example i can think of. suppose you have a method that is returning a boolean status, but you want to get some data back out of it as well. then you have it return a boolean value, and toss a pass-by-reference parameter in there, eg. /** * do some crazy crap to some dudes account */ function doCrazyCrapToAccount($accountId, $someCrazyNewCrapOnTheAccount) { $wasSuccess = false; /// potentially alter $wasSuccess ... /// drop something meaningful in $someCrazyNewCrapOnTheAccount ... return $wasSuccess; } // then $accountId = 5; $crazyNewCrapOnAccount = null; if(doCrazyCrapToAccount($accountId, $crazyNewCrapOnAccount)) { echo $crazyNewCrapOnAccount; } and i was doing that in c++ back in o, 99' so yeah; nothing to do w/ loose typing, totally relevant; and thats technically how you return multiple values from a function, because lets face it; an aggregate is well, one thing, that just so happens to contain things, but again; its just one thing ;) -nathan Not once did I knock By Reference value passing or pointers. I said, simply, returning an array of objects was usually an indication of poor design. -- == Nick Stinemates ([EMAIL PROTECTED]) http://nick.stinemates.org AIM: Nick Stinemates MSN: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More than one values returned?
On Tue, 2008-02-19 at 21:24 -0800, Nick Stinemates wrote: I said, simply, returning an array of objects was usually an indication of poor design. Please elaborate as to the why of it being an indication of poor design. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php