php-general Digest 8 Sep 2009 21:39:48 -0000 Issue 6329

Topics (messages 297786 through 297797):

Re: Return XML attribute in DOM
        297786 by: Peter Ford
        297787 by: Matthew Croud

Recursion And Serialization - Solved
        297788 by: Andrea Giammarchi

Re: new php script and sqlite
        297789 by: Paul M Foster
        297793 by: Eric Boo

Re: how to check function's execution?
        297790 by: Bob McConnell

Re: Displaying image paths with spaces
        297791 by: Bob McConnell

Re: Converting URL's to hyperlinks.
        297792 by: LuKreme

Re: Calendar tutorial
        297794 by: tedd

mysql user session handler
        297795 by: Tom Worster
        297796 by: Devendra Jadhav

Renaming a Directory
        297797 by: Floyd Resler

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:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Matthew Croud wrote:
>>> Doesn't the DOM have the getAttribute() method?
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
> 
> It's not in my reference, though I see it in the PHP manual now.
> This is what I have:
> 
> _____________________________
> 
> $dom = new DomDocument();
> $dom -> load("items.xml");
> 
> $topics = $dom -> getElementsByTagName("item");
> 
> echo("<ul>");
> foreach ($topics as $node )
> {
>     echo("<li>". $node -> hasAttributes() ."</li>");   
> }
> echo("</ul>");
> 
> ______________________________
> 
> I'm replacing hasAttributes() with getAttribute() but its throwing me an
> error, I'm probably using it incorrectly.
> I think I'm drowning in the deep end =/
> Could you advise Gamesmaster ?


It's a method on DomElement:
http://uk3.php.net/manual/en/function.domelement-get-attribute.php

and you need to tell it which attribute to get... :)

-- 
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--- End Message ---
--- Begin Message ---

Cheers Guys,
Your the greatest !



On 8 Sep 2009, at 09:08, Peter Ford wrote:

Matthew Croud wrote:
Doesn't the DOM have the getAttribute() method?

Thanks,
Ash
http://www.ashleysheridan.co.uk

It's not in my reference, though I see it in the PHP manual now.
This is what I have:

_____________________________

$dom = new DomDocument();
$dom -> load("items.xml");

$topics = $dom -> getElementsByTagName("item");

echo("<ul>");
foreach ($topics as $node )
{
   echo("<li>". $node -> hasAttributes() ."</li>");
}
echo("</ul>");

______________________________

I'm replacing hasAttributes() with getAttribute() but its throwing me an
error, I'm probably using it incorrectly.
I think I'm drowning in the deep end =/
Could you advise Gamesmaster ?


It's a method on DomElement:
http://uk3.php.net/manual/en/function.domelement-get-attribute.php

and you need to tell it which attribute to get... :)

--
Peter Ford                              phone: 01580 893333
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


Matthew Croud
Studio

Obvious Print Solutions Limited
Unit 3 Abbeygate Court
Stockett Lane
Maidstone
Kent
ME15 0PP

T | 0845 094 9704
F | 0845 094 9705
www.obviousprint.com






--- End Message ---
--- Begin Message ---
I do not know why php.net is not publishing yet the link I posted in specific 
page, but if you want to resolve serialized recursion problem or you just want 
to better understand the problem and possible solutions, you may be interested 
in this post:

http://webreflection.blogspot.com/2009/09/php-serialization-and-recursion.html

Regards

_________________________________________________________________
Show them the way! Add maps and directions to your party invites. 
http://www.microsoft.com/windows/windowslive/products/events.aspx

--- End Message ---
--- Begin Message ---
On Tue, Sep 08, 2009 at 11:20:01AM +0800, Eric Boo wrote:

> Hi,
> 
> I'm currently using a text file to store data which the php script
> will read and write back to. I've a few questions:
> 
> 1) I'm thinking of using sqlite, but not sure whether this will be
> widely available on most hosts, as I intend for the php script to be
> deployed without needing to much with much configuration. Is sqlite
> included with most php setups?

As I understand it, sqlite support is by default built into PHP. If so,
then it should be supported anywhere.

> 
> 2) Should I be using sqlite 2 or 3?

Don't use version 2. It's deprecated.

Paul

-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---
On Tue, Sep 8, 2009 at 9:41 PM, Paul M Foster<[email protected]> wrote:
> On Tue, Sep 08, 2009 at 11:20:01AM +0800, Eric Boo wrote:
>
>> Hi,
>>
>> I'm currently using a text file to store data which the php script
>> will read and write back to. I've a few questions:
>>
>> 1) I'm thinking of using sqlite, but not sure whether this will be
>> widely available on most hosts, as I intend for the php script to be
>> deployed without needing to much with much configuration. Is sqlite
>> included with most php setups?
>
> As I understand it, sqlite support is by default built into PHP. If so,
> then it should be supported anywhere.

Thanks for your reply.

I was under the impression that sqlite2 was supported widely by PHP,
but sqlite3 seems only to be enabled on php 5.3.0 by default.

