Re: [PHP] Disclaimer
On Wed, 2009-06-17 at 21:44 -0400, Daniel Brown wrote: On Wed, Jun 17, 2009 at 20:15, Stuartstut...@gmail.com wrote: 2009/6/18 Ashley Sheridan a...@ashleysheridan.co.uk: On Thu, 2009-06-18 at 01:06 +0100, Stuart wrote: 2009/6/17 Daniel Brown danbr...@php.net: On Wed, Jun 17, 2009 at 10:37, Jay Blanchardjblanch...@pocket.com wrote: Whoa! Totally unintentional dude! DON'T PANIC! Mr Mannering! [snip!] Error, undefine literal Mannering, assumed Mainwaring ... [snip!] Quite right too. Did I mention it's late? You crazy Brits and your local entertainment. I keep having to Google these references just to keep up! In fact, had Ash not chimed in, I may not have even thought to check for a pop culture reference there, instead just thinking that Stut went off his meds again this week. ;-P Hehe, it's not too popular these days, that shows is about half a century old! Thanks Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sloppiness stupidity
On Wed, 17 Jun 2009 22:51:55 +0100, Ashley Sheridan wrote: I read somewhere that the XHTML standards say that for all attributes that would normally be standalone in HTML, they should be given a value that is the same as the attribute name, so you would use multiple=multiple, selected=selected, checked=checked, etc. As far as I know, using this in regular HTML won't cause it to choke either, as the parsers tend to only look at the existence of the attributes, not the values they may or may not have. That's probably true, though. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sloppiness stupidity
On Wed, 17 Jun 2009 18:59:36 -0400, tedd wrote: As I understand it and is my experience, that is true -- a stand-alone HTML attribute should be equal to itself, such as selected=selected, or In HTML (as opposed to XHTML), there are a bunch of shortcut features[1] that allow you to write option selected=selected or option selected with exactly the same meaning. more specifically selected=SELECTED. However, I have no idea what this is supposed to mean. The selected attribute is case insensitive in HTML, so there is no difference between the two. it will still work but will throw a validation error/warning in some DOCTYPEs, such as XHTLM. I don't know of any other DOCTYPE that might throw such as error. XHTML is different. It doen't have nearly as many shortcuts as HTML, and tends to be more sensitive about case. I don't know (and don't care) about the exact details. [1]: They have technical names that I can't remember. Look them up in the SGML standard. /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] populate form input option dropdown box from existing data
On 17 June 2009 15:01, PJ advised: It does, indeed. This confirms my inexperienced conclusion that in_array() does not work on associative arrays per se; it works on simple arrays and I just don't have the experience to think of extracting only the id fields. Let's squash this misconception again -- PHP only has associative arrays, it's just that in most contexts it treats numeric keys specially. So, internally, array('fred', 'bill', 'joe') is stored using exactly the same techniques as array('one'='fred', 'two'='bill', 'three'='joe'), but because the first one has numeric keys there are some things you can do with it that you can't with the second. But functions such as in_array, where all that really matters is the array's values, really couldn't care whether the keys are numeric, string, or a mixture. Also, the other problem was the option selected definition required Shawn's clarification select name='component-select' multiple ... which now highlights the selected fields. In all my searches (horrendously wasted time) I did not find any mention of component-select either in php.net or w3c.org I totally don't understand this comment: 'component-select' is just the name that Shawn chose to give his select field -- he could just as well have named it 'arnold-frog' without it making a blind bit of difference (so long as every other reference to it was changed to match!). Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: sloppiness stupidity
On 17 June 2009 22:05, Nisse Engström advised: On Wed, 17 Jun 2009 10:18:09 +0100, Ford, Mike wrote: This is very true -- but XHTML requires *all* attributes to have a value, so an XHTML conformant page will use select multiple=multiple name=selector (or something similar such as select multiple=yes name=selector). The only inconsistency here is that different people have chosen to validate against different standards. The multiple attribute only has one value: multiple, so it has to be select multiple=multiple. I don't think yes cuts the mustard. In HTML, you can shorten it to select multiple. Well, on checking I'm surprised to find that you are right and I am wrong, and I will have to mend my ways. I don't know how I came to believe that the attribute value didn't matter, but there you go. An excellent example of what I referred to before as confidence in one's own misunderstanding! Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] populate form input option dropdown box from existing data
On 17 June 2009 14:30, PJ advised: For the moment, I am trying to resolve the problem of extracting a value from a string returned by a query. I thought that in_array() would do it, but the tests I have run on it are 100% negative. The only thing I have not used in the tests is third parameter bool $strict which only affects case-sensitivity if the $needle is a string. $strict has nothing whatsoever at all in any way to do with case sensitivity -- $strict controls whether the values are compared using equality (==) or identity (===) tests. As is stated quite clearly on the manual page, in_array() is always case-sensitive. This leads me to believe that in_array() is either inappropriately defined in the manual and not effective on associative arrays Complete rubbish -- the in_array() manual page is excellent and totally accurate, complete with 3 working examples. Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multi-Sort -- how to do this?
On 17 June 2009 22:12, tedd advised: Hi gang: Here's the problem. Let's say you have a collection of arrays, such as: $a = array(); $b = array(); $c = array(); $d = array(); And then you populate the arrays like so: while(...) { $a[] = ... $b[] = ... $c[] = ... $d[] = ... } Now, let's say you want to sort the $d array, but you also want the arrays $a, $b, and $c to be arranged in the same resultant order as $d. For example, please follow this: Before sort of $d: $a = [apple, banana, grape, orange] $b = [100, 2111, 198, 150] $c = [red, yellow, purple, orange] $d = [100, 300, 11, 50] After sort of $d: $a = [grape, orange, apple, banana] $b = [198, 150, 100, 2111] $c = [purple, orange, red, yellow] $d = [11, 50, 100, 300] array_multisort($d, $a, $b, $c) should do what you want, Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: sloppiness stupidity
On 17 June 2009 23:56, PJ advised: Nisse Engström wrote: On Wed, 17 Jun 2009 10:18:09 +0100, Ford, Mike wrote: This is very true -- but XHTML requires *all* attributes to have a value, so an XHTML conformant page will use select multiple=multiple name=selector (or something similar such as select multiple=yes name=selector). The only inconsistency here is that different people have chosen to validate against different standards. The multiple attribute only has one value: multiple, so it has to be select multiple=multiple. I don't think yes cuts the mustard. In HTML, you can shorten it to select multiple. From my limited experience, and vast reading of those glorious 20,000 entries on the Internet, multiple does not take a parameter. I had my fingers slapped once when I validated or something - multiple is just plain multiple ! :-P ;-) :-) Oh, good grief! Did you even read what you've quoted from me above? If you code to an HTML standard, then multiple can indeed be just plain multiple, but HTML 4 does allow the addition of =multiple for compatibility reasons. But if you code to an XHTML standard, multiple must be multiple=multiple, as XHTML **requires** that all attributes have an argument, and (as I've just learned!) multiple is the only valid argument for the multiple attribute. No modern browser that I know of will object to the multiple=multiple usage. Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
PJ wrote: I'm including the relevant code: // select categories for book to be updated $sql = SELECT id, category FROM categories, book_categories WHERE book_categories.bookID = '$bid' book_categories.categories_id = categories.id; if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } else $selected = Array( 0 = '0'); echo $selected; print_r($selected); $sql = SELECT * FROM categories; echo select name='categoriesIN[]' multiple size='8'; if ( ( $results = mysql_query($sql, $db) ) !== false ) { while ( $row = mysql_fetch_assoc($results) ) { if (in_array($row['id'], $selected)) { echo option value=, $row['id'], selected='selected' , $row['category'], /optionbr /; } else echo option value=, $row['id'], , $row['category'], /optionbr /; } } Problem #1)in the first query result. I can't figure out how to deal with it. The code works fine if there are categories assigned to the book. If not, an undefined variable error is spewed out for selected. That's because the test you use for the success of the query: ( ( $results = mysql_query($sql, $db) ) !== false ) is true if and only if the query succeeds, whether or not you get any rows returned. You then start looping over the fetched rows, and if there are none $selected never gets anything assigned to it, and so never gets defined. Since you don't rely on $selected being actually populated (in_array works fine on an empty array...), you might be better off pre-setting $selected before you start the first query: $selected = Array(); $sql = SELECT id, category FROM categories, book_categories WHERE book_categories.bookID = '$bid' book_categories.categories_id = categories.id; if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } Problem #2) in the second query, the selected is in the source code but it is not highlited. Several times I did get the categories highlighted, but I could never catch what it was that made it work. When I had the $id problem, i was trying this code from Yuri (but I don't understand where he got the $id from ) : The HTML you generate in the selected case is not quite right - you should have quotes around the value attribute's value, and you missed a closing '' off the option tag... while ( $row = mysql_fetch_assoc($results) ) { if (in_array($row['id'], $selected)) { echo option value=', $row['id'], ' selected='selected' , $row['category'], /optionbr /; } else { echo option value=, $row['id'], , $row['category'], /optionbr /; } } More succinctly: while ( $row = mysql_fetch_assoc($results) ) { $sel = in_array($row['id'], $selected) ? selected='selected':; echo option value='{$row['id']}' $sel{$row['category']}/optionbr /; } Unless the code is seriously performance critical, I still think variable interpolation is nicer to read than all those quotes and commas, and it keeps the HTML structure together better... Good luck -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object of class could not be converted to string
Dear all, We are experiencing this error: Object of class xxxClass could not be converted to string I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
Ford, Mike wrote: On 17 June 2009 22:12, tedd advised: Hi gang: Here's the problem. Let's say you have a collection of arrays, such as: $a = array(); $b = array(); $c = array(); $d = array(); And then you populate the arrays like so: while(...) { $a[] = ... $b[] = ... $c[] = ... $d[] = ... } Now, let's say you want to sort the $d array, but you also want the arrays $a, $b, and $c to be arranged in the same resultant order as $d. For example, please follow this: Before sort of $d: $a = [apple, banana, grape, orange] $b = [100, 2111, 198, 150] $c = [red, yellow, purple, orange] $d = [100, 300, 11, 50] After sort of $d: $a = [grape, orange, apple, banana] $b = [198, 150, 100, 2111] $c = [purple, orange, red, yellow] $d = [11, 50, 100, 300] array_multisort($d, $a, $b, $c) should do what you want That's even slicker than tedd_sort(). Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Object of class could not be converted to string
But what you trying to pass to the variable? I already see this error, but I see when I write $$ in the variable, you can see if you have some $$ in variables or try casting type with the function settype(); ex: settype($foo, array); settype($foo, integer); settype($foo, string); Or maybe in your class you did not declare the variable ex: private $var1 = NULL; private $var2 = NULL; From: ang...@elemental.co.za To: php-general@lists.php.net Date: Thu, 18 Jun 2009 13:20:59 +0200 Subject: [PHP] Object of class could not be converted to string Dear all, We are experiencing this error: Object of class xxxClass could not be converted to string I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. É grátis! http://specials.br.msn.com/ilovemessenger/pacotes.aspx
RE: [PHP] Object of class could not be converted to string
But what you trying to pass to the variable? I already see this error, but I see when I write $$ in the variable, you can see if you have some $$ in variables or try casting type with the function settype(); ex: settype($foo, array); settype($foo, integer); settype($foo, string); Or maybe in your class you did not declare the variable ex: private $var1 = NULL; private $var2 = NULL; Yuri Yarlei From: ang...@elemental.co.za To: php-general@lists.php.net Date: Thu, 18 Jun 2009 13:20:59 +0200 Subject: [PHP] Object of class could not be converted to string Dear all, We are experiencing this error: Object of class xxxClass could not be converted to string I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Conheça os novos produtos Windows Live! Clique aqui. http://www.windowslive.com.br
Re: [PHP] how to extract fields from associative array into different variables
On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote: Ashley Sheridan wrote: On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: Then I have to add some loopy thing to assign the values to the $variables... a real pita since my variable do not lend themselves too well to linear alterations ($varIn, $var2IN, $var3IN... etc... so $i=0 and $i++ arren't going to be too cooperative here... I guess I'd have to change that to $var1IN... and then figure out how to do $var.$i.IN ... I already tried, but don't seem to have it right Why do you need them in separate variables? Can't you use them using array syntax elsewhere in your code? Basically, I don't know how else to handle inserting and updating random ... What he's talking about is doing this: if ($res = mysql_query ($sql, $db)) { /* I personally prefer res for resource, not results */ while ($r = mysql_fetch_assoc ($res)) { $rows[] = $r; } } And then you access the individual rows/columns as $rows[0]['first_name'] $rows[0]['last_name'] $rows[1]['first_name'] $rows[1]['last_name'] and so on, in some kind of loop probably. (I thought this had been spelled out already, but I was unable to find it so perhaps not.) /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multi-Sort -- how to do this?
From: Ashley Sheridan On Wed, 2009-06-17 at 19:27 -0400, tedd wrote: At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote: I'd probably go with some sort of custom bubble sorting function. Base the sorting on your $d array, and then update the other arrays as necessary. Should be OK if they all have the same index, like in your example. If you were using keys, could you maybe join all the arrays using some sort of serialisation, sort, then unserialise into the separate arrays? Ash: You missed the point. I could use the built-in sort (i.e., sort() ) and sort the $d array. However, I would like the indexes of the other arrays to match the new sort. I think I might need a for-instance here, as you lost me! He is emulating a four column table using four arrays. He wants to sort the table on one of the columns. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multi-Sort -- how to do this?
From: Ashley Sheridan On Wed, 2009-06-17 at 19:27 -0400, tedd wrote: At 10:54 PM +0100 6/17/09, Ashley Sheridan wrote: I'd probably go with some sort of custom bubble sorting function. Base the sorting on your $d array, and then update the other arrays as necessary. Should be OK if they all have the same index, like in your example. If you were using keys, could you maybe join all the arrays using some sort of serialisation, sort, then unserialise into the separate arrays? Ash: You missed the point. I could use the built-in sort (i.e., sort() ) and sort the $d array. However, I would like the indexes of the other arrays to match the new sort. I think I might need a for-instance here, as you lost me! He is emulating a four column table using four arrays. He wants to sort the whole table on one of the columns. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
Stuart wrote: 2009/6/18 PJ af.gour...@videotron.ca: I snipped to make it short... continue at bottom... Step back from the code and consider the steps you need to perform... 1) Get an array of the categories, ideally in the form $cats[catid] = categoryname. 2) Get an array of the category IDs that should be selected, i.e. $selectedcats = array(3, 5, 7, 9). 3) Start the HTML select element 4) foreach ($cats as $id = $catname) 5) Determine whether it should be selected. e.g. $selected = (in_array($id, $selectedcats) ? 'selected=selected' : ''. 6) Output the HTML option element, like option value=$id $selected$catname/option, escaping where appropriate. 7) End of loop, job done. If your code doesn't have that structure then you may want to consider starting again. I'm quite sure the structure is correct. Secondly, check that you're not using the same variable name twice. I did find that in an instance of $id being repeated so I changed it to $bid. In one of your previous emails you used $selected to hold the array of selected categories, and in another you used it for the text to be inserted into the option element. The latter will blat over the former leading to no more than 1 option selected, and even then only if it's the first option displayed. The $selected were not mine... as I was using $ccc ; only started using $selected a couple of hours ago. If you're still stuck please post more of your code in a single chunk including all the elements in my step-by-step above. The snippets you're currently posting are not giving us enough context to spot even the most common mistakes. I'm including the relevant code: // select categories for book to be updated $sql = SELECT id, category FROM categories, book_categories WHERE book_categories.bookID = '$bid' book_categories.categories_id = categories.id; if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } else $selected = Array( 0 = '0'); echo $selected; print_r($selected); $sql = SELECT * FROM categories; echo select name='categoriesIN[]' multiple size='8'; if ( ( $results = mysql_query($sql, $db) ) !== false ) { while ( $row = mysql_fetch_assoc($results) ) { if (in_array($row['id'], $selected)) { echo option value=, $row['id'], selected='selected' , $row['category'], /optionbr /; } else echo option value=, $row['id'], , $row['category'], /optionbr /; } } Problem #1)in the first query result. I can't figure out how to deal with it. The code works fine if there are categories assigned to the book. If not, an undefined variable error is spewed out for selected. It's best practice to initialise all variables before using them. The code you have will not create the $selected variable if there are no results... (code repeated for clarity) if ( ( $results = mysql_query($sql, $db) ) ) { If there are no results this will still work so will drop through to... while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } But since there are no results the first call to mysql_fetch_assoc will return false so the line in the middle will never get executed. } else $selected = Array( 0 = '0'); Drop this else line and instead put $selected = array(); before the mysql_query line. Not sure why you want an element 0 = '0' in there, I'm guessing it's one of your attempts to get rid of the notice. Problem #2) in the second query, the selected is in the source code but it is not highlited. Several times I did get the categories highlighted, but I could never catch what it was that made it work. Can you post the HTML you're getting for this select using the above code. If the selected attributes are in the code correctly then there must be a syntax error in there somewhere and the easiest way to find it will be by looking at the HTML. Stuart, you are one clear-headed dude. This is such a nice and clear explanation - it's what we need for dummies llike me. I had tried to declcare the variable, but didn't understand that it needed to be declared as an array; I had put $selected = ; and obviously it din't work. As for the seconf problem, today it works. without any changes. I think the Quirk Daemon struck my browser. Actuall, I have been sabotaged by the cache when, in not thinking and not taking my ridalin, I would confuse refresh with go to previous page. I guess I can get some sleep now. THANKS TO ALL in clearing my brain toward the path of PHP enlightenment. :-) -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com
Re: [PHP] populate form input option dropdown box from existing data
Ford, Mike wrote: On 17 June 2009 15:01, PJ advised: It does, indeed. This confirms my inexperienced conclusion that in_array() does not work on associative arrays per se; it works on simple arrays and I just don't have the experience to think of extracting only the id fields. Let's squash this misconception again -- PHP only has associative arrays, it's just that in most contexts it treats numeric keys specially. So, internally, array('fred', 'bill', 'joe') is stored using exactly the same techniques as array('one'='fred', 'two'='bill', 'three'='joe'), but because the first one has numeric keys there are some things you can do with it that you can't with the second. But functions such as in_array, where all that really matters is the array's values, really couldn't care whether the keys are numeric, string, or a mixture. Thanks for the explanation. Also, the other problem was the option selected definition required Shawn's clarification select name='component-select' multiple ... which now highlights the selected fields. In all my searches (horrendously wasted time) I did not find any mention of component-select either in php.net or w3c.org I totally don't understand this comment: 'component-select' is just the name that Shawn chose to give his select field -- he could just as well have named it 'arnold-frog' without it making a blind bit of difference (so long as every other reference to it was changed to match!). The way it was put, I understood that that was the definitive attribute for the field. This confused me even more! Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object of class could not be converted to string
PHP tries to convert the class to string, but he can't because in your class is missing the __toString magic method. try to add this one and the error must be gone. On Thu, Jun 18, 2009 at 9:06 AM, Yuri Yarlei gargari...@hotmail.com wrote: But what you trying to pass to the variable? I already see this error, but I see when I write $$ in the variable, you can see if you have some $$ in variables or try casting type with the function settype(); ex: settype($foo, array); settype($foo, integer); settype($foo, string); Or maybe in your class you did not declare the variable ex: private $var1 = NULL; private $var2 = NULL; Yuri Yarlei From: ang...@elemental.co.za To: php-general@lists.php.net Date: Thu, 18 Jun 2009 13:20:59 +0200 Subject: [PHP] Object of class could not be converted to string Dear all, We are experiencing this error: Object of class xxxClass could not be converted to string I have searched google a lot mostly the results are for Drupal or badly coded sites. I have further found out that the issue is with PHP 5.2 version. There isn't a problem with the script as it works on other servers with prior versions, so I am wondering if any one has any tips or ways to go about this error. Unfortunately we are in a position whereby we cant downgrade PHP as it's a shared hosted server. Any help will be appreciated. Thanks, Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Conheça os novos produtos Windows Live! Clique aqui. http://www.windowslive.com.br -- Martin Scotta
Re: [PHP] Multi-Sort -- how to do this?
On Thu, Jun 18, 2009 at 05:11, Ford, Mikem.f...@leedsmet.ac.uk wrote: array_multisort($d, $a, $b, $c) should do what you want, That'll actually hit it right on the head, too, Mike. My example from last night sorted and combined the arrays to be keyed and sortable by $d --- which, re-reading this morning, is not what Tedd wanted. He wants to be able to run a loop and echo out each individual array in place. In which case, array_multisort() is proper. Show-off. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sloppiness stupidity
Ford, Mike wrote: On 17 June 2009 23:56, PJ advised: Nisse Engstr�m wrote: On Wed, 17 Jun 2009 10:18:09 +0100, Ford, Mike wrote: This is very true -- but XHTML requires *all* attributes to have a value, so an XHTML conformant page will use select multiple=multiple name=selector (or something similar such as select multiple=yes name=selector). The only inconsistency here is that different people have chosen to validate against different standards. The multiple attribute only has one value: multiple, so it has to be select multiple=multiple. I don't think yes cuts the mustard. In HTML, you can shorten it to select multiple. From my limited experience, and vast reading of those glorious 20,000 entries on the Internet, multiple does not take a parameter. I had my fingers slapped once when I validated or something - multiple is just plain multiple ! :-P ;-) :-) Oh, good grief! Did you even read what you've quoted from me above? If you code to an HTML standard, then multiple can indeed be just plain multiple, but HTML 4 does allow the addition of =multiple for compatibility reasons. But if you code to an XHTML standard, multiple must be multiple=multiple, as XHTML **requires** that all attributes have an argument, and (as I've just learned!) multiple is the only valid argument for the multiple attribute. No modern browser that I know of will object to the multiple=multiple usage. Ouch, my hand is beginning to hurt. :-( -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
It is a sintax error if (in_array($ex, $selected) --- missing ) echo br /yes; else echo br /no; On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca wrote: Ford, Mike wrote: On 17 June 2009 14:30, PJ advised: For the moment, I am trying to resolve the problem of extracting a value from a string returned by a query. I thought that in_array() would do it, but the tests I have run on it are 100% negative. The only thing I have not used in the tests is third parameter bool $strict which only affects case-sensitivity if the $needle is a string. $strict has nothing whatsoever at all in any way to do with case sensitivity -- $strict controls whether the values are compared using equality (==) or identity (===) tests. As is stated quite clearly on the manual page, in_array() is always case-sensitive. This leads me to believe that in_array() is either inappropriately defined in the manual and not effective on associative arrays Complete rubbish -- the in_array() manual page is excellent and totally accurate, complete with 3 working examples. I would really like to understand why my attempts to reproduce the first example just did not work. Note also that the examples do not show in_array($string, $array) My array was Array ([0]=6[1]=14), so when I tried if (in_array($string, $array) , echo $string did not return 14 as I had expected; neither did if(in_array(14, $array) ... nor if(in_array(14, $array). It still does not... actually, the screen goes blank. So, what am I doing wrong? Here's what is not working... I'm trying to reproduce the example from php.net: $selected = array(); if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } print_r($selected); $ex = 14; if (in_array($ex, $selected) echo br /yes; else echo br /no; Regardless if I put 14 into $ex or 14 or '14' or even if I put the 14 instead of the $ex into the if line, I get a blank screen. It seems tp me, from what I see in the manual that this should work... or am I supposed to know something that is not clear in the examples... ? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta
Re: [PHP] how to extract fields from associative array into different variables
Nisse Engström wrote: On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote: Ashley Sheridan wrote: On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: Then I have to add some loopy thing to assign the values to the $variables... a real pita since my variable do not lend themselves too well to linear alterations ($varIn, $var2IN, $var3IN... etc... so $i=0 and $i++ arren't going to be too cooperative here... I guess I'd have to change that to $var1IN... and then figure out how to do $var.$i.IN ... I already tried, but don't seem to have it right Why do you need them in separate variables? Can't you use them using array syntax elsewhere in your code? Basically, I don't know how else to handle inserting and updating random ... What he's talking about is doing this: if ($res = mysql_query ($sql, $db)) { /* I personally prefer res for resource, not results */ while ($r = mysql_fetch_assoc ($res)) { $rows[] = $r; } } And then you access the individual rows/columns as $rows[0]['first_name'] $rows[0]['last_name'] $rows[1]['first_name'] $rows[1]['last_name'] and so on, in some kind of loop probably. (I thought this had been spelled out already, but I was unable to find it so perhaps not.) /Nisse Right. I finally got it. PJ -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to extract fields from associative array into different variables
Total nitpick, but foreach is a control structure, not a function :P On Thu, Jun 18, 2009 at 8:40 AM, Yuri Yarleigargari...@hotmail.com wrote: You can try use the foreach function. ex: if ($res = mysql_query ($sql, $db)) { /* I personally prefer res for resource, not results */ while ($r = mysql_fetch_assoc ($res)) { $rows[] = $r; } } foreach ($rows as $row){ echo $row['first_name']; echo br; } the foreach function transform the array $rows[] (the fisrt level of associative array) in a variable $row. Yuri Yarlei. Programmer PHP, CSS, Java, PostregreSQL; Today PHP, tomorrow Java, after the world. Kyou wa PHP, ashita wa Java, sono ato sekai desu. To: php-general@lists.php.net From: news.nospam.0ixbt...@luden.se Date: Thu, 18 Jun 2009 14:17:59 +0200 Subject: Re: [PHP] how to extract fields from associative array into different variables On Tue, 16 Jun 2009 08:50:45 -0400, PJ wrote: Ashley Sheridan wrote: On Mon, 2009-06-15 at 17:38 -0400, PJ wrote: Then I have to add some loopy thing to assign the values to the $variables... a real pita since my variable do not lend themselves too well to linear alterations ($varIn, $var2IN, $var3IN... etc... so $i=0 and $i++ arren't going to be too cooperative here... I guess I'd have to change that to $var1IN... and then figure out how to do $var.$i.IN ... I already tried, but don't seem to have it right Why do you need them in separate variables? Can't you use them using array syntax elsewhere in your code? Basically, I don't know how else to handle inserting and updating random ... What he's talking about is doing this: if ($res = mysql_query ($sql, $db)) { /* I personally prefer res for resource, not results */ while ($r = mysql_fetch_assoc ($res)) { $rows[] = $r; } } And then you access the individual rows/columns as $rows[0]['first_name'] $rows[0]['last_name'] $rows[1]['first_name'] $rows[1]['last_name'] and so on, in some kind of loop probably. (I thought this had been spelled out already, but I was unable to find it so perhaps not.) /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. É grátis! http://specials.br.msn.com/ilovemessenger/pacotes.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] aesthetic beauty in conception, execution
I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: aesthetic beauty in conception, execution
PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Il y a seulement une problème - je ne lis pas Française... I18N - it's important, you know... -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Can I have my 5 minutes back please? It's about as simplistic a site as it gets. If simple is elegant sure, you're sort of right, but artistic design seemed awfully lacking. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: aesthetic beauty in conception, execution
PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Superb for a mass of validation errors. It must be in the design stage as its still full of gibberish placeholder text. Most people use lorem ipsum etc... -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can someone tell me why this is not working?
The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone tell me why this is not working?
Gary wrote: The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } The $ character is a special character for variable interpolation. You should be escaping it. with a backslash. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone tell me why this is not working?
Thanks for your reply, but that is not it. I had already removed it$, slashed it, and no, plus it is working in the others. Gary Robert Cummings rob...@interjinn.com wrote in message news:4a3a5e7c.8000...@interjinn.com... Gary wrote: The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } The $ character is a special character for variable interpolation. You should be escaping it. with a backslash. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can someone tell me why this is not working?
Gary wrote: The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary if ($purchprice) { echo Purchase Price:\$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:\$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can someone tell me why this is not working?
Nope, I added slashes to all of the $, still no go. Thank you for your help. Gary Shawn McKenzie nos...@mckenzies.net wrote in message news:53.c2.08167.5206a...@pb1.pair.com... Gary wrote: The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary if ($purchprice) { echo Purchase Price:\$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:\$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
On Thu, Jun 18, 2009 at 11:44 AM, Garygwp...@ptd.net wrote: Nope, I added slashes to all of the $, still no go. Thank you for your help. Gary Shawn McKenzie nos...@mckenzies.net wrote in message news:53.c2.08167.5206a...@pb1.pair.com... Gary wrote: The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary if ($purchprice) { echo Purchase Price:\$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:\$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php try wrapping the data in htmlentites(). Maybe there is a funky control characters in there or a null value $newmort=htmlentities(STRIPSLASHES($_POST['newmort'])); -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can someone tell me why this is not working?
Everything is exaclty the same, but this one will not work. I have retyped them, copied from those working, changed the name, changed the input name...If I change the var to $zip, it works. Any other suggestions? Thanks again. Gary gwp...@ptd.net wrote in message news:89.71.08167.d8d5a...@pb1.pair.com... The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } check $newmort value var_dump( $newmort ); if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } you if fails is $newmort is there but empty On Thu, Jun 18, 2009 at 1:11 PM, Gary gwp...@ptd.net wrote: Everything is exaclty the same, but this one will not work. I have retyped them, copied from those working, changed the name, changed the input name...If I change the var to $zip, it works. Any other suggestions? Thanks again. Gary gwp...@ptd.net wrote in message news:89.71.08167.d8d5a...@pb1.pair.com... The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta
Re: [PHP] Re: sloppiness stupidity
At 8:47 PM -0400 6/17/09, Robert Cummings wrote: tedd wrote: As I understand it and is my experience, that is true -- a stand-alone HTML attribute should be equal to itself, such as selected=selected, or more specifically selected=SELECTED. How is that MORE specific? XHTML is like a cross-section of XML and HTML. It is case sensitive, so using an uppercase value in this context is LESS specific. Cheers, Rob: It's by definition that case-sensitive is more specific than case-insensitive -- for example with respect to case-insensitive selected, SELECTED, and SeLeCtEd are all the same whereas case sensitive is more specific. Is this not true? Or do you have a different definition that states more variety is more specific? As far as using selected=selected or selected=SELECTED, I prefer the latter -- but I don't think it makes much difference. Do you see otherwise? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
[PHP] Re: Can someone tell me why this is not working? The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; Echo out the value of $newmort just above the if statement. If it is zero or blank, the if will evaluate to false. Is there a second form field named newmort lower on the page? If so, it will be the value of $_POST['newmort'] that you receive in the post. Kirk
Re: [PHP] Re: Can someone tell me why this is not working?
on this line echo Mortgage Amount:$ $newmortbr /; the echo is trying to evaluate the string... in your case you should escape the $ sign... like this \$ echo Mortgage Amount:\$ $newmortbr /; regards On Jun 18, 2009, at 1:15 PM, Martin Scotta wrote: if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } check $newmort value var_dump( $newmort ); if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } you if fails is $newmort is there but empty On Thu, Jun 18, 2009 at 1:11 PM, Gary gwp...@ptd.net wrote: Everything is exaclty the same, but this one will not work. I have retyped them, copied from those working, changed the name, changed the input name...If I change the var to $zip, it works. Any other suggestions? Thanks again. Gary gwp...@ptd.net wrote in message news:89.71.08167.d8d5a...@pb1.pair.com... The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
Thanks...Now I get NULL I have another set of these if($) echo, and the all work, it is just this one that refuses to give it up. Martin Scotta martinsco...@gmail.com wrote in message news:6445d94e0906180915o392d1500hd906b23dbf5c4...@mail.gmail.com... if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } check $newmort value var_dump( $newmort ); if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } you if fails is $newmort is there but empty On Thu, Jun 18, 2009 at 1:11 PM, Gary gwp...@ptd.net wrote: Everything is exaclty the same, but this one will not work. I have retyped them, copied from those working, changed the name, changed the input name...If I change the var to $zip, it works. Any other suggestions? Thanks again. Gary gwp...@ptd.net wrote in message news:89.71.08167.d8d5a...@pb1.pair.com... The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
On Thu, Jun 18, 2009 at 12:22, Garygwp...@ptd.net wrote: Thanks...Now I get NULL I have another set of these if($) echo, and the all work, it is just this one that refuses to give it up. Gary, if you can, send the link to the live development copy on which you're working. Even if it's just a temporary copy of the file for now, for debugging purposes. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
Thanks, but that is not it, have already slashed the $, but the others without the \ still work. Gabriel Sosa sosagabr...@gmail.com wrote in message news:c4316a8f-3ee4-43d0-9b30-c4b447428...@gmail.com... on this line echo Mortgage Amount:$ $newmortbr /; the echo is trying to evaluate the string... in your case you should escape the $ sign... like this \$ echo Mortgage Amount:\$ $newmortbr /; regards On Jun 18, 2009, at 1:15 PM, Martin Scotta wrote: if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } check $newmort value var_dump( $newmort ); if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } you if fails is $newmort is there but empty On Thu, Jun 18, 2009 at 1:11 PM, Gary gwp...@ptd.net wrote: Everything is exaclty the same, but this one will not work. I have retyped them, copied from those working, changed the name, changed the input name...If I change the var to $zip, it works. Any other suggestions? Thanks again. Gary gwp...@ptd.net wrote in message news:89.71.08167.d8d5a...@pb1.pair.com... The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. tr tdPurchase Price: /td td input name=purchprice type=text/td /tr tr tdMortgage Amount: /td td input name=newmort type=text/td /tr tr tdHow long seller has owned property: /td td input name=howlong type=text size=4/td /tr $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; } Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
Ok, I dont really know how it got working, but it is. I did try the test, and after that it worked, however I had tried one before But thank you all for your time and help. Gary kirk.john...@zootweb.com wrote in message news:of24965909.4acbeaf3-on872575d9.00598a62-872575d9.0059e...@zootweb.com... [PHP] Re: Can someone tell me why this is not working? The center echo does not show. It will show if I replace $newmort with anything else. I have copied the first if statement,pasted it in the second position, and it works fine. Once I change the var to $newmort, it will not show. The third echo shows fine, it is only if I use newmort. I have renamed the var from mort1, because I was getting the same thing. $newmort=STRIPSLASHES($_POST['newmort']); $purchprice=STRIPSLASHES($_POST['purchprice']); $howlong=STRIPSLASHES($_POST['howlong']); if ($purchprice) { echo Purchase Price:$ $purchpricebr /; } if ($newmort) { echo Mortgage Amount:$ $newmortbr /; } if ($howlong) { echo How Long has seller owned property: $howlongbr /br /; Echo out the value of $newmort just above the if statement. If it is zero or blank, the if will evaluate to false. Is there a second form field named newmort lower on the page? If so, it will be the value of $_POST['newmort'] that you receive in the post. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
Martin Scotta wrote: It is a sintax error if (in_array($ex, $selected) --- missing ) echo br /yes; else echo br /no; On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: Ford, Mike wrote: On 17 June 2009 14:30, PJ advised: For the moment, I am trying to resolve the problem of extracting a value from a string returned by a query. I thought that in_array() would do it, but the tests I have run on it are 100% negative. The only thing I have not used in the tests is third parameter bool $strict which only affects case-sensitivity if the $needle is a string. $strict has nothing whatsoever at all in any way to do with case sensitivity -- $strict controls whether the values are compared using equality (==) or identity (===) tests. As is stated quite clearly on the manual page, in_array() is always case-sensitive. This leads me to believe that in_array() is either inappropriately defined in the manual and not effective on associative arrays Complete rubbish -- the in_array() manual page is excellent and totally accurate, complete with 3 working examples. I would really like to understand why my attempts to reproduce the first example just did not work. Note also that the examples do not show in_array($string, $array) My array was Array ([0]=6[1]=14), so when I tried if (in_array($string, $array) , echo $string did not return 14 as I had expected; neither did if(in_array(14, $array) ... nor if(in_array(14, $array). It still does not... actually, the screen goes blank. So, what am I doing wrong? Here's what is not working... I'm trying to reproduce the example from php.net http://php.net: $selected = array(); if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } print_r($selected); $ex = 14; if (in_array($ex, $selected) echo br /yes; else echo br /no; Regardless if I put 14 into $ex or 14 or '14' or even if I put the 14 instead of the $ex into the if line, I get a blank screen. It seems tp me, from what I see in the manual that this should work... or am I supposed to know something that is not clear in the examples... ? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com mailto:p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Actually, we have to call it a typo because i fixed that and the results are exactly the same = blank screen. :-( -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: aesthetic beauty in conception, execution
Peter Ford wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Il y a seulement une problème - je ne lis pas Française... I18N - it's important, you know... close enough... it wold still be great even if it were in Esperanto - it's not the content, its the look, the presentation, the coding that make it so unique. ;-) -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
Robert Cummings wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Can I have my 5 minutes back please? It's about as simplistic a site as it gets. If simple is elegant sure, you're sort of right, but artistic design seemed awfully lacking. Cheers, Rob. Well, it depends by what you mean by simplistic and if you're looking for cluttered crap that one finds all over the place, yeah, it's simple - but certainly not simplistic. It has a purpose that is met, it gets to the point, it focuses your attention, it gives information and is pleasing to the eye. What more could you want? American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
2009/6/18 PJ af.gour...@videotron.ca: Martin Scotta wrote: It is a sintax error if (in_array($ex, $selected) --- missing ) echo br /yes; else echo br /no; On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: Ford, Mike wrote: On 17 June 2009 14:30, PJ advised: For the moment, I am trying to resolve the problem of extracting a value from a string returned by a query. I thought that in_array() would do it, but the tests I have run on it are 100% negative. The only thing I have not used in the tests is third parameter bool $strict which only affects case-sensitivity if the $needle is a string. $strict has nothing whatsoever at all in any way to do with case sensitivity -- $strict controls whether the values are compared using equality (==) or identity (===) tests. As is stated quite clearly on the manual page, in_array() is always case-sensitive. This leads me to believe that in_array() is either inappropriately defined in the manual and not effective on associative arrays Complete rubbish -- the in_array() manual page is excellent and totally accurate, complete with 3 working examples. I would really like to understand why my attempts to reproduce the first example just did not work. Note also that the examples do not show in_array($string, $array) My array was Array ([0]=6[1]=14), so when I tried if (in_array($string, $array) , echo $string did not return 14 as I had expected; neither did if(in_array(14, $array) ... nor if(in_array(14, $array). It still does not... actually, the screen goes blank. So, what am I doing wrong? Here's what is not working... I'm trying to reproduce the example from php.net http://php.net: $selected = array(); if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } print_r($selected); $ex = 14; if (in_array($ex, $selected) echo br /yes; else echo br /no; Regardless if I put 14 into $ex or 14 or '14' or even if I put the 14 instead of the $ex into the if line, I get a blank screen. It seems tp me, from what I see in the manual that this should work... or am I supposed to know something that is not clear in the examples... ? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com mailto:p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Actually, we have to call it a typo because i fixed that and the results are exactly the same = blank screen. :-( If you're getting a blank screen instead of an error message I highly recommend turning display_errors on and setting error_reporting to E_ALL in you dev php.ini - that way you'll actually see error messages rather than having to hunt through the code by hand. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sloppiness stupidity
tedd wrote: At 8:47 PM -0400 6/17/09, Robert Cummings wrote: tedd wrote: As I understand it and is my experience, that is true -- a stand-alone HTML attribute should be equal to itself, such as selected=selected, or more specifically selected=SELECTED. How is that MORE specific? XHTML is like a cross-section of XML and HTML. It is case sensitive, so using an uppercase value in this context is LESS specific. Cheers, Rob: It's by definition that case-sensitive is more specific than case-insensitive -- for example with respect to case-insensitive selected, SELECTED, and SeLeCtEd are all the same whereas case sensitive is more specific. Is this not true? Or do you have a different definition that states more variety is more specific? As far as using selected=selected or selected=SELECTED, I prefer the latter -- but I don't think it makes much difference. Do you see otherwise? The spec says set the attribute value equal to the name of the attribute itself. XHTML has case sensitive attributes. You have not set the value equal to the attribute name, you have set it equal to the uppercase transformation of the attribute name. if it were a password, most systems wouldn't let you in. Fortunately for you, there's a zillion others out there that follow instructions according to their own internal (oft misguided) interpretation, and so the browser developers decided to ignore case sensitivity. I only added a comment because you said: selected=selected, or more specifically selected=SELECTED' In which case you've suggested the latter format is more correct... I disagree for the aforementioned reasons. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: aesthetic beauty in conception, execution
Shawn McKenzie wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Superb for a mass of validation errors. It must be in the design stage as its still full of gibberish placeholder text. Most people use lorem ipsum etc... Câlice the tabernac, t'es donc un hosti niezeu. ;-) I may have misspelled that as it's not my native tongue - mine is forked. -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
PJ wrote: Robert Cummings wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Can I have my 5 minutes back please? It's about as simplistic a site as it gets. If simple is elegant sure, you're sort of right, but artistic design seemed awfully lacking. Cheers, Rob. Well, it depends by what you mean by simplistic and if you're looking for cluttered crap that one finds all over the place, yeah, it's simple - but certainly not simplistic. It has a purpose that is met, it gets to the point, it focuses your attention, it gives information and is pleasing to the eye. What more could you want? My 5 minutes back :) American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P I'm Canadian as are you. But I'm no minimalist. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing level above $_SERVER['DOCUMENT_ROOT']
hi, I have this structure: /home/lamp/mydomain/html /home/lamp/mydomain/logs /home/lamp/mydomain/config etc. html directory is the only one accessible from outside. to access config file I can use this: required_once('/home/lamp/mydomain/config'); but this is the structure on my local/development machine. once the site is done it will be moved to production server and the structure will be /srv/www/mydomain/html /srv/www/mydomain/logs /srv/www/mydomain/config etc. to automate the document_root I define on the begining of the page define('HTML_PATH', $_SERVER{DOCUMENT_ROOT']); define('CONFIG_PATH', $_SERVER{DOCUMENT_ROOT'].'/../config'); define('LOGS_PATH', $_SERVER{DOCUMENT_ROOT'].'/../logs'); it works but I think it's not good solution. or at least - it's not nice solution :-) suggestions? afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] populate form input option dropdown box from existing data
Stuart wrote: 2009/6/18 PJ af.gour...@videotron.ca: Martin Scotta wrote: It is a sintax error if (in_array($ex, $selected) --- missing ) echo br /yes; else echo br /no; On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca mailto:af.gour...@videotron.ca wrote: Ford, Mike wrote: On 17 June 2009 14:30, PJ advised: For the moment, I am trying to resolve the problem of extracting a value from a string returned by a query. I thought that in_array() would do it, but the tests I have run on it are 100% negative. The only thing I have not used in the tests is third parameter bool $strict which only affects case-sensitivity if the $needle is a string. $strict has nothing whatsoever at all in any way to do with case sensitivity -- $strict controls whether the values are compared using equality (==) or identity (===) tests. As is stated quite clearly on the manual page, in_array() is always case-sensitive. This leads me to believe that in_array() is either inappropriately defined in the manual and not effective on associative arrays Complete rubbish -- the in_array() manual page is excellent and totally accurate, complete with 3 working examples. I would really like to understand why my attempts to reproduce the first example just did not work. Note also that the examples do not show in_array($string, $array) My array was Array ([0]=6[1]=14), so when I tried if (in_array($string, $array) , echo $string did not return 14 as I had expected; neither did if(in_array(14, $array) ... nor if(in_array(14, $array). It still does not... actually, the screen goes blank. So, what am I doing wrong? Here's what is not working... I'm trying to reproduce the example from php.net http://php.net: $selected = array(); if ( ( $results = mysql_query($sql, $db) ) ) { while ( $row = mysql_fetch_assoc($results) ) { $selected[] = $row['id']; } } print_r($selected); $ex = 14; if (in_array($ex, $selected) echo br /yes; else echo br /no; Regardless if I put 14 into $ex or 14 or '14' or even if I put the 14 instead of the $ex into the if line, I get a blank screen. It seems tp me, from what I see in the manual that this should work... or am I supposed to know something that is not clear in the examples... ? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com mailto:p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta Actually, we have to call it a typo because i fixed that and the results are exactly the same = blank screen. :-( If you're getting a blank screen instead of an error message I highly recommend turning display_errors on and setting error_reporting to E_ALL in you dev php.ini - that way you'll actually see error messages rather than having to hunt through the code by hand. Duh, Stuart, I'm wet behind the ears, but that was one of my first revelations - to use error_reporting(E_ALL); ini_set('display_errors', 1); ;-) But that's what's weird... if I comment those last 4 lines out, the proggie works (or shall I say, limps; I still have other problems) But the in_array just refuses to cooperate. -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can someone tell me why this is not working?
I was about to do something really stupid. I had gotten it to work (even a blind squirell gets a nut every now and again), and had copied the code to send to you to look at.and then realized it was working so you would be chasing ghosts. Thank you for your help. Gary Daniel Brown danbr...@php.net wrote in message news:ab5568160906180925q18afdc95ua9d48f1e8f6ae...@mail.gmail.com... On Thu, Jun 18, 2009 at 12:22, Garygwp...@ptd.net wrote: Thanks...Now I get NULL I have another set of these if($) echo, and the all work, it is just this one that refuses to give it up. Gary, if you can, send the link to the live development copy on which you're working. Even if it's just a temporary copy of the file for now, for debugging purposes. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
Robert Cummings wrote: PJ wrote: Robert Cummings wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Can I have my 5 minutes back please? It's about as simplistic a site as it gets. If simple is elegant sure, you're sort of right, but artistic design seemed awfully lacking. Cheers, Rob. Well, it depends by what you mean by simplistic and if you're looking for cluttered crap that one finds all over the place, yeah, it's simple - but certainly not simplistic. It has a purpose that is met, it gets to the point, it focuses your attention, it gives information and is pleasing to the eye. What more could you want? My 5 minutes back :) American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P I'm Canadian as are you. No, I'm not... :-P I'm Martian... but this is a nicer place to hideout... But I'm no minimalist. H... I just believe in efficiency, if at all possible... I don't think I'm succeeding too well at that in php :-( god, you should see the code... -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multi-Sort -- how to do this?
At 10:11 AM +0100 6/18/09, Ford, Mike wrote: On 17 June 2009 22:12, tedd advised: -snip- Now, let's say you want to sort the $d array, but you also want the arrays $a, $b, and $c to be arranged in the same resultant order as $d. For example, please follow this: Before sort of $d: $a = [apple, banana, grape, orange] $b = [100, 2111, 198, 150] $c = [red, yellow, purple, orange] $d = [100, 300, 11, 50] After sort of $d: $a = [grape, orange, apple, banana] $b = [198, 150, 100, 2111] $c = [purple, orange, red, yellow] $d = [11, 50, 100, 300] array_multisort($d, $a, $b, $c) should do what you want, Cheers! Mike Mike: Slick indeed! That's exactly what I was looking for (see subject line -- I was close). Here's the working example: http://www.webbytedd.com//multisort/ Thanks to Rob and Daniel for also playing, better luck next time. :-) - note smiley -- I do appreciate your time. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
Ash: You missed the point. I could use the built-in sort (i.e., sort() ) and sort the $d array. However, I would like the indexes of the other arrays to match the new sort. Cheers, tedd I think I might need a for-instance here, as you lost me! Thanks Ash Ash: You can sort any array by using the built-in php function sort() -- try it. After you try it, you'll find that the array is sorted but the order of the values are not as they were before. In other words, the index-value pairs are different. Here's an example: http://www.webbytedd.com//sort/ Before the sort, the value 'red' is located in the $a array under index 0 After the sort, the value 'red' is still in the $a array but under index 2. Note, the values of the indexes have changed. My query was simply how to sort one array (order it) while ordering the values of other arrays in the same manner. The multisort() function does that as seen here: http://www.webbytedd.com//multisort/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sloppiness stupidity
On Tue, Jun 16, 2009 at 8:43 PM, PJaf.gour...@videotron.ca wrote some nonsense: I'm sorry, guys, but I am really getting po'd. Fail. Please try again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
At 12:43 PM -0400 6/18/09, Robert Cummings wrote: I'm Canadian as are you. Cheers, Rob. Oh that explains a lot. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: aesthetic beauty in conception, execution
On 6/18/09 12:35 PM, PJ af.gour...@videotron.ca wrote: Peter Ford wrote: PJ wrote: I just thought I would share a revelation. Someone just pointed me to a site that IMHO is superb for elegance of artistic design and programming. I was blown away. http://www.apfq.ca You won't regret it. 8-) Il y a seulement une problème - je ne lis pas Française... I18N - it's important, you know... close enough... it wold still be great even if it were in Esperanto - it's not the content, its the look, the presentation ?!?! any reliance stock photos of happy beautiful people doing fun or productive things is just lame. was already 10 years ago. the presentation looks like one of those domain sitting sites you get when you type a uri wrong. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
On Thu, Jun 18, 2009 at 12:39:35PM -0400, PJ wrote: snip American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P Clear proof you are insane. The Matrix. Alien. Terminator. Star Wars. Star Trek II: The Wrath of Khan. Cannibal Women in the Avacado Jungle of Death. Yep, insane. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR Spreadsheet_Excel_Writer setLocked method
Hey all, Any one use the PEAR Spreadsheet_Excel_Writer package? I need to know how to implement the setLocked method to lock out a cell, but can't figure out how this would be done. Do you add it as a format? But then how is it applied to a cell. It's not documented on the PEAR pages. Any help as always is greatly appreciated. Also, what about making a cell span more than one cell below and above it? I can't find a way to do this either. Thanks, Skip -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison WI 53703 608.250.2720 http://bigskypenguin.com Those of you who believe in telekinesis, raise my hand. -- Kurt Vonnegut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
At 1:16 PM -0400 6/18/09, Paul M Foster wrote: On Thu, Jun 18, 2009 at 12:39:35PM -0400, PJ wrote: snip American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P Clear proof you are insane. The Matrix. Alien. Terminator. Star Wars. Star Trek II: The Wrath of Khan. Cannibal Women in the Avacado Jungle of Death. And don't forget my favorite Queen of Outer Space staring Zsa Zsa Gabore and a bunch of her friends -- real camp. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
tedd wrote: At 10:11 AM +0100 6/18/09, Ford, Mike wrote: On 17 June 2009 22:12, tedd advised: -snip- Now, let's say you want to sort the $d array, but you also want the arrays $a, $b, and $c to be arranged in the same resultant order as $d. For example, please follow this: Before sort of $d: $a = [apple, banana, grape, orange] $b = [100, 2111, 198, 150] $c = [red, yellow, purple, orange] $d = [100, 300, 11, 50] After sort of $d: $a = [grape, orange, apple, banana] $b = [198, 150, 100, 2111] $c = [purple, orange, red, yellow] $d = [11, 50, 100, 300] array_multisort($d, $a, $b, $c) should do what you want, Cheers! Mike Mike: Slick indeed! That's exactly what I was looking for (see subject line -- I was close). Here's the working example: http://www.webbytedd.com//multisort/ Thanks to Rob and Daniel for also playing, better luck next time. :-) - note smiley -- I do appreciate your time. Mine version retains key associations. It wasn't a complete waste of time. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] edit db fields
How to deal with pre-selected input fields. To edit db fields in a table, I have a page that is basically the same as an insert page to create entries in the db. The table displays all the entries for a particular book that is selected from a search page. From the search page results a link leads to the edit page throught the page id (...edit.php?id=2435, for example) . Here we already have a problem because the form action to PHP_SELF cannot work; so there has to be some adjustment, like incorporating the edit page into the search page. Next, it should be possible to change the inputs, but how? I think the use of sessions may prevent this - not sure - at present I get an undefined variable error for categoriesIN. The categories are generated dynamically from the db, but this does not work on the insert page either... they must be hard coded (at least I don't know how else to fix that). But if hard coded, then some code has to used to make the selected entries (about 35 categories). And then, how to change them if so needed? Anybody have some suggestions where to look for a model? It doesn't seem like a terribly difficult project, if you're pretty proficient at this. I have had some interesting suggestions; but it is difficult enough to just learn php/mysql and then to learn other platforms like smarty (??) seems rather challenging, to say the least. Apprediate any input. Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
On Thu, Jun 18, 2009 at 1:34 PM, teddtedd.sperl...@gmail.com wrote: At 1:16 PM -0400 6/18/09, Paul M Foster wrote: On Thu, Jun 18, 2009 at 12:39:35PM -0400, PJ wrote: snip American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P Clear proof you are insane. The Matrix. Alien. Terminator. Star Wars. Star Trek II: The Wrath of Khan. Cannibal Women in the Avacado Jungle of Death. And don't forget my favorite Queen of Outer Space staring Zsa Zsa Gabore and a bunch of her friends -- real camp. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Jane Fonda as Barbarella remains a cult classic though ;-P -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isset question
I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about locale settings
Daniel Brown wrote: On Tue, Jun 16, 2009 at 15:33, Per Jessenp...@computer.org wrote: Environment Variable = Value LC_ALL = de_DE.utf8 Is that what you were after? Sure is. Unfortunately, that means it's not an environment-import issue as I had originally suspected. I'll take a look on one of my servers and see if I can help you debug the problem in just a few minutes. Now Dan, I hate to be a pest, but them minutes of yours seem to be running a teeny bit slow? :-) /Per -- Per Jessen, Zürich (25.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
Okay, had to chime in here... Jesus Christ, Vampire Hunter See the trailer here http://www.youtube.com/watch?v=4LRIypcaIX4 Skip Bastien Koert wrote: On Thu, Jun 18, 2009 at 1:34 PM, teddtedd.sperl...@gmail.com wrote: At 1:16 PM -0400 6/18/09, Paul M Foster wrote: On Thu, Jun 18, 2009 at 12:39:35PM -0400, PJ wrote: snip American movies, for the most part and what goes with them, are pollution of the senses. My take, of course. ;-) :-P Clear proof you are insane. The Matrix. Alien. Terminator. Star Wars. Star Trek II: The Wrath of Khan. Cannibal Women in the Avacado Jungle of Death. And don't forget my favorite Queen of Outer Space staring Zsa Zsa Gabore and a bunch of her friends -- real camp. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Jane Fonda as Barbarella remains a cult classic though ;-P -- Skip Evans Big Sky Penguin, LLC 503 S Baldwin St, #1 Madison WI 53703 608.250.2720 http://bigskypenguin.com Those of you who believe in telekinesis, raise my hand. -- Kurt Vonnegut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about locale settings
On Thu, Jun 18, 2009 at 14:52, Per Jessenp...@computer.org wrote: Now Dan, I hate to be a pest, but them minutes of yours seem to be running a teeny bit slow? :-) It's the uhh time difference between Zurich and Scranton...? [*blushes*] Sorry about that. Let me finish this one final task and I'll take a look at it. Toss me a message off-list with a way to chat with you (Google, MSN, AIM, Skype, whatever) as well, and we can hash it out quicker. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset question
2009/6/18 Gary gwp...@ptd.net: I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? A variable isset even if it's empty. Either compare it to an empty string or test the result from strlen against 0. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset question
Use !empty($_POST['mort']) instead of isset() for form input since the form will still set an empty value if left blank. Gary wrote: I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.78/2185 - Release Date: 06/18/09 05:53:00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset question
Steve wrote: Use !empty($_POST['mort']) instead of isset() for form input since the form will still set an empty value if left blank. Gary wrote: I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.78/2185 - Release Date: 06/18/09 05:53:00 using !empty() instead isset() will work if you don't care for PHP Notice: Undefined variable... If you want to avoid PHP Notice you have to use both: $msg.= (isset($_POST['mort']) and !empty($_POST['mort'])) ? The mortgage amount is $mort\n : ; afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset question
I notice that you're checking $_POST['mort'] but you're echoing $mort, is that your actual code? On 6/18/09, Gary gwp...@ptd.net wrote: I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
At 1:45 PM -0400 6/18/09, Robert Cummings wrote: Thanks to Rob and Daniel for also playing, better luck next time. :-) - note smiley -- I do appreciate your time. Mine version retains key associations. It wasn't a complete waste of time. Cheers, Rob. Rob: Nothing you provide me is a complete waste of time -- see here: http://www.webbytedd.com//multisort-rob/ Many thanks for your code. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
tedd wrote: At 1:45 PM -0400 6/18/09, Robert Cummings wrote: Thanks to Rob and Daniel for also playing, better luck next time. :-) - note smiley -- I do appreciate your time. Mine version retains key associations. It wasn't a complete waste of time. Cheers, Rob. Rob: Nothing you provide me is a complete waste of time -- see here: http://www.webbytedd.com//multisort-rob/ Many thanks for your code. I meant to have a smiley at the end of it. I don't mind doing it, even thought he solution existed for multisort, thinking through the process is invaluable :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: isset question
This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second half. I'm not sure I understand the comment about use the !empty if you dont care about PHP. But this is working, and unless someone sees a problem with it, I will leave it as is. Thank you to everyone for helping. Gary $msg.= !empty($_POST['purchprice']) ? If this information is completed, it is a new purchase.\n The Purchase Price is $purchprice\n : ; $msg.= !empty($_POST['mort']) ? The mortgage amount is {$_POST['mort']}\n : ; $msg.= !empty($_POST['howlong']) ? The sellers have owned the property for $howlong\n\n\n : ; $msg.= !empty($_POST['mortgage']) ? If this information is completed, it is a refinance.\nThe mortgage amount is $mortgage\n : ; $msg.= !empty($_POST['purdate']) ? The property was originally purchased on $purdate\n : ; $msg.= !empty($_POST['datefin']) ? The property was last financed $datefin\n : ; Gary gwp...@ptd.net wrote in message news:ea.e8.08167.6ac8a...@pb1.pair.com... I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
On Thu, Jun 18, 2009 at 01:58:26PM -0500, Skip Evans wrote: Okay, had to chime in here... Jesus Christ, Vampire Hunter See the trailer here http://www.youtube.com/watch?v=4LRIypcaIX4 Ohmygosh! That's a *real* movie! Doubtless in the fine tradition of The Toxic Avenger, but with an even lower budget. Priceless! ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need someone to bounce some thoughts with for a project!
hi list... sorry to post here, but i figured you might be able to help... i'm working on a project, that deals with building a crawler, and i'm working out the details for the mgmt app for the crawler. i'm currently looking at how to deal with the status/actions of the crawler, and how the different components of what i call a job would be compiled, and reported back to the batabase. i'm wondering.. is there anyone on this list that i might be able to email with, talk to about this.. while i've got a few ideas, never hurts to be able to talk/share thoughts with others.. thanks much! basically: my methodology is that i create a batchfile (the batchfile consists of the underlying apps that do the crawling) each batchfile can be run by multiple jobs (as required) i'm creating the piece of the mgmt app that will track/manage the jobs i'm lookin at being able to track the health of the 'jobs' as they run i'm considering the 'actions' as well as the 'status' i'm thinking of: disable/enable stop/restart waiting to start running complete/finished status might have things like: success/complete (no errs at all) complete/errs (ran through all the scripts, but some had errs) failed (didn't complete all the scripts) etc... i'm looking for someone i might be able to talk to, or exchange a few ideas/emails with on this.. thanks much! ps.. and yeah.. the web app is all in php!!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] aesthetic beauty in conception, execution
It's the greatest movie I've ever seen. Canadians, Jesus, vampires and lesbians, what hte hell else could you ask for in a film? On Thu, Jun 18, 2009 at 3:50 PM, Paul M Fosterpa...@quillandmouse.com wrote: On Thu, Jun 18, 2009 at 01:58:26PM -0500, Skip Evans wrote: Okay, had to chime in here... Jesus Christ, Vampire Hunter See the trailer here http://www.youtube.com/watch?v=4LRIypcaIX4 Ohmygosh! That's a *real* movie! Doubtless in the fine tradition of The Toxic Avenger, but with an even lower budget. Priceless! ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: isset question
Gary wrote: This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second half. I'm not sure I understand the comment about use the !empty if you dont care about PHP. if you don't care about PHP Notice... eror_reporting: http://us.php.net/manual/en/function.error-reporting.php http://us.php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-notice put error_reporting(E_ALL) on the begining of you page you will get errors, warnings and notices - if any. errors and warnings stop the execution of the code. notice not. notices are usually about not defined variables before you started to use them. if you put error_reporting(E_ALL ^ E_NOTICE) it will not bother you. but I like to do everything correctly. :-) afan But this is working, and unless someone sees a problem with it, I will leave it as is. Thank you to everyone for helping. Gary $msg.= !empty($_POST['purchprice']) ? If this information is completed, it is a new purchase.\n The Purchase Price is $purchprice\n : ; $msg.= !empty($_POST['mort']) ? The mortgage amount is {$_POST['mort']}\n : ; $msg.= !empty($_POST['howlong']) ? The sellers have owned the property for $howlong\n\n\n : ; $msg.= !empty($_POST['mortgage']) ? If this information is completed, it is a refinance.\nThe mortgage amount is $mortgage\n : ; $msg.= !empty($_POST['purdate']) ? The property was originally purchased on $purdate\n : ; $msg.= !empty($_POST['datefin']) ? The property was last financed $datefin\n : ; Gary gwp...@ptd.net wrote in message news:ea.e8.08167.6ac8a...@pb1.pair.com... I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-Sort -- how to do this?
On Thu, 2009-06-18 at 13:04 -0400, tedd wrote: Ash: You missed the point. I could use the built-in sort (i.e., sort() ) and sort the $d array. However, I would like the indexes of the other arrays to match the new sort. Cheers, tedd I think I might need a for-instance here, as you lost me! Thanks Ash Ash: You can sort any array by using the built-in php function sort() -- try it. After you try it, you'll find that the array is sorted but the order of the values are not as they were before. In other words, the index-value pairs are different. Here's an example: http://www.webbytedd.com//sort/ Before the sort, the value 'red' is located in the $a array under index 0 After the sort, the value 'red' is still in the $a array but under index 2. Note, the values of the indexes have changed. My query was simply how to sort one array (order it) while ordering the values of other arrays in the same manner. The multisort() function does that as seen here: http://www.webbytedd.com//multisort/ Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com I know about the sort() function, I just didn't fully understand the question. I guess that's what late nights can do to ya! Thanks Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: isset question
error_reporting( E_ALL | E_STRICT ); if you want to be extremely sure about your app (only in develop) On Thu, Jun 18, 2009 at 5:04 PM, LAMP l...@afan.net wrote: Gary wrote: This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second half. I'm not sure I understand the comment about use the !empty if you dont care about PHP. if you don't care about PHP Notice... eror_reporting: http://us.php.net/manual/en/function.error-reporting.php http://us.php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-notice put error_reporting(E_ALL) on the begining of you page you will get errors, warnings and notices - if any. errors and warnings stop the execution of the code. notice not. notices are usually about not defined variables before you started to use them. if you put error_reporting(E_ALL ^ E_NOTICE) it will not bother you. but I like to do everything correctly. :-) afan But this is working, and unless someone sees a problem with it, I will leave it as is. Thank you to everyone for helping. Gary $msg.= !empty($_POST['purchprice']) ? If this information is completed, it is a new purchase.\n The Purchase Price is $purchprice\n : ; $msg.= !empty($_POST['mort']) ? The mortgage amount is {$_POST['mort']}\n : ; $msg.= !empty($_POST['howlong']) ? The sellers have owned the property for $howlong\n\n\n : ; $msg.= !empty($_POST['mortgage']) ? If this information is completed, it is a refinance.\nThe mortgage amount is $mortgage\n : ; $msg.= !empty($_POST['purdate']) ? The property was originally purchased on $purdate\n : ; $msg.= !empty($_POST['datefin']) ? The property was last financed $datefin\n : ; Gary gwp...@ptd.net wrote in message news:ea.e8.08167.6ac8a...@pb1.pair.com... I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta
RE: [PHP] isset question
The isset or empty, it's return a boolean (true 1, false 0), the isset will return true if the variable will have been initiated, the empty will return true if the variable is empty, but for that the variable need to be initiated. You can do it in a many ways, like: $msg.= (isset($_POST['mort']) !empty($_POST['mort']) ? The mortgage amount is $mort\n : ); or $msg.= ($_POST['mort'] == '' ? The mortgage amount is $mort\n : ); or $msg.= (strlen($_POST['mort']) 0 ? The mortgage amount is $mort\n : ); Yuri Yarlei. Programmer PHP, CSS, Java, PostregreSQL; Today PHP, tomorrow Java, after the world. Kyou wa PHP, ashita wa Java, sono ato sekai desu. Date: Thu, 18 Jun 2009 20:07:09 +0100 From: stut...@gmail.com To: gwp...@ptd.net CC: php-general@lists.php.net Subject: Re: [PHP] isset question 2009/6/18 Gary gwp...@ptd.net: I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? A variable isset even if it's empty. Either compare it to an empty string or test the result from strlen against 0. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Conheça os novos produtos Windows Live! Clique aqui. http://www.windowslive.com.br
Re: [PHP] Re: isset question
Martin Scotta wrote: error_reporting( E_ALL | E_STRICT ); if you want to be extremely sure about your app (only in develop) Actually, I use error_reporting(E_ALL) while developing :-) Afan On Thu, Jun 18, 2009 at 5:04 PM, LAMP l...@afan.net mailto:l...@afan.net wrote: Gary wrote: This is what I have now and it works. I do know that on the second line I have $_POST['mort']}\n : ; in the second half. I'm not sure I understand the comment about use the !empty if you dont care about PHP. if you don't care about PHP Notice... eror_reporting: http://us.php.net/manual/en/function.error-reporting.php http://us.php.net/manual/en/errorfunc.constants.php#errorfunc.constants.errorlevels.e-notice put error_reporting(E_ALL) on the begining of you page you will get errors, warnings and notices - if any. errors and warnings stop the execution of the code. notice not. notices are usually about not defined variables before you started to use them. if you put error_reporting(E_ALL ^ E_NOTICE) it will not bother you. but I like to do everything correctly. :-) afan But this is working, and unless someone sees a problem with it, I will leave it as is. Thank you to everyone for helping. Gary $msg.= !empty($_POST['purchprice']) ? If this information is completed, it is a new purchase.\n The Purchase Price is $purchprice\n : ; $msg.= !empty($_POST['mort']) ? The mortgage amount is {$_POST['mort']}\n : ; $msg.= !empty($_POST['howlong']) ? The sellers have owned the property for $howlong\n\n\n : ; $msg.= !empty($_POST['mortgage']) ? If this information is completed, it is a refinance.\nThe mortgage amount is $mortgage\n : ; $msg.= !empty($_POST['purdate']) ? The property was originally purchased on $purdate\n : ; $msg.= !empty($_POST['datefin']) ? The property was last financed $datefin\n : ; Gary gwp...@ptd.net mailto:gwp...@ptd.net wrote in message news:ea.e8.08167.6ac8a...@pb1.pair.com... I have a form that gives the submitter a choice or either one set of questions, or another. I am still getting the message even if the input was left blank. So on the line below, $msg.= isset($_POST['mort']) ? The mortgage amount is $mort\n : ; I get The mortgage amount is What am I missing here? Thanks Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Calendar
Does Any body please have the code of A Java Script Calendar that works with a PHP Html Form.. if yes can you please send it as i have one but does not work that Efficiently. Thanks in advance -- View this message in context: http://www.nabble.com/Calendar-tp24099681p24099681.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.3.0RC4
Hello! we have packaged PHP 5.3.0RC4, which you can find here: http://downloads.php.net/johannes/ Windows binaries are available here: http://windows.php.net/qa/ This fourth release candidate focused on bug fixes and stability improvements and we hope to only require minimal changes ahead of the next release. Many, but not all, of the new features are already integrated in the official documentation on php.net. We aim to release PHP 5.3.0 next week. In case of critical issues we will continue producing weekly RCs. For most users there will not be a noticeable change meaning that now is the time to really do the final testing of PHP 5.3.0 before it gets released with any unnecessary incompatibilities with your project. Some additional links to get started: http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markuppathrev=PHP_5_3 http://cvs.php.net/viewvc.cgi/php-src/UPGRADING?revision=PHP_5_3 Best Regards, Lukas and Johannes PHP 5.3 Release Managers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calendar
On Thu, Jun 18, 2009 at 18:16, salmarayansalmara...@gmail.com wrote: Does Any body please have the code of A Java Script Calendar that works with a PHP Html Form.. No. if yes can you please send it as i have one but does not work that Efficiently. No. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why does simpleXML give me nested objects for blank tags?
I'm trying to use http://us2.php.net/manual/en/function.simplexml-load-string.php $xml_url = file_get_contents('http://myserver/cgi-bin/dart.cgi?request=c901c906e4d06a0d 4bd4e2932379d7c6'); try { $xml = simplexml_load_string($xml_url, 'SimpleXMLElement', LIBXML_NOBLANKS LIBXML_COMPACT LIBXML_NOEMPTYTAG); print_r( $xml); } catch (Exception $e) { echo bad xml; } If I have this XML file: issue crstatusi_field_submitted/crstatus problem_number151827/problem_number problem_synopsis_fieldtitle/problem_synopsis_field problem_description_fielddescription2/problem_description_field fi_priorityHigh/fi_priority assignee/ create_time5/12/2009 22:53:10/create_time fi_notes_oem/ fi_sw_part_namesw_part_name/fi_sw_part_name fi_general_referencegeneral_reference/fi_general_reference fi_sw_part_numbersw_part_num/fi_sw_part_number fi_customer_ecd_date1244703600/fi_customer_ecd_date fi_sw_part_versionsw_part_version/fi_sw_part_version fi_required_date1243839600/fi_required_date ac_type/ /issue Why does it give me sub-objects and not just empty strings for tags that have no values as I'd expect??! I tried all those options above and none of them make a difference. SimpleXMLElement Object ( [crstatus] = i_field_submitted [problem_number] = 151827 [problem_synopsis_field] = title [problem_description_field] = description2 [fi_priority] = High [assignee] = SimpleXMLElement Object ( ) [fi_notes_oem] = SimpleXMLElement Object ( ) [fi_sw_part_name] = sw_part_name [fi_general_reference] = general_reference [fi_sw_part_number] = sw_part_num [fi_customer_ecd_date] = 1244703600 [fi_sw_part_version] = sw_part_version [fi_required_date] = 1243839600 [ac_type] = SimpleXMLElement Object ( ) )