php-general Digest 8 May 2010 16:48:31 -0000 Issue 6733
php-general Digest 8 May 2010 16:48:31 - Issue 6733 Topics (messages 305006 through 305012): Re: Problem with IE7 caching 305006 by: Karl DeSaulniers Re: Finding similar results with php from mysql 305007 by: Teus Benschop 305008 by: Merlin Morgenstern Re: simplexml choking on apparently valid XML 305009 by: Deva 305010 by: Deva 305011 by: Peter Lind PHP GD - Create a flag 305012 by: Giorgio Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On May 7, 2010, at 10:35 PM, Charlene Wroblewski wrote: Karl DeSaulniers wrote: On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote: I have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways: * I make a minor change to a php program, but you can't see it in IE7, but can in FF. CTRL-Refresh does not make it work. * I modify data using a form in IE7. When I click on a link to return to the form the old data is still there, but if I hit CTRL-Refresh the new values are there. I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines: $now = time (); $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT'; $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT'; // Backwards Compatibility header (Last Modified: $prety_lmtime); header (Expires: $prety_emtime); // HTTP/1.1 Support header (Cache-Control: private, max-age=$interval,s-maxage=0); I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db. Charlene Sounds like you need attach the data somehow when hitting that return link. Maybe an array $newData = array();//fill this array with the new values On your form page, set up a if(isset($newData)){ //fill form fields } I did notice that on your header, you did not have no-cache. header (Cache-Control: private, no-cache, max-age=$interval,s- maxage=0); Actually, I should have looked at which caching code I was using for the second problem. This is the code: header (Expires: 0); header (pragma: no-cache); // HTTP/1.1 Support header (Cache-Control: no-cache,no-store,max- age=0,s-maxage=0, must-revalidate); About storing the values, I really would rather the browser keep track of form input if I can. It could get confusing trying to store temporary information, especially since the form is being used to modify a client profile as well as create a new password for the first time in the application (not my choice - I'd rather do passwords first and then allow them to modify info). Charlene Are you using sessions? I would store it in a session variable. That shouldn't make things too confusing. Also, I would make sure the form page header has the no-cache in it, since that is the page you dont want caching. Or call on that form page with the time attached to the end of the link url like what what suggested by Bastien. This will make sure that page doesn't cache. Then set up your session variables to store the form results. Then use the isset condition on the form page to apply the new values if they are present. MBG Karl Karl DeSaulniers Design Drumm http://designdrumm.com ---End Message--- ---BeginMessage--- I am searching for a way to show the user similar records from the mysql database. A functionality like this could also be of interest to you. Does anybody know if this is there is a standard functionality to do this, or a good way on retrieving this with the help of PHP? There is the LIKE clause in the SELECT statement, or, better still, MySQL's full text searching capabilities. Teus. ---End Message--- ---BeginMessage--- Am 08.05.2010 03:04, schrieb David McGlone: On Friday 07 May 2010 19:37:32 Merlin Morgenstern wrote: Hi there, I am searching for a way to show the user similar records from the mysql database. A functionality like this could also be of interest to you. Does anybody know if this is there is a standard functionality to do this, or a good way on retrieving this with the help of PHP? Kind regards, Merlin I have some code that makes suggestions on items that one might be interested in based on what they are buying or did buy in the past using PHP. Is this what your interested in? Hi David, I did manage to create a function that provides datasets that are similar
Re: [PHP] Finding similar results with php from mysql
Am 08.05.2010 03:04, schrieb David McGlone: On Friday 07 May 2010 19:37:32 Merlin Morgenstern wrote: Hi there, I am searching for a way to show the user similar records from the mysql database. A functionality like this could also be of interest to you. Does anybody know if this is there is a standard functionality to do this, or a good way on retrieving this with the help of PHP? Kind regards, Merlin I have some code that makes suggestions on items that one might be interested in based on what they are buying or did buy in the past using PHP. Is this what your interested in? Hi David, I did manage to create a function that provides datasets that are similar based on the title. My page is a site similar to craigslist, so I don't know if your code would make sense. It would be interesting though to show items that have been visited by other people after the viewed a particular classified. Could your code be adapted to serve that? Kind regards, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML: client_orderitem_numberBasketball Personalized Notebook - Jeffapos;s/client_orderitem_number It's returning Premature end of data in tag client_orderitem_number line 90 but as far as I can tell, Jeffapos;s is properly XML encoded. I can't debug this. Any suggestions? I have run the XML through a couple of online validators and it does come back as valid with no errors found. http://www.php.net/unsub.php I had this problem It turned out to be some special characters in the tags or data that I had to strip out first, then load it thru the simplexml parser. I will have to check my code when I get back to the office in the AM and I'll let you know what it was if you haven't figured it out by then. But that might get you started in fixing it. -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry -- Sent from my mobile device Devendra Jadhav देवेंद्र जाधव -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
- amp; added space because browser is converting it to :) On 5/8/10, Deva devendra...@gmail.com wrote: I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML: client_orderitem_numberBasketball Personalized Notebook - Jeffapos;s/client_orderitem_number It's returning Premature end of data in tag client_orderitem_number line 90 but as far as I can tell, Jeffapos;s is properly XML encoded. I can't debug this. Any suggestions? I have run the XML through a couple of online validators and it does come back as valid with no errors found. http://www.php.net/unsub.php I had this problem It turned out to be some special characters in the tags or data that I had to strip out first, then load it thru the simplexml parser. I will have to check my code when I get back to the office in the AM and I'll let you know what it was if you haven't figured it out by then. But that might get you started in fixing it. -- -Dan Joseph www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo Code NEWTHINGS for 10% off initial order http://www.facebook.com/canishosting http://www.facebook.com/originalpoetry -- Sent from my mobile device Devendra Jadhav देवेंद्र जाधव -- Sent from my mobile device Devendra Jadhav देवेंद्र जाधव -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simplexml choking on apparently valid XML
On 8 May 2010 00:39, Nathan Nobbe quickshif...@gmail.com wrote: hmm, both the strings seem to work fine on my laptop: +1. Have no problem with either string -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP GD - Create a flag
Hi, i've just started using GD libraries. My purpose is to create something like a flag. So that i have a 600*600 px background image, and a 1*1 px image for each colour I need. Ok now let's say i want to colour a third of the background image. I can use this code: imagecopymerge($base, $img1, 0, 0, 0, 0, 200, 600, 85); It will simply make red first 200 px (on x axys) of the bg image. And this work. Now the problem is: how can i add another colour on pixels from 201 (201 right? not 200?) to 400? Thankyou -- -- AnotherNetFellow Email: anothernetfel...@gmail.com
[PHP] dynamically generating and retrieving page data using flat files
Hello, I've got a project that i have to reference information stored on one page from another. This page I won't be visiting first, and at the moment i'd prefer to use flat php files, but should that prove to hard i'll transition to a mysql database. I'm looking for simplicity and maintainability. I've got a page of individuals, their names, positions, and a brief summary of them. On the main page I want to put their names and positions in an ordered list, pulling that information from the second page. The idea is whenever the second page is updated the main page will automatically update. Suggestions welcome. Thanks. Dave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamically generating and retrieving page data using flat files
Just a wild stab, but maybe hidden form fields and javascript pr php? Karl On May 8, 2010, at 8:41 PM, David Mehler wrote: Hello, I've got a project that i have to reference information stored on one page from another. This page I won't be visiting first, and at the moment i'd prefer to use flat php files, but should that prove to hard i'll transition to a mysql database. I'm looking for simplicity and maintainability. I've got a page of individuals, their names, positions, and a brief summary of them. On the main page I want to put their names and positions in an ordered list, pulling that information from the second page. The idea is whenever the second page is updated the main page will automatically update. Suggestions welcome. Thanks. Dave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: dynamically generating and retrieving page data using flat files
On 5/8/2010 9:41 PM, David Mehler wrote: Hello, I've got a project that i have to reference information stored on one page from another. This page I won't be visiting first, and at the moment i'd prefer to use flat php files, but should that prove to hard i'll transition to a mysql database. I'm looking for simplicity and maintainability. I've got a page of individuals, their names, positions, and a brief summary of them. On the main page I want to put their names and positions in an ordered list, pulling that information from the second page. The idea is whenever the second page is updated the main page will automatically update. Suggestions welcome. Thanks. Dave. Consider using arrays. Give each individual a unique ID and use for your keys Serialize() the array and put_file_contents() file_get_contents and unserialize() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php