My concern now is actually that users may find that their hosting
service providers don't provide sqlite3 out of the box.

Eric

>
>>
>> 2) Should I be using sqlite 2 or 3?
>
> Don't use version 2. It's deprecated.
>
> Paul
>
> --
> Paul M. Foster
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
From: A.a.k
> 
> hello
> I have a problem to check whether a function successfully inject to
database 
> or not, here is the code :
>    if($object->dbupdate())
>        echo 'done';
>      else
>         echo 'damn!';
> inside the 'if' statement $obj->dbupdate() doesn't execute , how can I

> execute and check if it was a successful inject within this function?
is it 
> even possible or should I check within class or something? 

I normally would have dbupdate() do something like:

    $temp_set = pg_query($conn, $Sql);
    $numRows = pg_affected_rows($temp_set);
    return $numRows;

There should be something similar available in the other database APIs.

Bob McConnell

--- End Message ---
--- Begin Message ---
From: Skip Evans
> HallMarc Websites wrote:
>> Actually, %5C is a \ character, % is %25 
>> Why it is adding a character that is used in local address strings is
>> baffling and I think a clue as to what is going on. Is it possible it
is
>> mashing a local file address into a web address? 
> 
> Aha! I think that might be it. In the database it is stored as
> 
>
src="/clients/client_118/images//Event%20images/Show%20ads/catspaw1compr
essed.jpg"
> 
> But somehow it is converting this to a local file address 
> before it is displayed.

That's the job of the browser. It takes those entities and converts them
to displayable characters. You might want to look at the htmlentities()
and related functions to put it back into the encoded version.

Bob McConnell

--- End Message ---
--- Begin Message ---
On 4-Sep-2009, at 14:49, Daevid Vincent wrote:
I've used this code for about 6 years now and have yet to find emails that
it didn't work for. If someone has some funky (whacky) RFC extremity,

It's attitudes like this that make the web such a wonderful place. When I encounter a website the rejects my email address for being 'invalid" I simply NEVER GO THERE AGAIN. And your preg-replace would reject every email address I ever input into any web form.

As a note, this will also fail on domains like http://✪df.ws/, but I guess Daring Fireball is an 'edge case' funky whacky RFC extremity…

--
and I lift my glass to the Awful Truth / which you can't reveal to
        the Ears of Youth / except to say it isn't worth a dime


--- End Message ---
--- Begin Message ---
At 8:47 PM -0700 9/7/09, Haig Davis wrote:
Dear PHP List Members,

First off I am well aware that I can go online and download a PHP script to
make a Calendar, it's not that I'm too cheap to buy the script it is that I
want to work through and fully understand what I have so that I am
intimately aware of every aspect of my project. What I really would like is
a tutorial that will teach me to write the script for a calendar (or at
least get me started) that will allow me to schedule various multi day
events and write the requests to a mySQL database. I would prefer something
that is PHP/ mySQL, HTML and CSS no flash or Java. If any one knows of a
site on the web I could find such a tutorial please let me know.

Many Thanks

Haig Vancouver BC

Haig:

The "best" tutorial I would think would be to review code that someone already did. That way not only do you get a working example, you can also learn and improve it on your own.

Check out:

http://www.php-calendar.com/

Here's an example of it working:

http://php1.net/my-php-calendar/

I've had good luck with it and have been able to change things as I wanted.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
questions for those of you with a user session handler using mysql:

did you write your own handler, write one based off some other you found (if
so, which?), or are you using some available library (if so, which?)?

and how do you feel about your implementation? satisfied? or are there
improvements you'd like to have?

and what serializer do you use?

i have my own set of handler functions (less than 70 loc) which seem to work
in simple testing. but, while i'd really like to have the sessions in the db
for redundancy, i haven't had the courage to deploy it yet. i derived the
code from something i found on the web. i trust everything i read on the
internet ;-)

-tom




--- End Message ---
--- Begin Message ---
http://www.devshed.com/c/a/PHP/Storing-PHP-Sessions-in-a-Database/


On Tue, Sep 8, 2009 at 10:53 PM, Tom Worster <[email protected]> wrote:

> questions for those of you with a user session handler using mysql:
>
> did you write your own handler, write one based off some other you found
> (if
> so, which?), or are you using some available library (if so, which?)?
>
> and how do you feel about your implementation? satisfied? or are there
> improvements you'd like to have?
>
> and what serializer do you use?
>
> i have my own set of handler functions (less than 70 loc) which seem to
> work
> in simple testing. but, while i'd really like to have the sessions in the
> db
> for redundancy, i haven't had the courage to deploy it yet. i derived the
> code from something i found on the web. i trust everything i read on the
> internet ;-)
>
> -tom
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Devendra Jadhav

--- End Message ---
--- Begin Message --- How can I rename a directory with files in it? The rename function gives me a "directory not empty" error. I know I could do it be creating the directory, moving the files, and then deleting the old one. Is there an easier way?

Thanks!
Floyd


--- End Message ---

Reply via email to