php-general Digest 9 Sep 2008 15:19:26 -0000 Issue 5672

Topics (messages 279709 through 279732):

running a very long process from php
        279709 by: Rene Veerman
        279716 by: Nathan Rixham
        279717 by: Per Jessen

Re: CSV output.
        279710 by: Eric Gorr

Re: Using DOM textContent Property
        279711 by: Mario Trojan

Re: Length of Exception text?
        279712 by: Peter Ford
        279718 by: Jochem Maas

Re: Interntet Explorer 8 beater 2
        279713 by: Colin Guthrie

unsubscibe
        279714 by: songtao zheng

Zend Platform
        279715 by: Nathan Rixham

Regex help
        279719 by: Jason Pruim
        279720 by: Nathan Rixham
        279722 by: Jason Pruim
        279723 by: Nathan Rixham
        279726 by: Per Jessen
        279727 by: Boyd, Todd M.
        279728 by: Jason Pruim

Re: PHP Equivalent of JavaScript whatever.toFixed(2)
        279721 by: Jochem Maas
        279724 by: Nathan Rixham

Re: PHP RSS to email
        279725 by: Nathan Rixham
        279731 by: Richard Heyes

SimpleXML strange behaviour.
        279729 by: Mirco Soderi

Re: Problem of Connection Character Sets and Collations
        279730 by: Eric Butera

Re: Shopping Carts/Checkout Software
        279732 by: Charlene

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 ---
Hi.

For my CMS, i need to do imports of photos and videos.
For uploading large files i have a Java FTP applet with automated resume, so
no problems there.

But: unzipping them and importing them might take a long time if it's a
large batch (1000s of pictures/videos).

Currently i split this up by importing only 1 item per php call from the
browser, to get around the hoster's limitation of 30s php timeout.
But since my hoster wont support video-importing (ffmpeg) anyhow, i have
decided to do some tasks from my home server over which i have total
control.

I'd also like to get rid of the requirement to have a browser open during
the import process.
Not only is it cumbersome for the user, if the internet connection fails
then the import is interrupted too.

I'm considering to (after ftp has completed) call a php script on my
homeserver that calls scripts on the hoster.
Scripts on the hoster would write status-info to a file, which is then read
from the originating browser.
And if a video-file is encountered, my homeserver downloads it, then ffmpegs
the meta-info and thumbnails, uploads those results to the hoster, calls a
'receiver' script on the hoster to put the thumbnails and meta-info in the
database..

Good idea?
Or do you have a better one? :)

--- End Message ---
--- Begin Message ---
Rene Veerman wrote:
Hi.

For my CMS, i need to do imports of photos and videos.
For uploading large files i have a Java FTP applet with automated resume, so
no problems there.

But: unzipping them and importing them might take a long time if it's a
large batch (1000s of pictures/videos).

Currently i split this up by importing only 1 item per php call from the
browser, to get around the hoster's limitation of 30s php timeout.
But since my hoster wont support video-importing (ffmpeg) anyhow, i have
decided to do some tasks from my home server over which i have total
control.

I'd also like to get rid of the requirement to have a browser open during
the import process.
Not only is it cumbersome for the user, if the internet connection fails
then the import is interrupted too.

I'm considering to (after ftp has completed) call a php script on my
homeserver that calls scripts on the hoster.
Scripts on the hoster would write status-info to a file, which is then read
from the originating browser.
And if a video-file is encountered, my homeserver downloads it, then ffmpegs
the meta-info and thumbnails, uploads those results to the hoster, calls a
'receiver' script on the hoster to put the thumbnails and meta-info in the
database..

Good idea?
Or do you have a better one? :)

sounds like it's time to get your own dedicated server to be honest; in the time it takes you to do that semi-manual process I'm sure you could easily do a couple of jobs to fund the server if needs be;

Many Regards

Nathan

--- End Message ---
--- Begin Message ---
Nathan Rixham wrote:

> sounds like it's time to get your own dedicated server to be honest;

Yeah, that was my first thought too. 

> in the time it takes you to do that semi-manual process I'm sure you
> could easily do a couple of jobs to fund the server if needs be;

They're not even very expensive - how about EUR50/month for a dual-core
AMD with 2Gb RAM, dual 400GB SATA disks and unlimited bandwidth. 


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
What variable contains the number?
How _exactly_ are you assigning the number to the variable?
How _exactly_ are you writing the data to the CSV file?

