php-general Digest 14 Dec 2004 12:33:10 -0000 Issue 3169

Topics (messages 204250 through 204282):

Re: PHP &Apache Upload file Permission denied
        204250 by: Richard Lynch
        204251 by: Michael Leung
        204252 by: Michael Leung

Re: Delivering large files via PHP (>300MB)
        204253 by: Richard Lynch

Re: Unreliable mail delivery through PHP
        204254 by: Richard Lynch
        204257 by: Chris W. Parker
        204274 by: Jason Wong

bargraph  gd not working
        204255 by: jm
        204258 by: Stan F
        204259 by: jm

Re: Close all open tags in HTML text
        204256 by: Don Read

Re: File upload problems using Apache 1.3 on Debian stable
        204260 by: Michael Leung

email processing
        204261 by: adwin wijaya

Re: Question: Repopulating form parameters
        204262 by: David Robley

Re: Automaticly Play Sound when MySql Reach some Number
        204263 by: Sejati Opreker
        204277 by: Nigel Jones

Re: Web Development Overnight!!!
        204264 by: Josh
        204270 by: GH

php.ini
        204265 by: Travis Conway
        204266 by: Travis Conway

DomXPath and default XML namespaces
        204267 by: Dan Phiffer

APC - undefined symbol: OnUpdateInt in Unknown on line 0
        204268 by: CSN

Re: [PHP-XML-DEV] DomXPath and default XML namespaces
        204269 by: Adam Maccabee Trachtenberg
        204272 by: Dan Phiffer
        204273 by: Adam Maccabee Trachtenberg
        204276 by: Christian Stocker

Using SSL
        204271 by: Daniel Lahey

Re: Text tools
        204275 by: William Stokes

divide the text
        204278 by: Ahmed Abdel-Aliem

Good and free encoder for PHP5
        204279 by: M�rio Gamito

curl libraries on Debian Woody with apache 1.3.29.0.2-6 and php 4.3.4-4
        204280 by: symbulos partners

Re: "Byte Array"
        204281 by: Ian Firla

php mysql codes insertion error.
        204282 by: Jonathan

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 ---
And apache user can read/write /tmp?

What files are in /tmp?

su to apache and see if you can read the uploaded files, and mv them to
the directory.

Michael Leung wrote:
> Hi all,
> the user is apache for PHP. the directory is owned by apache user.
> I am 100% certain for the directory name.
>
> yours,
> Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
Hi,
   Yes, apache can do read/write in /tmp.  I can't su to apache.
But I created  another account in apache group(userid test1). I have
such tests by using that account. I can do mv , cp , create new file. 
After those successful test, I have  modified httpd.conf to make 
apache web server run as test1. But they are still working like the
same error.

yours,
Michael

--- End Message ---
--- Begin Message ---
Hi,
   Yes, apache can do read/write in /tmp.  I can't su to apache.
But I created  another account in apache group(userid test1). I have
such tests by using that account. I can do mv , cp , create new file. 
After those successful test, I have  modified httpd.conf to make 
apache web server run as test1. But they are still working like the
same error.

yours,
Michael

--- End Message ---
--- Begin Message ---
Richard Davey wrote:
>    So I came up with an idea that I'd like your opinions on: I built a
>    small but friendly Windows application (<50KB in size) that will
>    connect to the web server via HTTPS, check the download credentials
>    and if all is ok, it then downloads the file via HTTP in 1MB
>    chunks. The file is just a single EXE file sat outside of my web
>    root, and the PHP script that serves the file uses fopen() to open
>    the file, then fseeks to the required section of it, reads in 1MB
>    worth of data, closes the file and then echos this out (after
>    suitable headers of course, shown below)

This sounds an awful lot like various web installers.

It's likely that there are pre-existing applications "out there" to do the
same thing as yours.

They might even support interrupted downloads better, or have other
features worth investigating.

For sure, having them be somebody else's code to be maintained has its
pros and cons.

It would be worth your time, maybe, to investigate them.  I'd suggest
starting with the traditional installer software vendors whose name you
always see when you install software.

