php-general Digest 21 Oct 2006 23:25:55 -0000 Issue 4414

Topics (messages 243421 through 243429):

Re: How to recognise url in a block of text
        243421 by: AYSERVE.NET

Berger table algorithm?
        243422 by: Szymon

Re: Weird stack trace in error_log from PDOException
        243423 by: Russ Brown

Re: Check HTML style sheet?
        243424 by: Rafael
        243428 by: Al

Re: A problem with dates
        243425 by: David Robley

One-page password-protected file
        243426 by: Dotan Cohen
        243427 by: Dotan Cohen

Parsing serialized PHP arrays in "C"
        243429 by: Kevin Wilcox

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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!

--- End Message ---
--- Begin Message --- 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

--- End Message ---
--- Begin Message ---
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?

--- End Message ---
--- Begin Message ---
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. 

--- End Message ---
--- Begin Message ---
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:

<?php

$sha1_pw="5218lm849l394k1396dip4'2561lq19k967e'30";

if ( $_COOKIE["password"] != sha1($sha1_pw) ) {
   $varis=explode("/",$PATH_INFO);
   $pre_password=explode("&",$varis[1]);
   if ( sha1( substr($pre_password[0],0) ) == $sha1_pw ) {
       setcookie("password", sha1($sha1_pw) );
       header("Location: ".$_SERVER["SCRIPT_NAME"]."/".rand(999,99999));
       exit;
   } else {
       print "Fvck Off";
       exit;
   }
}

// REST OF PAGE

?>

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

--- End Message ---
--- Begin Message ---
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:

<?php

$sha1_pw="5218lm849l394k1396dip4'2561lq19k967e'30";

if ( $_COOKIE["password"] != sha1($sha1_pw) ) {
    $varis=explode("/",$PATH_INFO);
    $pre_password=explode("&",$varis[1]);
    if ( sha1( substr($pre_password[0],0) ) == $sha1_pw ) {
        setcookie("password", sha1($sha1_pw) );
        header("Location: ".$_SERVER["SCRIPT_NAME"]."/".rand(999,99999));
        exit;
    } else {
        print "Fvck Off";
        exit;
    }
}

// REST OF PAGE

?>

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

--- End Message ---
--- Begin Message ---
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

--- End Message ---

Reply via email to