I tried looking up a function 'dump' at php.net and didn't turn up anything. How is dump implemented?


On Sep 8, 2008, at 6:16 PM, Tom Shaw wrote:

This statement _is_ correct. I see values such as 234.55, but not 234.00 in
the CSV file and when I dump the data.
55.00 will equal 55 when it should equal 55.00. 234.00 shows up as 234. The
data is fine it just simple does not show up
correctly in the CSV file.

$out
.="".$name.",".$description.",".$size.",".$stock.",".$price.",". $total_cost.
"";
$out .= "\n";

}
                
dump($out); This prints the correct data.
exit();
                                
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=inventory_report.csv");

print $out; This prints wrong.

-----Original Message-----
From: Eric Gorr [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2008 4:21 PM
To: PHP General
Subject: Re: [PHP] CSV output.


On Sep 8, 2008, at 5:06 PM, Tom Shaw wrote:

Actually that won't work I tried it. For some reason the .00 shows
up when I
try to manually add a .00. I know weird.

Did you mean to say that it .00 _doesn't_ show up when you try to
manually add a .00?

The value is in the array or string
before outputting printing to CSV. Number format does not work either.


And just to clarify...in your .csv file, you do see values such as
234.55, but not 234.00.

I can promise you that if you fprintf( $fp, "234.00" ), you will see
234.00 in your file.

So, the question becomes, what _exactly_ are you doing when you are
writing this stuff out.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Hi Nathan,

if you're already speaking of iterating children, i'd like to ask you another question:

Basically i was trying to do the same thing as Tim, when i experienced some difficulties iterating over DOMElement->childNodes with foreach and manipulating strings inside the nodes or even replacing DOMElement/DOMNode/DOMText with another node. Instead, i am currently iterating like this:

$child = $element->firstChild;
while ($child != null) {
        $next_sibling = $child->nextSibling;

        // Do something with child (manipulate, replace, ...)
        
        // Continue iteration
        $child = $next_sibling
}

Is this correct, or is there any better way?

Thank you in advance!
Mario


Nathan Nobbe schrieb:
bouncing back to the list so that others may benefit from our work...

On Fri, Sep 5, 2008 at 3:09 PM, Tim Gustafson <[EMAIL PROTECTED]> wrote:

Nathan,

Thanks for the suggestion, but it's still not working for me.  Here's my
code:

===========
$HTML = new DOMDocument();
@$HTML->loadHTML($text);
$Elements = $HTML->getElementsByTagName("*");

for ($X = 0; $X < $Elements->length; $X++) {
  $Element =  $Elements->item($X);

 if ($Element->tagName == "a") {
   # SNIP - Do something with A tags here
 } else if ($Element instanceof DOMText) {
   echo $Element->nodeValue; exit;
 }
}
===========

This loop never executes the instanceof part of the code.  If I add:

 } else if ($Element instanceof DOMNode) {
   echo "foo!"; exit;
 }

Then it echos "foo!" as expected.  It just seems that none of the nodes in
the tree are DOMText nodes.  In fact, get_class($Element) returns
"DOMElement" for every node in the tree.


Tim,

i got your code working with minimal effort by pulling in two of the methods
i posted and making some revisions.  scope it out,
(this will produce the same output as my last post (the part after OUT:))

<?php
$text = '<html><body>Test<br><h2>[EMAIL PROTECTED]<a name="bar">stuff
inside the link</a>Foo</h2><p>care</p><p>yoyser</p></body></html>';
$HTML = new DOMDocument();
$HTML->loadHTML($text);
$Elements = $HTML->getElementsByTagName("*");

for ($X = 0; $X < $Elements->length; $X++) {
 $Element =  $Elements->item($X);
 if($Element->hasChildNodes())
    foreach($Element->childNodes as $curChild)
     if ($curChild->nodeName == "a") {
       # SNIP - Do something with A tags here
     } else if ($curChild instanceof DOMText) {
      convertToLinkIfNecc($Element, $curChild);
     }
}
echo $HTML->saveXML() . PHP_EOL;


function convertToLinkIfNecc(DomElement $textContainer, DOMText $textNode) {
    if( (strtolower($textContainer->nodeName) != 'a') &&
        (filter_var($textNode->nodeValue, FILTER_VALIDATE_EMAIL) !== false)
) {
        convertMailtoToAnchor($textContainer, $textNode);
    }
}
function convertMailtoToAnchor(DomElement $textContainer, DOMText $textNode)
{
    $newNode = new DomElement('a', $textNode->nodeValue);
    $textContainer->replaceChild($newNode, $textNode);
    $newNode->setAttribute('href', "mailto:{$textNode->nodeValue}");
}
?>