>    I'm aware my app is for Windows only (although I could easily port
>    it to OS X), but the files they are downloading are PC games
>    anyway, so it's no bad thing in this case.

I have been known to download a Windows app on my non-Windows work
computer, and then burn a CD to take it home.

Especially if it's 300MB -- where the bandwidth of the download machine is
more important to the user than the OS on it.

Granted, that's going to be a very very very small minority of users, but
it's something to consider -- Sooner or later, you are excluding some user
somewhere by limitin the download application to Windows users.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
>     mail($to, $subject, $body, $headers);

The mail() function returns true/false upon success/failure in injecting
the email into the mail queue.

You should be grabbing and checking the return value.

It's probably not the culprit here, but is Good Programming Practice.

> Assuming all the email addresses are correct, is there anything about
> the above two functions that is incorrect or might be causing the
> unreliable'ness'? Or maybe someone has some tips for debugging this kind
> of thing?
>
> Specifically, what's happening is that I don't get the same number of
> emails as I do new users. Let's say I get an email notifying me of a new
> account, when I get to the Admin section I'll see that there are maybe
> 2, 3, or 4 accounts waiting to be approved (administrator approval is
> required in most cases). But I didn't get that many emails, I just got
> the one.

Perhaps the other emails are still "coming"?

> I haven't been able to figure out why yet. The server is not under any
> amount of load (almost no load in fact) that would cause something like
> this.

Perhaps use error_log() when an account is created, and sprinkle other
error_log() calls throughout the script to log each action/function as it
occurs.

You should be able to at least "prove" that PHP is calling the mail()
function when it should.

PS
You may want to consider setting things up so you only get one (1) email
per day with the number of users with queued actions.  Otherwise, if you
ever *DO* get a ton of accounts pouring in, your Inbox will overflow
rather quickly.

It takes little more effort to run a cron job on "new" users with not
quite active accounts and email your Admin a summary than a new email on
each user insert.

-- 
Like Music?
http://l-i-e.com/artists.htm


--- End Message ---
--- Begin Message ---
Richard Lynch <mailto:[EMAIL PROTECTED]>
    on Monday, December 13, 2004 4:09 PM said:

>>     mail($to, $subject, $body, $headers);
> 
> The mail() function returns true/false upon success/failure in
> injecting the email into the mail queue.
> 
> You should be grabbing and checking the return value.
> 
> It's probably not the culprit here, but is Good Programming Practice.

Good idea.

> Perhaps the other emails are still "coming"?

Actually, I know this to not be the case as this has been a recurring
annoyance for some time and I've yet to see a email show up late. So far
it's been on time or not at all.

And thanks for the other good suggestions!


Chris.

--- End Message ---
--- Begin Message ---
On Tuesday 14 December 2004 07:43, Chris W. Parker wrote:

>     $headers = "From: $from\n"
>               ."Reply-To: $from\n"
>               ."X-Mailer: PHP/".phpversion();

Headers should be separated by "\r\n". Not sure why you're duplicating the 
From:.

> Assuming all the email addresses are correct, is there anything about
> the above two functions that is incorrect or might be causing the
> unreliable'ness'? Or maybe someone has some tips for debugging this kind
> of thing?

Does your mailserver logs have anything to say?

Is the send_email() function being called at all? I would use trigger_error() 
or similar to write a message in the (php) log after mail() so that I would 
know for sure mail() was executed.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
BOFH Excuse #50:

Change in Earth's rotational speed
*/

--- End Message ---
--- Begin Message ---
Hi guys:
I'm using php5 on winxp with IIS. I'm trying to run a simple bar graph demo
found it on phpbuilder site. When I run it I get nothing but an x in the top
left corner of my web page(no errors nothing).
GD is uncommented in my php.ini, ext dir set and I have verified that GD is
installed through php -m,phpinfo() , and gd_info(). Can anyone offer me some
advice on how to troubleshoot this problem.
I searched google, and did see other posts like mine but no solutions. Any
thoughts or suggestions would be appreciated

