Re: [PHP] How does one obtain the resolution of an image in PHP?
Arnaldo Gandol wrote: hi, I have troubles with strangers characters in my html pages, I've fixed them by using mb_convert_encoding() function with UTF-8 encoding but I've hear that mbstring library is unstable in some linux distributions. Does any body knows how to solve this problem without using mbstring library. I'm working with php-5. Thank you beforehand. Yeah if you tell me what that has to do with the resolution of images! Please create a new post on the main list! -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making a tutorial
Gustav Wiberg wrote: - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: PHP-General php-general@lists.php.net Sent: Friday, March 17, 2006 7:51 AM Subject: [PHP] making a tutorial I'm making a tutorial and don't really understand how to do this myself :) pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p [snip] I don't know if this works in PHP as well. It is a checkbox so it won't work without [] in PHP. Regards, -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making a tutorial
Sameer N Ingole said: Gustav Wiberg wrote: - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: PHP-General php-general@lists.php.net Sent: Friday, March 17, 2006 7:51 AM Subject: [PHP] making a tutorial I'm making a tutorial and don't really understand how to do this myself :) pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p [snip] I don't know if this works in PHP as well. It is a checkbox so it won't work without [] in PHP. Regards, -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It will work without []. It will just not be an array. For checkboxes you could use it without [] but then it would be more like a radio button. Or you could use it with different names in name=. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] double lines
Hi Im using the phpmailer class to send text emails (not html), it works 100%. So emails sent from a php script look correct in the mail client, however when I first load/show the message in a textarea and then send it to the same script which then sends the email, on some mail clients there are double line between paragraphs. Its almost like the textarea is putting in a extra \n, how can I test for this or fix this problem. Regards, Clive -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] making a tutorial
pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p [snip] I don't know if this works in PHP as well. It is a checkbox so it won't work without [] in PHP. It will work without []. It will just not be an array. For checkboxes you could use it without [] but then it would be more like a radio button. Or you could use it with different names in name=. Surely parsing the final checkbox would overwrite any previous ones unless they were clearly identifiable as different. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How does one obtain the resolution of an image in PHP?
Simon M. Campden-Main wrote: Good morning, folks. Can any one direct me to a snippet or suggest an approach to obtaining the resolution of an image [file] with PHP. exif_read_data() is great if the image was taken with a camera that is exif compliant, but is no help with my scanned images. getimagesize() gives me height and width - not much help that I can see. I want ppi! I've no doubt that this is another case where the answer is painfully obvious and my mind to dull, but I've spent the better part of the day searching usenet groups and the PHP docs and come up with naught. I'm running the current Cent OS distribution of EL, PHP Version 4.3.9 with, of course, GD support. Any suggestions would be most appreciated. Thank you. Simon [EMAIL PROTECTED] There is no way you can do it. To have on screen e.g. 40 ppi or 80 ppi when the image has a size of 400x400 pixel you would have to read out the image how big a pixel in it is. at 80 ppi you would have your normal image and on 40 ppi the pixels used per dot would be duplicated. you still have 400 pixel in width and you would not be able to count the pixels who got duplicated. If you are lucky it's written in the file. Otherwise no chance. The normal screen resolution is: with an average of 0.26 mm ~ 3.8 pixel/mm ~ 97 pixel per inch. No matter what kind of resolution you would choose (800x600,1024x768 etc.) an image having for example 48ppi would have pixels that use 2x2 pixels (4 pixels) as one colored pixel and so on. Now guess what you see when you have 194 ppi. Nothing, it's still 97 ppi because it's not possible for the screen to view anything else. Normally the screen would just duplicate the imagesize from 400x400 to 800x800. Greets Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session_cache_expire()
suresh kumar wrote: I searched php.net/session and weberdev website and implemented session_cache_limiter() and session_cache_expire() function.but i am not getting the output what i want.i spend whole day on searching.any one give the solution for my problem in windows,if user idle for 1 minute,his desktop screen is changed to screen saver.i like to implement the same logic in my project if user is idle for 3 minutes its session will have to automatically destroy.i am waiting for or response. __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com You have to set the session timeout to 3 minutes. Or set a javascript that automatically routes to a site that kills the session when the user is idle for 3 minutes. you could set a META html tag for that also. Note: session_cache_expire() and session_cache_limiter() has to be set before session_start() Greets Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: double lines
clive wrote: Hi Im using the phpmailer class to send text emails (not html), it works 100%. So emails sent from a php script look correct in the mail client, however when I first load/show the message in a textarea and then send it to the same script which then sends the email, on some mail clients there are double line between paragraphs. Its almost like the textarea is putting in a extra \n, how can I test for this or fix this problem. Regards, Clive This might be because there are \r in it. Search for them and replace them with so you wont have any probs. -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making a tutorial
George Pitcher wrote: pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p [snip] I don't know if this works in PHP as well. It is a checkbox so it won't work without [] in PHP. It will work without []. It will just not be an array. For checkboxes you could use it without [] but then it would be more like a radio button. Or you could use it with different names in name=. Surely parsing the final checkbox would overwrite any previous ones unless they were clearly identifiable as different. George numerize them favourite[1],favourite[2],favourite[3]... and so on That works! btw print_r($GLOBALS) would you print out what you got from the Posted site with some more values. Give it a try Greets barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] making php code from db work
Greetings All, I pull the following snippet of code directly from a MySQL database: ul lia href=# title=Highway Toll FacilitiesHighway Toll Facilities/a/li lia href=# title=Mass TransitMass Transit/a/li lia href=?php echo _root ?/expertise/index.php?category=specialized_expertiseamp;content=Intermodalamp;side_content=our_work title=IntermodalIntermodal/a/li lia href=# title=Public PolicyPublic Policy/a/li lia href=# title=Mega-ProjectsMega-Projects/a/li lia href=# title=Infrastructure RenewalInfrastructure Renewal/a/li lia href=# title=InternationalInternational/a/li lia href=# title=Design-BuildDesign-Build/a/li lia href=# title=WorkoutsWorkouts/a/li lia href=# title=Advanced Revenue Collection SystemsAdvanced Revenue Collection Systems/a/li lia href=# title=TIFIATIFIA/a/li lia href=# title=Corporate Alliances Ancillary RevenueCorporate Alliances Ancillary Revenue/a/li lia href=# title=Fare PolicyFare Policy/a/li lia href=# title=Joint DevelopmentJoint Development/a/li /ul As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Thanks in advance. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] making php code from db work
Hi! On Fri, 17 Mar 2006 12:07:42 +0200 Schalk wrote: Greetings All, I pull the following snippet of code directly from a MySQL database: [ . . . ] lia href=?php echo _root ?/expertise/index.php? category=specialized_expertiseamp;content=Intermodalamp;side_content=our_work title=IntermodalIntermodal/a/li [ . . . ] As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be Hmm.. I wanted to say check http://www.php.net/eval but then again, someone very famous in this group once said: If eval() is the answer, you're almost certainly asking the wrong question. So, maybe, I shouldn't even recommend that. (^_-) Try: http://www.google.com/search?q=parsing+php+code+db better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Maybe that one's better. Thanks in advance. HTH, - Edwin - -- A wise person will listen and take in more instruction. - Proverbs 1:5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] making php code from db work
The only two ways I can think this could work is you must either write the output to a file with a php extension and then include that file, or you must set up the apache server to parse html files in the same way as it does php files. Just doing a normal output on a standard server won't recognise any server-side script in that output (which is what you've already experienced). Arno DotContent Professional Content Management Solutions -Original Message- From: Schalk [mailto:[EMAIL PROTECTED] Sent: 17 March 2006 12:08 To: php-general@lists.php.net Subject: [PHP] making php code from db work Greetings All, I pull the following snippet of code directly from a MySQL database: ul lia href=# title=Highway Toll FacilitiesHighway Toll Facilities/a/li lia href=# title=Mass TransitMass Transit/a/li lia href=?php echo _root ?/expertise/index.php?category=specialized_expertiseamp;content=Intermodal amp;side_content=our_work title=IntermodalIntermodal/a/li lia href=# title=Public PolicyPublic Policy/a/li lia href=# title=Mega-ProjectsMega-Projects/a/li lia href=# title=Infrastructure RenewalInfrastructure Renewal/a/li lia href=# title=InternationalInternational/a/li lia href=# title=Design-BuildDesign-Build/a/li lia href=# title=WorkoutsWorkouts/a/li lia href=# title=Advanced Revenue Collection SystemsAdvanced Revenue Collection Systems/a/li lia href=# title=TIFIATIFIA/a/li lia href=# title=Corporate Alliances Ancillary RevenueCorporate Alliances Ancillary Revenue/a/li lia href=# title=Fare PolicyFare Policy/a/li lia href=# title=Joint DevelopmentJoint Development/a/li /ul As you can see in line three, I use the following PHP code there: ?php echo _root ? Unfortunately when this is loaded into the PHP page this bit of code is not parsed and the link still includes the code snippet. Is there a way I can make this work or would it be better to build this nav tree in a more robust fashion such as loading the li one by one in a for loop for example? Thanks in advance. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Business.Solution.Developers -- 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] Re: double lines
Thanks Ive tried it and waiting for feed back from the client on my pc it shows correctly ,Im using thunder bird on his computer he uses outlook, but Ive sent it to other people who have outlook and its fine on there PC. Does the html textarea add in \r. clive Barry wrote: clive wrote: Hi Im using the phpmailer class to send text emails (not html), it works 100%. So emails sent from a php script look correct in the mail client, however when I first load/show the message in a textarea and then send it to the same script which then sends the email, on some mail clients there are double line between paragraphs. Its almost like the textarea is putting in a extra \n, how can I test for this or fix this problem. Regards, Clive This might be because there are \r in it. Search for them and replace them with so you wont have any probs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How does one obtain the resolution of an image in PHP?
Hi! On Fri, 17 Mar 2006 09:46:16 +0100 Barry wrote: Simon M. Campden-Main wrote: Good morning, folks. Can any one direct me to a snippet or suggest an approach to obtaining the resolution of an image [file] with PHP. [ . . . ] There is no way you can do it. To have on screen e.g. 40 ppi or 80 ppi when the image has a size of 400x400 pixel you would have to read out the image how big a pixel in it is. at 80 ppi you would have your normal image and on 40 ppi the pixels used per dot would be duplicated. you still have 400 pixel in width and you would not be able to count the pixels who got duplicated. If you are lucky it's written in the file. Otherwise no chance. The normal screen resolution is: with an average of 0.26 mm ~ 3.8 pixel/mm ~ 97 pixel per inch. No matter what kind of resolution you would choose (800x600,1024x768 etc.) Reading the surrounding sentences, I think I can see where you're coming from. But, the above statement is a bit confusing. There is a reason why it's called pixel per INCH. And it definitely have something to do whether your monitor is set to 800x600, 1024x768, etc. A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. If your 15' monitor is normally setup at 1024x768, everything (images, etc.) will look a bigger if the same image is viewed using the same monitor at 800x600. This happens because the pixels are now bigger. (One image pixel is now compose of many physical dots on the screen.) But, I guess, you already knew that. (^_^) an image having for example 48ppi would have pixels that use 2x2 pixels (4 pixels) as one colored pixel and so on. Now guess what you see when you have 194 ppi. Nothing, it's still 97 ppi because it's not possible for the screen to view anything else. Normally the screen would just duplicate the imagesize from 400x400 to 800x800. Greets Barry HTH HAND, - Edwin - -- He that is slow to anger is abundant in discernment, but one that is impatient is exalting foolishness. - Proverbs 14:29 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] making a tutorial
On 17 March 2006 07:39, Gustav Wiberg wrote: - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: PHP-General php-general@lists.php.net Sent: Friday, March 17, 2006 7:51 AM Subject: [PHP] making a tutorial I'm making a tutorial and don't really understand how to do this myself :) pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0] - nMax. It is a checkbox. I might use favourite[] with mail() or store it in a mysql field. If mysql, would I store it in a varchar(20) or an enum() and how? John Hi there! Do you have to name it as favourite[]? Can't you name it as just favourite (without brackets) You need [] for it to be an array in PHP -- otherwise you only get one value no matter how many are checked. If you name it as just favourite, at least in Javascript you could loop through favourite as an array. I don't know if this works in PHP as well. It's easy enough to treat it as an array in Javascript with the brackets -- you just have to understand the equivalence between objects and arrays. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: double lines
clive wrote: Does the html textarea add in \r. Normally not. But the mailing function might do. Replace every \n with linbreak and every \r with linefeed with str_replace And probably you see where the problem is -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How does one obtain the resolution of an image inPHP?
- Edwin - wrote: Reading the surrounding sentences, I think I can see where you're coming from. But, the above statement is a bit confusing. There is a reason why it's called pixel per INCH. And it definitely have something to do whether your monitor is set to 800x600, 1024x768, etc. It's confusing but it's not ;) It's quite hard to explain but having the monitor set to 800x600 the physical inch isn't anymore. the image is still in 80ppi but using now the bigger pixels as reference per inch. This is very confusing and this whole ppi is very disturbing, because there isn't any real standard applyable for screens. A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. That's correct the ppi (theoretically) will be 53 or 68. If your 15' monitor is normally setup at 1024x768, everything (images, etc.) will look a bigger if the same image is viewed using the same monitor at 800x600. This happens because the pixels are now bigger. (One image pixel is now compose of many physical dots on the screen.) But, I guess, you already knew that. (^_^) Right ;) But the image is still in 80 ppi ;) And you probably now get where the problems are ;) Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session from php in ASP
Hi NG is it possible to get a Sessionvariable set in php read in an asp-file with the tag %= Session(php) %? Thanks in advance Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 5 installation problem
At 01:39 AM 3/17/2006, - Edwin - wrote: Hi! On Thu, 16 Mar 2006 20:45:29 -0400 Miles Thompson [EMAIL PROTECTED] wrote: At 06:23 PM 3/16/2006, Anthony Ettinger wrote: [...] Is there a drawback to running php5 as CGI? Anthony, I really don't know, because computers are much faster, so there may not be the time lags there were 10 years ago. As I understand CGI, the web server sees that the page is of type .php, starts up PHP, PHP processes the page, the web server shuts down PHP and sends out the results. The overhead of starting and stopping PHP (or Perl, etc.) was the complaint. When PHP is loaded as an Apache module there is not startup / shutdown overhead. If I have this wrong, or if PHP5 as a CGI stays resident and there is no penalty, will someone please correct me. No, nothing wrong there, I think. But there are other differences. (Like some functions not working, etc.) Pros and cons, one might say. Anyway, here are some results of a quick google search: http://www.google.com/search?q=php+CGI+module+difference Hmm.. I just couldn't find it but there should be a page about it on www.php.net ... (^_-) Regards - Miles HTH, - Edwin - Thanks Edwin. I guess it was too late and I couldn't formulate a proper search expression. I'd like to hear Chris Shiflet's opinion on the security advantages of running PHP5 as CGI. Why, after years of running PHP as an Apache module, the sudden conversion to CGI operation? I've noticed occasional references of PHP5 having issues with CPanel. Is it simply easier for ISPs, given the intense competitive cost pressures they are under, to not wrestle with these issues, but to say Here it is as a CGI if you want it. Regards - Miles Thompson -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 5 installation problem
Is there a drawback to running php5 as CGI? Anthony, I really don't know, because computers are much faster, so there may not be the time lags there were 10 years ago. As I understand CGI, the web server sees that the page is of type .php, starts up PHP, PHP processes the page, the web server shuts down PHP and sends out the results. The overhead of starting and stopping PHP (or Perl, etc.) was the complaint. When PHP is loaded as an Apache module there is not startup / shutdown overhead. If I have this wrong, or if PHP5 as a CGI stays resident and there is no penalty, will someone please correct me. No, nothing wrong there, I think. But there are other differences. (Like some functions not working, etc.) Pros and cons, one might say. Anyway, here are some results of a quick google search: http://www.google.com/search?q=php+CGI+module+difference Hmm.. I just couldn't find it but there should be a page about it on www.php.net ... (^_-) Regards - Miles HTH, - Edwin - Thanks Edwin. I guess it was too late and I couldn't formulate a proper search expression. I'd like to hear Chris Shiflet's opinion on the security advantages of running PHP5 as CGI. Why, after years of running PHP as an Apache module, the sudden conversion to CGI operation? I've noticed occasional references of PHP5 having issues with CPanel. Is it simply easier for ISPs, given the intense competitive cost pressures they are under, to not wrestle with these issues, but to say Here it is as a CGI if you want it. One major difference is the CGI runs as your user - whereas the apache module runs as the apache user which can cause problems with permissions etc (hence safe-mode and open-basedir to try and restrict what you can do). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date Question
Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the best way. Any help would be appreciated. (Current Code:) ?php $datestr = $row_rsSnags['date']; $arr1 = str_split($datestr, 2); echo $arr1 [2]; echo /; echo $arr1 [1]; echo /; echo $arr1 [0]; // echo $row_rsSnags['date']; ?
RE: [PHP] Re: How does one obtain the resolution of an image inPHP?
On 17 March 2006 11:15, - Edwin - wrote: A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. Er, no. The 15inches is a diagonal measure, so the screen is actually about 12x9, giving 67ppi in both directions. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Question
Hi How about doing this in the query string you send to mysql: DATE_FORMAT(fieldname, '%d %m %y') this way you wont have to mess around with the array stuff. for more info look here http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Regards Pure Web Solution http://www.purewebsolution.co.uk PHP, MYSQL, Web Design Web Services Tom Chubb [EMAIL PROTECTED] wrote: Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the best way. Any help would be appreciated. (Current Code:) ?php $datestr = $row_rsSnags['date']; $arr1 = str_split($datestr, 2); echo $arr1 [2]; echo /; echo $arr1 [1]; echo /; echo $arr1 [0]; // echo $row_rsSnags['date']; ? Pure Web Solution http://www.purewebsolution.co.uk PHP, MYSQL, Web Design Web Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Question
select date_format(date,%d/%m/%y) as date from table It'll show in 17/03/06 format select date_format(date,%d/%m/%Y) as date from table It'll show in 17/03/2006 format Tom Chubb wrote: Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the best way. Any help would be appreciated. (Current Code:) ?php $datestr = $row_rsSnags['date']; $arr1 = str_split($datestr, 2); echo $arr1 [2]; echo /; echo $arr1 [1]; echo /; echo $arr1 [0]; // echo $row_rsSnags['date']; ? -- --- João Cândido de Souza Neto Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Date Question [SOLVED]
Thanks guys. On 17/03/06, João Cândido de Souza Neto [EMAIL PROTECTED] wrote: select date_format(date,%d/%m/%y) as date from table It'll show in 17/03/06 format select date_format(date,%d/%m/%Y) as date from table It'll show in 17/03/2006 format Tom Chubb wrote: Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the best way. Any help would be appreciated. (Current Code:) ?php $datestr = $row_rsSnags['date']; $arr1 = str_split($datestr, 2); echo $arr1 [2]; echo /; echo $arr1 [1]; echo /; echo $arr1 [0]; // echo $row_rsSnags['date']; ? -- --- João Cândido de Souza Neto Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Tom Chubb [EMAIL PROTECTED] 07915 053312
Re: [PHP] Date Question
on the fly: use date_format function in select statement, format should be a string like %d%m%y not sure about it check on manual. hth adriano 2006/3/17, Tom Chubb [EMAIL PROTECTED]: Please can you help me. I've created a page where problems are posted into a database and I am using the datetime format in MySQL and trying to find the best way to display it in the 17/03/06 format. I've found a way of doing it (so you don't think I haven't googled, RTFM) but don't think it's the best way. Any help would be appreciated. (Current Code:) ?php $datestr = $row_rsSnags['date']; $arr1 = str_split($datestr, 2); echo $arr1 [2]; echo /; echo $arr1 [1]; echo /; echo $arr1 [0]; // echo $row_rsSnags['date']; ?
Re: [PHP] Re: How does one obtain the resolution of an image inPHP?
Hi! On Fri, 17 Mar 2006 13:12:21 - Ford, Mike wrote: On 17 March 2006 11:15, - Edwin - wrote: A 15-inch monitor at 800x600 will have around 53ppi x 40ppi (800 pixels divided by 15 inches, etc.) and *the same* monitor at 1024x768 will have around 68ppi x 51ppi. Er, no. The 15inches is a diagonal measure, so the screen is actually about 12x9, giving 67ppi in both directions. But of course! You're right (^_^) I was thinking more of if or for example as in for example you have a 25x25-inch monitor... But, yeah, a 25x25-inch monitor is rather ridiculous, I guess. Cheers! Mike - Edwin - -- Better is a needy but wise child than an old but stupid king... - Ecclesiastes 3:18 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session from php in ASP
[snip] is it possible to get a Sessionvariable set in php read in an asp-file with the tag %= Session(php) %? [/snip] Have you tried it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session from php in ASP
Yes. I don't get any values Jay Blanchard [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] [snip] is it possible to get a Sessionvariable set in php read in an asp-file with the tag %= Session(php) %? [/snip] Have you tried it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session from php in ASP
[snip] Yes. I don't get any values [/snip] Then it is not possible using that method. Have you tried writing session info to a file and then reading it from ASP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: setcookie security concerns [medium]
Rafael: ?php $thestyle= htmlentities($_POST['thestyle']); setcookie ('thestyle', $set, time()+31536000, '/', '', 0); header(Location: $HTTP_REFERER); ? Actually, you receive $set via GET, so you should use $_GET instead of $_POST. Yes, you are correct. In my example -- http://www.sperling.com/examples/styleswitch/ -- the value doesn't look like it is being added to the url and thus I mistakenly thought it was a POST. I wonder why the value isn't apparently attached to the url in this case? tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: setcookie security concerns [medium]
Rafael wrote: Actually, you receive $set via GET, so you should use $_GET instead of $_POST. A lot of people use $_REQUEST (wich is a combination of $_POST, $_GET and $_COOKIE -check the manual), but I read somewhere that this isn't a good practice, though I don't recall why :p From what I've read (PHP Cookbook by Sklar and other sources) the reason why you don't want to use $_REQUEST is because it holds all the variables from six global arrays, namely $_GET, $_POST, $_FILES, $_COOKIE, $_SERVER, and $_ENV. When PHP creates $_REQUEST, it does so by adding the global arrays together in a certain order, namely EGPCS. Normally, this would be OK, but if two (or more) of those arrays have a key with the same name, then that key value will be replaced with the last value read. For example, the value provided by $_GET('mykey') will be replaced by the value found in $_COOKIE ('mykey') in generating the value for $_REQUEST('mykey'). So, if you use $_REQUEST, then you can't reply upon where its values are derived. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP AJAX
Anyone know of a good AJAX mailing list? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: setcookie security concerns [medium]
Rafael wrote: A tipical example would be a login script that uses the data as it arrives, for example: $login = $_POST['login']; $passw = $_POST['passw']; $sql = SELECT * FROM user\n .WHERE( login = '$login' AND passw = '$passw' ); In this case, what happens if I send something like login: ' OR '1'='1' OR '0 passw: doesnt care ? (I avoided the ' in the passw, just in case) Well, we'll end up with an SQL similar to this SELECT * FROM user WHERE( login = '' OR '1'='1' OR '0' AND passw = 'doesnt care' ) and because of the priority of the AND / OR, we would have 3 separated conditions each enough to validate the user, as '1'='1' is true, then we have a validated user. At first, your description confused me, but now I understand. You simply want to keep a user out of your code. In other words, if you don't validate the input, then a user can alter your code by injecting additional code into your query to bypass your authorization protocol -- very clever. Thanks for the lesson. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CPanel, PHP5 as CGI (was Re: [PHP] php 5 installation problem)
Hi! On Fri, 17 Mar 2006 08:24:51 -0400 Miles Thompson wrote: Thanks Edwin. I guess it was too late and I couldn't formulate a proper search expression. I'd like to hear Chris Shiflet's opinion on the security advantages of running PHP5 as CGI. That'd be nice. But as somebody pointed out earlier, one of the advantages is that PHP can run as another user instead of as the apache user. (Of course, it's still considered rather slooow though.) Anyway, there are some more info here: http://www.php.net/manual/en/security.cgi-bin.php Why, after years of running PHP as an Apache module, the sudden conversion to CGI operation? Remember, Miles, *your* $Web_Hosting_Company decides (or better yet, *you* decide) whether PHP5 should run as CGI or as an apache module. ;-) I've noticed occasional references of PHP5 having issues with CPanel. I think it was also pointed earlier (somewhere) that it's the other way around. :-) Is it simply easier for ISPs, given the intense competitive cost pressures they are under, to not wrestle with these issues, but to say Here it is as a CGI if you want it. I really have no idea (read: lazy to check now ;-) ) what CPanel is. If it is a program written in PHP (4?), they could just fix it to work with PHP5 -- CGI mode or not. Regards - Miles Thompson Regards, - Edwin - -- The showing of partiality is not good, nor that an able-bodied man should transgress over a mere piece of bread. - Proverbs 28:21 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: setcookie security concerns [medium]
I just picked up this thread, so excuse me if I'm repeating or have totally missed the point. Another concern I picked up from a PHP security book is using '--' - which simply comments out the remainder of the line (with MySQL anyway). Therefore if your SQL is SELECT * FROM table WHERE user = '$user' AND pass = '$pass' a malicious visitor could enter a valid username followed by '-- which may allow them entry to that person's account by creating the following: SELECT * FROM table WHERE user = 'valid_user'--' AND pass = '$pass' Obviously restricting/validating form input entry would avoid this issue. HTH, Kevin -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 17 March 2006 14:49 To: php-general@lists.php.net; Rafael Subject: Re: [PHP] Re: setcookie security concerns [medium] Rafael wrote: A tipical example would be a login script that uses the data as it arrives, for example: $login = $_POST['login']; $passw = $_POST['passw']; $sql = SELECT * FROM user\n .WHERE( login = '$login' AND passw = '$passw' ); In this case, what happens if I send something like login: ' OR '1'='1' OR '0 passw: doesnt care ? (I avoided the ' in the passw, just in case) Well, we'll end up with an SQL similar to this SELECT * FROM user WHERE( login = '' OR '1'='1' OR '0' AND passw = 'doesnt care' ) and because of the priority of the AND / OR, we would have 3 separated conditions each enough to validate the user, as '1'='1' is true, then we have a validated user. At first, your description confused me, but now I understand. You simply want to keep a user out of your code. In other words, if you don't validate the input, then a user can alter your code by injecting additional code into your query to bypass your authorization protocol -- very clever. Thanks for the lesson. tedd -- http://sperling.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] CPanel, PHP5 as CGI (was Re: [PHP] php 5 installation problem)
Edwin wrote: I really have no idea (read: lazy to check now ;-) ) what CPanel is. If it is a program written in PHP (4?), they could just fix it to work with PHP5 -- CGI mode or not. I sure would like to know because two of my host can't install PHP 5 due to problems they have with CPanel and PHP 5 working together. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: setcookie security concerns [medium]
(Comments inline) tedd wrote: [···] From what I've read (PHP Cookbook by Sklar and other sources) the reason why you don't want to use $_REQUEST is because it holds all the variables from six global arrays, namely $_GET, $_POST, $_FILES, $_COOKIE, $_SERVER, and $_ENV. Actually, the super-global variables used in $_REQUEST are $_GET, $_POST and $_COOKIE¹, and though there is a gpc directive I'm not sure if you can control the order they are read (but my guess would be that you do) ¹http://php.net/manual/en/reserved.variables.php#reserved.variables.request When PHP creates $_REQUEST, it does so by adding the global arrays together in a certain order, namely EGPCS. Normally, this would be OK, but if two (or more) of those arrays have a key with the same name, then that key value will be replaced with the last value read. For example, the value provided by $_GET('mykey') will be replaced by the value found in $_COOKIE ('mykey') in generating the value for $_REQUEST('mykey'). So, if you use $_REQUEST, then you can't reply upon where its values are derived. Well, I still don't remember the reason, but this could be a valid one :) By the way, these are variables (arrays), so you should use square-brackets instead of parenthesis to specify an index (e.g. $_SERVER['SCRIPT_NAME']) -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: setcookie security concerns [medium]
The value doesn't show up in the URL as you are redirecting the user back to the referring URL... so only the referrer will be shown (unless the redirecting script breaks :) ) Dan - Dan Parry Senior Developer Virtua Webtech Ltd http://www.virtuawebtech.co.uk -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: 17 March 2006 14:30 To: php-general@lists.php.net; Rafael Subject: Re: [PHP] Re: setcookie security concerns [medium] Rafael: ?php $thestyle= htmlentities($_POST['thestyle']); setcookie ('thestyle', $set, time()+31536000, '/', '', 0); header(Location: $HTTP_REFERER); ? Actually, you receive $set via GET, so you should use $_GET instead of $_POST. Yes, you are correct. In my example -- http://www.sperling.com/examples/styleswitch/ -- the value doesn't look like it is being added to the url and thus I mistakenly thought it was a POST. I wonder why the value isn't apparently attached to the url in this case? tedd -- http://sperling.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] Re: setcookie security concerns [medium]
On Friday 17 March 2006 15:10, Kevin Davies - Bonhurst Consulting wrote: I just picked up this thread, so excuse me if I'm repeating or have totally missed the point. Another concern I picked up from a PHP security book is using '--' - which simply comments out the remainder of the line (with MySQL anyway). Therefore if your SQL is SELECT * FROM table WHERE user = '$user' AND pass = '$pass' a malicious visitor could enter a valid username followed by '-- which may allow them entry to that person's account by creating the following: SELECT * FROM table WHERE user = 'valid_user'--' AND pass = '$pass' A benefit to using something like PEAR::DB is access to the quotesmart() function, which quotes the input for you. Your query can then look like SELECT * FROM table WHERE user=$q_user AND pass=$q_pass q_user and q_pass are derived from form input which is passed to quotesmart(). Even if funky characters like ' and -- are included, the quoting should help prevent injection. Validating input helps, but some input literally can be most characters under the sun. It's easier to defend the entire system with some general purpose protections than try to guess every attack (imo). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP files in the SRC attribute of an SCRIPT element
Hi everybody, Does anybody know if it's possible to specify a php file as the src attribute of an script element in a html page. For example: script language=JavaScript type=text/javascript src=d:/projects/horde/dimp/js/DimpCore.js.php?Horde=b9d9e640abf31e49eab7fad91a543bb5/script I've installed the HORDE framework (www.horde.org) and I'm trying to make their AJAX web client work. It seems that this line of code causes problems. The DimpCore.js.php file is a file that has ?php ? tags between javascript lines. Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? I know this list is only for PHP issues, but I thougt maybe someone had the sameproblem and knows a workaround for this. Any ideas would be appreciated. Thank you! Christi Zeck
[PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Karl-Heinz Christian Zeck wrote: Hi everybody, Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? Yes -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thanks! On 3/17/06, Barry [EMAIL PROTECTED] wrote: Karl-Heinz Christian Zeck wrote: Hi everybody, Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? Yes -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
You will want to write PHP code to output the java-script. Because the java-script (client side scripting) gets executed without communicating with the server there is no PHP engine that java-script can push the PHP through on the client machine. So you would want to do something like: ?PHP $string = I want a new pop-up message; $javascript = scriptalert( $string )/script; echo $javascript; ? Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thanks! On 3/17/06, Barry [EMAIL PROTECTED] wrote: Karl-Heinz Christian Zeck wrote: Hi everybody, Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? Yes -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Gerfen Student Computing Labs, University Of Utah [EMAIL PROTECTED] J. Willard Marriott Library 295 S 1500 E, Salt Lake City, UT 84112-0860 801-585-9810 You will never be ready for me. ~ Me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Hi! On Fri, 17 Mar 2006 17:42:51 +0200 Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? I guess, it's because the file is NOT being parsed. If you go back to your first message (on this thread), you had something like this: script language=JavaScript type=text/javascript src=d:/projects/horde/dimp/js/ -snipped- /script Why are you using d:/ ? If the machine you're working on happens to be your test server as well, what you want is (something like this): src=http://localhost/path/to/srcDimpCore.js.php?etcetc; Thanks! HTH, - Edwin - -- An answer, when mild, turns away rage, but a word causing pain makes anger to come up. - Proverbs 15:1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thats because you don't load the Javascript file over HTTP and load it locally. The webserver doesn't parse it that way. That way he just reads it and thats why it isnt parsed -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP?
- Edwin - wrote: Hi! On Thu, 16 Mar 2006 14:31:38 -0500 John Hinton [EMAIL PROTECTED] wrote: Simon M. Campden-Main wrote: Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes up with PPI (Image - Image information). I have several thousand scanned images with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint Shop Pro) and want to discard, or more likely tag as rejected, any that suffer a resolution of less than 150 PPI. As you might imagine, I find the thought of doing it manually with Paint Shop Pro repugnant. Okay, if it was scanned at 72ppi then you can't really print it out again even with a near-similar quality. However, having an image with a 72ppi does NOT necessarily mean that you have an image unsuitable for printing. PPI or pixels per inch is a printing term. Last time I checked, dpi is the printing term. (^_^) dpi (dots per inch) - printer ppi (pixels per inch) - monitor/screen Still missing it.. Yes, dpi is a printing term.. but has absolutely nothing to with with images. dpi or Dots per Inch is purely a term that describes the limits of your printer. If for instance, we are talking about an ink jet printer with a 600 x 600 dpi capability, with black and three colors, that printer can print any of the four color or not print in a space 1/600th of an inch as it moves along. And there is no blending within that one dot... it's simply one of the colors or left the white or the paper color. One might think that an image should be scanned at 600 dpi to provide and equal quality, but really you can scan at a much reduced resolution and get the same results with a basic inkjet color printer, because the scan will most often be done at 16.7 million colors.. the printer only has 4(+paper color) so it really takes a 4x4 dot area or so to start to get close to matching a single pixel. Now, lets don't even go there on printers. The above is greatly understated and was how old inkjets worked.. much has changed and I really haven't followed exactly what they are doing now, but obviously it seems that there is a blending over top of other colors in today's printers. Just trying to provide simple theory, quick to type, easy to grasp. So, yet still ppi is being misrepresented.. Please stop doing this. If you don't believe me try this. Open a quality paint program. In fact, Macromedia's Fireworks in the image sizing dialog box separates pixel dimensions from ppi putting ALL ppi function under the heading of Print Size. The example. Open or create an image 600 pixels x 300 pixels. Make sure you stay at 100% zoom factor. Set the printing Pixels/Inch to 150, but don't let the program change the Pixel dimensions. You will be given a print size of 4 x 2. The image will take up 600 x 300 pixels of your monitor screen space. Now with that same image, change only the resolution to 300. Leave the pixel dimensions the same (one has to be careful with the locking of proportions and samplings to be sure the program doesn't change the pixel dimensions when changing the Pixel/Inch). You will now see that the print size is 2 x 1, but yet the image size on the screen has not changed sizes. A pixel is a pixel to a monitor. A pixel is sent thru an algorithm on the way to a printer and by and large, print quality has to be much greater than monitor quality to 'look' as good. Basically, you can't get a 4 wide image on the screen to look as good when printed at 4 wide. A general guideline is images for print should be no less than 150 ppi, newspaper quality, and 300 to 600 is recommended for color brochures and near photo quality. So, using our example above and assuming the printing company has requested 300 ppi images, that image at 600 x 300 which fills a major portion of one's monitor screen, can only be printed under this constraint at a maximum of 2 inches x 1 inch. If you're going to print, check with the printer before beginning as print quality is generally rising at all levels. The question of throwing away all images with 72dpi is irrelevant. The questions are: What resolution, pixels per inch, do you want to print at? Lets assume 300. What size are the images in pixels? Lets assume 1200 x 900. (I know, odd size but easy math to follow) Are you happy with printing these images at 4 inches x 3 inches? ((1200 pixels / 300 pixels per inch = 4 inches) x (900 pixels / 300 pixels per inch = 3 inches)) If yes, keep the image. If you started with an 8 x 10, scanning at 72dpi and are happy with 150ppi, you can get a good print out at 4 x 5. If you want 300ppi, then 2 x 2.5 inches.. and so on. Also, if working in .jpg filetypes, there is normally a quality setting in the paint program. If you're going to print, set it to the highest. If to the web, medium to medium high is generally not a noticeable difference. My testing showed that these settings affect the number
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
I cannot use such a code, because the file I'm using is added to the Script element in the html page. The guys from Horde, that created the files say this should work without any problems, but it doesn't. If you have any other suggestions, please let me know. Thank you! On 3/17/06, Jason Gerfen [EMAIL PROTECTED] wrote: You will want to write PHP code to output the java-script. Because the java-script (client side scripting) gets executed without communicating with the server there is no PHP engine that java-script can push the PHP through on the client machine. So you would want to do something like: ?PHP $string = I want a new pop-up message; $javascript = scriptalert( $string )/script; echo $javascript; ? Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thanks! On 3/17/06, Barry [EMAIL PROTECTED] wrote: Karl-Heinz Christian Zeck wrote: Hi everybody, Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? Yes -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Gerfen Student Computing Labs, University Of Utah [EMAIL PROTECTED] J. Willard Marriott Library 295 S 1500 E, Salt Lake City, UT 84112-0860 801-585-9810 You will never be ready for me. ~ Me
[PHP] print page from php
All, I have a web page with the results from several database queries. Now this page has an undefined horizontal and vertical size. Does anyone know if there is a php script available that will automatically split the webpage into parts that can fit on an A4 page? Or do I have to set boundaries on the size of the tables the queried data will be shown in. Hope this makes any sense, Thanks in advance, Reinhart Viane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Well on another note I see that you are trying to point to a local file on a windows machine (i.e. c:\path\to\php-script), that won't work but if you place the php script on the server it may. i am unfamiliar with the organization you are refering to. Karl-Heinz Christian Zeck wrote: I cannot use such a code, because the file I'm using is added to the Script element in the html page. The guys from Horde, that created the files say this should work without any problems, but it doesn't. If you have any other suggestions, please let me know. Thank you! On 3/17/06, *Jason Gerfen* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: You will want to write PHP code to output the java-script. Because the java-script (client side scripting) gets executed without communicating with the server there is no PHP engine that java-script can push the PHP through on the client machine. So you would want to do something like: ?PHP $string = I want a new pop-up message; $javascript = scriptalert( $string )/script; echo $javascript; ? Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thanks! On 3/17/06, Barry [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Karl-Heinz Christian Zeck wrote: Hi everybody, Are you allowed to do this? I mean, is the php file parsed by the PHP engine first and a js code is generated that will be used by the script element? Yes -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List ( http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Gerfen You will never be ready for me. ~ Me -- Jason Gerfen You will never be ready for me. ~ Me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP? [SOLVED]
Good morning, Edwin. Thank you very much for taking the time to respond to my query. E See if you have ImageMagick installed. I didn't, but do now. E You could probably use the identify command to find the info you need. For more information: $ man identify It works, Edwin. A tad slow (3 seconds to process a 762k jpg), but the -verbose option does provide Resolution in PPI. E Of course, this solution is not *in* PHP but you can invoke that program inside your PHP scripts (^_-) Indeed! For those following this thread, you can see the various outputs at: http://www.campden-main.com/~orchids/test/test_exif_2.php Thanks to all and, until the next time, Take Care! Simon [EMAIL PROTECTED] - Edwin - [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi! On Thu, 16 Mar 2006 08:13:41 -0800 Simon M. Campden-Main [EMAIL PROTECTED] wrote: [ . . . ] I want ppi! [ . . . ] I'm running the current Cent OS [ . . . ] See if you have ImageMagick installed. You could probably use the identify command to find the info you need. For more information: $ man identify Of course, this solution is not *in* PHP but you can invoke that program inside your PHP scripts (^_-) HTH, - Edwin - -- Happy are the mild-tempered ones, since they will inherit the earth. - Matthew 5:5 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE quirk
With IE, it's not a quirk. It's a feature. On Thursday 16 March 2006 3:31 pm, Jay Blanchard wrote: [snip] I created a small bannering program. It works great in Firefox. But I have a problem with IE. If I place the banner on a different domain than the bannering program, Ex: www.bannerserver.com www.otherserver.com has img tag calling from www.bannerserver.com I use a session to keep track of the banner that is displayed, have even tried using cookies directly. Works great in firefox, problem with IE is first time vising www.otherserver.com, clicking on the img does not work, apparently, the session was never start/recorded when retrieving the image. However, if I go back to www.otherserver.com, it then works fine, I can go anywhere, as long as I don't close the browser, www.otherserver.com works. Why would IE not be recording the session info on the first visit? Firefox does it just fine. Anyone run into this? [/snip] From http://www.php.net/session [quote] When using session_start() to begin a session this session will remain open until the page has finished loading or it is explicitly terminated. You can lose the session however if the the page contains a reference to img src= with name and id references (which may be used if the image is referencing a dynamic image, called by javascript) This seems to casue IE6 to refresh the page session id and hence loose the session. [/quote] -- Joe Henry www.celebrityaccess.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP files in the SRC attribute of an SCRIPT element
Thank you very much. That was the problem, I didn't noticed that I don't use the server path. On 3/17/06, Barry [EMAIL PROTECTED] wrote: Karl-Heinz Christian Zeck wrote: Thank you for your quick reply. I tried to modify the file. I removed all it's content and wrote only a single line: alert(test); When I refresh the main page, I get the alert message - this means the file was loaded successfuly. Then I tried this code: alert(?php echo 'test';?); This way it doesn't work, no alert message, so the file wasn't loaded. Any ideas? Thats because you don't load the Javascript file over HTTP and load it locally. The webserver doesn't parse it that way. That way he just reads it and thats why it isnt parsed -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] print page from php
[snip] I have a web page with the results from several database queries. Now this page has an undefined horizontal and vertical size. Does anyone know if there is a php script available that will automatically split the webpage into parts that can fit on an A4 page? Or do I have to set boundaries on the size of the tables the queried data will be shown in. [/snip] Create a CSS print stylesheet. http://www.alistapart.com/articles/goingtoprint/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How does one obtain the resolution of an image in PHP?
Hi! On Fri, 17 Mar 2006 10:58:12 -0500 John Hinton wrote: - Edwin - wrote: Hi! On Thu, 16 Mar 2006 14:31:38 -0500 John Hinton [EMAIL PROTECTED] wrote: Simon M. Campden-Main wrote: Well, there's the meat of it, isn't it? I wonder how Paint Shop Pro comes up with PPI (Image - Image information). I have several thousand scanned images with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint Shop Pro) and want to discard, or more likely tag as rejected, any that suffer a resolution of less than 150 PPI. As you might imagine, I find the thought of doing it manually with Paint Shop Pro repugnant. Okay, if it was scanned at 72ppi then you can't really print it out again even with a near-similar quality. However, having an image with a 72ppi does NOT necessarily mean that you have an image unsuitable for printing. PPI or pixels per inch is a printing term. Last time I checked, dpi is the printing term. (^_^) dpi (dots per inch) - printer ppi (pixels per inch) - monitor/screen Still missing it.. Yes, dpi is a printing term.. but has absolutely nothing to with with images. dpi or Dots per Inch is purely a I beg to differ... (see next) term that describes the limits of your printer. If for instance, we are talking about an ink jet printer with a 600 x 600 dpi capability, with black and three colors, that printer can print any of the four color or not print in a space 1/600th of an inch as it moves along. And there is no blending within that one dot... it's simply one of the colors or left the white or the paper color. One might think that an image should be scanned at 600 dpi to provide and equal quality, but really you can scan at a much reduced resolution and get the same results with a basic inkjet At a much reduced resolution? Try scanning some photo, say an A3 size photo, at 72ppi. Then, try printing that at 600dpi on the same A3 size paper and see what you get. color printer, because the scan will most often be done at 16.7 million colors.. the printer only has 4(+paper color) so it really takes a 4x4 dot area or so to start to get close to matching a single pixel. Now, lets don't even go there on printers. The above is greatly understated and was how old inkjets worked.. much has changed and I really haven't followed exactly what they are doing now, but obviously it seems that there is a blending over top of other colors in today's printers. Just trying to provide simple theory, quick to type, easy to grasp. Add to that that some have 8(+paper color). And that not all people are using inkjets. So, yet still ppi is being misrepresented.. Please stop doing this. Who is misrepresenting what? ;-) If you don't believe me try this. Open a quality paint program. In fact, Macromedia's Fireworks in the image sizing dialog box separates pixel dimensions from ppi putting ALL ppi function under the heading of Print Size. The example. Open or create an image 600 pixels x 300 pixels. Make sure you stay at 100% zoom factor. Set the printing Pixels/Inch to 150, but don't let the program change the Pixel dimensions. You will be given a print size of 4 x 2. The image will take up 600 x 300 pixels of your monitor screen space. Now with that same image, change only the resolution to 300. Leave the pixel dimensions the same (one has to be careful with the locking of proportions and samplings to be sure the program doesn't change the pixel dimensions when changing the Pixel/Inch). You will now see that the print size is 2 x 1, but yet the image size on the screen has not changed sizes. Of course! A pixel is a pixel to a monitor. A pixel is sent thru an algorithm on the way to a printer and by and large, print quality has to be much greater than monitor quality to 'look' as good. Basically, you can't get a 4 wide image on the screen to look as good when printed at 4 wide. That's correct. And nobody said otherwise. A general guideline is images for print should be no less than 150 ppi, newspaper quality, and 300 to 600 is recommended for color brochures and near photo quality. So, using our example above and assuming the printing company has requested 300 ppi images, that image at 600 x 300 which fills a major portion of one's monitor screen, can only be printed under this constraint at a maximum of 2 inches x 1 inch. If you're going to print, check with the printer before beginning as print quality is generally rising at all levels. The question of throwing away all images with 72dpi is irrelevant. 72dpi !== 72ppi Just to make it consistent, an image on the screen cannot have a dpi whereas a *printed* image can. The questions are: What resolution, pixels per inch, do you want to print at? Lets assume 300. What size are the images in pixels? Lets assume 1200 x 900. (I know, odd size but easy math to follow) Are you happy
Re: [PHP] Session from php in ASP
PHP and ASP both have built in session handling. The only problem is, they instantiate the sessions themselves. Therefore, whenever you hit a page in ASP you'll start one session, but if you immediately hit a PHP page on the same server in the same browser from the same machine, you start a brand spanking new PHP session. It'd be possible to write a handler that wrote information in and out of cookies and a DB and effectively merge the two systems into using the same handler. Alternatively, you could use (un)serialize(); in PHP (along with the ASP equivalent) to store data in files, but I don't see that as being as efficient for this scenario. -Myk OLeary [EMAIL PROTECTED] BLOG: http://www.blueneedle.com/wordpress/?bnphplists On Mar 17, 2006, at 4:22 AM, Stefan wrote: Hi NG is it possible to get a Sessionvariable set in php read in an asp- file with the tag %= Session(php) %? Thanks in advance Stefan -- 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] CPanel, PHP5 as CGI (was Re: [PHP] php 5 installation problem)
Ask them to install PHP5 to work with only .php5 extensioned files. They have no interoperability issues - you have access to PHP 5. PHP4 and PHP5 can safely coexist on the same server like this, as they aren't serving up the same files... -Myk OLeary [EMAIL PROTECTED] BLOG: http://www.blueneedle.com/wordpress/?bnphplists On Mar 17, 2006, at 7:17 AM, tedd wrote: Edwin wrote: I really have no idea (read: lazy to check now ;-) ) what CPanel is. If it is a program written in PHP (4?), they could just fix it to work with PHP5 -- CGI mode or not. I sure would like to know because two of my host can't install PHP 5 due to problems they have with CPanel and PHP 5 working together. tedd -- -- -- http://sperling.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] IE quirk
In this case it is very likely a feature. It sounds like the Security settings are set at default in IE, which is to disallow third party cookies without P3P privacy policies. I bet that if you add a P3P privacy policy header, that IE will like you just fine. This started with IE6, so you can try testing in IE5 to see if it works there right now. If it does, continue on by reading the below URL.. http://www.w3.org/P3P/ -Myk OLeary [EMAIL PROTECTED] BLOG: http://www.blueneedle.com/wordpress/?bnphplists On Mar 17, 2006, at 8:30 AM, Joe Henry wrote: With IE, it's not a quirk. It's a feature. On Thursday 16 March 2006 3:31 pm, Jay Blanchard wrote: [snip] I created a small bannering program. It works great in Firefox. But I have a problem with IE. If I place the banner on a different domain than the bannering program, Ex: www.bannerserver.com www.otherserver.com has img tag calling from www.bannerserver.com I use a session to keep track of the banner that is displayed, have even tried using cookies directly. Works great in firefox, problem with IE is first time vising www.otherserver.com, clicking on the img does not work, apparently, the session was never start/recorded when retrieving the image. However, if -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting a string
I think that we did this before, but I cannot find my notes or in the archive because I am not sure what we called it. Let us say that that I have a form item (I'll leave out clutter); input name=psFirstName It arrives in processing as $_POST['psFirstName'] Now, I have one of these for each form item, each with a different name. In my error script I want to say Cannot leave First Name blank I need to convert psFirstName to First Name. I tried preg_split, but it cuts away the capital letters. Can someone point me in the right direction again? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
[snip] If you have similar element names in $_POST, comething like: $human_friendly = array(psFirstName = First Name); foreach ($_POST as $ key = value) { echo Cannot leave {$human_friendly[$key]} blank; } [/snip] But I don't want to create another array, and should'nt have to
RE: [PHP] Best practice to set up register_globals
Would this be set in the apache.conf file or the php.ini file? -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 9:19 PM To: php-general@lists.php.net Subject: Re: [PHP] Best practice to set up register_globals On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote: One of my clients has an os commerce install which requires register_globals to be set to on, for some reason. It is set up to off in php.ini, as it should, but I'd like to know what the best fashion would be for me to set it on locally for this domain only. Assuming you have apache as your webserver.. If you must set it, you can set it per any apache directive, like a VirtualHost, Directory or the like or even a .htaccess (if enabled). Curt. -- cat .signature: No such file or directory -- 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] Converting a string
Try using preg_match_all with this pattern: /([A-Z].*[^A-Z])/U While this pattern does not get you exactly what you want, I think it serves as a starting point. I am not too good with regular expressions so I'll let the more accomplished regex people on the list jump in at this point. Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 10:24 AM To: Dave Goodchild Cc: php-general@lists.php.net Subject: RE: [PHP] Converting a string [snip] If you have similar element names in $_POST, comething like: $human_friendly = array(psFirstName = First Name); foreach ($_POST as $ key = value) { echo Cannot leave {$human_friendly[$key]} blank; } [/snip] But I don't want to create another array, and should'nt have to -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
I think I got the correct regex pattern: /[A-Z].*.[^A-Z]/U Again, I am not too good with regex so I can't explain why that pattern works and also if it will work in all cases. HTH, Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Shaunak Kashyap [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 10:49 AM To: Jay Blanchard; Dave Goodchild Cc: php-general@lists.php.net Subject: RE: [PHP] Converting a string Try using preg_match_all with this pattern: /([A-Z].*[^A-Z])/U While this pattern does not get you exactly what you want, I think it serves as a starting point. I am not too good with regular expressions so I'll let the more accomplished regex people on the list jump in at this point. Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 10:24 AM To: Dave Goodchild Cc: php-general@lists.php.net Subject: RE: [PHP] Converting a string [snip] If you have similar element names in $_POST, comething like: $human_friendly = array(psFirstName = First Name); foreach ($_POST as $ key = value) { echo Cannot leave {$human_friendly[$key]} blank; } [/snip] But I don't want to create another array, and should'nt have to -- 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] Converting a string
Jay Blanchard wrote: [snip] If you have similar element names in $_POST, comething like: $human_friendly = array(psFirstName = First Name); foreach ($_POST as $ key = value) { echo Cannot leave {$human_friendly[$key]} blank; } [/snip] But I don't want to create another array, and should'nt have to Then you should change the name of the field. Seriously, what do you expect the script to do, exactly? and once you know the answer, what would you do to achieve that? Put that (emphasis to the second question) in words and someone might be able to help you. -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
[snip] Then you should change the name of the field. Seriously, what do you expect the script to do, exactly? and once you know the answer, what would you do to achieve that? Put that (emphasis to the second question) in words and someone might be able to help you. [/snip] I expect that I can take a string, like 'psFirstName' and change it to 'First Name'. that way I don't have to worry about what some web designer named his fields, I can turn them into human readable strings without having to manually create a new array. So far I have this $newKey = preg_split(/([A-Z])/, substr($key, 2), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); Which returns; Array ( [0] = F [1] = irst [2] = N [3] = ame ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting a string
You're best off using an array that matches human readable form to field name as someone else suggested earlier. Form names for basic fields like this should be standardized such that auto form fillers (aka Google toolbar) are able to work. They won't know that your field named hmnrdble_F-irst_N-ame equates to a first name field. Skip the dastardly regexp and keep it simple. On the posted to page populate the array with boolean values as you do you boundary checking. If you fail, then save it to session, redirect back to the form, read the array from session, and you have access to ALL fields that failed, so you can not only have a message at top, but the ability to mark each field with a style or some such to visually draw the user to what they need to fix. -Myk OLeary [EMAIL PROTECTED] BLOG: http://www.blueneedle.com/wordpress/?bnphplists On Mar 17, 2006, at 11:21 AM, Jay Blanchard wrote: [snip] Then you should change the name of the field. Seriously, what do you expect the script to do, exactly? and once you know the answer, what would you do to achieve that? Put that (emphasis to the second question) in words and someone might be able to help you. [/snip] I expect that I can take a string, like 'psFirstName' and change it to 'First Name'. that way I don't have to worry about what some web designer named his fields, I can turn them into human readable strings without having to manually create a new array. So far I have this $newKey = preg_split(/([A-Z])/, substr($key, 2), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); Which returns; Array ( [0] = F [1] = irst [2] = N [3] = ame ) -- 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] Best practice to set up register_globals
Curt Zirzow wrote: On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote: One of my clients has an os commerce install which requires register_globals to be set to on, for some reason. It is set up to off in php.ini, as it should, but I'd like to know what the best fashion would be for me to set it on locally for this domain only. Assuming you have apache as your webserver.. If you must set it, you can set it per any apache directive, like a VirtualHost, Directory or the like or even a .htaccess (if enabled). Curt. I'm not sure how they set it up, but at my web host I can put individual php.ini files in the directory the php script files are in. That means that I can create a php.ini file and add 'register_globals on' in any directory where I need it. Does anyone know how to configure that? -- * Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
[snip] You're best off using an array that matches human readable form to field name as someone else suggested earlier. Form names for basic fields like this should be standardized such that auto form fillers (aka Google toolbar) are able to work. They won't know that your field named hmnrdble_F-irst_N-ame equates to a first name field. Skip the dastardly regexp and keep it simple. [/snip] Scared of regex? Since this is an Intranet application we do not care about auto form fillers and actually discourage reliance on them in these cases. You're suggesting that I make the programmers do more work when there is a solution that will work regardless of what the web designers name form fields as long as the web designers stick to a naming convention policy (studly caps) for form fields. I suppose I could make them change to underscore delimited field names and it would solve my current problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting a string
Well, you didn't answer the second question, how would you do it? So far I see a pattern: ignore the lowercase letters at the beginnig and add a space before an uppercase (this won't apply to all field names, and I hope you're aware of that), so try something like $text = preg_replace('/^[a-z]+\s*/X', '', preg_replace('/(?=[A-Z])/X', ' ', $name) ); Now, a better way, IMHO, would be to use _ as spaces and write the name of the field as you want it to appear (e.g. First_Name), so you just need to $text = str_replace('_', ' ', $name); --pretty much simplier, isn't? And... if you want to add a prefix (such as ps) then make it configurable, so it can be changed anytime without effort. Last comment: you should think about the question you didn't answer, and that might give you the solution to your problem. Jay Blanchard wrote: [snip] Then you should change the name of the field. Seriously, what do you expect the script to do, exactly? and once you know the answer, what would you do to achieve that? Put that (emphasis to the second question) in words and someone might be able to help you. [/snip] I expect that I can take a string, like 'psFirstName' and change it to 'First Name'. that way I don't have to worry about what some web designer named his fields, I can turn them into human readable strings without having to manually create a new array. So far I have this $newKey = preg_split(/([A-Z])/, substr($key, 2), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); Which returns; Array ( [0] = F [1] = irst [2] = N [3] = ame ) -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
[snip] Well, you didn't answer the second question, how would you do it? So far I see a pattern: ignore the lowercase letters at the beginnig and add a space before an uppercase (this won't apply to all field names, and I hope you're aware of that), so try something like $text = preg_replace('/^[a-z]+\s*/X', '', preg_replace('/(?=[A-Z])/X', ' ', $name) ); Now, a better way, IMHO, would be to use _ as spaces and write the name of the field as you want it to appear (e.g. First_Name), so you just need to $text = str_replace('_', ' ', $name); --pretty much simplier, isn't? And... if you want to add a prefix (such as ps) then make it configurable, so it can be changed anytime without effort. Last comment: you should think about the question you didn't answer, and that might give you the solution to your problem. [/snip] I was just headed in the wrong direction with preg_split(), and I had it stuck in my head. If I had delimiters, such as underscores, this question would have never come up. I am not in a position to tell the designers that we need them to change their naming conventions in forms at this unfortunately, so I need to work with what we have as efficiently as possible. Thank you for an elegant solution, but I am curiouswhy would it not work with all field names if they were named using the conventions (studly caps)? I can see a problem perhaps with a field named fooMyURL, it would come out as My U R L. Do you feel as if there are any other gotcha's? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting a string
IMHO, you do are in position to tell the designers how the fields should be named, after all they won't give any use to them, it's you (or the developer in turn) who will deal with them. Besides, using underscores (or any other space-replacement) anyone knows beforehand what the text displayed will be, and any special combination of lower/upper-case letters it's preserved. Anyway, right now it seems this is something we can't depend on, so let's refine the expression a little. Oh, and I was refering to the same problem with fields such as MyURL. I've changed a little the pattern, now it would say ignore the initial lower-case letters and spaces (if any of those) and add a space before any upper-case wich is not preceeded by an upper-case, and also those upper-case followed by a lower-case, so it now would look like $rex_initial = '/^[a-z]*\s*/X'; $rex_upper = '/(?![A-Z])(?=[A-Z])|(?=[A-Z][^A-Z])/X'; $text= preg_replace($rex_initial, '', preg_replace($rex_upper, ' ', $name) ); I think that solves the problem with the previous one. But I'd also like to point out that most of us (you included, if I understood right) seem to agree that this shouldn't be the first option, but something simplier --this is more like a patch than a feature ;) Good luck with the designers :) Jay Blanchard wrote: [···] I was just headed in the wrong direction with preg_split(), and I had it stuck in my head. If I had delimiters, such as underscores, this question would have never come up. I am not in a position to tell the designers that we need them to change their naming conventions in forms at this unfortunately, so I need to work with what we have as efficiently as possible. Thank you for an elegant solution, but I am curiouswhy would it not work with all field names if they were named using the conventions (studly caps)? I can see a problem perhaps with a field named fooMyURL, it would come out as My U R L. Do you feel as if there are any other gotcha's? -- Atentamente, J. Rafael Salazar Magaña Innox - Innovación Inteligente Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE http://www.innox.com.mx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Best practice to set up register_globals
Curt Zirzow wrote: On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote: One of my clients has an os commerce install which requires register_globals to be set to on, for some reason. It is set up to off in php.ini, as it should, but I'd like to know what the best fashion would be for me to set it on locally for this domain only. Assuming you have apache as your webserver.. If you must set it, you can set it per any apache directive, like a VirtualHost, Directory or the like or even a .htaccess (if enabled). Curt. I'm not sure how they set it up, but at my web host I can put individual php.ini files in the directory the php script files are in. That means that I can create a php.ini file and add 'register_globals on' in any directory where I need it. Does anyone know how to configure that? - Well that's what I always wondered. The php_info() shows the value as set globally and locally. How do you override for a site or domain? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Converting a string
[snip] IMHO, you do are in position to tell the designers how the fields should be named, after all they won't give any use to them, it's you (or the developer in turn) who will deal with them. Besides, using underscores (or any other space-replacement) anyone knows beforehand what the text displayed will be, and any special combination of lower/upper-case letters it's preserved. Anyway, right now it seems this is something we can't depend on, so let's refine the expression a little. Oh, and I was refering to the same problem with fields such as MyURL. I've changed a little the pattern, now it would say ignore the initial lower-case letters and spaces (if any of those) and add a space before any upper-case wich is not preceeded by an upper-case, and also those upper-case followed by a lower-case, so it now would look like $rex_initial = '/^[a-z]*\s*/X'; $rex_upper = '/(?![A-Z])(?=[A-Z])|(?=[A-Z][^A-Z])/X'; $text= preg_replace($rex_initial, '', preg_replace($rex_upper, ' ', $name) ); I think that solves the problem with the previous one. But I'd also like to point out that most of us (you included, if I understood right) seem to agree that this shouldn't be the first option, but something simplier --this is more like a patch than a feature ;) Good luck with the designers :) [/snip] You're correct, this shouldn't be the first option. Right now the designers are not under my control as they are outsourced and working with a set of specs created by someone who is/was no longer here when I got here (for good reason and this kind of thing is but one of those reasons). I am working to get designers on staff (and they will work for me), but until that point I have to work with what I have as the business is approaching launch and we really don't have time to go back and rework existing forms, etc. So, being the good systems guy that I am, I try to get it where everyone can work together with as little hassle as possible. We had worked this same problem on this same list about a year ago, so I knew that there was an answer, I just couldn't find it. Thanks to your truly elegant solution I have made developer world much happier this afternoon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Alright, how do you unsubscribe?
I went through the instructions about how to remove my address from the mailing list, but nothing happens. I sent this message almost 6 hours ago, and I am still getting traffic from the list. Is there someone who could remove my address? Or do I need to keep sending the unsubscribe message until it works? Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE quirk
If this were the case then it should never work, however, all I have to do is press the back button to go back to the page and it starts keeping the sessions just fine. In this case it is very likely a feature. It sounds like the Security settings are set at default in IE, which is to disallow third party cookies without P3P privacy policies. I bet that if you add a P3P privacy policy header, that IE will like you just fine. This started with IE6, so you can try testing in IE5 to see if it works there right now. If it does, continue on by reading the below URL.. http://www.w3.org/P3P/ -Myk OLeary [EMAIL PROTECTED] BLOG: http://www.blueneedle.com/wordpress/?bnphplists On Mar 17, 2006, at 8:30 AM, Joe Henry wrote: With IE, it's not a quirk. It's a feature. On Thursday 16 March 2006 3:31 pm, Jay Blanchard wrote: [snip] I created a small bannering program. It works great in Firefox. But I have a problem with IE. If I place the banner on a different domain than the bannering program, Ex: www.bannerserver.com www.otherserver.com has img tag calling from www.bannerserver.com I use a session to keep track of the banner that is displayed, have even tried using cookies directly. Works great in firefox, problem with IE is first time vising www.otherserver.com, clicking on the img does not work, apparently, the session was never start/recorded when retrieving the image. However, if -- 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] Alright, how do you unsubscribe?
[snip] I went through the instructions about how to remove my address from the mailing list, but nothing happens. I sent this message almost 6 hours ago, and I am still getting traffic from the list. Is there someone who could remove my address? Or do I need to keep sending the unsubscribe message until it works? [/snip] You sure you don't have more than one address subscribed? If not, it'll probably take a little while for it to filter through...but you're welcome to try again, this is an unmoderated list, so there is no one minding the asylumso to speak. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] print page from php
At 09:57 AM 3/17/2006, Reinhart Viane wrote: All, I have a web page with the results from several database queries. Now this page has an undefined horizontal and vertical size. Does anyone know if there is a php script available that will automatically split the webpage into parts that can fit on an A4 page? Or do I have to set boundaries on the size of the tables the queried data will be shown in. Hope this makes any sense, Thanks in advance, Reinhart Viane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php CSS is probably the best solution http://www.w3.org/TR/REC-CSS2/page.html#q16 found whle googling http://www.google.ca/search?hl=enq=printing+CSS+mediabtnG=Google+Search This is a good article: http://css-discuss.incutio.com/?page=PrintStylesheets and as always, A List Apart has CSS Design: going to Print at http://www.alistapart.com/stories/goingtoprint/ I have seen examples of two-column pages, but do not know if the pages broke correctly when the matter was longer than one page. Alternately, display in tables and make certain you have a TH so your header can repeat. Hope this steers you in the right direction - Miles. -- Internal Virus Database is out-of-date. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strangers characters and UTF-8 encoding
hi, I have troubles with strangers characters in my html pages, I've fixed them by using mb_convert_encoding() function with UTF-8 encoding but I've hear that mbstring library is unstable in some linux distributions. Does any body knows how to solve this problem without using mbstring library?. I'm working with php-5. Thank you beforehand.
[PHP] Newbie question
Hi there, I'm on WinXP, I got IIS installed, I downloaded and installed PHP 5.1.2 installer, I edited the php.ini file, I got documentation, I've been red and I'm kind of FRUSTATED!!! because I can't run PHP code. I need help please!!! Thanks for any help Alexander -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie question
[snip] I'm on WinXP, I got IIS installed, I downloaded and installed PHP 5.1.2 installer, I edited the php.ini file, I got documentation, I've been red and I'm kind of FRUSTATED!!! because I can't run PHP code. [/snip] Uninstall what you have and then go to http://www.devside.net/web/server/free/download and download setup1.16.exe and install that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SERVER['PHP_AUTH_USER'] not set
Apache2 PHP 4.4.n Suse Linux 10 PHP_AUTH_USER is not getting set in the $_SERVER array. Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] set_time_limit(90*60) and still timing out after 5 minutes on Windows
I have a Windows server (IIS) with PHP and MySQL installed on it. I have a script that is automatically ran every evening. This script has a set_time_limit(90*60) (90 minutes) at the top, but the script seems to just stop functioning after 5 minutes. I do *not* get the line about execution time exceeded. Hmmm ... Maybe this is an IIS setting? Any ideas? DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best practice to set up register_globals
On 3/18/06, Nicolas Verhaeghe [EMAIL PROTECTED] wrote: Curt Zirzow wrote: On Thu, Mar 16, 2006 at 08:46:07PM -0700, Nicolas Verhaeghe wrote: One of my clients has an os commerce install which requires register_globals to be set to on, for some reason. It is set up to off in php.ini, as it should, but I'd like to know what the best fashion would be for me to set it on locally for this domain only. Assuming you have apache as your webserver.. If you must set it, you can set it per any apache directive, like a VirtualHost, Directory or the like or even a .htaccess (if enabled). Curt. I'm not sure how they set it up, but at my web host I can put individual php.ini files in the directory the php script files are in. That means that I can create a php.ini file and add 'register_globals on' in any directory where I need it. Does anyone know how to configure that? - Well that's what I always wondered. The php_info() shows the value as set globally and locally. How do you override for a site or domain? With a htaccess file: php_flag register_globals on -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: set_time_limit(90*60) and still timing out after 5 minutes on Windows
Dan Baker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a Windows server (IIS) with PHP and MySQL installed on it. I have a script that is automatically ran every evening. This script has a set_time_limit(90*60) (90 minutes) at the top, but the script seems to just stop functioning after 5 minutes. I do *not* get the line about execution time exceeded. Hmmm ... Maybe this is an IIS setting? It WAS an IIS setting (buried very deep). MetaEdit is a utility needed to alter a setting LM - W3SVC - CGITimeout DanB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, SQL, AJAX, JS and populating a SelectBox?
I need to dynamically update a select box with results from a SQL database using AJAX, but I can't find a single example of how to do this. Basically I have a text input field, and a select box. As someone types in the input field, I want the select box to fill in the results of matches. I can fill in a DIV (as per the ten million examples out there) and that's all fine and dandy, but way too simplistic for what I need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER['PHP_AUTH_USER'] not set
On 3/18/06, Jay Blanchard [EMAIL PROTECTED] wrote: Apache2 PHP 4.4.n Suse Linux 10 PHP_AUTH_USER is not getting set in the $_SERVER array. Thoughts? It only gets set once you get to a page behind a htpasswd'ed area - it's not in there by default. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php