so, the problem is iterating over a tree structure will only show you whats
at the first level of the tree.  this is why you need to call
hasChildNodes(), and if that is true, call childNodes() and iterate across
that (and really, the code should be doing the same thing there as well,
calling hasChildNodes() and iterating over the results of childNodes()).
the code i have shown will work for the html i posted, however it wont work
on (x)html where these text nodes we're searching for are deeper in the tree
than the second level.  im sure you can cook up something that will recurse
down to the leafs :)
anyway, im going to try and hook up a RecursiveDOMDocumentIterator that
implements RecursiveIterator so that it has the convenient foreach support.
also, ill probly try to hook up a Filter varient of this class so that
situations like this are trivial.

stay tuned :D

-nathan


--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
ANR Daemon schreef:
Greetings, Jochem Maas.
In reply to Your message dated Sunday, September 7, 2008, 20:56:37,

I've been working on some PEAR-based app last week and I ran into problem.
While I debugging app, my backtrace always trimmed at some point.
First time I though it was my mistake, and switched back to standard
"Exception" class.
But nothing changed.

If I print everything by hands, it's all full and good, but if I let PHP print

what do you mean by:

1. print by hand

Catch excetion and manually call getTraceAsString.

2. let PHP print

Do not catch exception, let PHP behave on it's own way.

are you printing to screen or to error_log (or syslog)? I believe error_log has a limit as to the length of the string that will actually be logged ... I can't remember whether this
was php, apache or system related.

You want the php.ini setting:

log_errors_max_len

It defaults to 1024 characters: presumably that includes the preamble giving you 1015 or so to play with.

If you set it to zero then you get unlimited log messages. 'course that might fill your logs up a bit...


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

--- End Message ---
--- Begin Message ---
Peter Ford schreef:
Jochem Maas wrote:
ANR Daemon schreef:
Greetings, Jochem Maas.
In reply to Your message dated Sunday, September 7, 2008, 20:56:37,

I've been working on some PEAR-based app last week and I ran into problem.
While I debugging app, my backtrace always trimmed at some point.
First time I though it was my mistake, and switched back to standard
"Exception" class.
But nothing changed.

If I print everything by hands, it's all full and good, but if I let PHP print

what do you mean by:

1. print by hand

Catch excetion and manually call getTraceAsString.

2. let PHP print

Do not catch exception, let PHP behave on it's own way.

are you printing to screen or to error_log (or syslog)? I believe error_log has a limit as to the length of the string that will actually be logged ... I can't remember whether this
was php, apache or system related.

You want the php.ini setting:

log_errors_max_len

It defaults to 1024 characters: presumably that includes the preamble giving you 1015 or so to play with.

ah yes, good catch. I think I wrote the syslog wrapper because I didn't
have control over that setting at the time.


If you set it to zero then you get unlimited log messages. 'course that might fill your logs up a bit...

disk space is cheap :-) besides a decent setup should be rotating the logs,
so your pretty safe from filling up the disk (assuming your logs aren't dumped
to a seperate partition ... which is probably a good idea anyway ... to avoid
crashing the whole system ... although I vaguely recall that apache might
stop functioning if it can't write logs anymore ... again, not sure about that
at all.




--- End Message ---
--- Begin Message ---
Ross McKay wrote:
Jochem Maas wrote:

how do you handle licensing/activation in these VMs?
I have parallels on my Mac and a 'proper' bootcamp install of WinXP
which I need for work ... and I'm not about to screw with that install
for the sake of testing another POS version of IE.

You need a license for each instance of XP that you run. AFAIK, you only
need one license to multi-boot XP on a single computer (but you should
check that!) so I don't see why it would be any different for multiple
images run singly in a VM.

I somehow doubt it, but that would be nice. I certainly wouldn't have any moral qualms about it, but not sure if MS lawyers would see it lat way. That said, if you use a VM system that support snapshots, then you can have a faily convenient sacrificial install that you can play with this kind of thing. That said, it's still not useful. [Edit: I see you wrote pretty much the same thing at the end of your mail ;)]

NB: I'm talking XP here; I vaguely recall something about the Vista EULA
(spit!) specifically excluding installation in a non-MS VM, so you'd
need to check with your lawyers on that one... :/

