Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote: where is the part that it join()'s things together? it's: $in_list = '.join(',',$list).'; Good what is the output of the join() call it's: '7orange50lbs','8purple60lbs' //once echo'd Fine $query_One = SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN({$in_list}); This is the results of $query_One: PHP echo returns: SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs) MySQL returns: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0008 sec) SQL query: SELECT * FROM shoe WHERE CONCAT( size, color, weight ) IN (SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs') ??? What is wrong with the above statement? This should be an easy one for you to figure out? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Give up? Well, looks like you are inserting the sql statement inside it self It should look like this SELECT * FROMshoe WHERE CONCAT( size, color, weight ) IN('7orange50lbs','8purple60lbs') not SELECT * FROM shoe WHERE CONCAT( size, color, weight ) IN (SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs') Notice the sub-select??? Find where you are inserting the SQL into itself and remove it, and you might have the answer to your problems. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP as a strategic BUSINESS language
Mark Allen wrote: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL That's a very sweeping statement Mark. I use PHP in my business all the time and through it, I generally solve many problems. Perhaps if you've got specific gripes you can post some examples? Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
hmm I work for a large multinational transporting/logistics company, and the complete business management/tracking/billing/etc system is written in PHP... and it is working with almost zero downtime since the last four or five years... however it does have bugs and flaws in it - but those are the developers' fault not the language... so I can't imagine what the hell are you talking about greets Zoltán Németh 2007. 07. 4, szerda keltezéssel 22.17-kor Mark Allen ezt írta: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memory_limit higher than 256MB
Hello Chris, Chris wrote: Maybe in the typo3 code they have a memory_limit set: Yes! You were right. There was a ini_set('memory_limit', '256M'); hardcoded in the extension. (for the archive: it was in typo3_src-4.1.1/typo3/sysext/impexp/class.tx_impexp.php on line 183) Commenting the line resolves the Problem. Unfortunatly I did not have the option to use a mysqldump as I updated my typo3-installation and had quite a bit of old data in the DB. Therefore I wanted to add the content into a clean Installation. It worked. Thank you so much! Greets, Tobias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Re 2D: [ 2CPHP 2D] 2CRe 2D: 2Cphp security books
Andrew Hutchings wrote: In article [EMAIL PROTECTED] [EMAIL PROTECTED](Jochem Maas) wrote: OK, well, for example page 3 of the book suggests making PHP output errors into Apache's error_log. To do this on Linux it means PHP would have to be run as root. huh? funny thing is that on all the machines I work with Apache runs under it own user (apart from at start up when it briefly urns as root before switching), I run php as an Apache module (I'm assuming we're not talking about php cli given that we're mentioning Apache), this means php is running in the context of the apache user and btw is quite capable of logging to the Apache error_log Exactly, the initial process runs as root, and this is the process that does the logging, it would be another security issue to have your logs set as apache's owner. PHP is run as apache's user (unless you use something suPHP) so if you use PHP's error handler function (not the thing that sends data to the error logs) to write to apache's logs they would either have to be owned by apache or php would have to run as root. ok - I didn't realise the logging occurs under a root user process, I checked and can confirm that you are correct in that respect. I would assume though that Chris was referring to the use of error_log() which would mean php doesn't need any direct access to the log file - the 'log error' request is handed off to apache (which I'll assume securely manages to hand the request off to the root process that performs the actual write). therefore using error_log(), at least, doesn't pose a direct threat (a flaw may exist at the apache level but that is not something php can do much about - and as such any apache module would suffer from the same problem). If Chris did mean that one could/should write to apache's error_log() manually (i.e. not via error_log()) then I think that would constitute an incorrect advisement - giving read/write access to a webprocess for a file that should be accessible only by root doesn't seem right :-). Maybe Chris picks this thread up and offers some clarity on the matter, I'm sure he'd be the first to admit a mistake and take on board new/improved procedures. To give him credit it's probably quite tough to be one of only a very few 'php security' guys ... everything he says is taken apart with a fine toothcomb and being a kind of 'frontman' he takes all the flack, such is life. You are entitled to your opinions, and I am entitled to mine. If you ai. believe I am spreading FUD, so be it. okay, FUD might have been too strong a word - it puts you in the same league as Steve Ballmer and that probably not fair at all :-) But that example _is_ a security flaw. tangent the greatest flaw regarding security is to assume that it exists at all ... those understand this won't need to comment, those that don't please forget I said anything. :-) /tangent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
Mark Allen wrote: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL A few points... * This is a reactive list. The content is usually based upon the questions being asked. If you have specific issues you need help with, feel free to ask. We can't read your mind and provide the documentation you need to solve [your] BUSINESS issues. * This is a PHP list, not a BUSINESS logic list (is it important that BUSINESS is all caps?). If you have problems with PHP we're more than happy to help. If you need help designing your DB schema to solve your problem then you should probably be looking elsewhere. * As a language I see nothing that PHP lacks that would prevent it from being used in Real World business solutions (since when were real and world nouns?). -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] NAT Traversal
Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest -- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs)
Re: [PHP] NAT Traversal
Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NAT Traversal
Please include the list when replying. Fahad Pervaiz wrote: Thanks for the reply!!! I need to get the internal IP of the client. Is it possible to get it via javascript?? I have tried to search some scripts but found nothing useful. No, you can't. Javascript runs in a sandbox that limits what it can do. You could do this by utilising other client-side technology such as ActiveX controls or possibly Java. Both would require the user to give them permission to access that information. However, think about what you are trying to do. Say my local IP is 192.168.0.5. I got through a gateway (NAT server) at 192.168.0.1 which proxies my connections out to the internet with the public IP 80.1.1.1. Your server, on the internet, cannot access my local machine (192.168.0.5) from outside my network unless the gateway (NAT server) forwards ports through to it, which is highly unlikely. So even if you could get my local IP it would not be of any use to you. Why don't you tell us what you are actually trying to do - there may be a better way to do it. -Stut -- http://stut.net/ On 7/5/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. -Stut -- http://stut.net/ http://stut.net/ -- Regards Fahad Pervaiz www.ecommerce-xperts.com http://www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: NAT Traversal
Stut wrote: Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. Yeah the only way would be to get the client to supply it. As Stut says I'm not sure why you'd gain anything from doing this as you would not be able to contact that IP directly anyway. If you are trying to open a connection to the client machine from the server this is pretty much impossible. Either the firewall would have to forward an external port to the internal client you could use or you could use something along the lines of UDP packets sent to the firewalls NAT return ports in a way that fools it into thinking it is a reply to an outgoing package. This is (roughly) how methods such as STUN work for routing SIP traffic around NATed firewalls. However all this said, all of this is client driven, and I can't actually think of a reason for even trying to do this that isn't erm. dodgy! :p Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NAT Traversal
What i am trying to do is that, i have an ecommerce shopping cart application developed and deployed on many servers. Now i want to put support for the clients having cookies disabled. There are two options to do it. 1. Pass session id in the url ($_GET) array (encrypted or unencrypted) 2. Store session ID against IP in the database Option 1 requires large amount of work and changes required even on all the sytem that have the ecommerce application, so that makes it less feasable Option 2 seems much doable as updates required in the deployed systems is less. Theoratically it should work as follows: If client is using a proxy then store session id against actual IP + proxy addr If client is using NAT then store session against the NAT addr + the internal IP If client is not behind nat and not using proxy then store against the public IP Thats why i was looking for a way to get the internal ip, somehow I don't need to access the client directly but the reason to get his internal IP is to store session id against client's nat addr+internal ip Hope you get my point On 7/5/07, Stut [EMAIL PROTECTED] wrote: Please include the list when replying. Fahad Pervaiz wrote: Thanks for the reply!!! I need to get the internal IP of the client. Is it possible to get it via javascript?? I have tried to search some scripts but found nothing useful. No, you can't. Javascript runs in a sandbox that limits what it can do. You could do this by utilising other client-side technology such as ActiveX controls or possibly Java. Both would require the user to give them permission to access that information. However, think about what you are trying to do. Say my local IP is 192.168.0.5. I got through a gateway (NAT server) at 192.168.0.1 which proxies my connections out to the internet with the public IP 80.1.1.1. Your server, on the internet, cannot access my local machine (192.168.0.5) from outside my network unless the gateway (NAT server) forwards ports through to it, which is highly unlikely. So even if you could get my local IP it would not be of any use to you. Why don't you tell us what you are actually trying to do - there may be a better way to do it. -Stut -- http://stut.net/ On 7/5/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. -Stut -- http://stut.net/ http://stut.net/ -- Regards Fahad Pervaiz www.ecommerce-xperts.com http://www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs)
Re: [PHP] NAT Traversal
Fahad Pervaiz wrote: What i am trying to do is that, i have an ecommerce shopping cart application developed and deployed on many servers. Now i want to put support for the clients having cookies disabled. There are two options to do it. 1. Pass session id in the url ($_GET) array (encrypted or unencrypted) 2. Store session ID against IP in the database 3. Require cookies Seriously, I think you'll find the percentage of visitors who will have cookies disabled will be very small. Option 1 requires large amount of work and changes required even on all the sytem that have the ecommerce application, so that makes it less feasable Read up on the session.use_trans_sid php.ini setting on this page: http://php.net/session - note that this has security implications. Option 2 seems much doable as updates required in the deployed systems is less. Theoratically it should work as follows: If client is using a proxy then store session id against actual IP + proxy addr If client is using NAT then store session against the NAT addr + the internal IP If client is not behind nat and not using proxy then store against the public IP No, you can't do this. Even if you could get the clients local IP you would still be at the mercy of load-balanced proxies where each subsequent request from any given client could come from a different IP. Thats why i was looking for a way to get the internal ip, somehow I don't need to access the client directly but the reason to get his internal IP is to store session id against client's nat addr+internal ip Hope you get my point I do, and you're by no means the first person to try to solve this problem. The only reliable(ish) information you can use is an ID you give to the client. Whether that's as a cookie or by passing it back and forth with every request. I suggest you check out how some of the more popular open source ecommerce projects handle this, but don't necessarily take what they do as the best way to do it. -Stut PS. For someone with the domain name ecommerce-xperts.com you're scaring me! -- http://stut.net/ On 7/5/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Please include the list when replying. Fahad Pervaiz wrote: Thanks for the reply!!! I need to get the internal IP of the client. Is it possible to get it via javascript?? I have tried to search some scripts but found nothing useful. No, you can't. Javascript runs in a sandbox that limits what it can do. You could do this by utilising other client-side technology such as ActiveX controls or possibly Java. Both would require the user to give them permission to access that information. However, think about what you are trying to do. Say my local IP is 192.168.0.5 http://192.168.0.5. I got through a gateway (NAT server) at 192.168.0.1 http://192.168.0.1 which proxies my connections out to the internet with the public IP 80.1.1.1 http://80.1.1.1. Your server, on the internet, cannot access my local machine (192.168.0.5 http://192.168.0.5) from outside my network unless the gateway (NAT server) forwards ports through to it, which is highly unlikely. So even if you could get my local IP it would not be of any use to you. Why don't you tell us what you are actually trying to do - there may be a better way to do it. -Stut -- http://stut.net/ On 7/5/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. -Stut -- http://stut.net/ http://stut.net/ -- Regards Fahad Pervaiz www.ecommerce-xperts.com http://www.ecommerce-xperts.com http://www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- Regards Fahad Pervaiz www.ecommerce-xperts.com http://www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] NAT Traversal
Thanx Rick is there any solution that u recommend or is there any tutorial available that can help in resloving this problem Also i have observed that websites like ebay and amazon uses option1 approach i.e. they pass encrypted key on each page. On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: a problem that i see with your approach is that you're not taking into account the effects of clientA dropping their IPaddress (NATted or otherwise) and it being picked up by clientB (e.g., in a dhcp environment). if clientB then connects to your site you'll still treat it as clientA, with a large data leak resulting. [even item2 in option1 has this problem.] you need an approach that will uniquely identify the client and won't be handing one client's data to another client in a new session. in short, in an open environment, using the ipnumber (or ipnumber pair) as your key is a bad idea as it will likely result in inconsistencies and data leaks. neither of which will win you friends, especially in an ecommerce context. as a side note, if someone has cookies off there's a good probability that they have java and javascript turned off too, so if there were a way to get the client-side ipnumber (in a proxy/NATted environment) using java/javascript, it's a bit unlikely that it would work for the user who has already turned off cookies. - Rick Original Message Date: Thursday, July 05, 2007 04:38:35 PM +0500 From: Fahad Pervaiz [EMAIL PROTECTED] To: Stut [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] NAT Traversal What i am trying to do is that, i have an ecommerce shopping cart application developed and deployed on many servers. Now i want to put support for the clients having cookies disabled. There are two options to do it. 1. Pass session id in the url ($_GET) array (encrypted or unencrypted) 2. Store session ID against IP in the database Option 1 requires large amount of work and changes required even on all the sytem that have the ecommerce application, so that makes it less feasable Option 2 seems much doable as updates required in the deployed systems is less. Theoratically it should work as follows: If client is using a proxy then store session id against actual IP + proxy addr If client is using NAT then store session against the NAT addr + the internal IP If client is not behind nat and not using proxy then store against the public IP Thats why i was looking for a way to get the internal ip, somehow I don't need to access the client directly but the reason to get his internal IP is to store session id against client's nat addr+internal ip Hope you get my point On 7/5/07, Stut [EMAIL PROTECTED] wrote: Please include the list when replying. Fahad Pervaiz wrote: Thanks for the reply!!! I need to get the internal IP of the client. Is it possible to get it via javascript?? I have tried to search some scripts but found nothing useful. No, you can't. Javascript runs in a sandbox that limits what it can do. You could do this by utilising other client-side technology such as ActiveX controls or possibly Java. Both would require the user to give them permission to access that information. However, think about what you are trying to do. Say my local IP is 192.168.0.5. I got through a gateway (NAT server) at 192.168.0.1 which proxies my connections out to the internet with the public IP 80.1.1.1. Your server, on the internet, cannot access my local machine (192.168.0.5) from outside my network unless the gateway (NAT server) forwards ports through to it, which is highly unlikely. So even if you could get my local IP it would not be of any use to you. Why don't you tell us what you are actually trying to do - there may be a better way to do it. -Stut -- http://stut.net/ On 7/5/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Fahad Pervaiz wrote: Hello, I want to get the actual IP of a client behind NAT or a Firewall. Is there anyway to traverse NAT to get the actuall/real IP of the client to check weather its reachable directly or not. OR Is there anyother way to do that. Plz suggest No, you can't. And even if you could it wouldn't do you any good. Think about what NAT does and you'll realise why. As for firewalls... if there was a way around it there'd be no point in having the firewall. -Stut -- http://stut.net/ http://stut.net/ -- Regards Fahad Pervaiz www.ecommerce-xperts.com http://www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- End Original Message --
[PHP] Re: help curl followlocation
Hello, Thanks for your mail. However, I am not clear on how to use curl for my purpose. Kindly help me. In order to authenticate myself on a remote server, I have tried the following two ways: Method I ?php header(Location: http://remote.site.address;); ? On the resulting html page containing a form, I am able to pass credential details and get through. Method II I try the script ?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, http://remote.site.address;); curl_setopt($curl, CURLOPT_PROXY, proxy:port); curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); curl_setopt($curl, CURLOPT_COOKIEFILE, /tmp/cookie); curl_setopt($curl, CURLOPT_COOKIEJAR, /tmp/cookie); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 40); curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($curl, CURLOPT_HTTPHEADER, array(Pragma: )); $result=curl_exec($curl); curl_close($curl); echo $result; ? The permissions set on /tmp/cookie file are 0757. However, when I furnish credential details, I get error as Please enable cookies on your browser. Kindly help me understand how to set these cookies. Thanks -gowranga When your PHP script does curl it does not interact in any way, shape, or form with the Location bar of the browser... That's kinda the whole POINT of curl, to be able to snarf down content from inside your script, instead of pushing the user off to some other site. If you just want to send the user off to Google's site, you can skip curl and use: header(Location: http://google.com/;); -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Magis_qoutes + linux + smarty
Hi Guys I have a Problem wioth Smarty i have set the MAGIC_QOUTES_GPC =ON and the templates are not getting created. however when it is off ther created and everything is working fine. thsi happens only on linux. On windows it has no problem -- Have A plesant Day Chetan. D. Rane Location: India Contact: +91-9844922489 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] Magis_qoutes + linux + smarty
chetan rane wrote: Hi Guys I have a Problem wioth Smarty i have set the MAGIC_QOUTES_GPC =ON and the templates are not getting created. however when it is off ther created and everything is working fine. thsi happens only on linux. On windows it has no problem This list is for general PHP questions. Try one of the smarty mailing lists... http://smarty.php.net/resources.php?category=7 -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
I believe that any programming language is what you make of it... if you use it to write games, it's a games language Write webapps for your business, it's a business language... And this is by far the best resource I have found for getting answers to questions about PHP... It's taken a completely newbie to PHP Programming, up to only a SOMEWHAT newbie in a very short time period. Anyway... Just My 2¢ :) On Jul 4, 2007, at 10:17 PM, Mark Allen wrote: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how PHP is batter?
Chris wrote: Either phrase can be a good or a bad thing, it all depends on tone - Scottish is very like Japanese in that respect :p with regard to batter - isn't it the scots that have pechant for covering marsbars with the stuff and deepfrying them? The aussies do it too - are we just as crazy as the scots? Oy, speak for yerself, cobber. Even frying in Coopers beer batter couldn't make a mars bar taste like food :-) Cheers -- David Robley A seminar on Time Travel will be held two weeks ago. Today is Sweetmorn, the 40th day of Confusion in the YOLD 3173. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
let's break this down shall we. 1. there is no such thing a business [programming] language (you can lie through your teeth and sell shit in any language ;-), although some language may be synonymous with business because of their frequent use to solve business specific logic problems. 2. business is not as important as you think it is - writing it in all-caps doesn't make it so either. 3. nowhere has it ever been claimed that this list focuses on business issues (unless you're talking about the business of writing code in it's own right, but I don't believe you are) 4. how do I do X questions are the basis of any craft - if you're in need of discussing business issues then that suggests you have questions regarding something, this essentially comes down to how do I do X. you seem to consider that questions posed beginners/intermediates as below your level of expertise, possibly those that you turn to for answers regarding 'business issues' regard you in the same fashion? 5. you maybe suffering from some deeply repressed sexual frustrations - given by the so called freudian slip 'Good Lick', ok it was most like a typo :-) 6. IBM, Oracle and others seem to be less sure about whether php will ever be a major player in the business solutions arena (often referred to as 'being enterprise ready') ... there may be some way to go in this sense but there are plenty of people doing their best to make it possible by working on the core of php and developing frameworks/utilities that are up to the job. 7. if you have a question or issue you would like to discuss why then start the ball rolling - no one here has a direct link into your head that allows them to answer questions you have never asked. 8. php is not the answer to everything, just ask my girlfriend. Mark Allen wrote: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: developer seeking document writer
At 10:15 AM -0400 7/4/07, Robert Cummings wrote: On Wed, 2007-07-04 at 10:04 -0400, tedd wrote: Plus, documenting someone else's code always pays less than documenting you're own. I'm not so sure, I found documenting my own stuff paid 0 whereas documenting stuff while being paid hourly or even while on salary had a verifiable monetary value. That said, I don't recall that Adel was offering incentives :) Two things (I'm sure you agree): 1. Documenting your own stuff, (salary, hourly, or not) pays you back later; 2. Usually, you get what you pay for -- paying zip usually produces zip. 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] Re: PHP Brain Teasers
On Thu, 2007-07-05 at 10:19 -0400, Daniel Brown wrote: An easy one going on a previous theme. And see? Every so often, I come up with some good ideas like this thread albeit more intrusive than productive :-\ ? global $eggs; global $chickens; function hatch($eggs) { return 1; } if(!hatch($eggs)) { echo Null; } else { count($chickens); } ? Don't count your chickens till they hatch. 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
Re: [PHP] Re: PHP Brain Teasers
On 7/4/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-07-04 at 19:38 +0100, Colin Guthrie wrote: Robert Cummings wrote: For every action there is an equal and opposite reaction. Thanks Abe, Sir Abraham Newton - father of modern mechanics! It's the new physics where you have to lobby to get things to move :/ 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 An easy one going on a previous theme. And see? Every so often, I come up with some good ideas like this thread albeit more intrusive than productive :-\ ? global $eggs; global $chickens; function hatch($eggs) { return 1; } if(!hatch($eggs)) { echo Null; } else { count($chickens); } ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP as a strategic BUSINESS language
[snip] I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL [/snip] I love sweeping generalizations. So I must ask, are C++, SQL, Fortran, LiSP et.al., strategic BUSINESS languages? Can you put your BUSINESS logic into Visual Studio or any other IDE and have it produce workable code? (Clarion tried and failed miserably.) What is a strategic BUSINESS language? Is it a 4GL or 5GL language? Would we call it sBl? Are you using an sBl now? What is it? How does it solve BUSINESS issues? PHP solves real-world problems every day in thousands of businesses across the globe, in my business alone I can count dozens of real-world issues that are handled by PHP every hour of every day. Like any other language properly handled it can be used to build mission-critical enterprise level business solutions. BTW, I'll bet that you never return to have a meaningful discussion on the topic. Would be an interesting discussion and might bear some valuable fruit, but you will just lurk to see what responses come to your statements and probably smirk at those with whom you perceive to have less than your superior, if somewhat short-sided, intellect. Provide just one real-world business problem example and I am sure that you will see that this group can apply PHP to format a solution to that problem. Since you're lurking and will likely not respond I will pose a real-world BUSINESS problem and you can watch this group arrive at a solution, likely in a number of ways -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
Sorry, That was a typo there's on one IN clause. here is how it reads: SELECT * FROM central WHERE CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs'). So in my table I have 8 in size column, purple in color column, and 60lbs in weight column. Since the concatenated value will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] kvigor wrote: where is the part that it join()'s things together? it's: $in_list = '.join(',',$list).'; Good what is the output of the join() call it's: '7orange50lbs','8purple60lbs' //once echo'd Fine $query_One = SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN({$in_list}); This is the results of $query_One: PHP echo returns: SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs) MySQL returns: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0008 sec) SQL query: SELECT * FROM shoe WHERE CONCAT( size, color, weight ) IN (SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs') ??? What is wrong with the above statement? This should be an easy one for you to figure out? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Give up? Well, looks like you are inserting the sql statement inside it self It should look like this SELECT * FROM shoe WHERE CONCAT( size, color, weight ) IN('7orange50lbs','8purple60lbs') not SELECT * FROM shoe WHERE CONCAT( size, color, weight ) IN (SELECT * FROM shoe WHERE CONCAT(size,color,weight) IN('7orange50lbs','8purple60lbs') Notice the sub-select??? Find where you are inserting the SQL into itself and remove it, and you might have the answer to your problems. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
On 05/07/07, Jochem Maas [EMAIL PROTECTED] wrote: 6. IBM, Oracle and others seem to be less sure about whether php will ever be a major player in the business solutions arena (often referred to as 'being enterprise ready') ... there may be some way to go in this sense but there are plenty of people doing their best to make it possible by working on the core of php and developing frameworks/utilities that are up to the job. I don't think IBM have much doubts:- http://www.ibm.com/developerworks/opensource/top-projects/php.html http://www.zend.com/products/zend_core/zend_core_for_ibm Alan Disclaimer: I work for IBM but these are my own views. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. i usually take a statement of this nature to mean the person saying it doesnt know much about php. have you heard of facebook http://www.facebook.com/, that looks like a business to me :-P -nathan On 7/5/07, Alan Milnes [EMAIL PROTECTED] wrote: On 05/07/07, Jochem Maas [EMAIL PROTECTED] wrote: 6. IBM, Oracle and others seem to be less sure about whether php will ever be a major player in the business solutions arena (often referred to as 'being enterprise ready') ... there may be some way to go in this sense but there are plenty of people doing their best to make it possible by working on the core of php and developing frameworks/utilities that are up to the job. I don't think IBM have much doubts:- http://www.ibm.com/developerworks/opensource/top-projects/php.html http://www.zend.com/products/zend_core/zend_core_for_ibm Alan Disclaimer: I work for IBM but these are my own views. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Real-World BUSINESS Problem
PROBLEM I need to automatically create packing lists at the end of each day for items ordered through our warehouse inventory control system. Each packing list is related to a retail location. The packing list must be printed so that order pickers can get the materials and package for shipment to the locations. Each packing list must be archived electronically. RESOURCES Data from the inventory control system and the retail location database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
{snip=all} Actually, PHP is a phenomenal, scalable, and brilliantly-extensible ?=strtolower(BUSINESS);? language. Yahoo!, IBM, Google, and (of course) Zend are just a few of the multi-million and billion dollar players. The company for whom I'm building web and desktop-level, as well, a multi-million dollar corporation, and the applications are not strictly web-based. In fact, I've developed full-scale client-server systems, complete with graphical front-ends (using GTK+, REALBasic, or other simple front-end, GUI faceplates). Of the last three nine-figure-valued (not including beyond the decimal point! ;-P) companies I've consulted or done programming for, all three utilized PHP. One as a core component of their business model, and two to compliment their existing technology. So just because it doesn't work for you doesn't mean that it's not ever going to be a major player in Real World business solutions. Real World[TM] business solutions are discovered by recognizing a problem or identifying a need, defining that problem or need, and developing a solution. No language ever created --- or that ever WILL be created --- will ever be a business solution; it will be the masters of those languages that will mold that solution. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Real-World BUSINESS Problem
Jay Blanchard wrote: PROBLEM I need to automatically create packing lists at the end of each day for items ordered through our warehouse inventory control system. Each packing list is related to a retail location. The packing list must be printed so that order pickers can get the materials and package for shipment to the locations. Each packing list must be archived electronically. RESOURCES Data from the inventory control system and the retail location database. Hire a SAP consultancy to create a bespoke app for you. Their highly paid (and therefore, I assume, competent) sales people tell me they're the best choice for anything BUSINESS. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
At 10:17 PM -0400 7/4/07, Mark Allen wrote: I had high hopes for it when I started down the path, and was glad to find this list thinking that it would be a great resource for using PHP to help solve BUSINESS issues but basically 80% of the questions have nothing to do with BUSINESS issues but how do I do X questions which IMO should NOT be necessary for a true BUSINESS programming language. Those that aren't in the 80% are Tricks/hacks, something to show off and do not represent a solution to actually make PHP a language that can solve real world problems. I'll keep it in my toolbox for the simple, quick way to get something to the inter/intranet but other than that it's not ever going to be a major player in Real World business solutions. Good Lick ALL Sounds like reflections in a mirror, dude. True BUSINESS is using the tools at hand to make money. If you have to wait for someone else to create an approved way for you to do business, then you'll always be a follower picking up crumbs from someone else's table. I've probably pissed away more money than you'll ever make -- and php works fine for me. 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] Re: php security books
At 11:23 AM -0400 7/4/07, Andrew Hutchings wrote: In article [EMAIL PROTECTED] [EMAIL PROTECTED](Mark Kelly) wrote: Hi. On Wednesday 04 July 2007 13:01, Andrew Hutchings wrote: Avoid the O'Reilly one as it is flawed. In what way? Its written by Chris Shiflett, isn't that enough reason? As will post written by you will be sufficient reason for my kill file. 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] PHP - QuickBooks
I usually don't post a question to the list, since Google is my friend, but this is somewhat of an urgent question that I don't feel qualified to answer 100% affirmatively. So as I research the Internet for some quality information, I'm hoping one (or more) of you have had some experience in this area Is there a simple way to interface QuickBooks using PHP, or will I need to convert my data to a common format (such as CSV) and import it into QB that way? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP - QuickBooks
Hi Daniel, There is a QB format. What you will have to do AFAIK is have PHP create the file then have QB import it. As far as Live changes, the only thing I have even glanced at is: http://www.devx.com/xml/Article/30482 Take care, Leonard On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: I usually don't post a question to the list, since Google is my friend, but this is somewhat of an urgent question that I don't feel qualified to answer 100% affirmatively. So as I research the Internet for some quality information, I'm hoping one (or more) of you have had some experience in this area Is there a simple way to interface QuickBooks using PHP, or will I need to convert my data to a common format (such as CSV) and import it into QB that way? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leonard Burton, N9URK http://www.jiffyslides.com [EMAIL PROTECTED] [EMAIL PROTECTED] The prolonged evacuation would have dramatically affected the survivability of the occupants. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
Alan Milnes wrote: On 05/07/07, Jochem Maas [EMAIL PROTECTED] wrote: 6. IBM, Oracle and others seem to be less sure about whether php will ever be a major player in the business solutions arena (often referred to as 'being enterprise ready') ... there may be some way to go in this sense but there are plenty of people doing their best to make it possible by working on the core of php and developing frameworks/utilities that are up to the job. I don't think IBM have much doubts:- given your disclaimer you are better positioned to opine over whether IBM is serious about php and it's potential, I was merely pointing out to the OP that there is plenty of evidence that they are *at the very least* taking an interest - and such interest taking from a major IT corporation normally is an indicator that the technology in question has some value to the business/enterprise community. I was personally under the impression that they're taking php quite seriously :-) http://www.ibm.com/developerworks/opensource/top-projects/php.html http://www.zend.com/products/zend_core/zend_core_for_ibm Alan Disclaimer: I work for IBM but these are my own views. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP - QuickBooks
On 7/5/07, Leonard Burton [EMAIL PROTECTED] wrote: Hi Daniel, There is a QB format. What you will have to do AFAIK is have PHP create the file then have QB import it. As far as Live changes, the only thing I have even glanced at is: http://www.devx.com/xml/Article/30482 Take care, Leonard On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: I usually don't post a question to the list, since Google is my friend, but this is somewhat of an urgent question that I don't feel qualified to answer 100% affirmatively. So as I research the Internet for some quality information, I'm hoping one (or more) of you have had some experience in this area Is there a simple way to interface QuickBooks using PHP, or will I need to convert my data to a common format (such as CSV) and import it into QB that way? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leonard Burton, N9URK http://www.jiffyslides.com [EMAIL PROTECTED] [EMAIL PROTECTED] The prolonged evacuation would have dramatically affected the survivability of the occupants. Excellent, Leonard, that was EXACTLY the information I was looking for. Thanks! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote: Sorry, That was a typo there's on one IN clause. here is how it reads: SELECT * FROM central WHERE CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs'). So in my table I have 8 in size column, purple in color column, and 60lbs in weight column. Since the concatenated value will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Ok, well, here is what I would do now. Just to make sure things are as we are assuming they are. SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central print the results of that sql and see if combined_string looks like what we think it should be. This you can do in phpmyadmin. oh, what is up with the naming conventions? Trying to trick us? To me it would not be obvious that you are storing colors in column for what looks like a city name. Just wondering... -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Real-World BUSINESS Problem
Okay. All of the orders are in your database, correct? 1. Write a query that selects all of the days orders from 12:00am-11:59pm. 2. Create a form for the specific data and layout you want in your packing slip. 3. In your loop for each record, send the data to a printer. 4. For your electronic copy you could: 4a. Leave the data as it is in your DB and just populate the slip upon request. 4b. Inside the loop add a query to save only the slip data to a new table. Since you already have all of the data it really shouldn't be very hard to pull it out, populate your form, send each form to a printer, and populate an electronic form on demand based on the input of an order number. On 7/5/07, Jay Blanchard [EMAIL PROTECTED] wrote: PROBLEM I need to automatically create packing lists at the end of each day for items ordered through our warehouse inventory control system. Each packing list is related to a retail location. The packing list must be printed so that order pickers can get the materials and package for shipment to the locations. Each packing list must be archived electronically. RESOURCES Data from the inventory control system and the retail location database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a strategic BUSINESS language
Daniel Brown wrote: {snip=all} Actually, PHP is a phenomenal, scalable, and brilliantly-extensible ?=strtolower(BUSINESS);? language. Yahoo!, IBM, Google, and (of course) Zend are just a few of the multi-million and billion dollar players. The company for whom I'm building web and desktop-level, as well, a multi-million dollar corporation, and the applications are not strictly web-based. In fact, I've developed full-scale client-server systems, complete with graphical front-ends (using GTK+, REALBasic, or other simple front-end, GUI faceplates). Of the last three nine-figure-valued (not including beyond the decimal point! ;-P) companies I've consulted or done programming for, all three utilized PHP. One as a core component of their business model, and two to compliment their existing technology. So just because it doesn't work for you doesn't mean that it's not ever going to be a major player in Real World business solutions. Real World[TM] business solutions are discovered by recognizing a problem or identifying a need, defining that problem or need, and developing a solution. No language ever created --- or that ever WILL be created --- will ever be a business solution; it will be the masters of those languages that will mold that solution. very well put. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is your script being run via the CLI or the web? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP - QuickBooks
On 7/5/07, Bob Covell [EMAIL PROTECTED] wrote: Daniel, We have found that changing data (correctly) in QB quite a task. Once we saw how we could really mess up data integrity we opted for a read only solution by pulling out the exact tables we needed. We used AccessBooks RT from synergration. http://www.synergration.com/ http://www.synergration.com/accessBooksRT/ This solution allowed us to store the information in MySql. Once in here you can do just about anything you want, minus putting it back into QB. -Bob -Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, July 05, 2007 9:48 AM To: PHP List Subject: [PHP] PHP - QuickBooks I usually don't post a question to the list, since Google is my friend, but this is somewhat of an urgent question that I don't feel qualified to answer 100% affirmatively. So as I research the Internet for some quality information, I'm hoping one (or more) of you have had some experience in this area Is there a simple way to interface QuickBooks using PHP, or will I need to convert my data to a common format (such as CSV) and import it into QB that way? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Right, but unfortunately, my purposes require the ability to successfully and reliably write back to the QuickBooks database. Here's the actual scenario: Selling products online via a LAMP site. Need to synchronize the orders to QB to interface with the shipping department, who absolutely, 100% will not be moved from their QB/UPS system (I tried). All I need to do is dump in the new data, once per day, from one MySQL table to the appropriate QB table(s). -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is your script being run via the CLI or the web? -- Daniel P. Brown he's running it on the web, as the CLI worked ;) Did you try to su to the PHP user first and then try to send the mail with the CLI? Sounds like a permission issue... Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/5/07, Tijnema [EMAIL PROTECTED] wrote: he's running it on the web, as the CLI worked ;) Yeah, I knew it was mentioned before, but I couldn't remember. I think I have early-onset Alzheimer's. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
No not trying to trick you at all. It's just that because of an incident I had on a previous site with giving actual table names etc. I had another one helping me through forums. I actually share too much info. as a result my DB was ruined... At any rate had no clue about combined_string it showed me the error of my ways. I am reading a file into an array using file( ). So SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central helped me to see error of my way so I changed the statement to. SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) it worked. So what do I owe you? - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Thursday, July 05, 2007 10:10 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Sorry, That was a typo there's on one IN clause. here is how it reads: SELECT * FROM central WHERE CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs'). So in my table I have 8 in size column, purple in color column, and 60lbs in weight column. Since the concatenated value will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Ok, well, here is what I would do now. Just to make sure things are as we are assuming they are. SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central print the results of that sql and see if combined_string looks like what we think it should be. This you can do in phpmyadmin. oh, what is up with the naming conventions? Trying to trick us? To me it would not be obvious that you are storing colors in column for what looks like a city name. Just wondering... -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php security books
Andrew Hutchings wrote: Avoid the O'Reilly one as it is flawed. Hollow claims are disrespectful and harmful to professional discourse. Perhaps you are motivated to persuade others that this is true and will do so at any cost, even if it means spreading misinformation. I'm aware of one person who does exactly this, so maybe you're just a victim of his propaganda. I'll give you the benefit of the doubt and assume the latter. The entire errata is published online and has been maintained very diligently: http://phpsecurity.org/errata I would argue that none of these errors constitute poor security advice, whereas I can't say the same for the other books I've read on the subject. (I don't want to disparage anyone's hard work, and feel free to discount my opinion as biased.) The errata is there for you to form your own opinion, and if you actually do know about something that isn't listed, then please disclose it. Put up, or shut up. There's nothing worse than poor security advice, but the fear of being wrong can't prevent us from sharing what we've learned. I have nothing but contempt for those who, for their own personal benefit, want to silence and discredit the people who are trying to help. The PHP community is one of the most open, friendly, and helpful communities around, and I think we are also one of the most security-conscious as a result. If you'll look through the reviews, you might notice that many leading PHP and web application security experts highly recommend it: http://phpsecurity.org/reviews Are all of these people fools, or is it really a good book? Chris -- Chris Shiflett http://shiflett.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Selecting Rows Based on Row Values Being in Array
K. Hayes wrote: No not trying to trick you at all. It's just that because of an incident I had on a previous site with giving actual table names etc. I had another one helping me through forums. I actually share too much info. as a result my DB was ruined... At any rate had no clue about combined_string it showed me the error of my ways. I am reading a file into an array using file( ). So SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central helped me to see error of my way so I changed the statement to. SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) it worked. So what do I owe you? - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Thursday, July 05, 2007 10:10 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Sorry, That was a typo there's on one IN clause. here is how it reads: SELECT * FROM central WHERE CONCAT(strName,strCity,strState) IN('7orange50lbs','8purple60lbs'). So in my table I have 8 in size column, purple in color column, and 60lbs in weight column. Since the concatenated value will be 8purple60lbs, shouldn't MySQL return that row? Thanks for your patience. Ok, well, here is what I would do now. Just to make sure things are as we are assuming they are. SELECT CONCAT(strName,strCity,strState) AS combined_string FROM central print the results of that sql and see if combined_string looks like what we think it should be. This you can do in phpmyadmin. oh, what is up with the naming conventions? Trying to trick us? To me it would not be obvious that you are storing colors in column for what looks like a city name. Just wondering... -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare One is glad to be of service. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About DREAMWEAVER
On Thu, 2007-07-05 at 11:52 -0700, Kelvin Park wrote: I'm trying to get rid of all the comments that are in a different language in dreamweaver. Anyone know how to do that automatically? I have like 1000 php files with full of comments in different language. I do not intend on translating them or doing anything with em, I just wanna get rid of them just like that. Maybe regular expressions will do? dunno. I'll appreciate any comment. thanks In linux you can do something like: rm `grep -irnE regex .` 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
Re: [PHP] About DREAMWEAVER
There is a Find and Replace function in Dreamweaver, but it is very specific and will only find specific words/tags. If these comments are from outside of Dreamweaver and it does not recognize them, then it is probably interpreting them as basic HTML text. And as such there would be no way for it to know where your comment ended and the code you want to be begins. Something a little faster but not your ideal solution would be to use the Find function. This will build a list of all the instances of your comment code, for instance if you start off all your comments with //. Then you can double click on the result and it will take you to that line, then just delete the line. On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: I'm trying to get rid of all the comments that are in a different language in dreamweaver. Anyone know how to do that automatically? I have like 1000 php files with full of comments in different language. I do not intend on translating them or doing anything with em, I just wanna get rid of them just like that. Maybe regular expressions will do? dunno. I'll appreciate any comment. thanks
[PHP] About DREAMWEAVER
I'm trying to get rid of all the comments that are in a different language in dreamweaver. Anyone know how to do that automatically? I have like 1000 php files with full of comments in different language. I do not intend on translating them or doing anything with em, I just wanna get rid of them just like that. Maybe regular expressions will do? dunno. I'll appreciate any comment. thanks
Re: [PHP] Re: PHP Brain Teasers
$which = isset($_GET['chicken']) ? $_GET['egg'] : null; 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] housekeeping program
Hi, I have built a server program. This program collects the data from the user. In the meantime, I have written another program to do housekeeping work: process user's data, send an alert email and delete old files. How can I ensure the housekeeping program run 24/7? If the server is rebooted, how to make this housekeeping program automatically start? Thanks. Scott - Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games.
RE: [PHP] Re: PHP Brain Teasers
Which came first, the chicken or the egg? -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Thursday, July 05, 2007 2:56 PM To: php-general@lists.php.net Subject: Re: [PHP] Re: PHP Brain Teasers $which = isset($_GET['chicken']) ? $_GET['egg'] : null; 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] housekeeping program
scott flemming wrote: Hi, I have built a server program. This program collects the data from the user. In the meantime, I have written another program to do housekeeping work: process user's data, send an alert email and delete old files. How can I ensure the housekeeping program run 24/7? If the server is rebooted, how to make this housekeeping program automatically start? Depends on the operating system. However, this has nothing to do with PHP so you really ought to be asking on a more appropriate list. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/5/07, tedd [EMAIL PROTECTED] wrote: $which = isset($_GET['chicken']) ? $_GET['egg'] : null; 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 That's the question that still perplexes even the greatest of minds. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Brain Teasers
On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) 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
RE: [PHP] PHP Brain Teasers
while( TRUE ) { $actions++; $words--; } $bets = array(1,2,3,4,5); unset( $bets ); $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; for( $i = 0; $i = 6; $i++ ) { $deep++; } for( $i = 0; $i = 5; $i++ ) { $flies--; } thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About Website Search Engine
I'm trying to build a search engine for my website (with php), it will have functions such as finding product names and their codes from the mysql database. Does anyone know any good tutorial or reference on any website, or any good books out there that you might recommend? I couldnt' find any decent one but only the ones that keep on saying, use google search engine to search your website! etc. Thanks!
Re: [PHP] Re: PHP Brain Teasers
Let's get obscure try to guess it before running the code. It actually shouldn't be difficult. ? class Brainteaser { function paint($original_image,$rgb_string1,$rgb_string2,$input1,$input2) { header(Content-type: image/png); $im = imagecreatefromjpeg($original_image); $rgb1 = explode(',',$rgb_string1); $rgb2 = explode(',',$rgb_string2); $color1 = imagecolorallocate($im,$rgb1[0],$rgb1[1],$rgb1[2]); $color2 = imagecolorallocate($im,$rgb2[0],$rgb2[1],$rgb2[2]); $px = (imagesx($im) - 7.5 * strlen($input1)) / 2; imagestring($im, 50, $px, 90, $input2, $color1); imagestring($im, 50, ($px + 30), 120, $input1, $color2); imagepng($im); imagedestroy($im); } } $objects = new Brainteaser(); $objects-original_image = http://www.sewterific.com/images/Just%20Baskets/SmPicnicBasket.jpg;; $_SCRIPT[word] = task; $_SCRIPT[otherword] = ticket; $update_word1 = $_SCRIPT[word].et; $rgb1 = 134,89,32; $rgb2 = 231,223,48; $objects-paint($objects-original_image,$rgb1,$rgb2,$update_word1,str_replace(c,s,$_SCRIPT[otherword])); ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Brain Teasers
On 7/5/07, Chris Boget [EMAIL PROTECTED] wrote: while( TRUE ) { $actions++; $words--; } Actions speak louder than words. $bets = array(1,2,3,4,5); unset( $bets ); All bets are off. $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; Behind the times. for( $i = 0; $i = 6; $i++ ) { $deep++; } Deep Six. for( $i = 0; $i = 5; $i++ ) { $flies--; } Time flies backwards? // Not sure on this one. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Yeah, good point, smartass. ;-P -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stop Download managers
Hi Is there a way to stop download managers on my php webpages? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Brain Teasers
Actions speak louder than words. Yup. All bets are off. Indeed. Behind the times. Correct. Deep Six. Got it. for( $i = 0; $i = 5; $i++ ) { $flies--; } Time flies backwards? // Not sure on this one. I wasn't sure if this one was done well enough; I guess it wasn't. The answer is 'Dropping like flies'. :p thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About Website Search Engine
On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: I'm trying to build a search engine for my website (with php), it will have functions such as finding product names and their codes from the mysql database. Does anyone know any good tutorial or reference on any website, or any good books out there that you might recommend? I couldnt' find any decent one but only the ones that keep on saying, use google search engine to search your website! etc. Thanks! Kelvin, That depends. Is the content of your website dynamically-driven from content within the MySQL database you mentioned? If so, something like this would work: ? // Do your includes and database connection schemes here. if($_POST['search_data']) { $terms = mysql_real_escape_string($_POST['search_data']); $sql = SELECT * FROM tablename WHERE $terms IN ; $sql .= product_id,product_name,product_description; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { extract($row); // Do your processing of each row of information here. } } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? Terms: INPUT TYPE=TEXT NAME=search_data VALUE=?=$_POST['search_data'];?BR / INPUT TYPE=SUBMIT VALUE=Search /FORM -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| 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
Re: [PHP] Stop Download managers
On 7/5/07, Pieter du Toit [EMAIL PROTECTED] wrote: Hi Is there a way to stop download managers on my php webpages? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You could do it by restricting the user agents like so ? if(!stristr($_SERVER['HTTP_USER_AGENT'],mozilla)) { die(We only allow Mozilla browsers in here!\n); } ? OR ? if(stristr($_SERVER['HTTP_USER_AGENT'],.net)) { die(You appear to be using a more modern version of Internet Exploder.\n); } ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About Website Search Engine
On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: Yes my website is dynamically driven from content within mysql. The products and the product information is within the datase. I was looking for a way to allow people to efficiently search for an item, for example if a customer types in, bunny, it would find everything (and display them) that has word bunny, or if the customer misspells it, bunn, it will still display every item with the letters accordingly. On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: I'm trying to build a search engine for my website (with php), it will have functions such as finding product names and their codes from the mysql database. Does anyone know any good tutorial or reference on any website, or any good books out there that you might recommend? I couldnt' find any decent one but only the ones that keep on saying, use google search engine to search your website! etc. Thanks! Kelvin, That depends. Is the content of your website dynamically-driven from content within the MySQL database you mentioned? If so, something like this would work: ? // Do your includes and database connection schemes here. if($_POST['search_data']) { $terms = mysql_real_escape_string($_POST['search_data']); $sql = SELECT * FROM tablename WHERE $terms IN ; $sql .= product_id,product_name,product_description; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { extract($row); // Do your processing of each row of information here. } } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? Terms: INPUT TYPE=TEXT NAME=search_data VALUE=?=$_POST['search_data'];?BR / INPUT TYPE=SUBMIT VALUE=Search /FORM -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 The example I sent to you will act as a foundation to do the first part of what you're asking, but not the second. To do something like the second, you'll want to do something like: $sql = SELECT * FROM tablename WHERE $terms IN ; $sql .= product_id,product_name,product_description ; $sql .= OR product_description LIKE '%.$terms.%'; -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how PHP is batter?
Crayon Shin Chan wrote: On Tuesday 03 July 2007 22:56, Stut wrote: I saw there is a free version of Studio, but I think it's for students... You cannot go build a corporate project with it I think... More FUD. Go read the licence before claiming to know what it says! Regardless, the Express version has strings attached: http://www.theregister.co.uk/2007/06/05/microsoft_mvp_threats/ Two more good (but dated) articles: http://www.webpronews.com/expertarticles/2005/12/22/asp-vs-php http://www.builderau.com.au/program/web/soa/PHP-ASP-or-ASP-NET-/0,339024632,320283074,00.htm One claims ASP.NET is *much* faster, as I would have suspected. It would be interesting to compare a LAMP server (mysql running MyISAM) and Win2k3/MS-SQL/.NET. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Real-World BUSINESS Problem
Jay Blanchard wrote: PROBLEM I need to automatically create packing lists at the end of each day for items ordered through our warehouse inventory control system. Each packing list is related to a retail location. The packing list must be printed so that order pickers can get the materials and package for shipment to the locations. Each packing list must be archived electronically. RESOURCES Data from the inventory control system and the retail location database. Hey I remember doing something similar to this on my first day at Uni. This is not hard You could do this in numerous languages and PHP would make it pretty quick. Python or Java would also be pretty good choices as all three have pretty good PDF generation libs which could make for nice printouts. I really don't get what your problem is. Just approach this like any other programming task and spec it out and break it down modularly and the design will come naturally. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Brain Teasers
Chris Boget wrote: I wasn't sure if this one was done well enough; I guess it wasn't. The answer is 'Dropping like flies'. :p Well you can't make it too easy... I like it :) (didn't get it but I like it!!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Real-World BUSINESS Problem
Colin Guthrie wrote: Jay Blanchard wrote: PROBLEM I need to automatically create packing lists at the end of each day for items ordered through our warehouse inventory control system. Each packing list is related to a retail location. The packing list must be printed so that order pickers can get the materials and package for shipment to the locations. Each packing list must be archived electronically. RESOURCES Data from the inventory control system and the retail location database. Hey I remember doing something similar to this on my first day at Uni. Erm, woops. I went into rant mode before I'd parsed the author of the original post ;) Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_start eval?
I have a template system that takes some data, scrubs it and then with a load method includes the required template. I need to add a param so it doesn't simply include but returns the contents of the template in a string with all of the vars populated. I tried: ob_start(); include my template $template=ob_get_contents(); ob_clean(); return $template; But this returns the template it's it's raw for with all of tha ?=$whatever? tags. Can I fill these in and still pass as another var without using eval()? What do other template systems to do return a template as a string on load? Thanks!
[PHP] Suggestion re: PHP Brain Teasers
Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. - steve, eschewing away... -- +--- 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] Stop Download managers
Yeah, but a good portion of Download managers clone the useragent field anyway so this wouldn't really stop them. The only reliable way I've ever heard of people doing this is if they see two connections from the same IP at the same time. I assume you're talking about how to stop download managers from opening multiple connections in an attempt to get a fasterdownload. But in case you're worried about people using a download manager to download a lot of files or your whole page, then you could have a counter that is incrememted every time a page is accessed in a database, and if that counter ever went over let's say 30 in a minute, it would temporarily ban the IP using .htaccess or something of the like that PHP can write. - Dan Daniel Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/5/07, Pieter du Toit [EMAIL PROTECTED] wrote: Hi Is there a way to stop download managers on my php webpages? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You could do it by restricting the user agents like so ? if(!stristr($_SERVER['HTTP_USER_AGENT'],mozilla)) { die(We only allow Mozilla browsers in here!\n); } ? OR ? if(stristr($_SERVER['HTTP_USER_AGENT'],.net)) { die(You appear to be using a more modern version of Internet Exploder.\n); } ? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Suggestion re: PHP Brain Teasers
On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! 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
[PHP] Re: PHP Courses in India
You go to an institute in India to learn PHP? Isn't it more of a language that you could get from a book? I know there's been lots of book discussions on this newsgroup, your English seems pretty good that would probably be the best option. As far as an institute goes I have no idea. Sorry I couldn't be more helpfull. - Dan OOzy Pal [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I would like to take PHP courses (intermediate to Advance) in India. Can someone recommend a good institute anywhere in India? -- OOzy Ubuntu-Feisty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start eval?
If I understand what you're doing correctly, then it should work and I've done it many times. First thing you should do, though, is switch from short tags to proper tags, ?php echo $whatever; ?. If you have short tags disabled, it will not parse ?= syntax. On Thursday 05 July 2007, blackwater dev wrote: I have a template system that takes some data, scrubs it and then with a load method includes the required template. I need to add a param so it doesn't simply include but returns the contents of the template in a string with all of the vars populated. I tried: ob_start(); include my template $template=ob_get_contents(); ob_clean(); return $template; But this returns the template it's it's raw for with all of tha ?=$whatever? tags. Can I fill these in and still pass as another var without using eval()? What do other template systems to do return a template as a string on load? Thanks! -- 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] Suggestion re: PHP Brain Teasers
At 7:37 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:27 -0700, Steve Edberg wrote: Proposal - Perhaps we could separate Brain Teasers, Obfuscated PHP challenges, and what-have-you to a separate mailing list, say php-fun (php-phun? PHPhun?)? Maybe you could also include 'use of eval()' in that list, since I think 97.004% of the time using eval() inevitably leads to obfuscation. And one should eschew obfuscation. We could... but why bother?! Minimizing the circumlocution and periphrasis that is characteristic of an exhaustively obfuscated style is conducive to a maximally productive ISO-9000/six-sigma enterprise infrastructure that is architected towards the rightsized core competencies of an n-tier profit maximization strategy. Errr, wait, I think I just wandered into the 'PHP as a strategic BUSINESS language' thread... - s -- +--- 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
[PHP] Help with HttpRequest -- avoiding 417s from Lighttpd
Is there a way to prevent HttpRequest (from the pecl_http extension) from using an Expect: 100-continue on large POSTs? I've a script which needs to submit pages to a host running Lighttpd v1.4, which does not support section 8.2.3 of the HTTP/1.1 spec and so always returns a 417 Expectation Failed when such a request is made. -- Ben Blank [EMAIL PROTECTED] Oregano, n. The ancient Italian art of pizza folding. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: parsin XML with DOM
Maybe you can set preserveWhiteSpace to ignore whitespace,like this: $RSS_DOM = new DomDocument(); $RSS_DOM-preserveWhiteSpace = false; On 6/27/07, M. Sokolewicz [EMAIL PROTECTED] wrote: Mikey wrote: [EMAIL PROTECTED] wrote: [snip] its type is not DomNode, but DomText. Only the 2nd child - $NODE = $NODE-nextSibling; has $NODE-tagName channel. My question is - why is the first child after rss DomText? Thank you, Iv My guess is the whitespace between the nodes :o) HTH, Mikey You are correct on that guess. In xml everything is (part of) a node. So if you have: node node2 / /node You'll actually have: DomNode(node) DomText( ) DomNode(node2) DomText( ) Same goes for newlines, as they are seen as text, thus part of a DomText node. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start eval?
We have short tags enabled as our templates work fine with them. Thanks! On 7/5/07, Larry Garfield [EMAIL PROTECTED] wrote: If I understand what you're doing correctly, then it should work and I've done it many times. First thing you should do, though, is switch from short tags to proper tags, ?php echo $whatever; ?. If you have short tags disabled, it will not parse ?= syntax. On Thursday 05 July 2007, blackwater dev wrote: I have a template system that takes some data, scrubs it and then with a load method includes the required template. I need to add a param so it doesn't simply include but returns the contents of the template in a string with all of the vars populated. I tried: ob_start(); include my template $template=ob_get_contents(); ob_clean(); return $template; But this returns the template it's it's raw for with all of tha ?=$whatever? tags. Can I fill these in and still pass as another var without using eval()? What do other template systems to do return a template as a string on load? Thanks! -- 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
[PHP] Loading a URL
/*I am trying to load an XML file from the following site, which btw is a working site you can put in the address bar.*/ $url = http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x;; //open the url if(!($handle = fopen($url, r))){ echo Error opening URL br /.$url; exit(); } else{ echo It Worked; //actually use simpleXML and parse it, but that's not the problem. } /* *For some reason that code returns: *Error opening URL *http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x *Is there something obvious that I am missing, or what? */
Re: [PHP] Loading a URL
On Thu, 2007-07-05 at 20:39 -0500, Kaleb Pomeroy wrote: /*I am trying to load an XML file from the following site, which btw is a working site you can put in the address bar.*/ $url = http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x;; //open the url if(!($handle = fopen($url, r))){ echo Error opening URL br /.$url; exit(); } else{ echo It Worked; //actually use simpleXML and parse it, but that's not the problem. } /* *For some reason that code returns: *Error opening URL *http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x *Is there something obvious that I am missing, or what? */ Check your configuration to see the value of: allow_url_fopen 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
RE: [PHP] Loading a URL
That's it. Thanks a bunch Robert -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Thu 05-Jul-07 8:53 PM To: Kaleb Pomeroy Cc: php-general@lists.php.net Subject: Re: [PHP] Loading a URL On Thu, 2007-07-05 at 20:39 -0500, Kaleb Pomeroy wrote: /*I am trying to load an XML file from the following site, which btw is a working site you can put in the address bar.*/ $url = http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x;; //open the url if(!($handle = fopen($url, r))){ echo Error opening URL br /.$url; exit(); } else{ echo It Worked; //actually use simpleXML and parse it, but that's not the problem. } /* *For some reason that code returns: *Error opening URL *http://isbndb.com/api/books.xml?access_key=WC2BD24Wresults=pricesindex1=isbnvalue1=030681496x *Is there something obvious that I am missing, or what? */ Check your configuration to see the value of: allow_url_fopen 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] About Website Search Engine
Kevin, just like Daniel said, $sql .= OR product_description *LIKE '%.$terms.%'*; most of the *search engines* ive seen revolve around the use of the LIKE constructhttp://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#operator_like which is a simplified regex mechanism for an SQL query [for MySQL at least, probly other RDBMS' as well] -nathan On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: Yes my website is dynamically driven from content within mysql. The products and the product information is within the datase. I was looking for a way to allow people to efficiently search for an item, for example if a customer types in, bunny, it would find everything (and display them) that has word bunny, or if the customer misspells it, bunn, it will still display every item with the letters accordingly. On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/5/07, Kelvin Park [EMAIL PROTECTED] wrote: I'm trying to build a search engine for my website (with php), it will have functions such as finding product names and their codes from the mysql database. Does anyone know any good tutorial or reference on any website, or any good books out there that you might recommend? I couldnt' find any decent one but only the ones that keep on saying, use google search engine to search your website! etc. Thanks! Kelvin, That depends. Is the content of your website dynamically-driven from content within the MySQL database you mentioned? If so, something like this would work: ? // Do your includes and database connection schemes here. if($_POST['search_data']) { $terms = mysql_real_escape_string($_POST['search_data']); $sql = SELECT * FROM tablename WHERE $terms IN ; $sql .= product_id,product_name,product_description; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { extract($row); // Do your processing of each row of information here. } } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? Terms: INPUT TYPE=TEXT NAME=search_data VALUE=?=$_POST['search_data'];?BR / INPUT TYPE=SUBMIT VALUE=Search /FORM -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 The example I sent to you will act as a foundation to do the first part of what you're asking, but not the second. To do something like the second, you'll want to do something like: $sql = SELECT * FROM tablename WHERE $terms IN ; $sql .= product_id,product_name,product_description ; $sql .= OR product_description LIKE '%.$terms.%'; -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Courses in India
you might try the online training courses from php architecthttp://hades.phparch.com/socrates/ . -nathan On 7/5/07, Dan [EMAIL PROTECTED] wrote: You go to an institute in India to learn PHP? Isn't it more of a language that you could get from a book? I know there's been lots of book discussions on this newsgroup, your English seems pretty good that would probably be the best option. As far as an institute goes I have no idea. Sorry I couldn't be more helpfull. - Dan OOzy Pal [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I would like to take PHP courses (intermediate to Advance) in India. Can someone recommend a good institute anywhere in India? -- OOzy Ubuntu-Feisty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP Brain Teasers
At 4:17 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| Cheers, Rob. Yeah, but he did say the greatest of minds. :-) 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] Re: PHP Brain Teasers
On Thu, 2007-07-05 at 22:37 -0400, tedd wrote: At 4:17 PM -0400 7/5/07, Robert Cummings wrote: On Thu, 2007-07-05 at 16:08 -0400, Daniel Brown wrote: That's the question that still perplexes even the greatest of minds. I've never found it very perplexing :| Cheers, Rob. Yeah, but he did say the greatest of minds. :-) I know *sniffle*. 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
RE: [PHP] PHP Brain Teasers
2b || !2b 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] Re: PHP Brain Teasers
At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Yeah, good point, smartass. ;-P Yeah, fish got all the action back then. But actually, it was dinosaurs. 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] About Website Search Engine
On Thu, 2007-07-05 at 22:26 -0400, Nathan Nobbe wrote: Kevin, just like Daniel said, $sql .= OR product_description *LIKE '%.$terms.%'*; most of the *search engines* ive seen revolve around the use of the LIKE constructhttp://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#operator_like which is a simplified regex mechanism for an SQL query [for MySQL at least, probly other RDBMS' as well] Don't do that. Unless you have a teency weency set of data don't use LIKE syntax to match data. It's extremely inefficient and requires scanning the entire table. If you need to use MySQL use the MATCH AGAINST syntax since it will index the data and search much faster. I've heard tell it sucks beyond a certain size, but it's great for quick solutions and moderate sized data. If you need something more powerful look into something like Lucene. 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
RE: [PHP] PHP Brain Teasers
My favorite. /world 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] PHP Brain Teasers
At 9:20 PM +0100 7/5/07, Chris Boget wrote: while( TRUE ) { $actions++; $words--; } $bets = array(1,2,3,4,5); unset( $bets ); $arr = array( 'this', 'that', 'times' ); $arr[] = 'behind'; for( $i = 0; $i = 6; $i++ ) { $deep++; } for( $i = 0; $i = 5; $i++ ) { $flies--; } thnx, Chris In similar vein. $actions $words 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] PHP Brain Teasers
To be.. or not to be? On 7/5/07, tedd [EMAIL PROTECTED] wrote: 2b || !2b 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About Website Search Engine
note: i never said this was an optimal solution; i just said thats what ive seen. obviously i havent worked on any major search engine to date. in fact i was fishing a bit for some info on how to do it right. On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: If you need to use MySQL use the MATCH AGAINST syntax since it will index the data and search much faster. I've heard tell it sucks beyond a certain size, but it's great for quick solutions and moderate sized data. If you need something more powerful look into something like Lucene. thanks Robert, -nathan On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 22:26 -0400, Nathan Nobbe wrote: Kevin, just like Daniel said, $sql .= OR product_description *LIKE '%.$terms.%'*; most of the *search engines* ive seen revolve around the use of the LIKE construct http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#operator_like which is a simplified regex mechanism for an SQL query [for MySQL at least, probly other RDBMS' as well] Don't do that. Unless you have a teency weency set of data don't use LIKE syntax to match data. It's extremely inefficient and requires scanning the entire table. If you need to use MySQL use the MATCH AGAINST syntax since it will index the data and search much faster. I've heard tell it sucks beyond a certain size, but it's great for quick solutions and moderate sized data. If you need something more powerful look into something like Lucene. 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] Re: PHP Brain Teasers
On Thu, 2007-07-05 at 22:44 -0400, tedd wrote: At 4:48 PM -0400 7/5/07, Daniel Brown wrote: On 7/5/07, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote: Which came first, the chicken or the egg? The egg, fish were laying them long before chickens walked the earth :) Yeah, good point, smartass. ;-P Yeah, fish got all the action back then. But actually, it was dinosaurs. Um... fish predate all land creatures according to evolution that's not to say something with eggs didn't predate fish, but I'm too lazy to go look. But dwelling on the topic, the chicken egg problem is actually stated incorrectly to some degree, it's a more interesting question to ask: What came first? The chicken or the chicken egg? Now this question is only perplexing until you realize that the concept of chicken egg is ambiguous. Is a chicken egg an egg that was created by a chicken, or an egg from which a chicken hatches? As such, there are two possible answers to the age old question... Case 1: a chicken egg is defined by having been created by a chicken. In this case the chicken must have come first :) Case 2: a chicken egg is defined by being an egg from which a chicken hatches. In this case the egg comes first since the first genetic chicken was born from an egg created by it's direct ancestor that was not a chicken. See... it's not perplexing at all :) 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
[PHP] mailparse_msg_extract_part_file error
I have written a PHP (v5.1) app to parse a bunch of MIME files. It works for the vast majority, but sometimes I get this error: mailparse_msg_extract_part_file(): mbstring doesn't know how to decode plain transfer encoding! It appears to be when messages have Content-Type: text/plain; charset=us-ascii or Content-Transfer-Encoding: plain or a combination of the two. I've searched on the error message and only found a url that times out. Does anyone have any experience with this? The code in question is this (it's part of a function that gets the email body): foreach ($this-_sectiondata as $index = $data) { $contdisp = $this-_getHeaderData($index, 'content-disposition'); if ($contdisp == $data['content-type'] != 'multipart/mixed') { $sec = mailparse_msg_get_part($this-_mimehandle, $index); ob_start(); /* extract the part from the message file and dump it to the output buffer */ mailparse_msg_extract_part_file($sec, $this-_filename); $contents = ob_get_contents(); ob_end_clean(); $this-_body = $contents; } } Thanks! Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding the array in to each element of another one array
Hi Guys, I have a array like that below, $values = (name1 %we %tr , name2 %de.%ty %sd, name3 %we 5te %mt/% Hs); another one array like that, $tmp = (%tr, %uy, %xc); I need to add the array of $tmp in to each element of array $values.Also i need to add the $tmp array in to after the name of each element.. could you help me to find the solution..?? Thanks,