--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "jm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 3:22 AM
Subject: [PHP] bargraph gd not working


> Hi guys:
> I'm using php5 on winxp with IIS. I'm trying to run a simple bar graph
demo
> found it on phpbuilder site. When I run it I get nothing but an x in the
top
> left corner of my web page(no errors nothing).
> GD is uncommented in my php.ini, ext dir set and I have verified that GD
is
> installed through php -m,phpinfo() , and gd_info(). Can anyone offer me
some
> advice on how to troubleshoot this problem.
> I searched google, and did see other posts like mine but no solutions. Any
> thoughts or suggestions would be appreciated
>

Do other php/gd scripts work as expected?
(ie display images)
Do you send the correct headers to browser?
Please show us the code cuz without it it's not so easy to help.

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

HTH
Stan F

--- End Message ---
--- Begin Message ---
Hey Stan:
None of the other php/gd scripts work either. I have just started working 
with this so at this point all I'm doing is tinkering with a bunch of 
examples .
Here's one CODE example,  and it gets called from  <img src="bargraph.php"> 
in a html page.


<?php

         // graph parameters
         $graphwidth = 400;
         $graphHeight = 200;
         $graphscale = 2;
         $graphfont = 5;
         $graphdata = 
Array("beef"=>"99","pork"=>"75","chicken"=>"15","lamb"=>"66","fish"=>"22");


        $image = imagecreate($graphwidth,$graphheight) ;

         imageantialias($image,true);

         $colorbody = imagecolorallocate($image,255,255,255);
         $colorgrid = imagecolorallocate($image,255,0,0);
         $colorbar = imagecolorallocate($image,0,255,0);
         $colortext = imagecolorallocate($image,0,0,255);

         imagefill($image,0,0,$colorbody);

         $gridlabelwidth = imagefontwidth($graphfont)*3+1;
         imageline($image,$gridlabelwidth,0,$gridlabelwidth,$graphheight - 
1,$colorgrid);

         $styledashed = 
array_merge(array_fill(0,4,$colorgrid),array_fill(0,4,IMG_COLOR_TRANSPARENT));
         imagesetstyle($image,$styledashed);

         for($index = 0;$index < $graphheight;$index += $graphheight/10)
         {
            imageline($image,0,$index,$graphwidth - 
1;$index,IMG_COLOR_STYLED);
            imagestring($image,$graphfont,0,$index,round(($graphheight - 
$index)/$graphscale),$colortext);

         }

         imageline($image,0,$graphheight - 1,$graphwidth - 1,$graphheight - 
1,$colorgrid);

         $barwidth = (($graphwidth-$graphlabelwidth)/count($graphdata)) - 
