php-general Digest 15 Apr 2005 17:59:02 -0000 Issue 3399
php-general Digest 15 Apr 2005 17:59:02 - Issue 3399 Topics (messages 213127 through 213152): Re: Any experience with multi-language PHP sites? 213127 by: Kim Madsen general 213128 by: Balwant Singh php and linux shell script 213129 by: Balwant Singh 213141 by: Rory Browne Levels of Site Protection 213130 by: R. Van Tassel 213131 by: Petar Nedyalkov Re: Reverse plural forms to singular for search 213132 by: Mark Rees diffence between two numbers... 213133 by: Tristan.Pretty.risk.sungard.com 213134 by: Petar Nedyalkov 213148 by: Chris W. Parker 213149 by: Petar Nedyalkov Re: pixels per character 213135 by: Marek Kilimajer Re: Tomcat and php in Suse 9.2 213136 by: Dan Rossi How to unset a post variable 213137 by: Mario de Frutos Dieguez 213143 by: Nieko Maatjes 213144 by: Mark Rees 213146 by: Angelo Zanetti cant get data 213138 by: kyriacos sakkas Re: cant get data - Solved 213139 by: kyriacos sakkas 213140 by: kyriacos sakkas Barcodes 213142 by: Mike Smith 213147 by: Mike Smith configure problem on solaris 2 213145 by: Heim, Stefan Amazon/eBay API 213150 by: Brian Dunning Magpie with a db cache? 213151 by: Brian Dunning PHP, SDL and OpenGL 213152 by: Reynier Perez Mira 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: php-general@lists.php.net -- ---BeginMessage--- -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 4:26 PM KM Look in the archives, it´s less than 2 weeks since this was KM discussed (again :-) If you're referring to the subject Multilingual Web application - how to? (the only multi-language thread in this mailing list since the start of April - I checked before posting) then I'm afraid it didn't even come close to covering any of the issues raised, it was simply one post with one specific reply. Nops, not that thread. Look for the subject language files, the mail was sent around 7/4-2005 -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/Systemdeveloper ---End Message--- ---BeginMessage--- hi and greetings from India to all of you... my name is balwant, i m from Noida, India. hope there are many from India... through this email, i request all of you, who are from India to send me your contact details like email, address and phone numbers so that we can be in touch whenever needed and also to discuss the scope of PHP in India. with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 ---End Message--- ---BeginMessage--- hello, 1) first of all i would like to inform you that i have made a PHP script which also have some amount of linux shell script in it for converting emails from EVOLUTION to MOZILA THUNDERBIRD just by executing this script. if anybody need it, do let me know, i will send the same. 2) i am also exploring possibilities of using linux dialog boxes (used in shell scripting) with PHP. has anybody tried it, may please advise me how to call dialog boxes through PHP in CLI. also please share with me if u have information on how to use PHP with Shell Scripting. thx with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 ---End Message--- ---BeginMessage--- I don't think you'll find anything in PHP as simple as the shell script version of dialog, but you may be able to bang something together like that using ncurses. Probably handier if your time is more important than the machines, to just use the shell version using one of the Program Executions functions. Personally I suggest passthru: ?php function yesno($str){ $tmpvar = 0; // to avoid E_NOTICE passthru(dialog --yesno . escapeshellarg($str) . 200 10, $tmpvar); return $tmpvar; } ? On 15 Apr 2005 12:22:05 +0530, Balwant Singh [EMAIL PROTECTED] wrote: hello, 1) first of all i would like to inform you that i have made a PHP script which also have some amount of linux shell script in it for converting emails from EVOLUTION to MOZILA THUNDERBIRD just by executing this script. if anybody need it, do let me know, i will send the same. 2) i am also exploring possibilities of using linux dialog boxes (used in shell scripting) with PHP. has anybody tried it, may please advise me how to call dialog boxes through PHP in CLI. also please share with me if u have information on how to use PHP with Shell Scripting. thx with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- I'm working
RE: Re[2]: [PHP] Any experience with multi-language PHP sites?
-Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 4:26 PM KM Look in the archives, it´s less than 2 weeks since this was KM discussed (again :-) If you're referring to the subject Multilingual Web application - how to? (the only multi-language thread in this mailing list since the start of April - I checked before posting) then I'm afraid it didn't even come close to covering any of the issues raised, it was simply one post with one specific reply. Nops, not that thread. Look for the subject language files, the mail was sent around 7/4-2005 -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/Systemdeveloper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] general
hi and greetings from India to all of you... my name is balwant, i m from Noida, India. hope there are many from India... through this email, i request all of you, who are from India to send me your contact details like email, address and phone numbers so that we can be in touch whenever needed and also to discuss the scope of PHP in India. with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and linux shell script
hello, 1) first of all i would like to inform you that i have made a PHP script which also have some amount of linux shell script in it for converting emails from EVOLUTION to MOZILA THUNDERBIRD just by executing this script. if anybody need it, do let me know, i will send the same. 2) i am also exploring possibilities of using linux dialog boxes (used in shell scripting) with PHP. has anybody tried it, may please advise me how to call dialog boxes through PHP in CLI. also please share with me if u have information on how to use PHP with Shell Scripting. thx with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Levels of Site Protection
I'm working on a website for a musical outfit where different levels of access are required depending on the specific section. Writers will have access to a section of the site where they can listen to an entire album (for review). Radio personnel will have access to a section of the site where they can download radio-quality mp3 versions of singles. Can anyone suggest how to approach this? Is the easiest way to set up a table of username and passwords associated with an id which would let me know what level of access they have and direct them accordingly? Thanks in advance... -R. Van Tassel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Levels of Site Protection
On Friday 15 April 2005 10:37, R. Van Tassel wrote: I'm working on a website for a musical outfit where different levels of access are required depending on the specific section. Writers will have access to a section of the site where they can listen to an entire album (for review). Radio personnel will have access to a section of the site where they can download radio-quality mp3 versions of singles. Can anyone suggest how to approach this? You can make a list of all actions that can be performed in your system, and then map subsets of these actions to roles. Then each actor (user of the system) gets a role and you can easily check if he can do a certain action. Is the easiest way to set up a table of username and passwords associated with an id which would let me know what level of access they have and direct them accordingly? Thanks in advance... -R. Van Tassel -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgpsOUX3VypGx.pgp Description: PGP signature
FW: [PHP] Reverse plural forms to singular for search
Eugene, your reply-to address is set -Original Message- From: Mark Rees Sent: 15 April 2005 09:08 To: 'Eugene Voznesensky' Subject: RE: [PHP] Reverse plural forms to singular for search That sounds like a nightmare! Assuming you are talking about English, you might be able to make some progress by removing trailing s or es for words. This would trim words down to their stem. You could do this with a regular expression, which will need to do something like look for es or s with no preceding s at the end of words (to avoid trimming words like glass). It will not catch forms like medium/media and thesis/theses. You could think about trying to trim words like that down to their stem (med in this case). In fact, would just trimming off the last two letters and searching for that do for you? It depends on the range of words you are searching for. Good luck Mark -Original Message- From: Eugene Voznesensky [mailto:[EMAIL PROTECTED] Sent: 14 April 2005 17:22 To: php-general@lists.php.net Subject: [PHP] Reverse plural forms to singular for search I'm trying to reverse plural forms to singular ones and use the result for search [in database]. Is there any third party product to integrate with PHP, or some reliable algorithm? Thank you, Eu. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of IBM, Compaq, Cisco, Sun Microsystems, 3Com and HP Products. GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com EOE ** ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] diffence between two numbers...
I need to know the difference between two numbers... eg: $a = 7; $b = 27; somefunction($a, $b) // outputs 20 $a = 10; $b = 12; somefunction($a, $b) // outputs 2 etc... does that exist?
Re: [PHP] diffence between two numbers...
On Friday 15 April 2005 13:35, [EMAIL PROTECTED] wrote: I need to know the difference between two numbers... eg: $a = 7; $b = 27; somefunction($a, $b) // outputs 20 $a = 10; $b = 12; somefunction($a, $b) // outputs 2 function difference ($a, $b) { return (max($a, $b) - min($a, $b)); } etc... does that exist? -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgpoa9Fd8Ip9p.pgp Description: PGP signature
Re: [PHP] pixels per character
Christian Calloway wrote: Hey all, trying to dynamically size cell widths; what I need is a formula to measure pixels per character for an arbitrary font (in this case 10pt verdana). A simple function f(x) = strlen(x) * SOMECONSTANT just doesn't seem to cut it, as returned widths are to small are long. Any ideas? Try imagettfbbox(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tomcat and php in Suse 9.2
I noticed you never had a reply for this, its probably because this is non standard, or totally not heard of. What I would do, (even though I have yet to try this), is run php standard as a module in apache, but then run the tomcat connector jk or jk2 into apache, so it will run seamlessly. There is prob alot of settings to configure to do it though. Tomcat has a nice easy to understand xml descriptor, i actually prefer them than .conf files ;) On 14/04/2005, at 7:30 PM, Andreas Persson wrote: I have installed tomcat and added php-support with help of the php-servlet but it seem like php cant find any of the extensions installed. Like mysql. I have the php4-mysql package installed. If i run php -i from the commandline its telling me that I have mysql-support and a small php-script runned from the commandline verifies this. But if i run phpinfo() from a php-page under tomcat there is no support for mysql (or anyother extension). It tells me that its using /etc/php.ini and I have enabled the mysql extension in it. Anyone who knows why tomcat failes to find the php-extensions? /Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to unset a post variable
Hi! I have another little question hehe :D, i have a page with a form where the user insert data and can click in a new,edit or delete button. I've make that when a button is clicked the page refresh and in the head of the page i have conditions like this: if ($_POSt[buttonNew]!=) { insert commands.. } , etc My question is, how can i unset $_POST[buttonNew] or leave it empty because when the user refresh the page make insert commans again because the $_POST[buttonNew] arent empty. Thx in advance for all *^_^* -- Mario de Frutos Dieguez División de Ingeniería del Software y Comunicaciones CARTIF -Parque Tecnológico Boecillo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cant get data
Hi all, I have a problem getting the data from a post request. I have tried $_POST and $HTTP_RAW_POST_DATA and they appear to be completely empty. the always_populate_raw_post_data directive is set to on. Below is the incoming data as captured by ethereal: POST /cyprus/reply.php HTTP/1.1 Host: 212.31.98.213 Connection: keep-alive, TE X-External-Id: ef58e0602c7db247419ca535eb66e4d4 X-Recipient: 99527583:0:0 X-Sender: 4000 X-Status: done TE: trailers Any ideas ? I am at a loss here Thanks, Kyriacos -- Kyriacos Sakkas Netsmart Development Team Tel: + 357 22 452565 Fax: + 357 22 452566 kyriacos(at)netsmart.com.cy http://www.netsmart.com.cy Taking Business to a New Level! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: cant get data - Solved
Solved getallheaders() worked. Kyriacos Sakkas wrote: Hi all, I have a problem getting the data from a post request. I have tried $_POST and $HTTP_RAW_POST_DATA and they appear to be completely empty. the always_populate_raw_post_data directive is set to on. Below is the incoming data as captured by ethereal: POST /cyprus/reply.php HTTP/1.1 Host: 212.31.98.213 Connection: keep-alive, TE X-External-Id: ef58e0602c7db247419ca535eb66e4d4 X-Recipient: 99527583:0:0 X-Sender: 4000 X-Status: done TE: trailers Any ideas ? I am at a loss here Thanks, Kyriacos -- Kyriacos Sakkas Netsmart Development Team Tel: + 357 22 452565 Fax: + 357 22 452566 kyriacos(at)netsmart.com.cy http://www.netsmart.com.cy Taking Business to a New Level! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and linux shell script
I don't think you'll find anything in PHP as simple as the shell script version of dialog, but you may be able to bang something together like that using ncurses. Probably handier if your time is more important than the machines, to just use the shell version using one of the Program Executions functions. Personally I suggest passthru: ?php function yesno($str){ $tmpvar = 0; // to avoid E_NOTICE passthru(dialog --yesno . escapeshellarg($str) . 200 10, $tmpvar); return $tmpvar; } ? On 15 Apr 2005 12:22:05 +0530, Balwant Singh [EMAIL PROTECTED] wrote: hello, 1) first of all i would like to inform you that i have made a PHP script which also have some amount of linux shell script in it for converting emails from EVOLUTION to MOZILA THUNDERBIRD just by executing this script. if anybody need it, do let me know, i will send the same. 2) i am also exploring possibilities of using linux dialog boxes (used in shell scripting) with PHP. has anybody tried it, may please advise me how to call dialog boxes through PHP in CLI. also please share with me if u have information on how to use PHP with Shell Scripting. thx with best wishes balwant singh [EMAIL PROTECTED] 0091-120-2568472 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Barcodes
I just ordered a CueCat from eBay to play with reading Barcodes. Of course we'll use a Symbol or some other reader when we implement this in production, but I thought this would be a start. There are several classes at phpclasses.org (http://www.google.com/custom?q=barcodehl=enlr=ie=UTF-8oe=ISO-8859-1c2coff=1client=pub-2951707118576741cof=FORID:1%3BL:http://files.phpclasses.org/graphics/googlesearch.jpg%3BLH:50%3BLW:256%3BGL:1%3BBGC:A3C5CC%3BT:%2300%3BLC:%23ff%3BVLC:%23663399%3BALC:%23ff%3BGALT:%23663399%3BGFNT:%23ff%3BGIMP:%23ff%3BDIV:%2322%3BLBGC:A3C5CC%3BAH:center%3BS:http://www.phpclasses.org/search.html%3Bdomains=www.phpclasses.orgsitesearch=www.phpclasses.orgstart=10sa=N) for generating barcodes. At this point I'm assuming a form with a text field with onchange=this.form.submit(); would handle reading the barcode and submitting it. I'm assuming we would need to have all our barcodes in a single format (codabar, code39, etc). Would I then need to store barcode data. The barcodes will be generated from unique part numbers so I'm thinking I can generate them (and compare them to input) on the fly. -- Thanks for any help, Mike Smith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to unset a post variable
On Fri, 15 Apr 2005 14:08:36 +0200, Mario de Frutos Dieguez [EMAIL PROTECTED] wrote: My question is, how can i unset $_POST[buttonNew] or leave it empty because when the user refresh the page make insert commans again because the $_POST[buttonNew] arent empty. The browser sends $_POST, you can't just tell PHP to accept it the one time, and not the other, unless you use sessions of course. You might also try to refresh using a 302-header I think, but I forgot how it worked exactly. It makes the browser refresh so that next time the user presses F5 or something the POST-data doesn't get sent. -- Nieko Maatjes http://www.nieko.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: How to unset a post variable
Your best bet is to check that the data has not already been inserted rather than try to fiddle with the post: Don't know what db you are using but something like IF NOT EXISTS (SELECT X FROM Y WHERE Z=1) INSERT INTO Y VALUES X Cheers Mark -Original Message- From: Nieko Maatjes [mailto:[EMAIL PROTECTED] Sent: 15 April 2005 14:34 To: php-general@lists.php.net Subject: [PHP] Re: How to unset a post variable On Fri, 15 Apr 2005 14:08:36 +0200, Mario de Frutos Dieguez [EMAIL PROTECTED] wrote: My question is, how can i unset $_POST[buttonNew] or leave it empty because when the user refresh the page make insert commans again because the $_POST[buttonNew] arent empty. The browser sends $_POST, you can't just tell PHP to accept it the one time, and not the other, unless you use sessions of course. You might also try to refresh using a 302-header I think, but I forgot how it worked exactly. It makes the browser refresh so that next time the user presses F5 or something the POST-data doesn't get sent. -- Nieko Maatjes http://www.nieko.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Gamma Global : Suppliers of IBM, Compaq, Cisco, Sun Microsystems, 3Com and HP Products. GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY ** CONFIDENTIALITY NOTICE: This Email is confidential and may also be privileged. If you are not the intended recipient, please notify the sender IMMEDIATELY; you should not copy the email or use it for any purpose or disclose its contents to any other person. GENERAL STATEMENT: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content herein may be held binding upon Gamma Global (UK) Ltd or any associated company unless confirmed by the issuance of a formal contractual document or Purchase Order, subject to our Terms and Conditions available from http://www.gammaglobal.com EOE ** ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] configure problem on solaris 2
Hello, I'm having trouble installing php.4.3.11 ub Solaris8: ./configure and it is this promt infinitely: checking host system type...sparc-sun-solaris2.8 I see in on ather window the following processes: 25263 pts/10 S 0:00 /bin/sh ./configure 25323 pts/10 S 0:00 /bin/sh ./build/shtool echo -n -e %B 25330 pts/10 S 0:00 sed -e s/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g 25332 pts/10 R 0:21 tr x- x_ Any ideas ? thanks! -- Dipl.-Ing. Stefan Heim University of Ulm Sektion Informatik i.d. Psychotherapie Tel: +4973150025702 Fax: +4973150025662 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to unset a post variable
well this might help, you can see the referrer page from which the current one was accessed. this is javascript though but it might help depending on your situation. cheers Angelo Zanetti Z Logic [c] +27 72 441 3355 [t] +27 21 464 1363 [f] +27 21 464 1371 www.zlogic.co.za Mario de Frutos Dieguez wrote: Hi! I have another little question hehe :D, i have a page with a form where the user insert data and can click in a new,edit or delete button. I've make that when a button is clicked the page refresh and in the head of the page i have conditions like this: if ($_POSt[buttonNew]!=) { insert commands.. } , etc My question is, how can i unset $_POST[buttonNew] or leave it empty because when the user refresh the page make insert commans again because the $_POST[buttonNew] arent empty. Thx in advance for all *^_^* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Barcodes
Thanks Jason, I'll pass along any info I come across. I can generate barcodes easily enough. I guess I'll wait until I get the CueCat and see what troubles I run into. Our suppliers seem willing to cooperate in terms of putting whatever barcode we tell them to. Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] diffence between two numbers...
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Friday, April 15, 2005 3:35 AM said: $a = 7; $b = 27; somefunction($a, $b) // outputs 20 etc... does that exist? function difference($a, $b) { return abs($a-$b); } Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] diffence between two numbers...
On Friday 15 April 2005 19:01, Chris W. Parker wrote: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Friday, April 15, 2005 3:35 AM said: $a = 7; $b = 27; somefunction($a, $b) // outputs 20 etc... does that exist? function difference($a, $b) { return abs($a-$b); } Yep, I was wrong. Nice remark. Chris. -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgp3aXVVfTMql.pgp Description: PGP signature
[PHP] Amazon/eBay API
Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Magpie with a db cache?
Anyone know if it's possible to use Magpie (or similar) using MySQL for the caching instead of text files? I couldn't find anything in their docs. - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, SDL and OpenGL
Hi list: I'm receive a theme class call Computers Graphics in wich my and my friends programming making use of OpenGL library. Few day ago I have a brilliiant or an stupid idea to narrate to my teacher if I can make my final course project with PHP. They tell me that is possible always I use OpenGL. So, I investigate in Discussion Boards and they tell me that exists SDL library and I can use it to comunicate my application with OpenGL. Well Y have the phpSDL library and I made my fisrt things. But I have a problem and it's that I haven't more information to continue. If exists somebody in this list that this idea pass for his mind can help me? Or somebody know how obtain documentation about it? Regards Reynier Pérez Mira 3ero. Ing. Informática Entre más inteligente me siento, más me doy cuenta de lo ignorante que soy.
Re: [PHP] dynamic image will not print properly
I got it figured out finally! It is so stupid with what the issue was... My image was being created exactly as it should have been - and the code was fine. Now where my issue was: I had a line of code in there that was to prevent people from calling the script directly (had to be referred from a particular page). Well IE did not like that for printing. Even though the script acted exactly as it should have by design. I saved the image to my desktop to test it, and when opening in an image app - it would not even open (even though displaying fine in a browser). So I changed the file ext of the downloaded file to that of a text file and opened it... and what do you know - there was the error my php script generates when the page is not called properly. So I removed that line of code (completely irrelevant to the image itself) And win/IE could print like all the other browsers could. doh! Dustin On 14-Apr-05, at 5:41 PM, Richard Lynch wrote: You'd want to http://php.net/urlencode the text, then. ?php $text = This is an example!; $text_url = urlencode($text); $url = http://example.com/gd_script/text=$text_url/fool_ie.jpg;; ? On Wed, April 13, 2005 5:42 pm, DuSTiN KRySaK said: One thing I feel is important to point out before I keep banging my head off of the wall here... In the URL parameter that is sent to the file, the url parameter is just carrying text that is printed into the image. It is not actually the image name, or anything. The image is generated in the cstl file (which actually is the image - sends JPEG headers,etc) - with the text on it (grabbed from the URL parameter). d On 13-Apr-05, at 5:03 PM, Richard Lynch wrote: Yup. $_PATH['x'] for the items that look like this: .../x=42/ And $PATH (without the underscore) is a string concatenation of all elements (after the PHP script) that look like this /whatever/ So you might use something like a PHP script named 'scale' and then: http://example.com/scale/width=100/height=100/images/subdir/ bigpic.jpg and then you know that you want to scale the image in your images/subdir naemd bigpic.jpg down to 100x100 at maximum. You'll have: $_PATH['width'] - 100 $_PATH['height'] - 100 $PATH = '/images/subdir/bigpic.jpg' On Tue, April 12, 2005 6:21 pm, DuSTiN KRySaK said: And then all I should have to do is change my $_REQUESTS to $PATH in hte cstl file right? d On 12-Apr-05, at 5:46 PM, Richard Lynch wrote: On Mon, April 11, 2005 1:14 pm, DuSTiN KRySaK said: hey - thanks a lot for the code snip - I am trying to use it now Just to confirm - the $path include file is included in the file that calls the cstl file - correct? Yes. Something like: ?php require 'pathinfo.inc'; ? You can use this same technique for not just JPEG, but also PDF, SWF (Ming) and FDF files, all of which Microsoft will screw up if you don't fool them with a URL that looks like static content. d On 5-Apr-05, at 5:57 PM, Richard Lynch wrote: On Tue, April 5, 2005 2:26 pm, DuSTiN KRySaK said: Hi there - I had my first crack at creating a dynamic image. The thing is - the image is displayed fine in the browser, but when you go to print it, the image is either missing, or part of it is missing. Is there something special needed to print a dynamic image? What you did, *should* work just fine. But we're talking *MICROSOFT* here! These people do *NOT* follow standards. Period. Here is a code snippet used to create the image header(Content-type: image/jpg); $image = imagecreatefromjpeg(template_cpn.jpg); $red = imagecolorallocate( $image, 255,0,0 ); imagestring($image, 2, 306, 200, $couponcode, $red); imagestring($image, 2, 306, 235, $exp, $red); imagestring($image, 2, 175, 338, $myname, $red); imagestring($image, 2, 175, 360, $myemail, $red); imagejpeg($image); imagedestroy($image); Now the way I have it set up, is that there is a PHP file that generates the image (the above code). Then I have a parent PHP page that calls that page like so: $theurl = cstl.php?dk=soemthinghere echo img src=\$theurl\; See any issues in my code or setup? Any ideas? Here's what you do: You make it *IMPOSSIBLE* for Microsoft to screw up. This means you make your URL look JUST LIKE any other JPEG URL. $theurl = cstl/dk=somethinghere/whatever.jpg; Step 1: Add/Create an .htaccess file with this: Files cstl ForceType application/x-httpd-php /Files This forces Apache to treat the file named 'cstl' as a PHP script. Step 2: Rename cstl.php to just 'cstl' (see Step 1) Step 3: Instead of using $_GET['dk'] do this: $pathinfo = $_SERVER['PATH_INFO']; $pathinfo = explode('/', $pathinfo); //Key-Value pairs: $_PATH = array(); //Path information buried in URL for source image sub-directories: $PATH = array(); while (list(, $keyval) = each($pathinfo)){ $parts = explode('=', $keyval); switch(count($parts)){ case 0: break; //do nothing with bogus extra '/' in URL case 1: $PATH[] = $keyval; default: $key = $parts[0]; unset($parts[0]); $_PATH[$key] =
Re: [PHP] Amazon/eBay API
Brian Dunning wrote: Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds? There are two PEAR classes which handle both of these things, Services_Ebay and Services_Amazon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setting permissions such that file can be included but not open directly
Hi! I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves... Is it possible to set folder permission such that files inside it cant be open directly but could be included? thanks in advance :) -- Free cPanel Web Hosting http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mysql insert problems
All, I have a form which submits technical requests. It worked fine on an old linux box using Mysql 3 series but recently we switched to windows 2003 server SP1 using Mysql 4.1.10. It was doing this before the service pack. I get the form values and then insert them into a table. Sometimes it works and sometimes it dies. I don't know where to look to fix this. Here is my code: ?php $Email = $_POST['Email']; $Phonenumber = $_POST['Phonenumber']; $RoomNo = $_POST['RoomNo']; $Situation = $_POST['Situation']; $type = $_POST['type']; if (!( (empty($Phonenumber)== TRUE) || (empty($Email)== TRUE) || (is_email($Email) == false) ) ) { $ip = $_SERVER['REMOTE_ADDR']; $DateRec = date(Y) .-.date(m).-.date(d); $TimeRec = date(H).:.date(i).:.date(s); // initialize database connection include ('../../db.inc'); $connection = mysql_connect($Host,$User,$Password) or die(Invalid server or user); // select database mysql_select_db(techsupport, $connection); //formulate and run query $query = insert into techsupport(Completed,Phonenumber,RoomNo,Email,Situation,DateRec,TimeRec,ip) values('N','$Phonenumber','$RoomNo','$Email','$Situation','$DateRec','$TimeRec','$ip'); $result = mysql_query($query,$connection) or die(Couldn't Insert into table techsupport); $WONumber = mysql_insert_id(); etc... Any help would be appreciated. Thanks - Frank -- Frank Miller Webmaster and Computer Specialist Texas AM Uiversity-Texarkana Phone/Voice Mail 9032233156 Fax 9032233139 Web Page www.tamut.edu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setting permissions such that file can be included but not open directly
directly to private/includefile.php can run the script without authorising themselves... Is it possible to set folder permission such that files inside it cant be open directly but could be included? Can you just give read permissions -only- to the user that PHP runs as and not these other users? -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql insert problems
Frank Miller wrote: All, I have a form which submits technical requests. It worked fine on an old linux box using Mysql 3 series but recently we switched to windows 2003 server SP1 using Mysql 4.1.10. It was doing this before the service pack. I get the form values and then insert them into a table. Sometimes it works and sometimes it dies. I don't know where to look to fix this. Here is my code: Search the archives for connecting to MySQL 4.1, and/or look at the MySQL manual. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting permissions such that file can be included but not open directly
Dasmeet Singh wrote: Hi! I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves... Is it possible to set folder permission such that files inside it cant be open directly but could be included? thanks in advance :) In private/.htaccess put: Order Deny,Allow Deny from all -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Streaming video BLOBs from MySQL
J J wrote: I have a case where video files (mov, flv, etc) have been stored in a MySQL database as blobs. I'm loading them into a flash video player and everything works fine except it takes longer it seems and it doesn't allow streaming the actual video. If I load the same videos with a direct link to the http:// file system (/videos/file.flv) it loads in super-fast and allows streaming. I'm guessing mysql and/or php doesn't actually release the BLOB until it's loaded it completely. So, is there a way to actually have PHP read the BLOB and stream it as it's loading? Is there an fstream() option like the fread()? use mysql's SUBSTRING() function in a loop -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Amazon/eBay API
There is a PHPNuke (web portal application) module that will allow you to open an Amazon Store on your website. NukeAmazon http://www.PrecioGasolina.com/ I'm still looking for an eBay feed, I think the barrier there is that I heard eBay charges some big bucks to be able to access the interface. Amazon on the other hand recognized the power of having a proliferation of front-ends promoting and selling their products and provides access pretty much for free (there are features you can pay extra for if you are inclined). Don't know if eBay will ever come along. Apple, even today, doesn't recognize that IBM gained it's dominance by giving away its bios listing and hardware specs (and some of its business) in the very beginning, while apple looked at that type of move as giving away income it was intitled to receive and jealously guarded it's monopoly, even sueing vendors in some cases. eBay probably feels they already have a monopoly on auction sites and don't need to give their stuff away. Warren Vail [EMAIL PROTECTED] -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 9:57 AM To: php-general@lists.php.net Subject: [PHP] Amazon/eBay API Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds? - Brian -- 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] Mysql insert problems
Hi Whilst you are searching the net, you might also want to search for 'sql injection'. This is no joke! Please use the mysql_escape_string on each variable you get from the user side. In your example $Email = mysql_escape_string($_POST['Email']); $Phonenumber = mysql_escape_string($_POST['Phonenumber']); etc There are some issues when magic quotes are turned on but you can implement a hack that corrects any consuequences of that (stripslashes) Andy -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting permissions such that file can be included but not open directly
I use a page to authorize a user and based on certain criterias (user group etc) include a file in another directory (named private)... Everything is working fine but the problem is anyone goign directly to private/includefile.php can run the script without authorising themselves... Is it possible to set folder permission such that files inside it cant be open directly but could be included? Configure apache to not allow access to the private directory... That will stop web browsers from getting there, but still allow your php script to include() a file within it. Something like the below if you're using apache. Other servers have similar functionality... Location /url/to/private/directory Order deny,allow Deny from all /Location -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql insert problems
On Fri, 15 Apr 2005, Frank Miller wrote: All, I have a form which submits technical requests. It worked fine on an old linux box using Mysql 3 series but recently we switched to windows 2003 server SP1 using Mysql 4.1.10. It was doing this before the service pack. I get the form values and then insert them into a table. Sometimes it works and sometimes it dies. I don't know where to look to fix this. Here is my code: [snip] Take a look at the following functions: http://us4.php.net/manual/en/function.mysql-errno.php http://us4.php.net/manual/en/function.mysql-error.php and modify your die() statements (all of them) to include the output of these functions which might shed some light on exactly what the problem is when it's failing. Good luck! -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php and linux shell script
On Friday 15 April 2005 08:52, Balwant Singh wrote: 2) i am also exploring possibilities of using linux dialog boxes (used in shell scripting) with PHP. has anybody tried it, may please advise me how to call dialog boxes through PHP in CLI. also please share with me if u have information on how to use PHP with Shell Scripting. Hi I like to think of PHP as a stream programming language. You can use it to generate a stream of html documents, images, sound files, text files, etc etc etc. So why shouldn't you use it to make your own dialogs in it as well? Make an include file that contains the classes, then just declare your class and use it. Like $mydialog=new clsDialog; $mydialog-type=DIALOGTYPE_INPUTBOX; $mydialog-title=Provide some information; $mydialog-regexp=$xxx^; $result=$mydialog-showDialog(); unset($mydialog); Off course the limitations are second to none! I have released some PHP CLI scripts under the terms of GPL2 and they all use the same basic simple engine for argument processing. It may not suit your needs, but you're welcome to study it to get you started. With kind regards Andy -- Registered Linux User Number 379093 -- --BEGIN GEEK CODE BLOCK- Version: 3.1 GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++ L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e$@ h++(*) r--++ y--() -- ---END GEEK CODE BLOCK-- -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ -- -- sas_php_script.php Description: application/php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] create file download page for firefox using net-transport thru flashGot?
Hello, PHP gurus, As a PHP newbie, I am trying to create a PHP page that generates and force dowload a file depending on user's input. Attached is the code. I give 's' to 'submit' and double checked that the value is correctly retried and the control flow is right. It works well if I use direct download of firefox or open the download file with an editor. It also works well with IE. But if I tried to download the file thru flashGot extension of firefox, which is connected to net-transport (an multi-thread download accelerator), the name field has 'tmp' instead of the real file name. And the downloaded tmp has only the stderr saying that '/var/tmp' can not be removed as it is a directory. But this flashGot works if I replace the variables with its real value. I tried to output the value of $filenm and it is correct. It must be sth that has to do with how this sort of download accelerator deals with HTML headers. Has anyone seen this problem before? can I have some hint? Thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] con'td create file download page for firefox using net-transport thru flashGot?
Hi, Here is the code ?php $filenm = '/var/tmp/'; $s = 1; $q =2; switch( $_POST[submit] ) { case 's': $filenm .= 's.tab'; //create $filenm break; case 'q': $filenm .= 'q.tab'; //create $filenm break; } /* echo file name = {$filenm}br\n; echo base name = , basename($filenm), br\n; echo file size = , filesize($filenm), br\n; echo file name = {$filenm}br\n; */ $sname = basename($filenm); header(Content-Type: application/octet-stream); header('Content-Disposition: attachment; filename=' . $sname); header('Content-Transfer-Encoding: binary'); header('Content-Length: '.filesize($filenm)); readfile($filenm); unlink($filenm); ? Thanks
[PHP] Font color
Hey, On our profiles page we are allowing the person to pick their own font color and background image, the font color is picked by a DHTML popup and displays swatches of color, when the user picks the color she wants its html RRGGBB value is automatically inserted... Heres the problemthe profile is displayed like this (I'll use html code so it will be easier to understand) bName:/b iHarry Houdini/i if they pick a light color for the ipart/i I want the b part/b to be the opposite... eg: if they pick white I need the heading to be black and vice versa...any way to do this? Thanks, Ryan -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 4/14/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] processing email
I want to write an application that's almost like a webmail, but not quite. It must receive emails from several mailing lists, store them in a database, allow making annotations, provide some kind of accounts with passwords, etc. It's quite specialized, it cannot be used as a webmail proper, nor a webmail can be used instead (and that's why i'm writing it). But i do not want to reinvent the wheel. Are there any PHP libraries or something to process email? E.g., for things like here's the message, separate the headers from the body and do something different with each other item or find a discussion thread in these emails if i give you the headers of each message. Things like that. BTW, i will use PHP-4.3 -- Florin Andrei http://florin.myip.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Amazon/eBay API
Hello, on 04/15/2005 01:56 PM Brian Dunning said the following: Does anyone know of any PHP classes for processing the Amazon or eBay XML feeds? Here you may find classes to provide API to acess Web servers of many sites including Amazon and eBay. http://www.phpclasses.org/browse/class/33.html -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: processing email
Hello, on 04/15/2005 11:17 PM Florin Andrei said the following: I want to write an application that's almost like a webmail, but not quite. It must receive emails from several mailing lists, store them in a database, allow making annotations, provide some kind of accounts with passwords, etc. It's quite specialized, it cannot be used as a webmail proper, nor a webmail can be used instead (and that's why i'm writing it). But i do not want to reinvent the wheel. Are there any PHP libraries or something to process email? E.g., for things like here's the message, separate the headers from the body and do something different with each other item or find a discussion thread in these emails if i give you the headers of each message. Things like that. BTW, i will use PHP-4.3 You may want to start to use POP3 to fetch any messages that you want to be processed. Here you may find one POP3 class for that purpose: http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Font color
On 16 Apr 2005 Ryan A wrote: eg: if they pick white I need the heading to be black and vice versa...any way to do this? Well it depends what you mean by opposite, but as a starting approach I would try simply complementing the bits in the RGB value: $opposite_color = $original_color ^ 0xFF; This will yield, for example, all of the following, and their inverses: #00 = #FF (black = white) #FF = #00 (red = cyan) #00FF00 = #FF00FF (green = magenta) #FF = #00 (blue = yellow) -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Font color
Here is a little code that shows the web-safe colors and their opposites using the algorithm I described in the previous message: html head title Web-safe color 'opposites' /head body ?php # Display color opposites for web colors $weblist = array('00', '33', '66', '99', 'CC', 'FF'); print(table cols=\4\ cellspacing=\5\ cellpadding=\0\); print(tr\n); print(th align=\right\Color/td\n); print(th width=\100\ align=\center\Color swatch/td\n); print(th width=\100\ align=\center\'Opposite' swatch/td\n); print(th align=\left\'Opposite' color/td\n); print(/tr\n); foreach ($weblist as $red) { foreach ($weblist as $green) { foreach ($weblist as $blue) { $hexcolor = $red . $green . $blue; $hexoppcolor = sprintf(%06X, (hexdec($hexcolor) ^ 0xFF)); print(tr\n); print(td align=\right\#$hexcolor/td\n); print(td width=\100\ height=\20\ bgcolor=\#$hexcolor\nbsp;/td\n); print(td width=\100\ height=\20\ bgcolor=\#$hexoppcolor\nbsp;/td\n); print(td align=\left\#$hexoppcolor/td\n); print(/tr\n); } } } print(/table\n); ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Determining array type
We have two kinds of arrays in PHP: $array[name] = George $array[0] = George How can I determine (with a function returning true/false for example) which type of array I am working with? -- NSK (Nikolaos S. Karastathis) Personal Homepage at http://nsk.wikinerds.org/ Owner of http://portal.wikinerds.org Owner of http://www.nerdypc.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php