I think I remember reading that they relaxed their VM licensing stance... Having never installed Vista and having no intention of touching it with a 10ft barge pole, I can't say I care!


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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

--- End Message ---
--- Begin Message ---
Morning All,

Short and sweet; does anybody have any practical experience; thoughts or case studies in regards to implementing the Zend Platform.

Many Regards

Nathan

--- End Message ---
--- Begin Message ---
Hey everyone,

Not completely specific to php but I know you guys know regex's better then I do! :)

I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112

Here are my current matching patterns:

RewriteRule /(.*) "/volumes/raider/webserver/ documents/dev/schreurprinting.com/p.php?purl=$
#               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
# RewriteRule /(mail.php?purl=*) "/ purl.schreurprinting.com/mail.php?purl=$1"

Yes I am doing this for apache's mod_rewrite, but my question is much more specific to regex's at this point :)

Any ideas where I am going wrong? it seems like it should be fairly simple to do, but I don't know regex's at all :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
Jason Pruim wrote:
Hey everyone,

Not completely specific to php but I know you guys know regex's better then I do! :)

I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112

Here are my current matching patterns:

RewriteRule /(.*) "/volumes/raider/webserver/documents/dev/schreurprinting.com/p.php?purl=$
#               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
# RewriteRule /(mail.php?purl=*) "/purl.schreurprinting.com/mail.php?purl=$1"

Yes I am doing this for apache's mod_rewrite, but my question is much more specific to regex's at this point :)

Any ideas where I am going wrong? it seems like it should be fairly simple to do, but I don't know regex's at all :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]


RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]

prehaps

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

On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:

Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112
Here are my current matching patterns:
RewriteRule /(.*) "/volumes/raider/webserver/ documents/dev/schreurprinting.com/p.php?purl=$
#               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
# RewriteRule /(mail.php?purl=*) "/ purl.schreurprinting.com/mail.php?purl=$1" Yes I am doing this for apache's mod_rewrite, but my question is much more specific to regex's at this point :) Any ideas where I am going wrong? it seems like it should be fairly simple to do, but I don't know regex's at all :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]

RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]

Just tried it, and it pops up with a 404... I'll keep looking.

One other thing that I should probably add is the fact that the ^jasonpruim112$ could have hundreds of counterparts.... ^bobsmith112$ ^jerrybob112$ etc... etc...

Thanks for looking though!



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
Jason Pruim wrote:

On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:

Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112
Here are my current matching patterns:
RewriteRule /(.*) "/volumes/raider/webserver/documents/dev/schreurprinting.com/p.php?purl=$
#               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
# RewriteRule /(mail.php?purl=*) "/purl.schreurprinting.com/mail.php?purl=$1" Yes I am doing this for apache's mod_rewrite, but my question is much more specific to regex's at this point :) Any ideas where I am going wrong? it seems like it should be fairly simple to do, but I don't know regex's at all :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]

RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]

Just tried it, and it pops up with a 404... I'll keep looking.

One other thing that I should probably add is the fact that the ^jasonpruim112$ could have hundreds of counterparts.... ^bobsmith112$ ^jerrybob112$ etc... etc...

Thanks for looking though!



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]




here's a typical rule; probably best to modify what works and go from there :)

RewriteRule ^directory/(.*)$ /newdirectory/$1 [L]

the other alternative is to let php handle it..
this is basicaly if request isn't a file or a directory route to a php handler [my prefered way]:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /notfound_handler.php [L]

--- End Message ---
--- Begin Message ---
Jason Pruim wrote:

> 
> On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
> 
>> Jason Pruim wrote:
>>> Hey everyone,
>>> Not completely specific to php but I know you guys know regex's
>>> better then I do! :)
>>> I am attempting to match purl.schreurprinting.com/jasonpruim112 to
>>> purl.schreurprinting.com/p.php?purl=jasonpruim112
>>> Here are my current matching patterns:
>>>                RewriteRule /(.*) "/volumes/raider/webserver/
>>> documents/dev/schreurprinting.com/p.php?purl=$
>>> #               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
>>> #               RewriteRule /(mail.php?purl=*) "/
>>> purl.schreurprinting.com/mail.php?purl=$1"
>>> Yes I am doing this for apache's mod_rewrite, but my question is
>>> much more specific to regex's at this point :)
>>> Any ideas where I am going wrong? it seems like it should be fairly
>>> simple to do, but I don't know regex's at all :)
>>> --
>>> Jason Pruim
>>> Raoset Inc.
>>> Technology Manager
>>> MQC Specialist
>>> 11287 James St
>>> Holland, MI 49424
>>> www.raoset.com
>>> [EMAIL PROTECTED]
>>
>> RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]
> 
> Just tried it, and it pops up with a 404... I'll keep looking.
> 
> One other thing that I should probably add is the fact that the
> ^jasonpruim112$ could have hundreds of counterparts.... ^bobsmith112$
> ^jerrybob112$ etc... etc...
> 

