php-general Digest 30 Jun 2007 13:16:14 -0000 Issue 4877
php-general Digest 30 Jun 2007 13:16:14 - Issue 4877 Topics (messages 257999 through 258006): implementation of guest book 257999 by: Shiv Prakash Re: Handling animated GIFs with GD? 258000 by: Manuel Lemos Re: simple OCR in php 258001 by: Manuel Lemos Selecting Rows Based on Row Values Being in Array 258002 by: kvigor 258003 by: Jim Lucas 258004 by: kvigor 258005 by: Jim Lucas Re: HELP - I have tried to unsubscribe from this listmutipletimes but cannot. 258006 by: Brian Seymour Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Sir, I have implemented the guest book in web site successfully and its working also without any problem but administration side is asking for ID and Password, my request is how do I get that because I have tried my level best to find it in the site but I couldnt get it ,there was not any option for that and as of downloading is concern it was free, therefore I request you to help me out of this and solve my problem, Thank you Shiv Prakash Email Id 2. [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Hello, on 06/26/2007 06:38 AM Tijnema said the following: Is it possible to parse animated GIFs with GD, just frame by frame? Try Laszlo Zsidi GIF animation classes: http://www.phpclasses.org/gifmerge http://www.phpclasses.org/gifsplit -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ ---End Message--- ---BeginMessage--- Hello, on 06/29/2007 01:24 PM Ray said the following: Hello all, I am looking for a way to incorporate some simple OCR into a php script. The user will bulk scan a pile of invoices. I want the php script to look at each invoice and read a number off the invoice. The image will then be renamed, and be organized into a directory and the file name will be added to a database. (all of these steps are straight forward once the number is read.) I have no problem with a system that requires a special OCR font and/or some sort of registration mark to help locate the Invoice number. Can anybody tell me of any tools out there that can do this? I think you are looking for something like this: http://www.phpclasses.org/phpocr -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ ---End Message--- ---BeginMessage--- Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. ---End Message--- ---BeginMessage--- kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. I would suggest approaching the problem with a slightly different thought. just have the sql concat() the columns together and then compare. something like this should do the trick $list = array( '6blue40lbs', '7orange50lbs', '8orange60lbs', '9purple70lbs', ); $SQL = SELECT * FROMmy_Table WHERE CONCAT(value1, value2,
Re: [PHP] Selecting Rows Based on Row Values Being in Array
kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. I would suggest approaching the problem with a slightly different thought. just have the sql concat() the columns together and then compare. something like this should do the trick $list = array( '6blue40lbs', '7orange50lbs', '8orange60lbs', '9purple70lbs', ); $SQL = SELECT * FROMmy_Table WHERE CONCAT(value1, value2, value3) IN ('.join(',', $list).') ; mysql_query($SQL); this should take, for each row in the DB, value1 + value2 + value3 and create one string from them, then it will compare each string in the IN (...) portion to each entry in the $list array(). Let me know if you need any further help -- 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
Will do. Thanks. - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Saturday, June 30, 2007 1:46 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. I would suggest approaching the problem with a slightly different thought. just have the sql concat() the columns together and then compare. something like this should do the trick $list = array( '6blue40lbs', '7orange50lbs', '8orange60lbs', '9purple70lbs', ); $SQL = SELECT * FROM my_Table WHERE CONCAT(value1, value2, value3) IN ('.join(',', $list).') ; mysql_query($SQL); this should take, for each row in the DB, value1 + value2 + value3 and create one string from them, then it will compare each string in the IN (...) portion to each entry in the $list array(). Let me know if you need any further help -- 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: Will do. Thanks. - Original Message - From: Jim Lucas [EMAIL PROTECTED] To: kvigor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Saturday, June 30, 2007 1:46 AM Subject: Re: [PHP] Selecting Rows Based on Row Values Being in Array kvigor wrote: Hello All, I'm attempting to return rows from a mysql DB based on this criteria: I have a list, in the form of an array that I need to compare against each row in the table. Where theres a match I need that entire row returned. e.g.$varListof 3outOf_10Fields = array(6blue40lbs, 7orange50lbs, 8orange60lbs, 9purple70lbs); The array contains 3 of the db row fields in 1 value. However there are 10 fields/columns in the table. === what table looks like | === size colorweight ROW 1| value1 | value1 | value1 | value1 | value1 | value1 | So how could I set up a query that would SELECT the entire row, if the row contained $varListof 3outOf_10Fields[1]. Open to any suggestions or work arounds. I'm playing with extract() but code is too crude to even post. I would suggest approaching the problem with a slightly different thought. just have the sql concat() the columns together and then compare. something like this should do the trick $list = array( '6blue40lbs', '7orange50lbs', '8orange60lbs', '9purple70lbs', ); $SQL = SELECT * FROM my_Table WHERE CONCAT(value1, value2, value3) IN ('.join(',', $list).') ; mysql_query($SQL); this should take, for each row in the DB, value1 + value2 + value3 and create one string from them, then it will compare each string in the IN (...) portion to each entry in the $list array(). Let me know if you need any further help one other thing, make sure that you run each of the values in the $list array() through mysql_real_escape_string(). That way it is all nicely encoded for the SQL statement. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HELP - I have tried to unsubscribe from this listmutipletimes but cannot.
Patrick, did you trying going to http://www.php.net/unsub.php yet? =D Brian Seymour AeroCoreProductions http://www.aerocore.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Flash / Ajax / PHP
David Giragosian escreveu: I've recently been using some limited free time to explore the Freemovie (Flash-PHP API) and Ajax technologies. Can anyone help me to understand whether these can be used together? Can I, for example, pull data from MySQL, dynamically alter Flash function parameters, then use Ajax to deliver the new content? Thanks in advance, David --- The right place: http://labs.adobe.com/technologies/spry/ -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- Você deve, sempre, consultar uma segunda opinião! -- Deixe todos saberem se esta informação foi-lhe útil. -- You must hear, always, one second opinion! In all cases. -- Let the people know if this info was useful for you! -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Flash / Ajax / PHP
At 10:30 AM -0500 6/29/07, David Giragosian wrote: I've recently been using some limited free time to explore the Freemovie (Flash-PHP API) and Ajax technologies. Can anyone help me to understand whether these can be used together? Can I, for example, pull data from MySQL, dynamically alter Flash function parameters, then use Ajax to deliver the new content? Thanks in advance, David David: Short answer is yes, you can pull all these together to deliver content. However, you need to understand not only php, but ActionScript. I don't see why you would need Ajax to do this because you would first create the Flash segment in the background and then simply bring it forward and present it in a Flash player.. I think I have an idea of what you are trying to do and I believe it would be best if you created graphics in the background using php and then brought it forward with Ajax as data changed, all without the need for flash. But, if you want to investigate the Flash-PHP connection try Google actionscript and php 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] implementation of guest book
Shiv Prakash wrote: Sir, I have implemented the guest book in web site successfully and its working also without any problem but administration side is asking for ID and Password, my request is how do I get that because I have tried my level best to find it in the site but I couldn’t get it ,there was not any option for that and as of downloading is concern it was free, therefore I request you to help me out of this and solve my problem, It seems that the guestbook script you're using was written by somebody else. If that's the case then you should probably contact whomever you got this code from. Failing that, you'll probably have to write your own administrative scripts to access the guestbook tables in the database. That should be pretty straightforward by studying the script you have. brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Flash / Ajax / PHP
On 6/30/07, tedd [EMAIL PROTECTED] wrote: At 10:30 AM -0500 6/29/07, David Giragosian wrote: I've recently been using some limited free time to explore the Freemovie (Flash-PHP API) and Ajax technologies. Can anyone help me to understand whether these can be used together? Can I, for example, pull data from MySQL, dynamically alter Flash function parameters, then use Ajax to deliver the new content? Thanks in advance, David David: Short answer is yes, you can pull all these together to deliver content. However, you need to understand not only php, but ActionScript. I don't see why you would need Ajax to do this because you would first create the Flash segment in the background and then simply bring it forward and present it in a Flash player.. I think I have an idea of what you are trying to do and I believe it would be best if you created graphics in the background using php and then brought it forward with Ajax as data changed, all without the need for flash. But, if you want to investigate the Flash-PHP connection try Google actionscript and php Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Thanks tedd and zerof. tedd, I did as you suggested above with graphics created with PHP/GD and pulled with Ajax ( http://home.capecod.net/~cape84/Monitor.PNG for a static example ) but the image, when updated, is still unstable on IE while still _perfectly_ stable on FireFox. I'm guessing I'm gonna have to live with suggesting users view with FireFox but I'll try to mock up a test case with Flash to satisfy my curiosity. Thanks, David
Re: [PHP] HELP - I have tried to unsubscribe from this listmutipletimes but cannot.
On 6/30/07, Brian Seymour [EMAIL PROTECTED] wrote: Patrick, did you trying going to http://www.php.net/unsub.php yet? =D Brian Seymour AeroCoreProductions http://www.aerocore.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Patrick, In Gmail, you may have it forwarded to your account via a remote domain, or perhaps pulled in from a POP3/IMAP server. If you click the down-arrow next to the Reply link at the top-right corner of each message, then click View Original, you'll see the full headers of the message. Check the Return-Path of any of the messages from the list and you should see an address similar to [EMAIL PROTECTED] If you see a different address, then you're subscribed under a forwarder. -- 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] Date Calculation Help
I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen date falls on? Result - Ex: 5-30-07 = month 5 and should fall in quarter 2 -- Thanks - RevDave [EMAIL PROTECTED] [db-lists] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Calculation Help
revDAVE wrote: I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen date falls on? Result - Ex: 5-30-07 = month 5 and should fall in quarter 2 You could do it like this: floor(($month-1)/3)+1; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_replace new line
Hello; I have the following code: $prps = str_replace(\n, ' ', $input[3]); $request = str_replace(// var purpose = {} ;\n, var purpose = '$prps';\n, $request); In the first line $input[3] is a string formatted with new lines at the end of each line. It is to be used to initialize a javascript variable (in the second line above), in an html file template. When the html file is generated from the template, the javascript written to it fails with unterminated string literal error message. When opening a view source window, the 'var purpose...' line does have the string broken up with extra spaces at the beginning of each line. This indicates that the new line was not replaced with the space. The space was merely added after the new line. How do you replace a new line with php in a case like this? Testing this is very tedious. Each time I have to go through and undo file modifications that this function performs in addition to the above. So it is not just a case of making a change and reloading the file and rerunning it. Thanks in advance; JK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simple OCR in php
[snip] In short PHP cannot perform OCR functions. Why? PHP provides all requisite functions/features so if someone was sadistic enough and talented enough there's nothing to stop them writing an OCR app using it. [/snip] Sure, but then the scanning device would have to be connected to the server. I suppose you could open a socket and stream the information to the server and then have PHP read and interpret the stream as it arrives. See how complex this is becoming? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] simple OCR in php
On Sat, 2007-06-30 at 12:12 -0500, Jay Blanchard wrote: [snip] In short PHP cannot perform OCR functions. Why? PHP provides all requisite functions/features so if someone was sadistic enough and talented enough there's nothing to stop them writing an OCR app using it. [/snip] Sure, but then the scanning device would have to be connected to the server. I suppose you could open a socket and stream the information to the server and then have PHP read and interpret the stream as it arrives. See how complex this is becoming? It was JUST as complex the first time someone did it in C, or Java, or what have your for a chosen language. 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] simple OCR in php
Jay Blanchard wrote: [snip] In short PHP cannot perform OCR functions. Why? PHP provides all requisite functions/features so if someone was sadistic enough and talented enough there's nothing to stop them writing an OCR app using it. [/snip] Sure, but then the scanning device would have to be connected to the server. I suppose you could open a socket and stream the information to the server and then have PHP read and interpret the stream as it arrives. See how complex this is becoming? Maybe it's just me, but OCR and scanning are certainly related but are by no means dependant on each other. Is it becoming complex or are you over-complicating it? -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Calculation Help
At 6/30/2007 08:14 AM, revDAVE wrote: I have segmented a year into four quarters (3 months each) nowdate = the month of the chosen date (ex: 5-30-07 = month 5) Q: What is the best way to calculate which quarter (1-2-3 or 4) the chosen date falls on? Result - Ex: 5-30-07 = month 5 and should fall in quarter 2 If you divide the month number by 3 you get: 1 0.3 2 0.7 3 1 4 1.3 5 1.7 6 2 7 2.3 8 2.7 9 3 10 3.3 11 3.7 12 4 The first digit is off by one, so subtract .1 from each result: 1 0.2 2 0.56667 3 0.9 4 1.2 5 1.56667 6 1.9 etc. Now you can see from the first digit that if you take the integer value and add 1 you'll get: 1 1 2 1 3 1 4 2 5 2 6 2 etc. In PHP this could be: intval(($month - .1)/3 + 1) or: intval(($month + .9)/3) I believe you can use intval() and floor() interchangeably in this circumstance. Regards, Paul __ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] developer seeking document writer
hi I wrote php 5 framework, not trying to do everything or add layers of complexing to what php already do easy, this framework has few objects that helps me doing commonly tasks easily like generating valid HTML, localization, ajax without coding any javascript and managing database without any SQL... stuff you may find useful, the problem that stops people from using it, is the lack of fine document, I wrote one [1] and rolled Example package [2] but my English is not good enough for writing such as document, so if you are interested to help this open source framework, please let me know :) thank you 1 - http://code.google.com/p/teddyframework/wiki/Documentation 2 - http://code.google.com/p/teddyframework/downloads/detail?name=Examples-0.2.zipcan=2q= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php