10;
         $column = 0;

         foreach($graphdata as $label=>$value)
         {
                 $bartopx = $gridlabelwidth + (($column+1) + 10) + ($column 
* $barwidth);
                 $barbottomx = $bartopx + $barwidth;
                 $barbottomy = $graphheight - 1;
                 $bartopy = $barbottomy - ($value * $graphscale);

                 
imagefilledrectangle($image,$bartopx,$bartopy,$barbottomx,$barbottomy,$colorbar);

                 $labelx = $bartopx + (($barbottomx - $bartopx)/2) - 
(imagefontheight($graphfont)/2);
                 $labely = $barbottomy - 10;

                 imagestringup($image,$graphfont,$labelx,$labely,"$label: 
$value",$colortext);
                 $column++;
         }

         //output image
         header("Content-Type: image/png");

         Imagepng($image)
         ImageDestroy($image);
?>
"Stan F" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> ----- Original Message -----
> From: "jm" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 14, 2004 3:22 AM
> Subject: [PHP] bargraph gd not working
>
>
>> Hi guys:
>> I'm using php5 on winxp with IIS. I'm trying to run a simple bar graph
> demo
>> found it on phpbuilder site. When I run it I get nothing but an x in the
> top
>> left corner of my web page(no errors nothing).
>> GD is uncommented in my php.ini, ext dir set and I have verified that GD
> is
>> installed through php -m,phpinfo() , and gd_info(). Can anyone offer me
> some
>> advice on how to troubleshoot this problem.
>> I searched google, and did see other posts like mine but no solutions. 
>> Any
>> thoughts or suggestions would be appreciated
>>
>
> Do other php/gd scripts work as expected?
> (ie display images)
> Do you send the correct headers to browser?
> Please show us the code cuz without it it's not so easy to help.
>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> HTH
> Stan F 

--- End Message ---
--- Begin Message ---
On 09-Dec-2004 Marek Kilimajer wrote:
<snipage>
> 
> not really, but it removes <script> and </script> so javascript is
> not 
> interpreted.

$txt = preg_replace('|<script[^>]*?>.*?</script>|si', '', $txt);

Regards,
-- 
Don Read                                     [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

--- End Message ---
--- Begin Message ---
Is it a permission error?
I am facing the permission problem.

--- End Message ---
--- Begin Message ---
Hi all :)


I want to create a system to process the email that coming. For example, I send a confirmation email to our client and they just simply reply the email that we send to them to verify. The problem I got, I dont know how to process the email that coming to our mailbox and process the message inside with PHP.


can someone recommend me a PHP class that has been created for handling this task ?


-- ======================= Best Regards Adwin Wijaya

www.kuya-kuya.net
www.e-rhema.net
=======================

--- End Message ---
--- Begin Message ---
On Tue, 14 Dec 2004 02:33, Jason Wong wrote:

> On Monday 13 December 2004 22:59, Ford, Mike wrote:
> 
>> > The issue was the difference between double and single quotes.
>>
>> Yes -- but you said "they are both the same", when there were *three*
>> things being displayed, and (a) you can't have both of three (b) only two
>> of the three were the same, and (c) the important comparison was between
>> the first and second, which *were* different; so it looked like you might
>> not have fully read and understood the message.  (Yes, I'm pedantic. 
>> Yes, I'm proud of it!)
> 
> It's ironic that this code:
> 
>> echo '$Ind<br>', "$Ind<br>", $Ind;
> 
> was an attempt to show which form of quotes (single or double) would give
> a literal string and was in direct response to (rummaging through the
> garbage again):
> 
>> > I could not find a difference with '$Ind', or "$Ind",
>> > except I would think '$Ind' is correct, since " "
>> > would be a literal string.
>> > 
>> > Any more hints ? :)
> 
> Apparently my hint was not obvious enough as the message seems not to have
> gotten through.
> 

Jason

Dig around under the desk and see if you can find the clue-by-four! Seems
this is a case for repeated application of same.

-- 
David Robley

Send $20 and I will double your IQ or no money back.

--- End Message ---
--- Begin Message ---
I planning to make an inventory php-mysql based
program, that need to warn my user when the stock
reach at specific mount, yeah that true playing sound
might annoyed some people around, is it posible to use
the same way if sound replace by a dialog box ?
--- Richard Lynch <[EMAIL PROTECTED]> wrote:

> Sejati Opreker wrote:
> > How do I make automaticly PHP playing a sound
> (Ogg, or
> > MP3 format file) when MySql (in Table, or Coulom)
> > reach a number (for example 5)
> 
> Errrrr.
> 
> You'd have to write a query in MySQL/PHP such as:
> $query = "select whatever = 5 from something";
> 
> Or, perhaps:
> $query = "select count(*) from something where
> whatever";
> 
> Or maybe something entirely different.  You've been
> so vague about the
> specification that we can't really say.
> 
> Then, you need to use OBJECT and EMBED tags in your
> HTML printed out by
> PHP to make the sound play.  You can count on a
> *LOT* of annoyed users
> when you automatically play an audio file, by the
> way.
> 
> The exact format of the OBJECT and EMBED tags
> depends on what format you
> want, Ogg or MP3.
> 
> Pretty much, there wasn't really any PHP in your
> question, when you get
> right down to it...
> 
> -- 
> Like Music?
> http://l-i-e.com/artists.htm
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

--- End Message ---
--- Begin Message ---
That would be javascript alert() feature. (Documented so much on sites
which can be found on google I won't even bother explain)


On Mon, 13 Dec 2004 18:23:35 -0800 (PST), Sejati Opreker
<[EMAIL PROTECTED]> wrote:
> I planning to make an inventory php-mysql based
> program, that need to warn my user when the stock
> reach at specific mount, yeah that true playing sound
> might annoyed some people around, is it posible to use
> the same way if sound replace by a dialog box ?
> 
> 
> --- Richard Lynch <[EMAIL PROTECTED]> wrote:
> 
> > Sejati Opreker wrote:
> > > How do I make automaticly PHP playing a sound
> > (Ogg, or
> > > MP3 format file) when MySql (in Table, or Coulom)
> > > reach a number (for example 5)
> >
> > Errrrr.
> >
> > You'd have to write a query in MySQL/PHP such as:
> > $query = "select whatever = 5 from something";
> >
> > Or, perhaps:
> > $query = "select count(*) from something where
> > whatever";
> >
> > Or maybe something entirely different.  You've been
> > so vague about the
> > specification that we can't really say.
> >
> > Then, you need to use OBJECT and EMBED tags in your
> > HTML printed out by
> > PHP to make the sound play.  You can count on a
> > *LOT* of annoyed users
> > when you automatically play an audio file, by the
> > way.
> >
> > The exact format of the OBJECT and EMBED tags
> > depends on what format you
> > want, Ogg or MP3.
> >
> > Pretty much, there wasn't really any PHP in your
> > question, when you get
> > right down to it...
> >
> > --
> > Like Music?
> > http://l-i-e.com/artists.htm
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
>                 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 250MB free storage. Do more. Manage less.
> http://info.mail.yahoo.com/mail_250
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
N Jones
#newzealand @ irc.freenode.net
The future of IRC is coming,

--- End Message ---
--- Begin Message ---
$70 for a domain name registration?   A domain name only costs $6 or $7 US
dollars per year...

--- End Message ---
--- Begin Message ---
Supprisedly, Register.com still charges alot

 $35/1 year
$70/2 years
$150/5 years
$299/10 years



On Mon, 13 Dec 2004 22:16:00 -0500, Josh
<[EMAIL PROTECTED]> wrote:
> $70 for a domain name registration?   A domain name only costs $6 or $7 US
> dollars per year...
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message --- What is the default place for php.ini? I have a few copies when I do a `whereis php.ini`. I figure it is the /etc/php.ini. Anyone shed some light? Also, is there anything that must be done after I modify the php.ini?

Trav
--- End Message ---
--- Begin Message --- Nevermind. I got it
----- Original Message ----- From: "Travis Conway" <[EMAIL PROTECTED]>
To: "PHP-GEMERAL" <[EMAIL PROTECTED]>
Sent: Monday, December 13, 2004 9:30 PM
Subject: [PHP] php.ini



What is the default place for php.ini? I have a few copies when I do a `whereis php.ini`. I figure it is the /etc/php.ini. Anyone shed some light? Also, is there anything that must be done after I modify the php.ini?

Trav

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

--- End Message ---
--- Begin Message --- I'm curious whether it's possible to use the DomXPath->query in such a way that this...

<html xmlns="http://www.w3.org/1999/xhtml";>
    <body>
        <div>Foo</div>
    </body>
</html>

.. could be accessed like this:

$xp = new DomXPath($domdoc);
echo $xp->query("/html/body/div")->item(0)->nodeValue;

... instead of like this:

$xp = new DomXPath($domdoc);
$xp->registerNamespace('html', 'http://www.w3.org/1999/xhtml');
echo $xp->query("/html:html/html:body/html:div")->item(0)->nodeValue;

I guess what I would expect to work is to allow for blank values as the first argument to registerNamespace, representing the default namespace, but that causes the queries to always return no matches. Is there something I'm missing with this?

Thanks!
-Dan

--- End Message ---
--- Begin Message ---
I'm trying to get APC
(http://pecl.php.net/package-info.php?package=APC) to
work with PHP 5.0.2 and Apache 2.0.49. I followed the
instructions in INSTALL and it appeared to configure,
compile, and install without any problems. However, no
APC info appears in phpinfo() and this appears in my
error log:

PHP Warning:  PHP Startup: Unable to load dynamic
library './/usr/lib/php4/apc.so' -
.//usr/lib/php4/apc.so: undefined symbol: OnU
pdateInt in Unknown on line 0

or:

PHP Warning:  PHP Startup: Unable to load dynamic
library './apc.so' - ./apc.so: cannot open shared
object file: No such file or d
irectory in Unknown on line 0

Anybody know what the problem might be?

Thanks,
CSN


                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 

--- End Message ---
--- Begin Message ---
On Mon, 13 Dec 2004, Dan Phiffer wrote:

> I guess what I would expect to work is to allow for blank values as the
> first argument to registerNamespace, representing the default namespace,
> but that causes the queries to always return no matches. Is there
> something I'm missing with this?

This is an XPath FAQ. Without a ns prefix, XPath doesn't choose
elements living in the default ns, but ones living in no namespace.

Otherwise, you have problems with:

<root>
  <foo/>
  <foo xmlns="bar"/>
</root>

What would /root/foo be, the first, the second, both? And if this
example is resolvable, what happens to:

<root>
  <foo>
    <qxx/>
  </foo>
  <foo xmlns="bar">
   <qxx/>
  </foo>
</root>

And /root/foo/qxx? Do you select qxx in the default ns? Or not?

-adam

-- 
[EMAIL PROTECTED] | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!

--- End Message ---
--- Begin Message ---
Adam Maccabee Trachtenberg wrote:

This is an XPath FAQ. Without a ns prefix, XPath doesn't choose
elements living in the default ns, but ones living in no namespace.

Are there any good references you might point me to? I'm pretty new to this stuff and beyond my "in a Nutshell" book don't have many places to consult yet.



> what happens to:

<root> <foo> <qxx/> </foo> <foo xmlns="bar"> <qxx/> </foo> </root>

And /root/foo/qxx? Do you select qxx in the default ns? Or not?

-adam


That makes perfect sense. I'm realizing that XPaths are not as portable as I thought they were. At least not without some way of converting element prefixes easily...


Thanks,
-Dan

--- End Message ---
--- Begin Message ---
On Mon, 13 Dec 2004, Dan Phiffer wrote:

> Adam Maccabee Trachtenberg wrote:
>
> > This is an XPath FAQ. Without a ns prefix, XPath doesn't choose
> > elements living in the default ns, but ones living in no namespace.
>
> Are there any good references you might point me to? I'm pretty new to
> this stuff and beyond my "in a Nutshell" book don't have many places to
> consult yet.

Nothing good I can think of off hand besides the spec. That's really
the only tricky XPath gotcha, however.

-adam

-- 
[EMAIL PROTECTED] | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!

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


On 14.12.2004 6:45 Uhr, Dan Phiffer wrote:
Adam Maccabee Trachtenberg wrote:

This is an XPath FAQ. Without a ns prefix, XPath doesn't choose
elements living in the default ns, but ones living in no namespace.


Are there any good references you might point me to? I'm pretty new to this stuff and beyond my "in a Nutshell" book don't have many places to consult yet.


> what happens to:


<root> <foo> <qxx/> </foo> <foo xmlns="bar"> <qxx/> </foo> </root>

And /root/foo/qxx? Do you select qxx in the default ns? Or not?

-adam


That makes perfect sense. I'm realizing that XPaths are not as portable as I thought they were. At least not without some way of converting element prefixes easily...

You just have to learn that prefixes are just aliases to the real namespaces, then you're fine. Don't count on prefixes, they itself are meaninngless. And always use registerNamespace() for all namespaces you need in the XPath query. Then XPath is very portable.


chregu


Thanks, -Dan


-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [EMAIL PROTECTED] | gnupg-keyid 0x5CE1DECB

--- End Message ---
--- Begin Message --- Can anyone point me to a good source of information for how to use SSL with PHP? I know it's not quite on-topic, but perhaps someone could point me at a good source of info? TIA
--- End Message ---
--- Begin Message ---
Thanks Jay. The Htmlarea looks like the app. I was talking about. It's 
definitely worth a test atleast.
-Will


"Jay Blanchard" <[EMAIL PROTECTED]> kirjoitti 
viestiss�:[EMAIL PROTECTED]
[snip]
I was just wondering how to build a text editing tool with php. I mean a

tool that can help users to format their texts in the pages.
[/snip]

Have you looked at something like http://www.htmlarea.com/ ? Most apps
like this use a lot of JavaScript to get the work done. You may want to
look at the PHP-GTK http://gtk.php.net but other than that you have
asked a really broad-scoped question. Have you ever done any basic
application design before? It all starts with a proposed features list
and then some flowcharts. 

--- End Message ---
--- Begin Message ---
hi, 
i have a page that views details of games from a database
i get the text and screen shots from the database, 
i want to view 3 pictures among the text when i view it
how i can view the 1st picture after 1/3 of the text and the next one
after 2/3 of the text without affecting the text itself

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

Does anyone around here knows a *good* and *free* encoder for PHP5 ?
I used to run Turck, but it seems that somehow it has been discontinued.
(At least, the last release occured about a year ago).

Any help would be apreciated.

Warm Regards.
--
M�rio Gamito
Administra��o de sistemas e desenvolvimento
Netual - Multim�dia e Telecomunica��es, Lda.
Rua Jo�o Afonso, N�1
3800-198 Aveiro - Portugal
Tel. +351 234 371 431 / Fax. +351 234 371 438
E-mail: [EMAIL PROTECTED]
www.netual.pt

--- End Message ---
--- Begin Message ---
Dear friends,

we would like to use the curl libraries on a server, which is open on the
internet.

We would like to know about security issues with curl, before installing it.

We are using Debian Woody (some few packages from Sarge), and apache
1.3.29.0.2-6 and php 4.3.4-4.

Thanks in advance.
-- 
symbulos partners
-.-
symbulos
ethical services for your organisation
http://www.symbulos.com

--- End Message ---
--- Begin Message ---
You're right. I think it will. Thanks.

I've got another issue now though which may indeed be a show-stopper.

It seems that while socket_recvfrom is binary safe, there's no way to
send data in any way other than a string... Is that right? Can I not
send data of other types?

Ian

On Mon, 2004-12-13 at 07:57 -0800, Chris wrote:
> Try the unpack function, it should do quite nicely.
> 
> Chris
> 
> Ian Firla wrote:
> 
> >Hello All,
> >
> >I've hit a bit of a show stopper in a project I'm working on.
> >
> >I'm getting a 65 byte stream of data. 32 of those bytes are of the type
> >"Byte Array". Is there a way that I can covert that data into something
> >useful?
> >
> >For the record, the data stream that I'm getting is in the format:
> >
> >|ascii|ascii|asciiX10|integerX4|byte arrayX32|
> >
> >The byte array looks like this: 
> >gÃ.ÃÃ.ÃÆÃÃÂÃUâÃAÃÂ9xÅÂÃ|%ÃrÂÃ9â.
> >
> >Any ideas?
> >
> >Ian
> >
> >  
> >
> 

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

I have encounter something rather weird. In my development server,

when I insert a string contain  '&*%$, I got this in my mysql server '&*%$
(i.e. the same)

but in my application server, I got this �?T&*%$ in my mysql server (i.e. '
==> �?T)

anyone know how to resolve this? When I use the string to send out the
email, I got the funny characters instead.

Version Running

development server
mysql-server-3.23.58-9
php-4.3.4

application server:
mysql-server-3.23.58-9
php-4.3.8-2.1

--- End Message ---

Reply via email to