Maybe this:

RewriteCond %{REQUEST_URI} !^/p\.php
RewriteRule ^/(.+)$ /p.php?purl=$1


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jason Pruim [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 09, 2008 7:30 AM
> To: PHP-General List
> Subject: [PHP] Regex help
> 
> Hey everyone,
> 
> Not completely specific to php but I know you guys know regex's
> better then I do! :)
> 
> I am attempting to match purl.schreurprinting.com/jasonpruim112 to
> purl.schreurprinting.com/p.php?purl=jasonpruim112
> 
> Here are my current matching patterns:
> 
>                  RewriteRule /(.*) "/volumes/raider/webserver/
> documents/dev/schreurprinting.com/p.php?purl=$
> #               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
> #               RewriteRule /(mail.php?purl=*) "/
> purl.schreurprinting.com/mail.php?purl=$1"
> 
> Yes I am doing this for apache's mod_rewrite, but my question is much
> more specific to regex's at this point :)
> 
> Any ideas where I am going wrong? it seems like it should be fairly
> simple to do, but I don't know regex's at all :)

http://www.regular-expressions.info ... that's how I learned. :)
Anyway... your match might be something like:

^/([^/\.]+)/?$

And the rewrite...

"/p.php?purl=$1"

To break it down, the match is looking for "The beginning of the line,
followed by a forward slash, followed by (begin capture group) 1 or more
characters that are not a forward slash or a period (end capture group)
followed by an optional forward slash, followed by the end of the line."

The rewrite is fairly straightforward.

I went 100% generic with the match due to your following e-mail that
stated "jasonpruim112" could be any username. If "112" is necessary for
the match, it would be more like:

^/([^/\.]+112)/?$

Hope this helps,


Todd Boyd
Web Programmer




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

On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote:

Jason Pruim wrote:
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
Jason Pruim wrote:
Hey everyone,
Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112
Here are my current matching patterns:
RewriteRule /(.*) "/volumes/raider/webserver/ documents/dev/schreurprinting.com/p.php?purl=$
#               RewriteRule /(*.) "/purl.schreurprinting.com/$1"
# RewriteRule /(mail.php?purl=*) "/ purl.schreurprinting.com/mail.php?purl=$1" Yes I am doing this for apache's mod_rewrite, but my question is much more specific to regex's at this point :) Any ideas where I am going wrong? it seems like it should be fairly simple to do, but I don't know regex's at all :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]

RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]
Just tried it, and it pops up with a 404... I'll keep looking.
One other thing that I should probably add is the fact that the ^jasonpruim112$ could have hundreds of counterparts.... ^bobsmith112$ ^jerrybob112$ etc... etc...
Thanks for looking though!
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]

here's a typical rule; probably best to modify what works and go from there :)

RewriteRule ^directory/(.*)$ /newdirectory/$1 [L]

the other alternative is to let php handle it..
this is basicaly if request isn't a file or a directory route to a php handler [my prefered way]:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /notfound_handler.php [L]

Interesting idea... I hadn't thought about that... Then I could just use a regex in php and grab everything after the domain name and pass it to my database to search and find the appropriate info to pull out...

I'll have to do some searching :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
Ross McKay schreef:
Arnie Shore wrote:
Folks, I need to take a given float value to, say, two decimals, as per
subject JS.  I've RTFM, but to no avail.

On Mon, 08 Sep 2008 22:03:54 +0200, Sjoerd wrote:
$str = sprintf("%01.2f", $number);

Skinning cat, method two:

$str = number_format($number, 2);

watch out with number_format() it will format according to the current locale
unless you specify the decimal and thousands seperator char explicitly ... e.g.

english: 1,000.00
dutch:   1.000,00




--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Ross McKay schreef:
Arnie Shore wrote:
Folks, I need to take a given float value to, say, two decimals, as per
subject JS.  I've RTFM, but to no avail.

On Mon, 08 Sep 2008 22:03:54 +0200, Sjoerd wrote:
$str = sprintf("%01.2f", $number);

