|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 12 Sep 2006 00:32:34 -0000 Issue 4342
php-general-digest-help
lists.php.net
Date: Mon Sep 11 2006 - 19:32:34 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 12 Sep 2006 00:32:34 -0000 Issue 4342
Topics (messages 241577 through 241637):
Re: does magic_quotes_gpc prevents sql injection through forms?
241577 by: Dave Goodchild
241578 by: Reinhart Viane
241579 by: Dave Goodchild
241581 by: David Tulloh
241587 by: Reinhart Viane
241589 by: Christopher Weldon
Re: does magic_quotes_gpc prevents sql injection through forms?(SOLVED)
241580 by: Reinhart Viane
241583 by: Faisal Sahar
241584 by: Dave Goodchild
Re: Ajax and PHP: XMLHTTP
241582 by: Alex Turner
241585 by: Arpad Ray
241588 by: Miguel Guirao
241622 by: Micky Hulse
strip urls
241586 by: Merlin
241590 by: Mariano Guadagnini
241604 by: RalfGesellensetter
241609 by: Merlin
241613 by: Christopher Weldon
241618 by: Merlin
Starting week number of year to Sunday
241591 by: Bagus Nugroho
Re: Newbie question about <?= ?>
241592 by: Jon Anderson
241598 by: Stut
241603 by: tedd
241605 by: Satyam
241606 by: Stut
241607 by: Stut
241608 by: Stut
241621 by: Satyam
241623 by: tedd
Re: FUNCTION TO CHECK IMAGE
241593 by: tedd
241617 by: Christopher Weldon
241620 by: BBC
Re: How could I make the browser to send a command to a cash register...
241594 by: Man-wai Chang
241597 by: Jay Blanchard
Re: Date maths
241595 by: tedd
[ANNOUNCEMENT] Sparse v1.06b released
241596 by: Daniel Orner
Re: How could I make the browser to send a command to a cash register...]
241599 by: Mitch Miller
241616 by: Satyam
Getting an argument out of a web page
241600 by: Brian Dunning
241610 by: John Nichel
241611 by: Brian Dunning
241612 by: John Nichel
Really stupid cookie question
241601 by: Brian Dunning
241615 by: Christopher Weldon
241619 by: Tim Traver
mail() help
241602 by: suresh kumar
241614 by: Christopher Weldon
Re: PHP 4 OOP, re-using a object?
241624 by: Curt Zirzow
241630 by: Micky Hulse
241634 by: Curt Zirzow
php4 / php5 unable to locate module
241625 by: Zbigniew Szalbot
241626 by: Curt Zirzow
241628 by: Zbigniew Szalbot
241632 by: Curt Zirzow
241633 by: Zbigniew Szalbot
241636 by: Zbigniew Szalbot
Re: if statement with or comparison (newbie)
241627 by: Curt Zirzow
DOM - parse HTML document
241629 by: Leonidas Safran
241631 by: Satyam
241635 by: Leonidas Safran
Is SOAP not really enabled?
241637 by: Brian Dunning
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
>
> I don't think so. What if magic_quotes_gpc gets turned off or you move to
> another environment. Best practice is to turn if off (if you can) and so
> gain fine control over your data. You can either compromise and use a
> function that checks whether the setting is enabled and either add your own
> slashes or do nothing. To ensure the best level of control over escaping
> data before it goes into your db, check out mysql_real_escape_string.
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
So, if I understand correct mysql_real_escape_string is the way to prevent
sql injection.
Is there still need (as in both good coding and security) for variable
validation at that point? Like a hidden field id that must only be an int?
________________________________________
Van: Dave Goodchild [mailto:buddhamagnet
gmail.com]
Verzonden: maandag 11 september 2006 13:04
Aan: rv
domos.be
CC: php-general
lists.php.net
Onderwerp: Re: [PHP] does magic_quotes_gpc prevents sql injection through
forms?
I don't think so. What if magic_quotes_gpc gets turned off or you move to
another environment. Best practice is to turn if off (if you can) and so
gain fine control over your data. You can either compromise and use a
function that checks whether the setting is enabled and either add your own
slashes or do nothing. To ensure the best level of control over escaping
data before it goes into your db, check out mysql_real_escape_string.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
Yes. Always treat incoming data as if it were tainted. How rigorous you are
is up to you, but check for required fields, then validate them (type, size
etc) and finally escape before database entry.
>
> http://www.projectkarma.co.uk
>
>
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
With magic_quotes_gpc or addslashes it's harder to do injection attacks
but it's still possible. http://shiflett.org/archive/184 demonstrates
an attack using php and mysql with multi-byte characters.
I think the more likely attack is actually due to how annoying
magic_quotes is. You have to remove it to do any work, then you have to
remember to put it back on because you aren't escaping your sql.
A final point is that it looks like magic_quotes will be removed from PHP6.
David
Reinhart Viane wrote:
> After some comments on my code I went on a 'fieldtrip' to learn about sql
> injection...
>
> Now after testing some examples with single and double quotes and mysql
> comment (--) I haven't find any way to insert edit or delete any data in the
> database.
> The loginscript is rather simple:
>
> $query="SELECT FROM persons WHERE login='$login' AND password='$password'";
> $result=mysql_query($query) or die(mysql_error());
>
> The form has action POST.
> Now magic_quotes_gpc escapes every quote I insert.
>
> Does this mean with magic_quotes_gpc on I am secured enough concerning
> mysql-injection through forms?
>
> Thx
>
attached mail follows:
>I think the more likely attack is actually due to how annoying
>magic_quotes is. You have to remove it to do any work, then you have to
>remember to put it back on because you aren't escaping your sql.
>David
What exactly do you mean by ' You have to remove it to do any work '?
Seems that the only and best way to prevent mysql injection is the
combination of mysql_real_escape_string combined with value validation.
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Reinhart Viane wrote:
>
> Seems that the only and best way to prevent mysql injection is the
> combination of mysql_real_escape_string combined with value validation.
>
Yes, this should be what you use. When you think about application
design, not only should you escape the data going into the database for
security purposes. DBMS's have certain characters specific to them that
can make the DMBS think what's been inputted as a quote, but PHP won't
see it as a quote, and magic_quotes, addslashes, etc. won't catch it -
still leaving a security hole.
You should also be making sure you're inserting the proper data (ints in
integer fields, strings in varchar, char, text, etc. fields) so that
your DBMS doesn't start spitting SQL errors out in a log (or worse yet -
to your visitor) and cause nightmares for visitors entering seemingly
valid data when they aren't. This is definitely done in the case where
you don't have quotes around your data in the SQL query - as is done
sometimes with integer, double, etc.
Easy validation for integer:
is_numeric($_POST['var'])
Easy way to just straight-up typecast:
$clean['var'] = (int) $_POST['var'];
The best way is to check to see if it is_numeric rather than force it's
type to be integer - but for simplicities sake, it can be used.
- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
cweldon
cerberusonline.com
979.739.5874
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFBXHEZxvk7JEXkbERAuf/AJ9Rs8TxgKjNlK6XR59KykTq3OXUdACeNPaW
O5j8lNIEWIaPA56ZdCttaUA=
=+ur0
-----END PGP SIGNATURE-----
attached mail follows:
Thx a lot
-----Oorspronkelijk bericht-----
Van: Dave Goodchild [mailto:buddhamagnet
gmail.com]
Verzonden: maandag 11 september 2006 14:10
Aan: Reinhart Viane
CC: php-general
lists.php.net
Onderwerp: Re: [PHP] does magic_quotes_gpc prevents sql injection through
forms?
Yes. Always treat incoming data as if it were tainted. How rigorous you are
is up to you, but check for required fields, then validate them (type, size
etc) and finally escape before database entry.
>
> http://www.projectkarma.co.uk
>
>
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
CAN ANYONE TELL ME WHAT TOPICS ARE REQUIRED TO MASTER
IN ORDER TO BECOME A GENIOUS WEB PROGRAMMER ?
attached mail follows:
Learning strtolower() for a start.
On 11/09/06, Faisal Sahar <faisalsahar
gmail.com> wrote:
>
> CAN ANYONE TELL ME WHAT TOPICS ARE REQUIRED TO MASTER
> IN ORDER TO BECOME A GENIOUS WEB PROGRAMMER ?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
attached mail follows:
Micky Hulse wrote:
> <?=$_SERVER['PHP_SELF']?>
>
> Can I replace the above with some sort of XMLHTTP request?
>
> Googling now... thought I would ask here first.
>
> Any good links to tuts that might cover that sort of thing?
>
> Kinda thinking about plugging some Ajax into a random image php script.
>
> TIA. :)
> Cheers,
> Micky
>
I think that is a javascript question is it not? Unless you mean to use
curl or some such.
AJ
--
www.deployview.com
www.nerds-central.com
www.project-network.com
attached mail follows:
Micky Hulse wrote:
> <?=$_SERVER['PHP_SELF']?>
>
> Can I replace the above with some sort of XMLHTTP request?
>
As noted, that's a javascript question. However your PHP code is
vulnerable to XSS attacks; you should at least encode the output with
htmlspecialchars() so that URLs like
"foo.php/<script>alert('hi');</script>" are safe.
eg. <?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>
Arpad
attached mail follows:
What do you exactly want to do?
-----Original Message-----
From: Micky Hulse [mailto:micky
ambiguism.com]
Sent: Domingo, 10 de Septiembre de 2006 10:46 p.m.
To: php php
Subject: Ajax and PHP: XMLHTTP
<?=$_SERVER['PHP_SELF']?>
Can I replace the above with some sort of XMLHTTP request?
Googling now... thought I would ask here first.
Any good links to tuts that might cover that sort of thing?
Kinda thinking about plugging some Ajax into a random image php script.
TIA. :)
Cheers,
Micky
--
Wishlist: <http://snipurl.com/vrs9>
Switch: <http://browsehappy.com/>
BCC?: <http://snipurl.com/w6f8>
My: <http://del.icio.us/mhulse>
Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos.
This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever.
attached mail follows:
Hi all, thanks for responses, I appreciate it. :)
Miguel Guirao wrote:
> What do you exactly want to do?
Oh, I wanted to call a php function on my page that changes some CSS. I
was hoping I could change my CSS on the fly without having to reload
page... but after doing more research, I think that a page refresh is
best way to go.
All the Ajax/PHP examples i have seen deal with elements on page (in
this case i have PHP script in head that changes my css)... Still new to
"Ajax" and XMLHTTP... I know how to handle JS, but I am way more
comfortable with PHP. Not too many examps on the web that show some good
techniques for calling PHP functions to manipulate CSS that I could find.
I am also not a big fan of plugging-in a huge Ajax scripting
library(ies) for something as simple as calling a PHP script to
manipulate CSS. I would prefer simple on the JS end of things and make
it more about PHP without a page refresh. :D
Lol, hope that makes sense... In a bit of a rush - headed out door to
work. :)
You guys are right though, I should probably ask on the JS listserv.
Many thanks for your time.
Cheers,
Micky
--
Wishlist: <http://snipurl.com/vrs9>
Switch: <http://browsehappy.com/>
BCC?: <http://snipurl.com/w6f8>
My: <http://del.icio.us/mhulse>
attached mail follows:
Hi there,
I am trying to strip URL's out of a text. There is a function for this
in php, but I can't find it anywhere. Can sombody help?
Regards,
Merlin
attached mail follows:
You may try using regular expressions for that. Something like
preg_replace("http:\/\/.*\s","",$your_var). That's a simple example, but
you can change to suit your needs, check the online help for more info
about.
HTH,
Mariano.
Merlin wrote:
> Hi there,
>
> I am trying to strip URL's out of a text. There is a function for this
> in php, but I can't find it anywhere. Can sombody help?
>
> Regards,
>
> Merlin
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/443 - Release Date: 11/09/2006
attached mail follows:
Am Montag 11 September 2006 15:36 schrieb Merlin:
> I am trying to strip URL's out of a text. There is a function for
> this in php, but I can't find it anywhere. Can sombody help?
hi, it's strip_tags and only removes the tags (<a href ...) but keeps
the plain text that would be displayed in a text browser.
attached mail follows:
RalfGesellensetter schrieb:
> Am Montag 11 September 2006 15:36 schrieb Merlin:
>> I am trying to strip URL's out of a text. There is a function for
>> this in php, but I can't find it anywhere. Can sombody help?
>
> hi, it's strip_tags and only removes the tags (<a href ...) but keeps
> the plain text that would be displayed in a text browser.
Hi there,
thank you for the hint. This it the one I was searching for. However
unfortunatelly the function also strips all other tags! I am looking for
one that only does strip the <a href tag.
I am not so familar with regex, but I fear I would need to :-(
My guess is that it must be something like this:
$str = 'foo <a href="">test</a> o';
$str = preg_replace('<a (.*)', '', $str);
echo $str;
Can anybody help me on that? Thank you so much in advance.
Regards,
Merlin
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Merlin wrote:
> RalfGesellensetter schrieb:
>> Am Montag 11 September 2006 15:36 schrieb Merlin:
>>> I am trying to strip URL's out of a text. There is a function for
>>> this in php, but I can't find it anywhere. Can sombody help?
>>
>> hi, it's strip_tags and only removes the tags (<a href ...) but keeps
>> the plain text that would be displayed in a text browser.
>
> Hi there,
>
> thank you for the hint. This it the one I was searching for. However
> unfortunatelly the function also strips all other tags! I am looking for
> one that only does strip the <a href tag.
>
> I am not so familar with regex, but I fear I would need to :-(
>
> My guess is that it must be something like this:
>
> $str = 'foo <a href="">test</a> o';
> $str = preg_replace('<a (.*)', '', $str);
> echo $str;
>
> Can anybody help me on that? Thank you so much in advance.
>
> Regards,
>
> Merlin
>
Two things:
First, you can actually specify which tags you don't want strip_tags to
take out. Say for example you want <p> and <br /> tags to remain in the
string:
$string = strip_tags($string, '<p><br />');
Second, don't forget the tags you'll need in the preg_replace function:
$str = preg_replace('/\<a href="([^\"]*)"[^\>]*\>/', "\1", $str);
You can use other characters, such as ! if you want instead of /, but
you have to use the same at the beginning and the end.
- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
cweldon
cerberusonline.com
979.739.5874
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFBZ9yZxvk7JEXkbERAhuUAJ4o4rBiypj2OwpHjrUj2e0XZ8FVhQCeJZ6e
eCOa+PYkyrRacqnT5VtoL/A=
=/r2e
-----END PGP SIGNATURE-----
attached mail follows:
Thank you! That workes excellent!
Merlin
Christopher Weldon schrieb:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Merlin wrote:
>> RalfGesellensetter schrieb:
>>> Am Montag 11 September 2006 15:36 schrieb Merlin:
>>>> I am trying to strip URL's out of a text. There is a function for
>>>> this in php, but I can't find it anywhere. Can sombody help?
>>> hi, it's strip_tags and only removes the tags (<a href ...) but keeps
>>> the plain text that would be displayed in a text browser.
>> Hi there,
>>
>> thank you for the hint. This it the one I was searching for. However
>> unfortunatelly the function also strips all other tags! I am looking for
>> one that only does strip the <a href tag.
>>
>> I am not so familar with regex, but I fear I would need to :-(
>>
>> My guess is that it must be something like this:
>>
>> $str = 'foo <a href="">test</a> o';
>> $str = preg_replace('<a (.*)', '', $str);
>> echo $str;
>>
>> Can anybody help me on that? Thank you so much in advance.
>>
>> Regards,
>>
>> Merlin
>>
>
> Two things:
>
> First, you can actually specify which tags you don't want strip_tags to
> take out. Say for example you want <p> and <br /> tags to remain in the
> string:
>
> $string = strip_tags($string, '<p><br />');
>
> Second, don't forget the tags you'll need in the preg_replace function:
>
> $str = preg_replace('/\<a href="([^\"]*)"[^\>]*\>/', "\1", $str);
>
> You can use other characters, such as ! if you want instead of /, but
> you have to use the same at the beginning and the end.
>
> - --
> Christopher Weldon, ZCE
> President & CEO
> Cerberus Interactive, Inc.
> cweldon
cerberusonline.com
> 979.739.5874
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFBZ9yZxvk7JEXkbERAhuUAJ4o4rBiypj2OwpHjrUj2e0XZ8FVhQCeJZ6e
> eCOa+PYkyrRacqnT5VtoL/A=
> =/r2e
> -----END PGP SIGNATURE-----
attached mail follows:
Hi All,
Is anyway to change starting week number of year on Sunday, instead
Monday as default?
Thanks in advance,
bn
attached mail follows:
Satyam wrote:
> for ($x=0;$x<1000;$x++) {
> echo ' <tr><td>X is ' , $x , '</td></tr>';
> }
This seems to be a hair faster. I extended the test to 10000 requests
(still concurrency 10) to make the test a little more reproducible:
echo str,var,str did 604.65 requests a second where <tr><td><?= $x
?></td></tr> did 599.63 requests a second. I also tried echo str . var .
str, and it came in at about 584.55 requests a second. printf("str %i
str",var) came out at 547.01 requests a second and printf("str %s
str",var) was only 452.03 requests a second.
> Can you try and time that one so we have comparable results? This one
> should be second best:
>
> for ($x=0;$x<1000;$x++) {
> echo "<tr><td>X is $x</td></tr>";
> }
Approximately 330 (?!) requests a second for that one.
> Back again to what would be 'longer', well, in your example, the whole
> header, up to the loop itself should be faster if sent out of PHP.
> Likewise, you could echo $buffer right after the loop, drop out of PHP
> and send the footer as plain HTML. This, of course, is harder to time
> since it happens only once. I admit though that I did time the
> options I listed and on the 'dropping in and out of PHP' I'm relying
> on the PHP manual ( see
> http://www.php.net/manual/en/language.basic-syntax.php, the first
> paragraph after the examples) and the source of the lexical scanner,
> which supports that, though your numbers do contradict it. Interesting.
I'm not sure that my results would count as contradictory - I'm running
APC which would likely throw performance related numbers out of whack as
compared to out-of-the-box PHP.
Because of that, I wouldn't recommend anyone take my numbers too
seriously - they're just an example taken from my server: 1.8 GHz
SMP/1G/RAID5/Linux 2.6.17.7/Apache 2.2.3/PHP 5.1.6/APC 3.0.12p2. Anyone
else's results would probably vary widely.
jon
attached mail follows:
How bored am I?
This bored: http://dev.stut.net/phpspeed/
Server is running PHP 5.1.2 (really should upgrade that) with no caches
of any sort.
-Stut
attached mail follows:
At 4:56 PM +0100 9/11/06, Stut wrote:
>How bored am I?
>
>This bored: http://dev.stut.net/phpspeed/
>
>Server is running PHP 5.1.2 (really should upgrade that) with no
>caches of any sort.
>
>-Stut
Which begs the question, does it make much of a difference? (not you
being bored, but the rather speed concers).
With all the things out there that can slow your browsers reaction
time in presenting some result, does a couple of seconds count much
in the over all scheme of things?
I know, purest will say that they want to make whatever they do as
fast as possible, but is that time to make it faster be better spent
elsewhere? We used to have to worry about the size of our strings,
but now we can place the kjv of the bible in one. So, what's the
point of counting characters in strings now?
I suspect at some point, probably soon, speed isn't going to matter much.
Opinions?
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
I admit I'm totally surprised about the buffered results. Nevertheless, may
I sugest you add the following to the series of tests?:
<h3>Using line-by-line single-quoted echo<br/>with comma separated
arguments</h3>
<?php
$start = mt();
print '<table style="display:none;" id="table2a">';
for ($x = 0; $x < $iterations; $x++)
{
echo '<tr><td>X is</td><td>',$x,'</td></tr>';
}
print '</table>';
$duration = mt() - $start;
print '<p>Took '.number_format($duration, 4).' seconds</p>';
?>
<p>» <a id="table2alink"
href="#"
onclick="document.getElementById('table2a').style.display='block';
document.getElementById('table2alink').style.display='none';return
false;">
Reveal output</a></p>
There seems to be one thing rarely anybody remembers, echo admits multiple
arguments, and as the numbers will show, (or at least they do in my
machine), they are the second best option.
Satyam
----- Original Message -----
From: "Stut" <stuttle
gmail.com>
To: "Jon Anderson" <jon
gamingsolutions.ca>
Cc: "Satyam" <Satyam
satyam.com.ar>; <php-general
lists.php.net>
Sent: Monday, September 11, 2006 5:56 PM
Subject: Re: [PHP] Re: Newbie question about <?= ?>
> How bored am I?
>
> This bored: http://dev.stut.net/phpspeed/
>
> Server is running PHP 5.1.2 (really should upgrade that) with no caches of
> any sort.
>
> -Stut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Satyam wrote:
> I admit I'm totally surprised about the buffered results.
> Nevertheless, may I sugest you add the following to the series of tests?:
>
> <h3>Using line-by-line single-quoted echo<br/>with comma
> separated arguments</h3>
> <snip>
>
> There seems to be one thing rarely anybody remembers, echo admits
> multiple arguments, and as the numbers will show, (or at least they do
> in my machine), they are the second best option.
Done, but again it doesn't seem to make any significant difference to
the performance.
-Stut
attached mail follows:
tedd wrote:
> At 4:56 PM +0100 9/11/06, Stut wrote:
>> How bored am I?
>>
>> This bored: http://dev.stut.net/phpspeed/
>>
>> Server is running PHP 5.1.2 (really should upgrade that) with no
>> caches of any sort.
>>
>> -Stut
>
> Which begs the question, does it make much of a difference? (not you
> being bored, but the rather speed concers).
>
> With all the things out there that can slow your browsers reaction
> time in presenting some result, does a couple of seconds count much in
> the over all scheme of things?
>
> I know, purest will say that they want to make whatever they do as
> fast as possible, but is that time to make it faster be better spent
> elsewhere? We used to have to worry about the size of our strings, but
> now we can place the kjv of the bible in one. So, what's the point of
> counting characters in strings now?
>
> I suspect at some point, probably soon, speed isn't going to matter much.
>
> Opinions?
I would have to agree. Having watched the server CPU load while playing
with this test script it would appear that the performance can be
skewed a lot more by that than by the method you use for squidging out
the output.
As a curiosity I've also added a test using <?php print $x; ?> and
bizarrely that appears to be slightly faster than <?=$x?>.
Weird.
-Stut
attached mail follows:
Jon Anderson wrote:
> Stut wrote:
>> How bored am I?
>>
>> This bored: http://dev.stut.net/phpspeed/
>>
>> Server is running PHP 5.1.2 (really should upgrade that) with no
>> caches of any sort.
> Just looking through the source, could you try changing the first
> example to put the output all on one line? It's the only one that does
> the row output on multiple indented lines - I'm kind of curious what
> effect (if any) that has on the results.
Done. Doesn't seem to make a difference - I didn't expect it to.
> I also tried this on my own server. With the opcode cache, the results
> seem to be the inverse of yours without.
I would have been surprised if an opcode cache had made a huge
difference. I don't think the Zend Engine is intelligent enough to
compile the various different tests to the same set of opcodes - but I
could be wrong. I'm still quite new to the PHP internals.
> Also, with either server, the first three results seem to vary wildly,
> but the last two always seem to come out the same. I'm not sure why
> that is...
As I said in another post, the performance varies wildly with the load
on the server.
-Stut
attached mail follows:
----- Original Message -----
From: "Stut" <stuttle
gmail.com>
To: "Satyam" <Satyam
satyam.com.ar>
Cc: <php-general
lists.php.net>
Sent: Monday, September 11, 2006 6:32 PM
Subject: Re: [PHP] Re: Newbie question about <?= ?>
> Satyam wrote:
>> I admit I'm totally surprised about the buffered results. Nevertheless,
>> may I sugest you add the following to the series of tests?:
>>
>> <h3>Using line-by-line single-quoted echo<br/>with comma separated
>> arguments</h3>
>> <snip>
>>
>> There seems to be one thing rarely anybody remembers, echo admits
>> multiple arguments, and as the numbers will show, (or at least they do in
>> my machine), they are the second best option.
>
> Done, but again it doesn't seem to make any significant difference to the
> performance.
>
> -Stut
>
>
When I run those tests locally, the numbers are totally different and the
performance of one over the other comes out far clearer. I can only assume
that the numbers in the test run in a remote server are so much influenced
by the ability of the server to push out the characters into the output
stream that the processing time itself is of very little relevance. This
table shows the numbers for the different tests as run on my machine,
locally (where output streaming is irrelevant) and run from your site:
Using <?=$x?> Took 0.2801 seconds Took
3.5937 seconds
Using <?php print $x; ?> Took 0.3286 seconds Took 5.2654 seconds
Using line-by-line single-quoted print: Took 0.1215 seconds Took
3.2256 seconds
Using line-by-line single-quoted echo
with comma separated arguments Took 0.2542 seconds Took 3.2220
seconds
Using line-by-line double-quoted print Took 0.1782 seconds Took
3.3129 seconds
Using buffered single-quoted print Took 0.0277 seconds Took 3.3077
seconds
Using buffered double-quoted print Took 0.2038 seconds Took 3.3012
seconds
It would seem that it takes about 3 seconds to push those bytes into the
network, the actual processing times get completely masked behind a simple
glitch in the throughput of the communication line. While the differences
on the rightmost column (except for the second one, which is way off) are no
more than 5%, in the middle column the differences are up to 10 to 1. But
then there is that second row, which is so much higher and it is so in both
columns.
Unfortunately, I cannot make much sense about all this. I don't get it.
Nevertheless, something it is clear is that buffering all the output first
and then pushing it out all at once seems to beat them all, specially using
single quoted strings. Run locally, the differences are amazing!
Satyam
attached mail follows:
At 5:36 PM +0100 9/11/06, Stut wrote:
>tedd wrote:
>>Opinions?
>
>I would have to agree. Having watched the server CPU load while
>playing with this test script it would appear that the performance
>can be skewed a lot more by that than by the method you use for
>squidging out the output.
>
>As a curiosity I've also added a test using <?php print $x; ?> and
>bizarrely that appears to be slightly faster than <?=$x?>.
>
>Weird.
My guess would be that it's in the interpreter -- the look-up for
"<?" as compared to "<?php" may be delayed because of checking for
the short-tag option-on, or something similar. But, I admittedly
don't know.
However, I strongly suspect that drawing to the screen will take
longer than executing any "=" or "print" statement anyway. So
regardless of the time saved in computation, the delivery would
appear identical. It reminds me of the "hurry-up and wait" saying we
had in the Army some 50 years back.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
At 11:40 PM -0700 9/10/06, BBC wrote:
> > At 12:49 AM -0700 9/10/06, BBC wrote:
>> >Hi all.
>> >I'm having a problem regarding image handling. Sometimes an image
>> >can be showed in browser normally (in my computer) but when I
>> >upload it into my site that image is not valid, so there is an issue
>> >in my getimagesizes() function.
>> >Is there any function to recover such problem? I used
>> >"if(file_exists($image_path))" but it couldn't solve the problem.
>> >Input would be appreciated
>> >
> >
>> How are you uploading your image?
>I upload a file through some form then I manipulate it's size
Don't manipulate it's size and see if that works.
>Size of image can't be define seem's like the image is not there,
>but it's not happened all the time.
Can't help with sporadic problems -- that's probably a logic error.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
BBC wrote:
>> BBC wrote:
>>> Hi all.
>>> I'm having a problem regarding image handling. Sometimes an image can be showed in browser normally (in my computer) but when I
>>> upload it into my site that image is not valid, so there is an issue in my getimagesizes() function.
>>> Is there any function to recover such problem? I used "if(file_exists($image_path))" but it couldn't solve the problem.
>>> Input would be appreciated
>> - From what it sounds like you are doing, you are uploading a file through
>> some form, then manipulating it's size. Is this correct?
>
> Yes it is, but the uploading was going well (size is ok). When I show the image on the web using getimagesizes(), 'sometimes' such
> image size couldn't be resolved.
> Is there any function to define that image is ok or not?
>
>> What happens when you stop manipulating it's size and try to view just the uploaded
>> file?
>
> Size of image (after or before uploading) would be same. but the issue still there (sometimes)
>
>
What types of images are these? JPG, PNG, GIF?
- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
cweldon
cerberusonline.com
979.739.5874
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFBaLsZxvk7JEXkbERAg62AJ4iWogZyWry445xv6bT8ld6Mfw79ACgkWhx
zfIJGqxli9pHPHrcHoi8FjI=
=sllc
-----END PGP SIGNATURE-----
attached mail follows:
> What types of images are these? JPG, PNG, GIF?
Its jpg. Look... I don't know exactly what your point, I'm just asking you about the function to resolve the size of image like the
codes below:
if (file_exists($img_path)){
list($width,$height) = getimagesizes($img_path);
}else{
$width = $ height = $max_size;
}
So is there any other option to replace file_exists();?
attached mail follows:
> That 100% depends on how the cash register works. Is it an NT cash
> register, or an propitiatory one? Is it rs232 or on a network?
> Basically, find out how the cash register can be controlled, then make a
> php script that can fire that control.
Thanks.
It's a RS232 serial register. PHP, running at the server side, could
talk to the hardware at the client side? Or is it ActiveX?
--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06) Linux 2.6.17.13
^ ^ 23:31:01 up 2 days 4:25 0 users load average: 0.04 0.07 0.05
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk
attached mail follows:
[snip]
It's a RS232 serial register. PHP, running at the server side, could
talk to the hardware at the client side? Or is it ActiveX?
[/snip]
You're correct, server-side cannot perform a client-side task.
attached mail follows:
At 9:19 PM +0100 9/10/06, Dave Goodchild wrote:
>Has anyone out there had to deal with a similar problem, and if so do you
>have any advice. This is going to take time so I will be patient and
>continue, and welcome any suggestions. Many thanks and I can post code to
>specific requests.
Dave:
You might also consider MySQL functions for this -- there's many of
them. The MySQL Cookbook by Paul DuBois:
<ttp://www.amazon.com/MySQL-Cookbook-Paul-DuBois/dp/0596001452/sr=1-1/qid=1157988865/ref=pd_bbs_1/104-1612458-8071109?ie=UTF8&s=books>
has an entire chapter dealing with just date issues. Cheap, but
excellent, advice.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
attached mail follows:
It's been a little while, but a new beta version of Sparse is out. This
adds a warning log, a button to save either the current page or the
whole dataset as a CSV file, a tag that turns into a form that allows
the user to view specific rows, and a bunch of bugfixes. Take a look!
--Daniel
--
Sparse - a new way to write MySQL-based programs with little to no
actual programming. Save yourself time and effort!
http://sparse-php.sourceforge.net/
attached mail follows:
Just realized I forgot to CC: the original list on my reply below.
I also have since realized that using the solution in my reply below,
the SERVER *COULD* cause the register to open. On the server side, a
script that connects to HTTP://ip-of-register-to-open:secret-portnum
would cause the register to open as desired.
So, this is just a simple modification of my original reply. You still
write a socket listener app. that runs on the workstation where the
register is connected, that is capable of opening the register on
demand. Then, when the user using the browser does something to open
the cash drawer, you run a script on the server that connects to
REMOTE_ADDRESS:secret-port which makes the "listener" app. open the cash
drawer. (Okay, so it's technically client based, but server driven.)
A similar tool (the same listener app, even) could be used to send text
to the workstation-attached receipt printer. It could be setup such
that any text received on the port it's listening to, is simply echoed
to the printer. So, now the server generates what needs sent to the
printer and prints it by connecting (from the server) to the listener
app., followed by a connection to the port that causes the drawer to open.
-- Mitch
-------- Original Message --------
Subject: Re: [PHP] Re: How could I make the browser to send a command
to a cash register...
Date: Mon, 11 Sep 2006 10:42:37 -0500
From: Mitch Miller <mitch
mdmiller.com>
To: Man-wai Chang <toylet.toylet
gmail.com>
References: <ee14r5$ch6$1
sea.gmane.org>
<3B.02.21785.2A914054
pb1.pair.com> <ee3vjd$dr5$1
sea.gmane.org>
I think I'd be tempted to write a simple socket listener app., that
could listen on a TCP/IP port and when it makes a connection (and
optionally gets the right command), could open the register.
There are lots of examples of socket listener apps. done in Perl (check
Google), but the local app. would *not need* to be in Perl (that's just
one I've used personally).
Once the app. is running, simply connecting to
http://localhost:secret-portnum *could* be enough to make the app. open
the register (by sending the right command to the serial port).
Using this technique, any HTML that references
http://localhost:secret-portnum would open the register, regardless of
how the HTML is generated.
-- Mitch
Man-wai Chang wrote:
>>That 100% depends on how the cash register works. Is it an NT cash
>>register, or an propitiatory one? Is it rs232 or on a network?
>>Basically, find out how the cash register can be controlled, then make a
>>php script that can fire that control.
>
>
> Thanks.
>
> It's a RS232 serial register. PHP, running at the server side, could
> talk to the hardware at the client side? Or is it ActiveX?
>
>
attached mail follows:
I guess that embedding an ActiveX object to open the drawer into the web
page would be the easiest option for the application programmers to handle.
It would give the added flexibility to use JavaScript on the client side to
call the object method to open the drawer, besides sending the page with the
object embedded and the property to open the drawer set to open. Besides,
it would be easier to mantain since it is obvious which cash register you
are talking about, the one physically attached, otherwise, you would have to
mantain a table of which cash register corresponds to which client.
Satyam
----- Original Message -----
From: "Mitch Miller" <mitch
mdmiller.com>
To: <php-general
lists.php.net>
Sent: Monday, September 11, 2006 5:56 PM
Subject: [Fwd: Re: [PHP] Re: How could I make the browser to send a command
to a cash register...]
> Just realized I forgot to CC: the original list on my reply below.
>
> I also have since realized that using the solution in my reply below,
> the SERVER *COULD* cause the register to open. On the server side, a
> script that connects to HTTP://ip-of-register-to-open:secret-portnum
> would cause the register to open as desired.
>
> So, this is just a simple modification of my original reply. You still
> write a socket listener app. that runs on the workstation where the
> register is connected, that is capable of opening the register on
> demand. Then, when the user using the browser does something to open
> the cash drawer, you run a script on the server that connects to
> REMOTE_ADDRESS:secret-port which makes the "listener" app. open the cash
> drawer. (Okay, so it's technically client based, but server driven.)
>
> A similar tool (the same listener app, even) could be used to send text
> to the workstation-attached receipt printer. It could be setup such
> that any text received on the port it's listening to, is simply echoed
> to the printer. So, now the server generates what needs sent to the
> printer and prints it by connecting (from the server) to the listener
> app., followed by a connection to the port that causes the drawer to open.
>
> -- Mitch
>
>
> -------- Original Message --------
> Subject: Re: [PHP] Re: How could I make the browser to send a command
> to a cash register...
> Date: Mon, 11 Sep 2006 10:42:37 -0500
> From: Mitch Miller <mitch
mdmiller.com>
> To: Man-wai Chang <toylet.toylet
gmail.com>
> References: <ee14r5$ch6$1
sea.gmane.org>
> <3B.02.21785.2A914054
pb1.pair.com> <ee3vjd$dr5$1
sea.gmane.org>
>
> I think I'd be tempted to write a simple socket listener app., that
> could listen on a TCP/IP port and when it makes a connection (and
> optionally gets the right command), could open the register.
>
> There are lots of examples of socket listener apps. done in Perl (check
> Google), but the local app. would *not need* to be in Perl (that's just
> one I've used personally).
>
> Once the app. is running, simply connecting to
> http://localhost:secret-portnum *could* be enough to make the app. open
> the register (by sending the right command to the serial port).
>
> Using this technique, any HTML that references
> http://localhost:secret-portnum would open the register, regardless of
> how the HTML is generated.
>
> -- Mitch
>
>
> Man-wai Chang wrote:
>>>That 100% depends on how the cash register works. Is it an NT cash
>>>register, or an propitiatory one? Is it rs232 or on a network?
>>>Basically, find out how the cash register can be controlled, then make a
>>>php script that can fire that control.
>>
>>
>> Thanks.
>>
>> It's a RS232 serial register. PHP, running at the server side, could
>> talk to the hardware at the client side? Or is it ActiveX?
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
I'm trying to read a MySpace FriendID out of a web page. If you view
the source, you see this is multiple places:
.....&friendID=12345&....
What's the simplest way to extract the FriendID and stick it in a
variable? Is there a regex that would do this?
attached mail follows:
Brian Dunning wrote:
> I'm trying to read a MySpace FriendID out of a web page. If you view the
> source, you see this is multiple places:
>
> .....&friendID=12345&....
>
> What's the simplest way to extract the FriendID and stick it in a
> variable? Is there a regex that would do this?
>
Is it always in that format?
preg_match ( "/&friendID=(\d{5,})&/", $source, $id );
The result will be in $id[1].
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
That did it, thanks! :)
attached mail follows:
Brian Dunning wrote:
> That did it, thanks! :)
>
Keep in mind that if the ID is less than 5 digits, it won't match (I
don't know where MySpace ID's start). You can change it to something
like \d{1,} if you want it to match 1 or more digits.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnichel
dotcomholdingsofbuffalo.com
attached mail follows:
I am embarrassed to ask this. If I set a cookie for 30 days, and the
visitor comes back 25 days later but I do nothing to re-set the
cookie, will his cookie expire in 5 days, or does his browser
automatically reset it to another 30 days?
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brian Dunning wrote:
> I am embarrassed to ask this. If I set a cookie for 30 days, and the
> visitor comes back 25 days later but I do nothing to re-set the cookie,
> will his cookie expire in 5 days, or does his browser automatically
> reset it to another 30 days?
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It will expire in 5 days.
- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
cweldon
cerberusonline.com
979.739.5874
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFBaHLZxvk7JEXkbERAgBXAJ400jfYjm5EggSZpCKt8s2tnEpy5QCgt3yZ
8Och6y0aCPxgJw6t1R/VQnE=
=oH63
-----END PGP SIGNATURE-----
attached mail follows:
Brian Dunning wrote:
> I am embarrassed to ask this. If I set a cookie for 30 days, and the
> visitor comes back 25 days later but I do nothing to re-set the
> cookie, will his cookie expire in 5 days, or does his browser
> automatically reset it to another 30 days?
>
That depends on if you reset the cookie when they come back or not. If
your routines set the cookie only if the cookie does not already exist,
then it would not reset the cookie at 25 days, so it would indeed expire
5 days after that.
If you check to see if the cookie exists first, and then reset the
expiration date at that time, then the cookie would last for another 30
days...
Tim.
attached mail follows:
Hi to all,
i am having one doubt regarding php mail function.i am using php mail() function to send mail to the users.but when i send mail throught php its going to the users bulk folder but not to the user inbox.i dont know the reason.
Is there any setting that is requried in the php.ini file (or) the user have to change their setting in their mail (or) is there any option available to send mail to the user inbox.tnxs for reply
A.suresh
---------------------------------
Find out what India is talking about on - Yahoo! Answers India
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
suresh kumar wrote:
> Hi to all,
> i am having one doubt regarding php mail function.i am using php mail() function to send mail to the users.but when i send mail throught php its going to the users bulk folder but not to the user inbox.i dont know the reason.
>
> Is there any setting that is requried in the php.ini file (or) the user have to change their setting in their mail (or) is there any option available to send mail to the user inbox.tnxs for reply
>
> A.suresh
>
>
>
>
> ---------------------------------
> Find out what India is talking about on - Yahoo! Answers India
> Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
There are several things you need to check for, and probably add to your
emails that you're sending.
Number one, add additional headers to make SPAM / Bulk filters realize
the message is not SPAM or should not be considered SPAM. IE:
$headers = "From: Suresh Kumar <myemail
host.net>\r\n".
"X-Mailer: PHP 4.3.2\r\n".
"X-Sender: $_SERVER['HTTP_HOST']\r\n".
"X-Comment: If you can put a comment here, do it.\r\n";
mail($to, $subject, $body, $headers);
The above is considering you have already declared the $to, $subject,
and $body variables. Also, make sure your $subject is not
'undisclosed-recipients;' or something like that - it's a big no-no and
will definitely flag some SPAM filters. Put a valid e-mail address - but
you can still use the BCC-headers and everything should go just fine.
Alternatively, if your list is not too large, it looks better to run a
for / while loop to send each recipient a message directly (ie: not
using BCC) as that will cut down on the SPAM probability.
Second, if you are making MIME emails, make sure you are doing so
correctly. You can learn about creating multipart/alternative MIME
emails more at www.php.net/mail.
Finally, if none of the above works, it would be helpful for us to see
the headers of the received message from one of your recipients where
the message was put in the BULK folder.
- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
cweldon
cerberusonline.com
979.739.5874
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFBaG2Zxvk7JEXkbERAgZiAKCJVQfno2fAca13Sx7aXPWD2WMgUwCeOMBX
grbViYDnAXXy8l1i4liVHzE=
=ka5I
-----END PGP SIGNATURE-----
attached mail follows:
On 9/10/06, Micky Hulse <micky
ambiguism.com> wrote:
> Christopher Weldon wrote:
> > What's the error, and how do you have the class and functions defined?
>
> Hi Christopher, thanks for asking. :)
>
> Actually, it was one of those silly, right in front of my face, logic
> errors...
>
> class RandomSplash {
> var $alphabet = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
> 'k', 'l', 'm');
> function randomize($what) {
> switch($what) {
> case 'css':
> $data = $this->$alphabet;
> ...
> ...
> ...
> }
> }
>
> See the error?
For future reference it is best you provide a full code example in
what your problem is when you ask the question, Asking if it something
is proper isn't going to get you far.
<?php echo $am_somevar; ?>
is perfectly valid but accoring to the mistake you had you should have
been using:
<?php echo $I_am_somevar;?>
It would have been more relevant to supply the problem along with the solution.
>
> $data = $this->$alphabet;
>
> should've been:
>
> $data = $this->alphabet;
>
> At first I thought it was how I was calling the class... all works now
> though. :)
Good to hear you got it resolved..
Curt.
attached mail follows:
Hi Curt, thanks for the feedback/input and your time. :)
Curt Zirzow wrote:
> It would have been more relevant to supply the problem along with the
> solution.
Definitely. Sorry about that. Sometimes I post questions to forums/lists
without thinking things through more thoroughly... Hehe, I half blame
that on sleep deprivation and half on ADD. Lol, or something. :)
I will be sure to take your advice into account for my future posts to
this and other lists.
Thanks again. Have a great day.
Cheers,
Micky
--
Wishlist: <http://snipurl.com/vrs9>
Switch: <http://browsehappy.com/>
BCC?: <http://snipurl.com/w6f8>
My: <http://del.icio.us/mhulse>
attached mail follows:
On 9/11/06, Micky Hulse <micky
ambiguism.com> wrote:
> Hi Curt, thanks for the feedback/input and your time. :)
>
> Curt Zirzow wrote:
> > It would have been more relevant to supply the problem along with the
> > solution.
>
> Definitely. Sorry about that. Sometimes I post questions to forums/lists
> without thinking things through more thoroughly... Hehe, I half blame
> that on sleep deprivation and half on ADD. Lol, or something. :)
No problems at all. I just noticed that the question you originally
proposed couldn't really be solved without more info other wise
everyone would be guessing at what the issue is.. And in the end you
solved your own problem.
It is a common thing to do such a thing, i tend to practice this
method of posting questions to ensure i provide enough information to
solve the issue:
1) compose a question
2) forget the question was about and read the question, and see if
it is even able to be solved.
3) if it cant be solved, include a statement like: I've been looking
over this and can't see what I'm missing (type of thing).
Curt.
>
> I will be sure to take your advice into account for my future posts to
> this and other lists.
heh.. now you have more advice to consider.. :)
>
> Thanks again. Have a great day.
No problem.
Curt.
attached mail follows:
Hello,
I would appreciate your help. I am trying to get php and apache work
together and have a strange error while starting apache:
Can't locate API module structure `php4_module' in file
/usr/local/libexec/apache2/libphp5.so: Undefined symbol "php4_module"
I am using PHP 5.1.6 (cli) and Apache/2.0.59 on a FreeBSD 6.1 stable
release. Could anyone offer any suggestion why php4_module is missing in
libphp5.so?
Many thanks!
--
Zbigniew Szalbot
attached mail follows:
On 9/11/06, Zbigniew Szalbot <admin
szalbot.homedns.org> wrote:
> Hello,
>
> I would appreciate your help. I am trying to get php and apache work
> together and have a strange error while starting apache:
>
> Can't locate API module structure `php4_module' in file
> /usr/local/libexec/apache2/libphp5.so: Undefined symbol "php4_module"
How did you install both php and apache?
Curt
attached mail follows:
On Mon, 11 Sep 2006, Curt Zirzow wrote:
Hello,
> > I would appreciate your help. I am trying to get php and apache work
> > together and have a strange error while starting apache:
> >
> > Can't locate API module structure `php4_module' in file
> > /usr/local/libexec/apache2/libphp5.so: Undefined symbol "php4_module"
>
> How did you install both php and apache?
Thanks for such a fast response. I used portinstall. I did have apache
1.3.37 at the beginning but it later turned out that for some reason I
will have to upgrade for apache 2.x so I ran pkg_delete and the went for
apache2.
I am quite new to FreeBSD but the machine is not online and I want to test
and learn. I need these to working as I am running/testing/learning exim
and plan to use vexim in future. Probably irrelevant here but I am willing
to provide output.
Here is the content of php5 options:
_OPTIONS_READ=php5-5.1.6
WITH_CLI=true
WITH_CGI=true
WITH_APACHE=true
WITHOUT_DEBUG=true
WITHOUT_SUHOSIN=true
WITH_MULTIBYTE=true
WITH_IPV6=true
WITH_REDIRECT=true
WITH_DISCARD=true
WITH_FASTCGI=true
WITH_PATHINFO=true
Many thanks for your help!
--
Zbigniew Szalbot
attached mail follows:
On 9/11/06, Zbigniew Szalbot <admin
szalbot.homedns.org> wrote:
> On Mon, 11 Sep 2006, Curt Zirzow wrote:
> Hello,
>
>
> > > I would appreciate your help. I am trying to get php and apache work
> > > together and have a strange error while starting apache:
> > >
> > > Can't locate API module structure `php4_module' in file
> > > /usr/local/libexec/apache2/libphp5.so: Undefined symbol "php4_module"
> >
> > How did you install both php and apache?
>
> Thanks for such a fast response. I used portinstall. I did have apache
> 1.3.37 at the beginning but it later turned out that for some reason I
> will have to upgrade for apache 2.x so I ran pkg_delete and the went for
> apache2.
This is where port understanding comes in handy, I avoid port
installation of my server level of applications (php/apache/db).
If I understand correctly you first did a portinstall to get
apache/php4 installed and then did a pkg_delete to remove those old
versions and then added portinstall php5. What seems to be happening
is that you have an apache version that is trying to load php4 but
php5 is installed and thus the error. There are two options i think
will help:
1) start over
2) ensure there arn't any current port issues (via the bsd port mailing list)
Or
1) install php/apache/(db) manually and manage updates yourself.
What ever is the case it is obvious that you have conflicting
(configuration/installation)'s.
You might also want to try some bsp-port resources on searching for
what is going wrong.
HTH,
Curt.
attached mail follows:
On Mon, 11 Sep 2006, Curt Zirzow wrote:
Hi there again,
> > Thanks for such a fast response. I used portinstall. I did have apache
> > 1.3.37 at the beginning but it later turned out that for some reason I
> > will have to upgrade for apache 2.x so I ran pkg_delete and the went for
> > apache2.
>
> This is where port understanding comes in handy, I avoid port
> installation of my server level of applications (php/apache/db).
>
> If I understand correctly you first did a portinstall to get
> apache/php4 installed and then did a pkg_delete to remove those old
> versions and then added portinstall php5. What seems to be happening
> is that you have an apache version that is trying to load php4 but
> php5 is installed and thus the error. There are two options i think
> will help:
> 1) start over
OK. Thanks! I did try to start over by deleting php5 and issuing make,
make install and make clean. However, the result was just the same.
I need to go to BSD lists to find out how to completely wipe out PHP from
the system so that there is no trace of it left. Would that be a good
solution for a newbie in *nix systems in general?
Thanks again. I really appreciate that you are devoting so much of your
time to help me!
Warm regards,
--
Zbigniew Szalbot
attached mail follows:
Hi,
Please, please forgive! How dumb a person (me!) can sometimes be....!
I looked at httpd.conf again and saw that instead of replacing php4.so
library object I added a new line with php5 entry...
Sorry to have bothered!
Thanks!
Zbyszek
On Mon, 11 Sep 2006, Zbigniew Szalbot wrote:
> On Mon, 11 Sep 2006, Curt Zirzow wrote:
> Hi there again,
>
>
> > > Thanks for such a fast response. I used portinstall. I did have apache
> > > 1.3.37 at the beginning but it later turned out that for some reason I
> > > will have to upgrade for apache 2.x so I ran pkg_delete and the went for
> > > apache2.
> >
> > This is where port understanding comes in handy, I avoid port
> > installation of my server level of applications (php/apache/db).
> >
> > If I understand correctly you first did a portinstall to get
> > apache/php4 installed and then did a pkg_delete to remove those old
> > versions and then added portinstall php5. What seems to be happening
> > is that you have an apache version that is trying to load php4 but
> > php5 is installed and thus the error. There are two options i think
> > will help:
> > 1) start over
>
> OK. Thanks! I did try to start over by deleting php5 and issuing make,
> make install and make clean. However, the result was just the same.
>
> I need to go to BSD lists to find out how to completely wipe out PHP from
> the system so that there is no trace of it left. Would that be a good
> solution for a newbie in *nix systems in general?
>
> Thanks again. I really appreciate that you are devoting so much of your
> time to help me!
>
> Warm regards,
>
> --
> Zbigniew Szalbot
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Zbigniew Szalbot
attached mail follows:
On 9/8/06, Robert Cummings <robert
interjinn.com> wrote:
> On Fri, 2006-09-08 at 15:30 -0600, Jeremy Privett wrote:
> > Well, it could be this, too:
> >
> > switch( $_REQUEST['id'] ) {
> > case "white":
> > echo "Right color.";
> > break;
> >
> > case "black":
> > echo "Right color.";
> > break;
> >
> > default:
> > echo "Wrong color.";
> > break;
> > }
>
> Ugh, if you're going to use a big ugly case statement for something so
> trivial at least make use of the fall-through feature:
>
> <?php
> switch( $_REQUEST['id'] )
> {
> case 'white':
> case 'black':
> {
> echo 'Right color.';
> break;
> }
I don't know about big and ugly, it seems more clear on what is going
on in this situation. But yeah it is best to clearify the switch as
you rewrote it.
curt.
attached mail follows:
Hello all,
I don't really get it to work with that functions from http://www.php.net/manual/en/ref.dom.php
I try to get the content of <td> fields on an external html page, where I just know some ids of the rows.
Example:
...
<tr id = 'tr01'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr02'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr01'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr02'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
...
PS: Please note, that id is written more than once. So DomDocument->getElementById('tr01') returns only one element and not two or more...
I can't find out how to grab the data in the td fields... I don't find examples to look at... :-(
I'd be really glad if somebody could give me some advice or tutorial websites about that...
Thanks a lot
LS
--
"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
attached mail follows:
To start with, an ID should never be repeated. A name can be repeated, an
ID shouldn't. That is why there is a function to get an array of elements
with a certain name but there is none to get a list of elements with the
same ID simply because there shouldn't be any. Something helpful in
traversing the DOM is any tool that gives you a good view of the tree
structure. One such comes already in the Firefox browser.
Satyam
----- Original Message -----
From: "Leonidas Safran" <Elektrik
gmx.net>
To: <php-general
lists.php.net>
Sent: Monday, September 11, 2006 11:11 PM
Subject: [PHP] DOM - parse HTML document
> Hello all,
>
> I don't really get it to work with that functions from
> http://www.php.net/manual/en/ref.dom.php
>
> I try to get the content of <td> fields on an external html page, where I
> just know some ids of the rows.
>
> Example:
> ...
> <tr id = 'tr01'>
> <td>1</td><td>2</td><td>3</td><td>4</td>
> </tr>
> <tr id = 'tr02'>
> <td>1</td><td>2</td><td>3</td><td>4</td>
> </tr>
> <tr id = 'tr01'>
> <td>1</td><td>2</td><td>3</td><td>4</td>
> </tr>
> <tr id = 'tr02'>
> <td>1</td><td>2</td><td>3</td><td>4</td>
> </tr>
> ...
>
> PS: Please note, that id is written more than once. So
> DomDocument->getElementById('tr01') returns only one element and not two
> or more...
>
> I can't find out how to grab the data in the td fields... I don't find
> examples to look at... :-(
>
> I'd be really glad if somebody could give me some advice or tutorial
> websites about that...
>
>
> Thanks a lot
>
> LS
> --
>
>
> "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Hello Satyam,
Thanks for your answering...
>> I don't really get it to work with that functions from
>> http://www.php.net/manual/en/ref.dom.php
>> I try to get the content of <td> fields on an external html page, where
>> I just know some ids of the rows.
>> Example:
>> ...
>> <tr id = 'tr01'>
>> <td>1</td><td>2</td><td>3</td><td>4</td>
>> </tr>
>> <tr id = 'tr02'>
>> <td>1</td><td>2</td><td>3</td><td>4</td>
>> </tr>
>> <tr id = 'tr01'>
>> <td>1</td><td>2</td><td>3</td><td>4</td>
>> </tr>
>><tr id = 'tr02'>
>> <td>1</td><td>2</td><td>3</td><td>4</td>
>> </tr>
>> ...
>> PS: Please note, that id is written more than once. So
>> DomDocument->getElementById('tr01') returns only one element and not two
>> or more...
>> I can't find out how to grab the data in the td fields... I don't find
>> examples to look at... :-(
>> I'd be really glad if somebody could give me some advice or tutorial
>> websites about that...
> To start with, an ID should never be repeated. A name can be repeated,
> an ID shouldn't. That is why there is a function to get an array of
> elements with a certain name but there is none to get a list of elements
> with the same ID simply because there shouldn't be any. Something
> helpful in traversing the DOM is any tool that gives you a good view of
> the tree structure. One such comes already in the Firefox browser.
Unfortunately, I have no way to modify the source html page, it's on the web.
By the way, because I found it strange to have more than one field with the same id, I looked on the famous selfhtml tutorial website http://de.selfhtml.org which says that unique id is only mandatory for css, but not for javascript actually. I was surprised...
http://de.selfhtml.org/css/formate/zentrale.htm#individualformate
http://en.selfhtml.org/css/formate/zentrale.htm#individualformate
(english translation is a little different)
LS
--
"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
attached mail follows:
The techs at Rackspace just enabled SOAP for me. I have a command:
$soap = new SoapClient('http://geocoder.us/dist/eg/clients/
GeoCoderPHP.wsdl');
which works fine on my PHP 5.1.6 development server, but it won't run
on my 4.3.9 server at Rackspace. The only place 'soap' appears in
phpinfo() is '--with-soap' up in the Configure Command section. There
is no Soap section further down on the page, as there is on my dev
server (which, I notice, says '--enable-soap' instead).
Is it possible that the Rackspace techs didn't do something right?
That would be a first indeed.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]