[PHP] Re: php-general Digest 20 Sep 2013 17:33:26 -0000 Issue 8369
On Sep 20, 2013, at 1:33 PM, php-general-digest-h...@lists.php.net wrote: Friday's Question 322111 by: Tedd Sperling -- From: Tedd Sperling t...@sperling.com Subject: Friday's Question Date: September 20, 2013 12:51:49 PM EDT To: php-general@lists.php.net Hi gang: Do you use a Mousepad? My reason for asking is that I've used a Mousepad ever since mice first came out (back when they had one ball). Now that mice are optical (no balls), Mousepads are not really needed -- or so I'll told by the college -- you see, they don't provide Mousepads for their student's computers. As such, I wondered what's the percentage of programmers still using a Mousepad? Secondly, are Mousepads used primarily by older programmers (like me) while younger programmers don't use Mousepads, or what? So -- please respond with: Age: * Mousepad: Yes/No Thank you, tedd PS: * If you don't want to provide your actual age, then indicate your age by stating young, middle-age, old-age, ancient, or whatever term describes your age. Alternate -- I claim that you can tell a man's age by ten-times the number of personal products he routinely uses, for example: Years Old - Personal Products 10Toothpaste 20Toothpaste, Deodorant 30Toothpaste, Deodorant, Aftershave 40Toothpaste, Deodorant, Aftershave, Minoxidil 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, Fixodent So, you could indicate age by stating Bag Bomb like me. ___ tedd sperling t...@sperling.com Age: 72 years, 7 days toothpaste, deodorant, aftershave. Don't need the rest, yet. Mousepad: Yes. I find it easier to clean the mousepad than to try to clean the keyboard tray/desktop/whatever. -= Bill =- -- A day without sunshine is like a day in Seattle.
[PHP] Re: Seeking a scheduling algorithm
On Jul 14, 2012, at 4:53 PM, php-general-digest-h...@lists.php.net wrote: From: Tedd Sperling t...@sperling.com Subject: Seeking a scheduling algorithm Date: July 14, 2012 4:53:15 PM EDT To: php-general@lists.php.net Hi gang: Does anyone have a resource, or better yet code, to solve the scheduling problem described below? Let's say you have a week calendar that has openings between 8:00am to 5:00pm for Monday through Friday (40 hours). Then you have an assortment of appointments that must be scheduled into the week calendar. Some of the appointments are simply a one hour per week, while others may be two, three, four, or five times per week and each appointment for an hour or more (up to eight hours). The problem is, knowing what appointments (i.e., twice a week for 2 hours, three times a week for one hour, etc.) must be scheduled for the week, what is the most efficient way to schedule these appointments into that week? The most efficient way is defined as scheduling appointments with little, or no, gaps in between appointments. For example, four one-hour appointments on Monday between 8:00am to 12:00pm is better than four one-hour appointments spread out between 8:00am to 5:00pm. Anyone have any solutions, ideas, resources, code? Thanks, tedd _ t...@sperling.com http://sperling.com Tedd, There is an old general rule that the most time efficient way to schedule is to put the big time requests on the schedule first. In this case, that would mean schedule all five times a week requests first, then the four times a week, then the three times a week. The two hour requests should be scheduled next: three times a week and twice a week can be scheduled at the same time. Then fill in the rest with the one hour requests. Hope that makes sense. -= Bill =- -- A closed mouth gathers no feet.
Re: Re: [PHP] Round with money_format
On Sep 17, 2011, at 3:46 AM, Cyril Lopez wrote: From: Cyril Lopez cy...@nethik.fr Date: September 16, 2011 10:58:28 AM EDT To: php-general@lists.php.net Subject: Round with money_format Hi, Can someone help me understand how money_format() rounds numbers ? ?php setlocale(LC_ALL, 'fr_FR.UTF-8'); $price = 12.665; echo money_format('%i',$price); // 12.66 EUR, 12.67 EUR expected $price2 = 12.666; echo money_format('%i',$price2); // 12.67 EUR, ok echo round($price,2); // 12.67, ok echo round($price2,2); // 12.67, ok ? Misconfiguration ? Bug ? Thanks ! Cyril Config : Debian Lenny, PHP 5.3.8 As someone else pointed out, rounding rules vary by locale, but I was taught 40+ years ago in graduate school programming class, 4 rounds down, 6 rounds up, and 5 rounds to the even number. This means 65 rounds to 6, while 75 rounds to 8. Your example seems to follow that rule. -= Bill =- -- Virtuous action will never go unpunished. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Question
At 11:37 AM -0500 01/06/11, tedd wrote: At 8:16 PM -0500 1/5/11, Daniel Brown wrote: On Wed, Jan 5, 2011 at 19:45, David Harkness davi...@highgearmedia.com wrote: [snip!] Most companies will gladly give their product away to put it in the hands of soon-to-be-professionals. :) Tedd had his chance to be professional back in the forties (the eighteen-forties, I believe). Now he teaches others who still have a chance. ;-P Which reminds me of an old thread from back in 2008, where I posted Tedd's senior class picture. You can see it here: http://links.parasane.net/tb46 Again, you got it wrong, o' wise one -- that's a picture of my son's senior class. I'm the one on the left fogging a smart-ass who refused to get out of my Fogging must be a REAL OLD Fashioned term. Please clarify. -= Bill =- chariot's way. Boy, those were the good old days when I could flog a smart-ass. Cheers, tedd PS: It's not Friday yet. -- --- http://sperling.com/ -- Don't find fault. Find a remedy. - Henry Ford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Developer needed, right place for it?
Looking to get a bit of PHP work done, is this the right place for it, or is there a better place to ask? Bill
[PHP] Problem with Include
In an effort to clean up some code, I tried taking four lines out of 6 or 7 programs and putting them into an include file. The file structure is Root data clubs.php include fmt.inc Originally, clubs.php had the following code: ?PHP $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); ? This code works - on the web page I get This page last modified 12/18/2010 which is correct. So then I did the following: Create an include file, fmt.inc with the following code: $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); and then in the original file, I have ?PHP include ../include/fmt.inc; ? On my web page, I then get $file_name= basename($_SERVER['PHP_SELF']);$last_modified = filemtime($file_name);print(This page last modified ); print(date(m/j/y, $last_modified)); (all on one line). I would really like to understand why the include construct doesn't give the same results as the original? -= Bill =- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with Include
Many, many thanks to Tamara, Govinda, and Ashley. Adding the php tags ?php ? to the include file solved the problem. -= Bill =- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quotes vs. Single Quote
At 8:31 AM -0400 08/06/10, tedd wrote: Cheers, tedd PS: Considering that this is Friday. I have a grammar question for the group. I said above: neither CSS, PHP, or any web language exist in a vacuum. Is the word neither appropriate in this sentence? Normally, two items can be compared by neither or nor, but what about more than two items? Is it appropriate to use neither or nor for more than two items? Somewhere along the line, probably in college (if it were before college, it would have been so long ago I would have forgotten it), a professor said to handle this sort of thing thusly: neither A, nor B, nor C A little more wordy, but completely unambiguous. -= Bill =- -- Don't find fault. Find a remedy. - Henry Ford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [site is acting strange] - blank pages, download index.php, or works fine
At 6:45 PM -0600 7/29/10, Tristan wrote: Yeah like i said site works 95% of the time when navigating. PHP5.2, Mysql 5. The site is completely dynamic so it wouldn't work at all if that was the case of it not being installed right. so the other 5% of the time is blank pages and download index.php files. In Firefox when you get a blank page, if you click view source it will show all the code that should be there but, I can't tell if it's requesting the page again when you do that. It never fails 2 times in a row. A refresh will always fix it. When you look in firebug there is no html so it leads me to believe FF may be doing just that...going for a second request instead of viewing currently opened source? In IE8 I would get something like diagnose problem button more information drop down with this problem can be caused by a variety of issues..this is a completely typical M$ error with no valid help chrome same thing with web page cannot be displayed more information etc... On Thu, Jul 29, 2010 at 6:36 PM, David McGlone da...@dmcentral.net wrote: On Thu, 2010-07-29 at 18:11 -0600, Tristan wrote: I have the strangest issue with my host. They can't figure it out and I'm completely perplexed. We have other sites running on the server just fine. However, this new site is acting very weird. Sometimes we get blank pages, sometimes we get a blank page and then a dialog pops up asking if we want to download index.php, and then sometimes the site is working fine. Any ideas on this? I'm at ends. Appreciate any advice. For authentication we are using mysql auth module in apache/linux and proxy pass. We removed proxy pass to see if that was it but, it wasn't. its a members.domain.com subdomain if that helps. Do you have php-mysql installed? -- Blessings, David M. Does the page validate at http://jigsaw.w3.org/css-validator/? -= Bill =- -- Don't find fault. Find a remedy. - Henry Ford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: html analyzer
At 12:30 AM +0200 5/19/10, Rene Veerman wrote: Hi. I'm trying to build a html analyzer that looks at natural words in html text. I'd like to build a routine that walks through the HTML character by character, but i'm not sure on how to properly walk through escaped and ' characters in javascript or other embedded languages. Skipping the first and ' is no problem, but after that, the escaped and ', they can get difficult imo. If you have any ideas on this i'd like to hear 'm.. -- - Greetings from Rene7705, My free open source webcomponents: http://code.google.com/u/rene7705/ http://mediabeez.ws/downloads (and demos) http://www.facebook.com/rene7705 - Renee, I agree with the previous post - what you want to do is non-trivial. However, to address your question: one approach is to create a single quote flag (sqf) and a double quote flag (dqf). When you encounter the first quote, set that flag. When you encounter the second quote of the same type, clear the flag. At the end, both flags should be clear, or the html is mal-formed. You can also get more sophisticated and verify that you do not encounter a single, double, single sequence, or a double, single, double sequence. That gets more involved by remembering which quote was first, second, and third - third should be same as second, for example. -= Bill =- -- Don't find fault. Find a remedy. - Henry Ford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] åÐ-¡¨-¼· å|»®-åÉ|ó-ñ@
At 8:26 PM -0400 5/6/10, Robert Cummings wrote: Ashley Sheridan wrote: [/snip] If only I could speak Chinese and was gullible I'd love to take them up on the offer for whatever it is. Thanks, Ash http://www.ashleysheridan.co.uk My Chinese is a bit rusty, but I think it says, please reply on-list to this spam message! :| Cheers, Rob. :) -- http://www.interjinn.com Application and Templating Framework for PHP Boy, its a good thing no one on this list would fall for something like that. -= Bill =- -- Don't find fault. Find a remedy. - Henry Ford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] basic authentication and redirection
Hi there, In certain circumstances controlled by my users, I'd like to redirect my users to another site, a third party whom we have contracted with. The second site uses basic authentication with a simple username and password. Can I write my PHP code so my users do not have to login (or even know the username/password) on the remote site? This isn't intended to stop serious hackers, just enough security to stop casual passers-by. Thanks, Bill -- Bill Rausch We first make our habits and then our habits make us. --John Dryden -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I detect an exception without using try/catch?
Ok, the details of the problem obviously aren't being understood. Let's assume that I explained it poorly and I'll try again. Take the following code (It's complete, cut/paste to see what happens.): ?php class running { private $running; public function __construct() { $this-running = true; } public function stop() { $this-running = false; } public function __destruct() { if ($this-running) { throw new exception('I have not stopped running yet!'); } } } function fail_horribly() { throw new exception('This is the real error that I want a stack trace from'); } function do_that_thing() { $running = new running(); fail_horribly(); $running-stop(); } try { do_that_thing(); } catch (exception $e) { echo $e-getMessage(); } ? While putting this together, I discovered lots of interesting behaviour. Depending on exactly where I put the try/catch, there are different things that happen and different errors that occur. It's kinda interesting. The thing is, that none of those errors is the result that I _want_ which is to ignore the fact that $running was unset and just report the error that started everything going wrong. If I could put my fictional function (get_current_exception()) in the __destruct() method, I could detect that an exception was already in progress and avoid throwing another one. -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I detect an exception without using try/catch?
In response to Andrea Giammarchi an_...@hotmail.com: http://uk2.php.net/set_exception_handler http://uk2.php.net/manual/en/function.set-error-handler.php Thanks for the reply, Andrea. However, you either didn't read my entire message, or didn't understand it. I can't use either of those to detect an exception that's already in progress, I can only use them to catch the exception before the script ends if nothing else catches it. What would be nice is a function like get_current_exception() that would either return the current exception object, or return false if there is no exception. Date: Thu, 23 Apr 2009 12:19:30 -0400 From: wmo...@potentialtech.com To: php-general@lists.php.net Subject: [PHP] How can I detect an exception without using try/catch? Specifically, the __destruct() method of certain objects will be called if an object goes out of scope due to an exception. Since the __destruct() method didn't call the code that caused the exception, it can't catch it. I need the __destruct() method to behave differently if it's called while an exception is in progress than if it's called simply because the object is unset. Searches of the docs has yet to turn up anything and Google isn't helping. Anyone have any pointers? -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I detect an exception without using try/catch?
Specifically, the __destruct() method of certain objects will be called if an object goes out of scope due to an exception. Since the __destruct() method didn't call the code that caused the exception, it can't catch it. I need the __destruct() method to behave differently if it's called while an exception is in progress than if it's called simply because the object is unset. Searches of the docs has yet to turn up anything and Google isn't helping. Anyone have any pointers? -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] openssl extension problems: error:0E06D06C:configuration file routines:NCONF_get_string:no value
I'm trying to use the openssl extension for PHP. Having some problems and trying to figure out if the problem is in openssl or PHP's wrapper around it. The problem happens when I call openssl_pkey_get_private(). The function returns failure and openssl_error_string() returns error:0E06D06C:configuration file routines:NCONF_get_string:no value So, this is not a PHP error, per-se. But I'm wondering if PHP is Doing It Wrong, and thus causing this. The docs claim that a valid openssl.cnf is required, and I have one, but ktrace()ing the php script shows no attempt whatsoever to access the openssl.cnf file, so my first instinct is that PHP is doing something wrong. Some details FreeBSD 6.3-RELEASE-p4 which includes 0.9.8e PHP php5-openssl-5.2.6_1 (installed from FreeBSD ports) Some specific questions: 1) Does the above error indicate that the openssl.cnf is not being used? 2) Is there anything I can do to get more verbose debugging? 3) Anyone on-list familiar with PHP's implementation? However, any helpful advice on this is appreciated! -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chrome 1.0 released
At 9:30 AM -0500 12/14/08, tedd wrote: At 3:08 PM -0800 12/13/08, Yeti wrote: I have to defend poor little IE a little now. It supports XHTML and CSS2 pretty well so far. And those standards came out a couple of months ago. Even a blind pig finds an acorn every once in a while. Cheers, tedd Tedd, You should apologize to all pigs for that comparison. -= Bill =- -- A conclusion is the place where you get tired of thinking. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailing lists
At 11:00 AM -0400 11/1/08, tedd wrote: snip I used to have a theory that intelligence was inversely proportional to latitude. To prove my point, I would direct people to observe the Upper Peninsula of Michigan, where phrases like Say ya to da UP, eh? were common. When confronted with an discerning opinion, I would add even more evidence by telling them to look further north where pronunciation of about and a boot merged -- and thus that would usually win my argument. Now, that I am confronted with such a wide latitude (in both meanings) of diverse opinion, I must conclude that intelligence and ignorance are both amply distributed all over the globe irrespective of one's shortcomings in language skills -- thank God. Cheers, tedd I don't know, tedd. I believe it was my college physics instructor who taught us that the two most abundant elements in the universe are hydrogen and stupidity. -= Bill =- -- Half this game is ninety percent mental. -Philadelphia Phillies manager Danny Ozark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The Data Literacy Test
At 9:22 AM +0800 9/25/08, Shelley wrote: 2008/9/25 Philip Thompson [EMAIL PROTECTED] On Sep 24, 2008, at 7:29 AM, Maciek Sokolewicz wrote: tedd wrote: At 12:25 PM +0100 9/24/08, Ashley Sheridan wrote: On Wed, 2008-09-24 at 09:20 +0800, Shelley wrote: http://phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test The Data Literacy Test: http://www.phparch.cn/index.php/php/34-php-basics/202-the-data-literacy-test What the smeg is this? I don't know, but I figure 27. Cheers, tedd yes, I think 27 aswell... - Tul No no no. We all know the answer is 42. ? How come 42? The answer to the question of Life, The Universe, and Everything, is 42. -= Bill =- -- With best regards, Shelley Shyan http://phparch.cn -- A libertarian, immoral society is enticing you to excesses. Enjoy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unset($_GET['i'])
Hi given page1 has a list of goods and sends $i as a variable into a link to page2, ie, a href=page2.php?i=3send/a Page2 adds the items recieved in an array. In page2 how can I unset the $_GET['i'] so that if I press F5(refresh) it doesn't add the same item to the array ? I tried unset($_GET['i']) but no success. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset($_GET['i'])
Dan Shirah a écrit : How about just adding a simple counter on your page. That's what I do but that counter resets when you press F5 and is not functionnal. Why $_GET['i'] doesn't unsets ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset($_GET['i'])
Why $_GET['i'] doesn't unsets ? Your page URL has ?i=asdf in it. As such, $_GET['i'] is being set every time you refresh that particular URL. Unsetting $_GET['i'] will only erase the variable for that instance of that PHP script. As soon as you refresh, you are calling a new instance of that PHP script and assigning $_GET['i'] the value asdf (or whatever). Not using GET means rewriting all the pages. Ok then I'll use a session variable. Thanks you all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Writing MySQL Update Query with NULL value
I'm trying to write a MySQL UPDATE query where one or more variables may be NULL. So, I'm trying something like: $last_name = $_POST['last_name']; $first_name = $_POST['first_name']; $suffix = $_POST['suffix']; $suffix = empty($suffix) ? NULL : $suffix; $phone = $_POST['phone']; $phone_index = $_POST['phone_index']; $update_query = UPDATE 'phones' SET 'last_name' = $last_name, 'first_name' = $first_name, 'suffix' = $suffix, 'phone' = $phone WHERE 'phone_index' = $phone_index;; However, when I echo out this query, I get: UPDATE 'phones' SET 'last_name' = Doe, 'first_name' = John, 'suffix' = , 'phone' = 123-456-7890 WHERE 'phone_index' = 323; I think, for this to properly update the record, it should be: UPDATE 'phones' SET 'last_name' = Doe, 'first_name' = John, 'suffix' = NULL, 'phone' = 123-456-7890 WHERE 'phone_index' = 323; What am I doing wrong? -= Bill =- -- Nothing is so bad that it can't get worse. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newsletter administration
Hi Alain I would use RSS. My friend Google gave me that link to try http://www.feedforall.com/free-php-script.htm this newsletter should be in HTML format and send 1 by 1 to each customer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Quarters
Maybe you guys should get a Mac. Works just fine for me on a Mac, OS X, Firefox. -= Bill =- At 9:49 AM -0400 4/11/08, tedd wrote: Hi gang: Check out my new game: http://webbytedd.com/quarters/ What do you think? Cheers, tedd PS: I originally wrote the game for the Mac over eight years ago. -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- I plead contemporary insanity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic boxes problem... JS and PHP
At 3:20 PM -0700 4/8/08, Ryan S wrote: Hey! Thanks Andrew, will look into those points that you sent me. First thing to change will be the DOCTYPE I think, as i didht type that but must have copied code into a pre-made page... Cheers! R Ryan, Four observations: 1. Don't try to solve your problem by changing the DOCTYPE. Bad HTML is bad HTML. Changing the DOCTYPE may reduce the severity of the problem, but it won't solve it. 2. You have interpreted the fact that IE gave you what you expected while FF did not as a problem with FF, but the opposite is true. A problem with IE allowed it to accept HTML that it should not have accepted. FF treated it properly. 3. Firebug is a free download from Mozilla. I have it and it has solved more problems for me than I can remember. (Or, maybe I just don't have a very good memory.) Get it. You will see your form... tags inside the table /table tags, but not inside any td.../td tags. 4. Learn to use the W3C Markup Validation service - http://validator.w3.org/. It will point out many problems that you can solve quickly. -= Bill =- -- Murphy's Law Cardinal Conundrum - The optimist believes we live in the best of all possible worlds. The pessimist fears this is true. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: character encoding
Ok I give it a try as soon as I can. Hotmail will accept mail delivery from PHP ? Sure. There is nothing specific of PHP that prevents Hotmail from accepting messages sent by PHP scripts. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: character encoding
Hi Manuel Hotmail will accept mail delivery from PHP ? Sure. There is nothing specific of PHP that prevents Hotmail from accepting messages sent by PHP scripts. I used your test_smtp_message.php setting to_address to my hotmail, localhost to my ip on dyndns, smtp_host to www.hotmail.com, smtp_user to my hotmail, and smtp_password to my hotmail pw. Here's the answer : Error: could not connect to the host www.hotmail.com: Connection timed out What now? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: character encoding
Hi Manuel You can build mailto: links with a default subject and text, but I am not sure you can force Outlook to use specific HTML. It's wiser to not rely on mailto: . Hotmail will accept mail delivery from PHP ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: character encoding
Hi Manuel In the body that column shows Brébeuf in Windows Outlook. You may want to try this MIME message composing and sending class that http://www.phpclasses.org/mimemessage Looks great Manuel.but my server is under dyndns and the DN isn't qualified so no mail functions available. I was asking how to have the right character set translation so the data stored in the table show no grimmerish in the outlook window. A simple mailto link in the page with some basic content defined does the trick but the data retrieved from the table can look awsome in the mail client before the user sends it back to the owner email address. I'm making a site for myself. I'm a paintbrush artist, among other things, and I've set a buying level for the visitors. But one can ask to raise his level so he can buy more things in one session. For that I use a mailto link sent to my hotmail with the request giving the name and address of the sender. And that's where I can't control anything. The guy may have written accented caracters in his record and when that info is brought back, it messes the Outlook msg window of the sender. Can I force Outlook msg composer to use my Mysql table collation ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Quick email address check
At 1:28 PM -0400 3/26/08, Al wrote: I'm scripting a simple registry where the user can input their name and email address. I'd like to do a quick validity check on the email address they just inputted. I can check the syntax, etc. but want check if the address exists. I realize that servers can take a long time to bounce etc. I'll just deal with this separately. Is there a better way than simply sending a test email to see if it bounces? Thanks I've had pretty good success from the following: after checking the syntax (exactly one @, at least one . to the right of the @, etc.), if it passes the syntax check, I then set $rhs to everything to the right of the @. Then I test: if (!checkdnsrr($rhs, 'MX')) { invalid } else { valid } -= Bill =- -- You can't tell which way the train went by looking at the track. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] character encoding
Hi Zoltan, A column in a table has Brbeuf in it. (3rd caracter is eacute;) In the body that column shows Brébeuf in Windows Outlook. How could I translate to the correct encoding so that accents show correctly in Outlook ? based on the encoding of your e-mail, my guess is that your data is in some ISO-8859-1 encoding or something like that. of course, you should verify that first. so try to send those emails with that encoding, or what's much better, use utf8 for both your data and your email. I think outlook can cope with that, though I'm not sure ;) The encoding can be set to utf-8 in the recieved email, what translates the encoding but the sender's outlook window doesn't. It's a site where you can ask the owner to upgrade your account limit by clicking on a mailto link who writes most of the email body. The data used is your record from a Mysql table. When you use that link it opens a email window and the body of that message isn't translated. So the people will see some garbage and may not send the email. If I try to change the encoding in the editing window of Outlook while this garbaged email shows it doesn't work. I still see the garbage, yet my outlook is set for utf-8 !! Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date math
At 12:17 AM -0400 3/24/08, Ron Piggott wrote: I have this math equation this list helped me generate a few weeks ago. The purpose is to calculate how many days have passed between 2 dates. Right now my output ($difference) is 93.958333 days. I am finding this a little weird. Does anyone see anything wrong with the way this is calculated: $date1 = strtotime($date1); (March 21st 2008) $date2 = strtotime($date2); (December 18th 2007) echo $date1 = 1206072000 echo $date2 = 1197954000 #86400 is 60 seconds x 60 minutes x 24 hours (in other words 1 days worth of seconds) $factor = 86400; $difference = (($date1 - $date2) / $factor); 94 - 93.958333 = .04167 .04167 * 86400 = 3600 = 1 hour. Didn't you pass throught daylight savings time prior to 21 March? -= Bill =- -- You can't tell which way the train went by looking at the track. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session still open
Hi Daniel, on the site. If all you want to do is find out if they still have the socket open, then there are much smaller, simpler ways. Like what ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session still open
Hi socket open, then there are much smaller, simpler ways. Like what ? I meant as opposed to the session-handling method I sent in the other thread. However, you may want to look into having JavaScript handle the session-watching, and report to the server via AJAX calls every 30 seconds or so. If JavaScript doesn't PING the server at least once every thirty seconds, then you know either the user left the page or closed the browser. If it does, on the other hand, then the PHP side of the AJAX routine simply updates the [database/file/session info] to show that the user is still active. Hum. Then we rely on JS to implement security with conections. And JS is anything but secure AFAIK. I want to prevent one from taking over a session from one who left the site and left his desk for a moment. What if that connection were two servers communicating together !? Any crooked mind could then steal the latent session and start fire in the system(s). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session still open
I want to prevent one from taking over a session from one who left the site and left his desk for a moment. What if that connection were two servers communicating together !? Any crooked mind could then steal the latent session and start fire in the system(s). All things that would've been good to know from your first message, rather than the vague nature in which it was sent. ;-P The question remains the same and the initial problem is still the same. My first concern is to avoid abandonned sessions from beeing stolen. The extention of that problem is automation between two servers, like from branches to the main office. In that case, encryption is not a solution. It doesn't even block cross-browser action. Apache has mod_unique_id that could be usefull but it's not the final answer IMO since it produces a unique ID based on a quadruple built on UTC, the PID, the IP and a counter. That doesn't tell if the socket is still open but only the last request the server satisfied. For small applications maybe a cron like you gave could be a solution but even so, will you set it to run eveny 30 seconds or so ?? I think it could be somewhat heavy for the server. Just imagine 60 simultaneous visitors. I would rely on JS to send an ID every 30 secs or so and wait for a new ID based on the preceeding one. Something like mod_unique_id. Do you know what's used in commerce ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cart in a session
Is it a good idea to put a cart in a session var since the cart will be an array ? Yes, and it's far more secure than putting the actual data into a cookie, since that can be changed on the client-side to alter prices and other data. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session still open
Hi Ubuntu7.10 LAMP A PHP session destroys itself as soon as the client disconnects from the site. Why if I connect from another machine, log in, and disconnect without logging off, and return 5 mins later, my session is still alive ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session still open
Hi Daniel, Why if I connect from another machine, log in, and disconnect without logging off, and return 5 mins later, my session is still alive ? A session only expires in three cases: a.) An explicit session_destroy() is sent.* b.) The user-side cookie with the session key expires. c.) The session corrupts.+ I didn't set any cookie so it must be the php session cookie. How can I check for the visitor's presence ? I can't set a timer or check for activity since the visitor can be studying an online document. I must rely on the browser connection. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session still open
Hi Daniel, http://www.nabble.com/Logging-session-timeout-in-DB-to15845123.html It can build a lot of stress on the server. What if I use connection_aborted() ? In the status line of the page I can write a 'connected' timer and use it to check the connection !? At most I'll have a 30 secs. time lapse. (30 secs. is the default execution time for scripts) What do you think of that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pass Variable Names to a Function
I would like to use a function to check to see if a session variable is set and return the session variable if it is set, and return blank if not. Something like function set_var($var) { echo var = $var \n; if (isset($_SESSION['$var'])) { return $_SESSION['$var']; } else { return ; } } And I would call the function with set_var($name) or set_var($phone). The problem is getting the function to use $var as a variable name, rather than a value. What am I missing, please? -= Bill =- -- Diplomacy - telling your boss he has an open mind instead of saying he has a hole in his head. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 5.2.5 failed 7 tests
at the end of make test no critical errors, 3 or 4 said they were bugg. then 3 said iI may have a branded libc. Peter Smit [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Dec 3, 2007 12:18 AM, Bill [EMAIL PROTECTED] wrote: Do failed tests mean I absolutely should NOT install. Or is it normal to have a few fails? Try two different versions, all have some failure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Which tests do you mean? On the end of the configure command you'll see if there is a critical error. If not, you can make it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 5.2.5 failed 7 tests
Thank you. configure ended with no errors. But it said Don't forget to make test, so like a good little lemming I did. Daniel Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Dec 3, 2007 11:01 AM, Bill [EMAIL PROTECTED] wrote: at the end of make test no critical errors, 3 or 4 said they were bugg. then 3 said iI may have a branded libc. Peter Smit [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Dec 3, 2007 12:18 AM, Bill [EMAIL PROTECTED] wrote: Do failed tests mean I absolutely should NOT install. Or is it normal to have a few fails? Try two different versions, all have some failure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Which tests do you mean? On the end of the configure command you'll see if there is a critical error. If not, you can make it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So after ./configure finished, it didn't end with a line beginning like so? configure: error: [SOME_ERROR_MESSAGE] If not, feel free to run both 'make' and 'make install'. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 5.2.5 failed 7 tests
Do failed tests mean I absolutely should NOT install. Or is it normal to have a few fails? Try two different versions, all have some failure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: quicktime new window php
At 5:26 PM +0530 11/23/07, kNish wrote: Hi, How is it possible to have a hyper link open a new quicktime window BRgds, kNish Not sure if this is what you are looking for or not, but if your html code looks like a href=link-to-page target=_toppage name/a, the page will open in either a new page or a new tab. That choice is dependent on the local browser configuration. -= Bill =- -- Do not confuse liberty with license. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ZVAL reference counter code execution
Hi all, Do I have to worry about the ZVAL overflow vulnerability if I don't use unserialize() in my code? Or is it used behind the scenes whether I call it directly or not? I have a web server running PHP 4.4.4 with only one custom application running on it. The server is dedicated to this one application. Thanks, Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MPEG Properties
Hello, all. Thanks for your help in advance. I'm trying to figure out how to get PHP to retrieve MPEG File Properties, specifically the length of the video file in seconds. Thanks, -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IF command
On Oct 18, 2007, at 9:50 PM, Bastien Koert wrote: Are you sure that the value is a string? If its numeric, then try the check without the quotes around the value http://www.php.net/manual/en/language.operators.comparison.php If you compare an integer with a string, the string is converted to a number. If you compare two numerical strings, they are compared as integers. ?php $component_reference = 5; if ( ($component_reference != 5) AND ($component_reference != 19) ) { echo(I am not a 5 or a 19br); } else echo(I am a 5 or a 19br); $component_reference = 5; if ( ($component_reference != 5) AND ($component_reference != 19) ) { echo(I am not a 5 or a 19br); } else echo(I am a 5 or a 19br); $component_reference = 3; if ( ($component_reference != 5) AND ($component_reference != 19) ) { echo(I am not a 5 or a 19br); } else echo(I am a 5 or a 19br); $component_reference = 3; if ( ($component_reference != 5) AND ($component_reference != 19) ) { echo(I am not a 5 or a 19br); } else echo(I am a 5 or a 19br); ? The results: I am a 5 or a 19 I am a 5 or a 19 I am not a 5 or a 19 I am not a 5 or a 19 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] socket_bind function
I see reading the online docs that I'm supposed to go: socket_create... socket_bind... socket_connect... I've never used the bind function and it hasn't seemed to make any difference? I've always just done socket_create() and then socket_connect(). What benefit is there to putting a socket_bind in between? Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pragmatically changing a Record Number
I don't think you really want to do that, either. You don't need a field in the database to accomplish what you are trying to do. Execute your query to select the records you want, sorting them into what ever order you want. When you display the records on your web page, add a PHP variable, say $row_number, which starts at 1, and increments by one for each row you display. -= Bill =- At 3:09 PM -0400 8/29/07, Jason Pruim wrote: And what I'm looking for is away to take rows 4 and 5 and move them to rows 2 and 3 so the next record inserted would be row 4 :) it does not go back and fill in the holes/gaps -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- Reality is the leading cause of stress, for those in touch with it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: determine which string is longer and then what is different in that string
At 11:11 PM -0700 8/25/07, Richard Kurth wrote: I am trying to find out which string is the longest and then find out what is different between the two string. Sometimes String 2 is longer than String 1 The script below works sometimes but not all the time. Is there a better way to do this or tell me what is wrong with the script I am using $string1 = 1,2,3,4,5,6,7,8; $string2 = 1,2,3,4,6,7,8; Can you give us an example of two strings where the comparison fails? I suspect you are looking for the number of entries in the string, rather than the length of the string. For example: $string1 = 1,2,3,4,5,6,9; $string2 = 1,2,3,10,11,12; number of entries in $string1 is 7, number of entries in $string2 is 6, but length($string1) = 13, while length($string2) = 14. Is this the problem you are seeing? -= Bill =- -- The greatest calamity is not to have failed, but to have failed to try. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: determine which string is longer and then what is different in that string
At 6:00 PM -0700 8/26/07, Richard Kurth wrote: I am trying to find out which string is the longest and then find out what is different between the two string. Sometimes String 2 is longer than String 1 The script below works sometimes but not all the time. Is there a better way to do this or tell me what is wrong with the script I am using $string1 = 1,2,3,4,5,6,7,8; $string2 = 1,2,3,4,6,7,8; Can you give us an example of two strings where the comparison fails? I suspect you are looking for the number of entries in the string, rather than the length of the string. For example: $string1 = 1,2,3,4,5,6,9; $string2 = 1,2,3,10,11,12; number of entries in $string1 is 7, number of entries in $string2 is 6, but length($string1) = 13, while length($string2) = 14. Is this the problem you are seeing? Yes that is the problem $string2 is what is saved in the database and string1 is coming from a form. The form has every thing that is in the database but could have some items added and some removed. I need to know what is different so I can add to or remove from a separate table so both tables are the same. How about something like $array_string1 = explode(',' , $string1); $array_string2 = explode(',' , $string2); $len_string1 = count($array_string1); $len_string2 = count($array_string2); Now you can compare the number of elements in $string1 ($len_string1) vs. the number of elements in $string2 ($len_string2). And the two arrays can be compared to see what the differences are. You haven't really provided enough information about what is really going on (nor is it necessary to do so), but is it possible that the two strings could be different but have the same number of elements? If so, then the lenght of the strings is not particularly relevant, and you might just want to compare the specific elements of both strings with each other. -= Bill =- -- If you're living on the edge, make sure you're wearing your seat belt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Discussion of bug #39062
In response to Crayon [EMAIL PROTECTED]: On Thursday 03 May 2007 03:18, Richard Lynch wrote: On Wed, May 2, 2007 1:14 pm, Bill Moran wrote: http://bugs.php.net/bug.php?id=39062 This discussion may be better placed on Internals where the people who make these decisions hang out more... Maybe Bill wanted us lowly users to know that the all powerful developers aren't listening to their users. That wasn't the reason. Actually, I'm not sure what the reason was, but I suspect is has something to do with being overly busy and having 5 projects competing for my time yesterday. One of those, oops ... in hindsight that wasn't the correct way to do that. kind of things. I will post it to the internals list. Sorry for the noise here. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ [EMAIL PROTECTED] Phone: 412-422-3463x4023 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Discussion of bug #39062
http://bugs.php.net/bug.php?id=39062 I'm requesting that this bug be reopened and reconsidered. I'm completely befuddled by the handling of this bug. The message text suggests a workaround, then the bug is marked bogus. If the bug is bogus, why is there a workaround required? Additionally, the suggested workaround doesn't even work. dechex() reliably returns 64 hex bits for 64-bit numbers and 32 hex bits for 32-bit numbers, which still results in incorrect comparisons, for example f34c690a != f34c690a. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ [EMAIL PROTECTED] Phone: 412-422-3463x4023 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-WIN] Re: Question on virus/worms
Turn off all error reporting (in php.ini) so that the error isn't pushed to the screen. -Original Message- From: Seak, Teng-Fong [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 12:16 PM To: php-windows@lists.php.net; php-general@lists.php.net Subject: [PHP-WIN] Re: Question on virus/worms Robert Cummings wrote: Did you bother to google any of them? I just punched PHP/BackDoor.gen into Google and got a wealth of information. Yes, of course! But what I can see there aren't far from useless (cf what I write below). Stut wrote: Seak, Teng-Fong wrote: PHP/Chaploit http://vil.nai.com/vil/content/v_129568.htm [snipped] I know these already. The server is using McAfee. So I'm quite familiar with VIL of McAfee. But informations given by these pages aren't enough to let me know what to do and how those virus/worms got to get inside. Do they mean anything to anyone of you? Do you know how they've got inside the computer? Is there anything to do to prevent that? Are they known PHP virus/worms to PHP community? Most likely means of them getting onto your machine is poorly written scripts, over-reliance on scripts downloaded from the web and poor server security. Hope that helps. No, not really :-( But after I've spent some time reading the log files, I've finally found out how the hackers managed to achieve worm infiltration. Actually, they're using an URL like this: http://my-domain.com/index.php?page=http://hacker-domain.com/some-worm-f ile.txt? And the some-worm-file.txt file contains some PHP code, while my index.php contains this instruction: include($page.php); This is enough to make infiltration possible! IMO, this instruction is supposed to be used like this, isn't it? So this is obviously a PHP security loophole and I don't see how the poorly written scripts can help anything unless a totally rewrite! And there's no poor server security that I can see. I've installed PHP5 and the problem seems fixed. However, PHP writes out where the problem occurs! Indeed, the hacker could read a line like this: Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\Inetpub\wwwroot\index.php on line X I don't want them (the hackers) to be able to read this either. That gives too much information about my server's file system. How can I stop that? By the way, I know there're still a lot of servers out there still using PHP4. Is this vulnerability a known bug? At least, I'm not aware of that before! Regards, Seak -- * Zoner PhotoStudio 8 - Your Photos perfect, shared, organised! www.zoner.com/zps You can download your free version. -- PHP Windows 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] Getting mysql_query results into an array
At 6:22 PM -0600 2/13/07, Richard Lynch wrote: The most efficient way is Don't do that. :-) Simply loop through the results and do whatever you want to do with them, and don't put them into an array at all. This question has appeared before, and usually breaks down to one of these scenarios: #1 snip 1 #2 snip 2 #2 does occasionally have an exception to the rule, where the SQL query is nasty and the PHP is fast and easy, but that's awfully rare. How about scenario #3: I wish to output my data in (for example) three columns, as a phone book does. To make the example simple, assume 15 data points. I wish the output to look like 1 611 2 712 3 813 4 914 5 1015 So when I'm outputting row 1, I need data points 1, 6, and 11. Isn't it easier to generate the query, put in array, and output the rows from the array? Keep in mind, the number of data points might be variable, the constraints being n columns with approximately the same number of data point in each column. -= Bill =- -- The secret of life is...I can't tell you. It's a secret. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extracting XMP text from Jpeg
At 8:05 PM +0200 1/13/07, Dotan Cohen wrote: Hehehe... Good thing that I didn't post a picture of Gush: http://dotancohen.com/gallery/img-122.html I presume Gush is an advanced computer mouse? -= Bill =- -- Jury: a panel of 12 men and women selected to decide who has the better lawyer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Confused on the status of a bogus bug report
With reference to: http://bugs.php.net/bug.php?id=40067 I'm confused as to why this was marked bogus, and the message that marked as such doesn't give much insight. It would seem to me that infinite recursion within PHP is a bug. Shouldn't the interpreter catch this sort of thing before it coredumps? Or is the design philosophy for PHP different than that? If anyone can point me to a online explanation for this or other resource, I'd be happy to read up a bit. More than happy to understand why I'm wrong, but right now I feel as if this problem is getting the brush-off. -- Bill Moran Collaborative Fusion Inc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: comparing a string
At 9:28 PM -0500 6/21/06, Rafael wrote: snip The only possible values of strcmp() are: 1, 0 -1. Hmmm. My manual says: Compares two strings; returns a number less than 0 if the first string is less than the second, 0 if the two strings are equal, and a number greater than 0 if the first string is greater than the second. Sounds like values other than -1, 0, and +1 are possible. -= Bill =- -- You never know who's right, but you always know who's in charge. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form to form variables
I wonder if I may trouble you'all for some advice. I'm having a problem bringing along text variables with more than one word in them from form to form. The project is an on-line baseball score pitching log submission form that I'm trying to make a little more automated. The first form asks the user what league team they represent. For example: Your Team: select name=yourteam option value=- Select a team - option value=+ Juniors + option value=LCCMBLCCMB option value=FannonFannon option value=Avalon BayAvalon Bay option value=BeiroBeiro option value=Pioneer RoofingPioneer Roofing option value=FannonFannon This gets picked up on the next form and is used to feed a SELECT statment that gets records associated with the particular league team. This works just fine to capture the posted values and give them a name: $team = $_POST['yourteam']; $league = $_POST['yourleague']; Further down on this page, I pass these variables off to the next form: while ($thearray = mysql_fetch_array($res)) { printf(FORM ACTION = scoreForm_last.php METHOD = POST input type = hidden name = IDFIELD value = $thearray[id] input type = hidden name = yourleague value = $league input type = hidden name = yourteam value = $team I pick them up on the next page like this: $ID = $_POST['IDFIELD']; $yourleague = $_POST['yourleague']; $yourteam = $_POST['yourteam']; This passes the record ID, the league and team along just fine to the next form, BUT only the first word of each team comes through! Avalon Bay becomes Avalon, etc. Is there any obvious reason for this to be happening that you can see? Or am I approaching this all wrong? I'm using a similar approach to an umpire scheduling database and it works just fine. Thanks for any hints! bw --- Bill Whitacre [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IBM's Learning PHP Part 1 tutorial.
Newbie question. I'm working my way through IBM's PHP tutorial. Generally good ... but I'm stuck at an error point and have no idea what's going wrong. Before adding a new row to the mysql database (already opened) we do a query to see if a particular record already exists. (see $resultT). We then test, using if, to see if $resultT is true or false. If it's false we are then supposed to enter a new record. Problem: it's never false. It always evaluates true. What am I doing wrong? TIA /* build query to see if the record is entered already */ $sqlT = select * from users where username='.$_POST[name].'; $resultT = mysql_query($sqlT); /* Now test -- did we find anything ... if not add this user */ if (! $resultT) { /* here we add the new record if it doesn't already exit /* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cybercash as a shared object
Bill Shupp wrote: I need to install the cybercash module on a Debian Sarge system. I really want to keep Debian's PHP packages, and just build this as a shared module. At least one post in the archives indicates that this is possible, as does one changelog entry. However, no specifics were offered. Here's what I've tried: I can build the module fine statically. I can build the shared module cybercash.so by modifying the ext/cybercash/config.m4 and Makefile files, modeling them after the mcrypt.so entries. While modules/cybercash.so does get built, I get this error when trying to load it: PHP Warning: Unknown(): Invalid library (maybe not a PHP library) 'cybercash.so' in Unknown on line 0 I'm building with PHP 4.3.10, and the latest cybercash from PECL. I've also tried the cybercash module from 4.2.3, as suggested in one of the online manual comments. Any guidance would be greatly appreciated! Regards, Bill Shupp I was able to get it compiled by re-writing the config.m4 file, modeling it after the pfpro config.m4 file. Here's what I posted on the online manual comments, just so that it makes it to the mail archives as well: ## Here's how to install cybercash dynamically into PHP 1. Make sure you have the php dev tools installed, like pear and phpize. 2. Download the cybercash module: pear download cybercash 3. Untar the module: tar -xzf cybercash-version.tgz 4. Download and install my updated config.m4 file, the current one (as of version 1.18p1) doesn't work: wget http://shupp.org/patches/cybercash.config.m4 cd cybercash-version mv ../cybercash.config.m4 config.m4 5. Setup/compile module phpize ./configure --with-cybercash=/path/to/cybercash-mck-library-source/c-api make 6. Install module. For Debian Sarge, the modules directory is /usr/lib/php4/20020429/: cp modules/cybercash.so /usr/lib/php4/20020429/ (make install may work also) 7. Enable the module in php.ini, restart apache. ## Incidentally, when I tried to compile the pfpro module from within the PHP source using buildconf, I got setting mismatch errors when trying to load it into Debian's PHP binaries. However, by moving the extension out of the PHP source, and using phpize to setup it up, it loaded perfectly. Hope this helps someone else save some time! Regards, Bill Shupp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cybercash as a shared object
Blair Lowe wrote: Wow can cybercash.so be compiled with the newer glibc libraries? It compiles, but I can't load it. See my previous post. Is there source code for the old cybercash stuff? Per my previous message, the cybercash extension is available in PECL. I already had access to the MCK libraries, though. There's lots of stuff about this on Google. The only thing I ever had was a binary, and when Verisign bought out cybercash, the stuff went obsolete on me. Lots of people still run the PHP cybercash module, but use it statically. I'm trying to get it to run as a shared module. Regards, Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cybercash as a shared object
I need to install the cybercash module on a Debian Sarge system. I really want to keep Debian's PHP packages, and just build this as a shared module. At least one post in the archives indicates that this is possible, as does one changelog entry. However, no specifics were offered. Here's what I've tried: I can build the module fine statically. I can build the shared module cybercash.so by modifying the ext/cybercash/config.m4 and Makefile files, modeling them after the mcrypt.so entries. While modules/cybercash.so does get built, I get this error when trying to load it: PHP Warning: Unknown(): Invalid library (maybe not a PHP library) 'cybercash.so' in Unknown on line 0 I'm building with PHP 4.3.10, and the latest cybercash from PECL. I've also tried the cybercash module from 4.2.3, as suggested in one of the online manual comments. Any guidance would be greatly appreciated! Regards, Bill Shupp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Learning PHP ... online courses?
I'm just learning PHP. If anyone knows of any affordable quality on-line based PHP courses please pass on the details. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 17, 2005, at 10:24 PM, Richard Lynch wrote: I don't know much about that fancy new stream stuff, or the XML crap, but you've got zero (0) lines of code in there to do anything useful when the functions fail. no functions fail. what I'm expecting is that with libxml_set_streams_context(), I've correctly sent an HTTP If-Modified-Since Request Header along with the HTTP GET in the DOMDocument::load() call. what I'm seeing is that somehow I haven't, since the the DOMDocument::load() call returns the file (with an HTTP 200 status in the response header) even though I know the file has not been modified since the If-Modified-Since date (confirmed by looking at the Last-Modified date in the response header). the fact that there is no failure, and no error message that I can examine or test is exactly why I'm scratching my head and asking if anyone who does know something about stream contexts can offer some pointers. I don't think I need any help with the XML crap, as you put it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 18, 2005, at 1:20 PM, Richard Lynch wrote: *YOU* have check their return value to see if it's 'false' or -1 or 0 and, if so, *YOU* have to call another function to get the error message and error code. This is what I am suggesting is missing big-time in your code. Yes, you made your point in your first reply -- I'm clueless and don't know the first thing about basic defensive coding. Thanks for going out of your way -- twice -- to be so helpful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 18, 2005, at 4:10 PM, Jared Williams wrote: Sure the server is checking if modified since headers? I'm capturing the response headers from the remote server, so I can see that. Just tried a bit of code here and it seems to be working as expected (5.0.4 Win32) 1) I made an initial mistake by running my PHP script(s) from the command line and not from a server. 2) but now when running my PHP script(s) from a server I see that: file_get_contents() with a conditional get in a stream context works as expected; that is, the remote server returns a 304 not modified HTTP response header only. (if doing this with file_get_contents(), then the libxml_set_streams_context() function call is of course irrelevant). DOMDocument::load() with a conditional get in a stream context set via libxml_set_streams_context() shows odd results; that is, the remote server returns a 304 not modified in the HTTP response header, but also returns the file contents as well (!!??). That's a bit baffling -- a server shouldn't do that, since the 304 response header ends with connection: close, so I don't know how or why the file contents are being captured too. I would think a 304 response header means that the request header was properly interpreted and nothing but a header would be returned. Hard to know if the problem is on my end or on the remote server side. I note also that stream contexts send only as HTTP/1.0, and the remote server is returning HTTP/1.1, and I just don't know if that's a possible factor in this or not. Anyhow, I have a workable solution which is sort of ok -- use file_get_contents() with a conditional get in a stream context to fetch a remote file on an if-modified-since basis, then stuff the string result into a new DOMDocument() object and have at it that way. But of course I'm puzzled as to why libxml_set_streams_context() is doing what it's doing, and it would be nice to know how to get it to work if it can and should work elsewhere for others. Thanks for a helpful reply. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] libxml_set_streams_context
On May 18, 2005, at 7:07 PM, Jared Williams wrote: Heh, yes indeed most baffling... Libxml must be performing some sort of cacheing, I guess. Doesn't appear to be requesting twice (once with the if-modified-since header, and again without atleast) well, thanks for the confirm on that. I thought of a possible double request also (with header, then without) as well; I guess I'll have to break out the packet sniffer and see if that tells me anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] libxml_set_streams_context
I'm trying to use libxml_set_streams_context() to load a remote xml file via HTTP conditional GET with DOMDocument::load() by stuffing an 'If-Modified-Since: --- HTTP header into the stream, but no matter how I try it I always get an HTTP 200 response when I know the last- modified date is well before my if-modified date string. I've confirmed via curl -H on the command line that I can do it properly and get an HTTP 304 as expected, but I don't know what I'm not doing right with libxml_set_streams_context(). Here's my code: $opts = array('http'=array('method'=GET, 'header'=If-Modified- Since: Wed, 18 May 2005 23:55:29 GMT\r\n)); $context = stream_context_create($opts); libxml_set_streams_context($context); $doc-load('http://www.somewhere.com/somefile.xml'); echo $doc-saveXML(); using the same $context resource, this also produces the same result, when I expect it should work. file_get_contents('http://www.somewhere.com/somefile.xml', false, $context); I have php 5.0.4 compiled with libxml2 (2.6.16) on Mac OS X 10.4. I imagine I'm not doing something correctly, but can't figure out what it is. Any help? -- Bill Hoffman [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fedora-Apache2-PHP exec() failure
Hi all, I'm having the same problem as Jim Poserina. Richard pointed out some things to try. Here's my story. We installed Fedora 3 on a new box. Then we installed Apache 2 and PHP 4.3.9 from the RPMs that came on the CDs. Pretty much everything works as expected, except the exec() functions do not work in the web server. There is no error message displayed in the browser or in the error_log of apache. Here's the script: ?php $x = exec(/bin/pwd, $y, $z); echo brx is ; var_dump( $x ); echo bry is ; var_dump( $y ); echo brz is ; var_dump( $z ); ? Here is the output: x is string(0) y is array(0) { } z is int(127) If I run the php interpreter from the command line, exec() does work ok. I can turn safe mode on and define a safe_mode_exec_dir and copy /bin/pwd to it and then run that and the command line interpreter honors that setting ok. The web page result doesn't change though. No error message, no output. Just the 127 (-1?) So, what do I have to change in my setup to get the exec functions to work in the web server? Thanks, Bill Rausch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fedora-Apache2-PHP exec() failure
At 13:22 -0800 3/23/05, Rasmus Lerdorf wrote: Bill Rausch wrote: Hi all, I'm having the same problem as Jim Poserina. Richard pointed out some things to try. Here's my story. We installed Fedora 3 on a new box. Then we installed Apache 2 and PHP 4.3.9 from the RPMs that came on the CDs. Pretty much everything works as expected, except the exec() functions do not work in the web server. There is no error message displayed in the browser or in the error_log of apache. So, what do I have to change in my setup to get the exec functions to work in ... My guess it that it is an selinux issue. That stuff is such a mess in Fedora. Try playing with that. -Rasmus Bingo. I'd told my staff NOT to install the Selinux stuff so I never bothered looking for it because I knew it wasn't there. :( Thank you very much. Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SimpleXML: DOM, SAX or Other?
Phpdiscuss - Php Newsgroups And Mailing Lists wrote: Hi, Does anybody have any depthful knowledge of the SimpleXML extension in PHP5?.. More accurately, do you know if the simpleXml-xpath() method uses DOM, SAX or some other method of parsing a loaded XML document? I ask because I am trying to parse arbitrary XML documents as efficiently as possible (avoiding DOM). Kieran Hi, I've recently done a fair bit of work trying to make sense (for me) of the various PHP 5 XML-related alternatives. The bottom line (for me) is that at the end of the day the DOM functions provide the most access and flexibility, although at the cost of slightly more design complexity. If I have to generate a new XML file, DOM (for me) is the way to go. The XML Parser found its home (for me) processing include files. The output of this process is a single XML file that I can feed into downstream processes. The SimpleXML routines found its home (for me) working with static XML files. I haven't figured out how to add elements to a SimpleXML object, so it tends to be limited to read-only applications. The SimpleXMLIterator found a home (for me) in creating ID's and node genelogical ID's. Oddly, the SimpleXMLIterator skips the root level xml element and I had to use DOM to add it back. I ended up creating wrappers and proxy classes for each of the above. This allowed me to gain some uniformity in my API's so tend to forget about what's happening underneath. I also ended up creating a DomXPathQueryManager class to hide some of the complexity in setting up and executing XPath queries. So, at the end of the day, I might use any or all in some combination, but know that the DOM functions are my backup that can do it all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy (copy)
Curt Zirzow wrote: * Thus wrote Bill McCuistion: Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy Hello all. Hoping for some direction with the above step. Have PHP-5.0.2 and can configure the soap and openssl options, but when I add the tidy option, the operation stops with the following message. -- checking for TIDY support... yes -- configure: error: Cannot find libtidy I have of course gotten the latest tidy source (1.1) from sourceforge, but don't understand what to do with it. The rpm doen't seel to load the libtidy as I was hoping it would. Further to my confusion, the PHP docs speak to using tidy 2.0 with PHP5, but can not locate any other refs to tidy 2.x) I've never have used the rpm for tidy, but in general it should in theory install libtidy in either /usr/lib or /usr/local/lib so you'll need to configure php like: ./configure --with-tidy=/usr or ./configure --with-tidy=/usr/local If that doesn't work, then the rpm may not have installed the libtidy. As for the tidy 2.x reference, that is referencing php's interface to tidy: tidy 1.0: for php4.x tidy 2.0: for php5.x Both tidy's use the same libtidy, it is just that 2.0 includes the new OO interface that PHP5 provides. Curt Curt, Thanks for the reply. The rpm I found only contains tidy src files. I seem to have the chicken and egg problem. How do I make a libtidy that PHP will be satisfied with? I would prefer to use the PHP5 OO interface. Following is the command sequence showing my dilema... [EMAIL PROTECTED] tidy]# pwd /usr/src/tidy [EMAIL PROTECTED] tidy]# rpm -i tidy-20030525-1.src.rpm warning: user hany does not exist - using root warning: group hany does not exist - using root warning: user hany does not exist - using root warning: group hany does not exist - using root warning: user hany does not exist - using root warning: group hany does not exist - using root [EMAIL PROTECTED] tidy]# ls bin package.xml tidy tidy-1.1 tidy-1.1.tar tidy-20030525-1.src.rpm tidy_docs.tar tidy_linux_x86.tar [EMAIL PROTECTED] tidy]# tar -xvf tidy-1.1.tar [EMAIL PROTECTED] tidy]# cd tidy-1.1 [EMAIL PROTECTED] tidy]# phipize [EMAIL PROTECTED] tidy-1.1]# ls acinclude.m4config.guess config.nice CREDITS install-sh Makefile.global php_tidy.h TODO aclocal.m4 config.h.in config.subdoit.libtidy.sh *.loT Makefile.objects README autom4te.cache config.logconfigure examples ltmain.sh missing tests build config.m4 configure.in include Makefile.fragments mkinstalldirs tidy.c [EMAIL PROTECTED] tidy-1.1]# ./configure checking build system type... i686-redhat-linux-gnu checking host system type... i686-redhat-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking whether gcc and cc understand -c and -o together... yes checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking for PHP prefix... /usr/local checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20040412 checking for re2c... exit 0; checking for gawk... gawk checking for TIDY support... yes, shared configure: error: Cannot find libtidy Perhaps I've gotten something in my system (besides myself) horribly confused or am completely on the wrong path. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: simplexml question.
[EMAIL PROTECTED] wrote: Hello, I looking to get the data out of this test.xml file but dont know how to get the data out because of the bo: namespaces. If I remove all bo: from the xml then it works fine... Is anyone can tell me how to do it? ?php $file = test.xml; $xml = simplexml_load_file($file) or die (Unable to load XML file!); echo Name: . $xml-UserAuthRequest-UserLoginName . \n; ? test.xml: ?xml version=1.0 encoding=UTF-8? bo:TXLife xsi:schemaLocation=http://ACORD.org/Standards/Life/2 TXLife2.9.90.XSD xmlns:bo=http://ACORD.org/Standards/Life/2; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; bo:UserAuthRequest bo:UserLoginNameTest login/bo:UserLoginName Thanks, Andras Kende I couldn't get SimpleXML (nor the SimpleXMLIterator) to work with NS-enabled xml. Had to use DOM functions. Sorry if this is bad news. Would be interested if I missed a setting that enabled NS-support for SimpleXML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy (copy)
Q re: php-5.0.2 ./configure --with-soap --with-openssl --with-tidy Hello all. Hoping for some direction with the above step. Have PHP-5.0.2 and can configure the soap and openssl options, but when I add the tidy option, the operation stops with the following message. -- checking for TIDY support... yes -- configure: error: Cannot find libtidy I have of course gotten the latest tidy source (1.1) from sourceforge, but don't understand what to do with it. The rpm doen't seel to load the libtidy as I was hoping it would. Further to my confusion, the PHP docs speak to using tidy 2.0 with PHP5, but can not locate any other refs to tidy 2.x) My system is Fedora Core 2 (and is pretty standard and otherwise up-to-date). I of course would like to get the TidyLib functions enabled within the PHP5 core. The command-line version works just fine, but I don't remember from whence it came. Any help would be most appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP XML
Dan Joseph wrote: how is the xml being sent to you from the other place on the internet? is it being posted in a form, etc.? It won't be thru a form. I guess it'll be a direct send, he'll format something like... request nameJack/name account239048098324/account /request ... in a string and send it over. What methods are best suited for something like that? Would it be best Side One to open a socket up to Side Two and send it thru that way? I'm open to suggestions... -Dan Joseph Look at the SOAP functions. There's a SOAP client SOAP server. The applications use SOAP calls to transfer their XML messages over the Intenet, typically http/https, but could also use smtp for transport. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: https://...
Afan Pasalic wrote: hi, how can I check using php that I use SSL? tried with REQUEST_URI HTTP_HOST PATH_INFO but any of these does show http:// Thanks! -afan from the command line... php -m should list openssl if ./configure --with-openssl option specified. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Compiler?
Sorry if this is an old question: Where can I find information on any plans to create a compiler for PHP, especially v5.x? Barring that, is there a PHP syntax checker that would enforce some of the types of things that a compiler would find? I remember from back in my MS-DOS days the very good Clipper compiler for the dBase III language. dBase III, not unlike PHP, was an interpretive language, and along the way some bright folks figured out how to write a true dBase language compiler, which then allowed for all sorts of nice things to happen. One of the nicest things for me was that the compiler caught all sorts of little things before the same code in the interpreter would find them at run-time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: June 2004
1 contains 1 -- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: May 2004
1 row 1 -- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] concatenating strings
how do I add newline commands in the middle of a text string? I'm sending an email with the function mail($sendto,$subject,$message,$headers) The message is $message = My name is . $myname . My favorite color is . $color; How do I write it so the email message text is on two lines, My name is BILL My favorite color is RED Thanks, Bill Freeburg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] thanks
Thanks. Those solutions work. Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] email address Bill%40domain.com, hello+world
A previous program is passing an email address to my code via method=post. When I print it, it looks like bill%40Domain.com instead of [EMAIL PROTECTED] Also, text comes in as Hello+World instead of Hello World. What's going on? I'm obviously missing something. I can't wait until I'm furthur along the learning curve. Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql went away
HI. I've been using mySQL 4.0.13, php4.3.4, and phpMyAdmin2.5.5 on Mac OS 10.3.3 as a learning/testing/development environment for a couple of months now - no problems, works great. I've created more than a few mySQL databases and tables, but yesterday I created a database, a table, and LOAD DATA from within phpMyAdmin. Successfully. I looked at the data and all was fine. Logged out and went away for a while. Came back and phpMyAdmin would not show me my databases in the left frame, and I could not launch a query window. I could see runtime information, system vars, processes, and even privileges. I tried logging in to mySQL through the terminal Through the command line client I can run simple commands, but no commands to view or affect databases or tables. I can run php scripts from a browser - connect to databases, retrieve and even insert/update data, but I cannot view databases or tables, and though I haven't tried I doubt I'll be able to create, delete, or backup databases or tables. Does anyone have a clue about what the problems may be or where I should start? --- Bill Green [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [php 5] static class variable question
[PHP5 RC1, Windows XP Pro] Hi, I have a few classes called Audio, System, etc. In order to not pollute the namespace (if someone else has a System class, for example), I'd like to separate my classes. One way of doing this would be to preprend each class with some text, to make my classes something like myProject_Audio, myProject_System, myProject_Whatever. I would much rather be able to do something like myProject::Audio, myProject::System. I would like to do this by creating a class called myProject and having Audio and System be static variables, referring to the classes Audio and System. The Audio and System variables in class myProject would act as an alias to the Audio and System classes. I can access myProject::someVar fine when someVar is any variable, but I'm unable to call: $audio = new myProject::Audio; Is there any way to do this? Should I create a static function Audio() in class myProject and forward the variables to the Audio class? If I did that I could call $audio = new myProject::Audio(); or $audio = new myProject::Audio(var1, var2); but then it would be hard to access variables in class Audio (because you can't do myProject::Audio()::someVarInAudio because Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM) Thanks, Best Regards, Bill Zeller -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [php 5] static class variable question
A note: by creating a class called myProject and having Audio and System be static variables, referring to the classes Audio and System. The Audio and System This should be constant, not static. Sorry. -bill Bill Zeller [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [PHP5 RC1, Windows XP Pro] Hi, I have a few classes called Audio, System, etc. In order to not pollute the namespace (if someone else has a System class, for example), I'd like to separate my classes. One way of doing this would be to preprend each class with some text, to make my classes something like myProject_Audio, myProject_System, myProject_Whatever. I would much rather be able to do something like myProject::Audio, myProject::System. I would like to do this by creating a class called myProject and having Audio and System be static variables, referring to the classes Audio and System. The Audio and System variables in class myProject would act as an alias to the Audio and System classes. I can access myProject::someVar fine when someVar is any variable, but I'm unable to call: $audio = new myProject::Audio; Is there any way to do this? Should I create a static function Audio() in class myProject and forward the variables to the Audio class? If I did that I could call $audio = new myProject::Audio(); or $audio = new myProject::Audio(var1, var2); but then it would be hard to access variables in class Audio (because you can't do myProject::Audio()::someVarInAudio because Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM) Thanks, Best Regards, Bill Zeller -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: March 2004
-- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ASP.NET web control in PHP?
Dear All, I've a few months of experience in PHP programming. I'd like to know whether PHP has anything similar to the web control in ASP.NET? I found that ASP.NET is really handy when creating GUI for web applications. The web controls are quite easy to use and I like the DataGrid in ASP.NET a lot. I wonder whether there's any opensource project using PHP to build reusable GUI widgets for HTML pages? Thank you very much for your help. Yours, Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: February 2004
-- Searchable archives for this list are available at http://www.listsearch.com/phplist.lasso -- == PHP Net List Stats February, 2004 == Note: Up/Down % as compared with January, 2004 Posts: 2647 (Down 9%) Authors: 530 (Down 5%) Threads: 735 (Down 3%) Top 20 Contributors by Number of Posts -- Richard Davey 106 Adam Bregenzer 96 Jason Wong 86 John Nichel 75 Paul Furman 56 Chris W. Parker 51 John W. Holmes 51 Marek Kilimajer 43 Raditha Dissanayake 43 John Taylor-Johnston42 Andr Cerqueira 42 Ben Ramsey 37 Stuart 35 Ryan A 35 Scott Fletcher 32 Justin Patrin 29 Jay Blanchard 26 Ford, Mike [LSS] 26 Chris Shiflett 23 memoimyself 22 Top 20 Threads by Number of Posts -- [PHP] [Q]PHP not taking input values from forms 23 [PHP] HELP: Nested include(...)'s take relative paths not intui... 22 [PHP] PHP REDIRECT 19 [PHP] Headers Again 18 [PHP] Detecting Binaries17 [PHP] weird header() (bug may be) 16 [PHP] PHP Header to stimulate a POST method or POST string 16 [PHP] E-Commerce14 [PHP] Delayed mail()... ? 14 [PHP] New lines 13 [PHP] Recommendation on PHP encoder please 13 [PHP] Running Apache in one machine and php in another 13 [PHP] boolean search class 12 [PHP] Split() 12 [PHP] PHP Alternative to IFRAME?12 [PHP] beginner question about while loops 11 [PHP] Are variables persistent? 11 [PHP] Parse error 11 [PHP] session expired - how to know if the session is new or old 11 [PHP] [php] if $sql has returned something 11 Top 20 Search Terms by Number of Requests -- function 6 porno2 list 2 smtp 1 Net 1 password 1 lasso1 fonction 1 how 1 to 1 search 1 filemaker1 PHP 1 -- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP
[PHP] session: permission denied (13)
When I go from a normal php page (mod) to a cgi-based php page (stand alone), the session_start() function generates an error Warning: open(/tmp/sess_be0b03b8eb0ed759b10792d823099678, O_RDWR) failed: Permission denied (13) in (filename) on line 3 Is there a way to carry sessions across the different types of php pages? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: January 2004
-- Searchable archives for this list are available at http://www.listsearch.com/phplist.lasso -- == PHP Net List Stats January, 2004 == Note: Up/Down % as compared with December, 2003 Posts: 2900 (Up 26%) Authors: 555 (Up 8%) Threads: 759 (Up 17%) Top 20 Contributors by Number of Posts -- Richard Davey 80 John Nichel 75 John W. Holmes 73 Jason Wong 68 Chris Shiflett 66 Ryan A 61 Freedomware 60 Jay Blanchard 51 Ben Ramsey 50 Stuart 49 Raditha Dissanayake 41 Matt Matijevich 39 daniel 38 memoimyself 37 Marek Kilimajer 37 DvDmanDT35 CPT John W. Holmes 30 Radwan Aladdin 30 Tom Rogers 29 Justin Patrin 29 Top 20 Threads by Number of Posts -- [PHP] Odd Code Error. 43 [PHP] what PHP really needs 30 [PHP] URL rewriting...anybody done this?26 [PHP] Still error messages!!21 [PHP] Returning Newbie (Disoriented)20 [PHP] Session time-out value20 [PHP] picturing webpage 16 [PHP] jpeg Uploader issue 16 [PHP] Generating an Excel file? 16 [PHP] Why we love Microsoft (0t)16 [PHP] amp 16 [PHP] Flash-PHP Socket Connection 15 [PHP] Googlebot 14 [PHP] Form validation: client- or server-side? 13 [PHP] Syntax Error - This is WEIRD!13 [PHP] Sessions not working. 13 [PHP] How do you guys do this? 13 [PHP] Counting back 90 days... 12 [PHP] Sorting data into columns vertically 12 [PHP] Image Header Issues 12 Top 20 Search Terms by Number of Requests -- include 2 schedule 2 lasso1 session 1 -- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Register Globals is_upload_file
I'm converting old code to work with Register globals turned off in php.ini. With it on, is_upload_file($filename) works fine but when turned off doesn't work at all. What am I missing.. Help me please !! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] drop down list of years puzzles me
This works to create a drop down select box of numbers 1-12: for($i=1; $i 13; $i++) { echo option value={$i}.$i./option\n; } This doesn't to create a drop down box of years: $curr_year = intval(date('Y')); $range = 10; for ($y=$curr_year; $y $range; $y++) { echo option value={$y}.$y./option\n; } When I check for errors: $curr_year = 2004 $curr_year is an integer $range = 10 $curr_year + $range = 2014 $y = 2004 But my select box is empty... as in: select name='yada' /select What is it that I don't understand? -- Bill -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] tutor found
Thanks for the great responses. I've found some help, and they're even in my area. Bill Freeburg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Stats] PHP Net List: December 2003
-- Searchable archives for this list are available at http://www.listsearch.com/phplist.lasso -- == PHP Net List Stats December, 2003 == Note: Up/Down % as compared with November, 2003 Posts: 2149 (Down 33%) Authors: 508 (Down 9%) Threads: 628 (Down 17%) Top 20 Contributors by Number of Posts -- Jay Blanchard 68 Justin Patrin 59 Chris Shiflett 43 David T-G 43 Richard Davey 41 Chris W. Parker 37 Manuel Lemos37 Marek Kilimajer 37 John W. Holmes 36 Jason Wong 35 Jas 32 Ryan A 31 Chris 28 Raditha Dissanayake 26 Matt Matijevich 25 Robert Cummings 23 Justin French 22 Mike20 Sven20 Gerard Samuel 19 Top 20 Threads by Number of Posts -- [PHP] post an array into another site 27 [PHP] PHP IDE? 26 [PHP] What do you say to someone who says...24 [PHP] how to determine if shopping cart has been abandoned? 22 [PHP] register_globals problem 17 [PHP] problem with INSERT query 17 [PHP] progress in php 17 [PHP] How New Is HERE? 17 [PHP] goto label15 [PHP] Can't upload file greater than 11kb 15 [PHP] file uploads 14 [PHP] Write on image in faint color 14 [PHP] related products, how to's best practices 13 [PHP] [Newbie Guide] For the benefit of new members 12 [PHP] header(Location: page.php) not redirecting 11 [PHP] validating email address 11 [PHP] (0/T) executeing script below public 11 [PHP] Sorting arrays11 [PHP] HTTP headers, IE and downloading 11 [PHP] replace %rand[x]-[y]% macro in string with random string 10 Top 20 Search Terms by Number of Requests -- upgrade 13 problem 11 japanese 2 Server 2 session_destroy 2 setcookie1 cart 1 date 1 calander 1 hassle 1 calendar 1 -- - Bill Doerrfeld[EMAIL PROTECTED] Blue World Communications, Inc. http://www.blueworld.com/ - Build and serve powerful data-driven Web sites with Lasso Studio and Lasso Professional. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail question (mime)
Thanks for your replies. Figured it out, just blind. The $headers were written correctly (except for \r\n at end of lines though \n seems to work in this case). The problem was in the call to the boundary, the boundary has to start with -- outside the quoted string definition of the boundary, and end same with -- at the end of the message. -- Bill -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail question (mime)
Greetings all. In an effort to understand more about mime mail with php, I'm writing a little function to send a multipart/alternative encoded mime mail from a browser interface. I know you guys have answered these types of questions many times, but I've googled and research til I'm blue. I'm still somewhat new to php so I apologize. I'm on a shared hosting environment running Apache 1.3.29 (Unix), magic_quotes_gpc = on, path to sendmail = /usr/sbin/sendmail -t -i, smtp is localhost on port 25 (and I don't know much about Unix permissions). My client platform is Mac, my email client is Outlook Express (might as well be testing to the lowest common denominator). I've found lots of php classes on mime mail but have not tried them because I want to understand the code. I can use this code to send plain text email or html email just fine, but not multipart/alternative or mixed. Here's the relevant code. Can someone point out the error of my ways? browser interface: 5 fields (3 input of type=text, 2 input of type=textarea) names: $from $to $subject $text_msg $html_msg On submit, I trim all and stripslashes on the textarea inputs (interesting that magic quotes seems to add slashes to textarea inputs automatically), then set my email headers: $headers =From: {$from}\n; $headers .=Reply-To: {$from}\n; $headers .=Return-Path: {$from}\n; $headers .=Subject: {$subject}\n; $headers .=X-Sender: {$from}\n; $headers .=X-Mailer: PHP\n; $headers .=X-MSMail-Priority: High\n; $headers .=MIME-Version: 1.0\n; $headers .=Content-Type: multipart/alternative; boundary=\--i0o9u8h7g65v\; $message =--i0o9u8h7g65v\n; $message .=Content-Type: text/plain; charset=iso-8859-1\n; $message .=Content-Transfer-Encoding: 7bit\n; $message .=Content-Disposition: inline\n; $message .=$text_msg.\n;//plain text message here $message .=--i0o9u8h7g65v\n; $message .=Content-Type: text/html; charset=iso-8859-1\n; $message .=Content-Transfer-Encoding: 7bit\n; $message .=Content-Disposition: inline\n; $message .=$html_msg.\n;//html message here $message .=--i0o9u8h7g65v; mail($to,$subject,$message,$headers); The email is sent successfully, but with no message in the message body. Looking at the message source I see that all of the headers are set and I see the boundaries and I see both versions of the messages as one would expect. It all looks correct, even as compared to other mime encoded email I receive and read just fine. I've tried many variations on these variables. FYI, if I change the $header = Content-Type: multipart/alternative; ; to $message = Content-Type: ...; then I see the raw code in the message body, but of course that does no good. Same results when message is viewed in a browser based hotmail or yahoo account. I simply do not understand what I don't understand, so I don't know how to ask my question. Is this a coding problem, sendmail, permissions, a server issue??? Thanks for your help. -- Bill -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail question (mime)
Greetings all. (hope this isn't a second post, first try seemed to fail) In an effort to understand more about mime mail, I'm writing a little function to send a multipart/alternative encoded mime mail from a browser interface. I know you guys have answered these types of questions many times, but I've googled and research til I'm blue. I'm still somewhat new to php so I apologize. I'm on a shared hosting environment running Apache 1.3.29 (Unix), magic_quotes_gpc = on, path to sendmail = /usr/sbin/sendmail -t -i, smtp is localhost on port 25 (and I don't know much about Unix permissions). My client platform is Mac, my email client is Outlook Express (might as well be testing to the lowest common denominator). I've found lots of php classes on mime mail but have not tried them because I want to understand the code. I can use this code to send plain text email or html email just fine, but not multipart/alternative or mixed. Here's the relevant code. Can someone point out the error of my ways? browser interface: 5 fields (3 input of type=text, 2 input of type=textarea) names: $from $to $subject $text_msg $html_msg On submit, I trim all and stripslashes on the textarea inputs (interesting that magic quotes seems to add slashes to textarea inputs automatically), then set my email headers: $headers =From: {$from}\n; $headers .=Reply-To: {$from}\n; $headers .=Return-Path: {$from}\n; $headers .=Subject: {$subject}\n; $headers .=X-Sender: {$from}\n; $headers .=X-Mailer: PHP\n; $headers .=X-MSMail-Priority: High\n; $headers .=MIME-Version: 1.0\n; $headers .=Content-Type: multipart/alternative; boundary=\--i0o9u8h7g65v\; $message =--i0o9u8h7g65v\n; $message .=Content-Type: text/plain; charset=iso-8859-1\n; $message .=Content-Transfer-Encoding: 7bit\n; $message .=Content-Disposition: inline\n; $message .=$text_msg.\n;//plain text message here $message .=--i0o9u8h7g65v\n; $message .=Content-Type: text/html; charset=iso-8859-1\n; $message .=Content-Transfer-Encoding: 7bit\n; $message .=Content-Disposition: inline\n; $message .=$html_msg.\n;//html message here $message .=--i0o9u8h7g65v; mail($to,$subject,$message,$headers); The email is sent successfully, but with no message in the message body. Looking at the message source I see that all of the headers are set and I see the boundaries and I see both versions of the messages as one would expect. It all looks correct, even as compared to other mime encoded email I receive and read just fine. I've tried many variations on these variables. FYI, if I change the $header = Content-Type: multipart/alternative; ; to $message = Content-Type: ...; then I see the raw code in the message body, but of course that does no good. Same results when message is viewed in a browser based hotmail or yahoo account. I simply do not understand what I don't understand, so I don't know how to ask my question. Is this a coding problem, sendmail, permissions, a server issue??? Thanks for your help. -- Bill -- -- Bill -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] configure hangs on SunOS 5.8
Hello, I'm trying to configure php 4.3.4 on SunOS 5.8, but configure hangs just after checking host system type: bash-2.03# ./configure loading cache ./config.cache checking for Cygwin environment... no checking for mingw32 environment... no checking for working sed... sed checking host system type... sparc-sun-solaris2.8 Any ideas? Regards, Bill Shupp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php