Skinning cat, method two:

$str = number_format($number, 2);

watch out with number_format() it will format according to the current locale unless you specify the decimal and thousands seperator char explicitly ... e.g.

english: 1,000.00
dutch:   1.000,00



maybe I'm reading this wrong but
http://uk2.php.net/manual/en/function.round.php

--- End Message ---
--- Begin Message ---
Jason Pruim wrote:

On Sep 8, 2008, at 7:59 AM, Richard Heyes wrote:

Correct me if I'm wrong, but couldn't you use grab and parse the rss feeds you want, store the titles in a database, with a column for identifying if the e-mail has been sent? So every hour it checks your feeds, grabs the new
ones, checks to see if emailSent="1" if not pass it to
send_notification($email, $feedname, $feedtitle).

Of course, (if ever I've had a "doh" moment I think now would be it).
Though I'll probably use a tmp file.

I've been working almost exclusively with databases lately so all my solutions are including databases :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]




quick recommendation rss_php from rssphp.net is often faster than magpie and php5 - simplepie is also good; the old loop through and send what's new seems the way though Richard.

ps: may be worth ntoing this'd make a great open source site or even subscription service; I'd sign up for it!

Many Regards & Hope your well;

Nathan

--- End Message ---
--- Begin Message ---
> ps: may be worth ntoing this'd make a great open source site or even
> subscription service; I'd sign up for it!

I've already knocked something up. It's attached if you want it.

-- 
Richard Heyes

HTML5 Graphing for IE7, FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph

--- End Message ---
--- Begin Message ---
Do you know any reason why the following code does work


$xmlOperazioni = simplexml_load_file($xmlFilename);
foreach($xmlOperazioni->operazione as $operazione) {
   if($operazione['nome'] == $operazioneRichiesta) {
      require($operazione['php']);
      break;
   }
}

but the following does not

$xmlOperazioni = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_operazioni']);
foreach($xmlOperazioni->operazione as $operazione) {
   if($operazione->nome == $operazioneRichiesta) {
      require($operazione->php);
      break;
   }
}

that is I MUST access childrens of the element <operazione> as if it was an 
array, while (in the same page) the following code does work

$xmlViste = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_composizione_viste']);
foreach($xmlViste->vista as $vista) {
    if($vista->nome == $nomeVistaDaMostrare) {
       $smarty->assign("intestazione","componenti/".$vista->intestazione);
       $smarty->assign("menu","componenti/".$vista->menu);
       $smarty->assign("contenuto", "componenti/".$vista->contenuto);
       $smarty->assign("pie_di_pagina", "componenti/".$vista->pie_di_pagina);
       break;
    }
}

but the following does not

$xmlViste = 
simplexml_load_file($impostazioni['root']['configurazione']['generale']['xml_composizione_viste']);
foreach($xmlViste->vista as $vista) {
    if($vista['nome'] == $nomeVistaDaMostrare) {
       $smarty->assign("intestazione","componenti/".$vista['intestazione']);
       $smarty->assign("menu","componenti/".$vista['menu']);
       $smarty->assign("contenuto", "componenti/".$vista['contenuto']);
       $smarty->assign("pie_di_pagina", "componenti/".$vista['pie_di_pagina']);
       break;
    }
}

that is this time I MUST access the childrens of the element <operazione> as if 
it was an object?

--- End Message ---
--- Begin Message ---
On Sat, Sep 6, 2008 at 10:41 AM,  <[EMAIL PROTECTED]> wrote:
> php :
> Which command line is right ?
> 1, mysql_query("SET NAMES utf8");
> 2, mysql_query("SET NAMES utf-8");
>
> Many thank for your help !
>
> Edward.

On the php side look at this:

http://us3.php.net/manual/en/function.mysql-set-charset.php

That's recommended over set names.

--- End Message ---
--- Begin Message ---
Micah Gersten wrote:
ZenCart Reasons:
PHP-based
Open Source
lots if plugins
Take a look at this:
http://en.wikipedia.org/wiki/Zen_Cart

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Charlene wrote:
Micah Gersten wrote:
Try Zencart.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
It doesn't look like zencart includes a checkout system. I really need the complete system.

Otherwise, what I see at their site looks interesting. In searching for the website for zencart, I discovered a commercial product that looks like it would work and it uses XML to import product information into its system. I'm trying to figure out if zencart would use this method also.

Charlene

--- End Message ---

Reply via email to