Re: [PHP] Weird stack trace in error_log from PDOException
# [EMAIL PROTECTED] / 2006-10-19 16:05:58 -0500: > try > { > $objStatement->execute($arrParams); > $intID = $objStatement->fetchColumn(); > $objStatement->closeCursor(); > } > catch (PDOException $objEx) > { > error_log(get_class($objEx)); > // Actually handle the exception > } > > The query runs a stored procedure which sometimes results in an > (expected) error condition which the catch block handles. It all works > perfectly, with one exception: Inbetween the call to fetchColumn and the > catch block being invoked, PHP dumps a stack trace to the error log > complaining about the exception, and I can't for the life of me figure > out why or how to stop it. A wild guess: do you have xdebug enabled? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to recognise url in a block of text
Wow, that was deep but I'll try to see to what you're saying. Bunmi www.ayserve.net www.budelak.com Robin Vickery wrote: On 18/10/06, AYSERVE.NET <[EMAIL PROTECTED]> wrote: Hello Guys, I thought I was home and dry when the program worked fine on my windows but when I ran from my Linus server, I keep getting a url like: http://www.website.com/pdf/ED1.pdf%A0 instead of http://www.website.com/pdf/ED1.pdf. I'd look at the text that you're working on rather than the regexp. It looks like some characterset conversion is going wrong - 0xA0 is the latin-1 non-breaking space character. I'm expect that on your linux machine that it's being converted to %0A at some point which is perfectly valid in a URL. But I'm just guessing. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Berger table algorithm?
Hello, I'm looking for Berger table generation solution in PHP, for any (parity) number of teams. I'm working on it couple of hours, but haven't made anything useful. Please help! :) -- Szymon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird stack trace in error_log from PDOException
Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2006-10-19 16:05:58 -0500: >> try >> { >> $objStatement->execute($arrParams); >> $intID = $objStatement->fetchColumn(); >> $objStatement->closeCursor(); >> } >> catch (PDOException $objEx) >> { >> error_log(get_class($objEx)); >> // Actually handle the exception >> } >> >> The query runs a stored procedure which sometimes results in an >> (expected) error condition which the catch block handles. It all works >> perfectly, with one exception: Inbetween the call to fetchColumn and the >> catch block being invoked, PHP dumps a stack trace to the error log >> complaining about the exception, and I can't for the life of me figure >> out why or how to stop it. > > A wild guess: do you have xdebug enabled? > BINGO! Excellent, thanks for that. I'd never even considered xdebug. I only really have it installed for coverage in phing. I suppose I really should check out what else xdebug can do as it might be handy. Thanks again! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Check HTML style sheet?
For PHP, the HTML is pretty much a bunch of chars (a string) and nothing more, which that lets with one (initial) option: search the HTML for a given string. Marc Roberts wrote: Is it possible to use php to check that the .css file in the html of a web page is the correct one e.g. check if the file included in the html is new.css. I think I will have to write a regex but if anyone has any ideas (or already has a regex to do this), it would be much appreciated. Thanks, Marc -- Atentamente / Sincerely, J. Rafael Salazar MagaƱa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: A problem with dates
Dave Goodchild wrote: > Hi all. I have an online events directory and am having some issues with > date calculations. I have a table of dates (next year) and an events table > - which have a many to many relationship and so use an intermediary > mapping table called dates_events. All good - when the user enters a > single, multi-day, daily or monthly event the event is entered into its > table and some calculations done to enter values in the mapping table. > When I perform a search all the events fall on their specified dates. > > Apart from weekly events that is. When a user enters a weekly event, the > system looks at the start and end dates, finds out the ids of all the > dates in the date table in increments of 7, and adds the mappings. > > When the weekly events are viewed, every 4 weeks they shift forward by one > day over the week. There is some kind of ominous pattern here, but the > maths is very simple (increment by 7) and so i thought I'd see if anyone > can spot this right away before I dedicate my weekend to poring through > PHP and mySQL date maths. > > Thanks in advance! > Have you checked that daylight saving times changes don't interfere with your calculations? Cheers -- David Robley It's not the principle of the thing, it's the money Today is Setting Orange, the 3rd day of The Aftermath in the YOLD 3172. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] One-page password-protected file
I'm in the horrible situation where I need a one-page script to hold it's own password and validate itself. I coded this together, I want this lists opinion as to whether or not it holds water, considering the circumstance: The idea is that the user could call the page like this: http://server.com/directory/page.php/MyPassword and the page would refresh to not show his password, yet keep him logged in. Thanks for any and all input. Dotan Cohen http://nanir.com http://what-is-what.com/what_is/html.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: One-page password-protected file
On 21/10/06, Dotan Cohen <[EMAIL PROTECTED]> wrote: I'm in the horrible situation where I need a one-page script to hold it's own password and validate itself. I coded this together, I want this lists opinion as to whether or not it holds water, considering the circumstance: The idea is that the user could call the page like this: http://server.com/directory/page.php/MyPassword and the page would refresh to not show his password, yet keep him logged in. Thanks for any and all input. I should probably add more detail. I didn't want even the sha1 hashed password stored on in the cookie, so the sha1 hash is sha1 hashed again. That way, the password is not stored in plain text anywhere, and the sha1 hash of the password is stored only on the server. Like said, the file must be self-contained. What do the list memebers think of this solution? Thanks. Dotan Cohen http://lahes.com http://what-is-what.com/what_is/open_office.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Check HTML style sheet?
Marc Roberts wrote: Is it possible to use php to check that the .css file in the html of a web page is the correct one e.g. check if the file included in the html is new.css. I think I will have to write a regex but if anyone has any ideas (or already has a regex to do this), it would be much appreciated. Thanks, Marc Be more specific. What determines "the correct one"? Is there a list of the correct ones some place? Do you want to see if the css file name in the html header exist in the directory? What? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing serialized PHP arrays in "C"
I have a feeling this may be the wrong group to ask this question, but I thought that if it is, someone can point me in the right direction. I'm working on a application written in "C" that needs to parse and understand php arrays that have been serialized and stored in a MySQL table. I started writing the parser and realized its not a trivial task. I'm wondering if there is any source code in C to do what I'm looking for? I googled many different combinations of keywords and nothing useful came up. I even looked at the code in ext/standard/var_unserializer.c, and I don't think what will port to a stand alone application without extensive modifications. Any help would be greatly appreciated. Thanks, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IP Address
Is there a function which returns the IP address of the requestor of the current page? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IP Address
On Sat, 21 Oct 2006 19:55:17 -0400 Fred Moses <[EMAIL PROTECTED]> wrote: > Is there a function which returns the IP address of the requestor of the > current page? > > -- Don't think so but there is a superglobal that contains it: $_SERVER['REMOTE_ADDR'] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing serialized PHP arrays in "C"
Kevin Wilcox wrote: I have a feeling this may be the wrong group to ask this question, but I thought that if it is, someone can point me in the right direction. I'm working on a application written in "C" that needs to parse and understand php arrays that have been serialized and stored in a MySQL table. I started writing the parser and realized its not a trivial task. I'm wondering if there is any source code in C to do what I'm looking for? I googled many different combinations of keywords and nothing useful came up. I even looked at the code in ext/standard/var_unserializer.c, and I don't think what will port to a stand alone application without extensive modifications. Why not? It is a rather simple re2c parser. Don't look at var_unserializer.c, look at var_unserializer.re and read up on re2c. http://re2c.org/ You would obviously want to replace the creation of internal PHP data types with whatever you want to unserialize to in your app, but I don't see how you would find any code somewhere else where you wouldn't need to yank out the destination code from since that is going to be the unique part in each implementation. And if you use the same re2c grammar that PHP uses, it will be correct. Using any other implementation likely wouldn't be. Of course, I also wouldn't suggest using serialized PHP for a target that wasn't PHP. Why don't you look at json or perhaps wddx instead? -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php