php-general Digest 12 Aug 2008 18:48:06 - Issue 5620
Topics (messages 277992 through 277992):
strip_tags
277992 by: Philip Thompson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To
Hi all.
If you are sanitizing _POST input for a database by escaping (via
mysql_*), is there a reason to use strip_tags()? If so, why and could
you provide an example?
Thanks,
~Philip
innerHTML is a string. The DOM is not a string, it's a hierarchal
object structure. Shoving a string
If you are sanitizing _POST input for a database by escaping (via mysql_*),
is there a reason to use strip_tags()? If so, why and could you provide an
example?
Not really, as long as you're using something like
mysql_real_escape_string(). Though if you're redisplaying it to your
users (ie
On Aug 12, 2008, at 2:01 PM, Richard Heyes wrote:
If you are sanitizing _POST input for a database by escaping (via
mysql_*),
is there a reason to use strip_tags()? If so, why and could you
provide an
example?
Not really, as long as you're using something like
mysql_real_escape_string().
On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson [EMAIL PROTECTED] wrote:
Hi all.
If you are sanitizing _POST input for a database by escaping (via mysql_*),
is there a reason to use strip_tags()? If so, why and could you provide an
example?
Thanks,
~Philip
The database won't care
Actually, yes, the data is likely to be redisplayed to the users on a
website.
I covered that in my answer. Likely maybe; a certainty no.
However, when shoving the data to the browser, I use
htmlentities(). Is it recommended to use strip_tags() before sending to
htmlentities()?
Not unless
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 2008-08-12 at 15:18 -0500, Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
Please provide the list with the following
[snip]
Please provide the list with the following output:
?php
var_dump( $balanceTest );
var_dump( $oldLineArray[16] );
?
Methinks you have different data types.
[/snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
--
[snip]
?php
var_dump( $balanceTest );
var_dump( $oldLineArray[16] );
?
Methinks you have different data types.
[/snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
[/snip]
settype($balanceTest, float) had no effect
--
[snip]
string(5) 15.22
float(15.22)
You're right*smacks forehead*. Sometimes this whole forest and trees
thing kills me.
[/snip]
settype($balanceTest, float) had no effect
[/snip]
$diff = round(abs($balanceTest), 2) - round(abs($oldLineArray[16]), 2);
Works? Does round convert the string
below is the output I'm seeing along with my code. There are 11425 items in
the database, many of each of these possible values for $i[4], however
you'll see from my Output that the $iiscount variable is the only one being
incremented and it is getting incremented for every row in the table.
Nevermind, I figured it out. I needed to make the if statements use ==
instead of = like this:
if ($i[4] == IISRESET) {
$iiscount = $iiscount + 1;
}
etc. =)
Vinny Gullotta [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
below is the output I'm seeing along with my code. There are
Why not let the DB do this for you? You can group by whatever column
that is and select count(*), column_your_looking_for.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Vinny Gullotta wrote:
Nevermind, I figured it out. I needed to make the if statements
On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote:
On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson [EMAIL PROTECTED]
wrote:
Hi all.
If you are sanitizing _POST input for a database by escaping (via
mysql_*),
is there a reason to use strip_tags()? If so, why and could you
provide an
Well, what I need to be able to do is then take the numbers of each count
and figure out which is used the most. We use this database to log actions
taken on servers in our network. What my boss wants me to come up with is a
list of which commands are issued the most, which servers get the most
On Tue, Aug 12, 2008 at 4:53 PM, Philip Thompson [EMAIL PROTECTED] wrote:
On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote:
On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson [EMAIL PROTECTED]
wrote:
Hi all.
If you are sanitizing _POST input for a database by escaping (via
mysql_*),
is
Well, MySQL can aggregate the data for you so you don't have to pass it
to PHP. It can just give you the results. I suggest reading up on the
SELECT COUNT syntax and the GROUP BY syntax in MySQL.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Vinny
Hello,
I am working on data migration for one mysql db to another using PHP. How do
I check if a particular table has a particular column. If not alter...
Thanks
On Aug 12, 2008, at 4:11 PM, Andrew Ballard wrote:
On Tue, Aug 12, 2008 at 4:53 PM, Philip Thompson [EMAIL PROTECTED]
wrote:
On Aug 12, 2008, at 2:10 PM, Andrew Ballard wrote:
On Tue, Aug 12, 2008 at 2:47 PM, Philip Thompson [EMAIL PROTECTED]
wrote:
Hi all.
If you are sanitizing _POST
[snip]
I am working on data migration for one mysql db to another using PHP.
How do
I check if a particular table has a particular column. If not alter...
[/snip]
Use DESCRIBE TABLE;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
I do not see how it makes any difference if $balanceTest and $oldLineArray[16]
are
Vinny Gullotta wrote:
Well, what I need to be able to do is then take the numbers of each
count and figure out which is used the most. We use this database to log
actions taken on servers in our network. What my boss wants me to come
up with is a list of which commands are issued the most,
Hi gang:
I wish I had another identify for asking dumb questions, but it's
late and I'm tried -- so here goes.
I have a herdoc that I send out as an email -- no problems there.
However, how do I include a link within it?
If I use http://example.com, it's just a string but not an actual
On Tue, 12 Aug 2008 22:07:41 -0400, tedd sperling wrote:
I have a herdoc that I send out as an email -- no problems there.
However, how do I include a link within it?
If I use http://example.com, it's just a string but not an actual link.
So, how do you format a link in a heredoc?
a) most
tedd wrote:
Hi gang:
I wish I had another identify for asking dumb questions, but it's late
and I'm tried -- so here goes.
I have a herdoc that I send out as an email -- no problems there.
However, how do I include a link within it?
If I use http://example.com, it's just a string but not
On Tue, 2008-08-12 at 14:59 -0700, Jim Lucas wrote:
Jay Blanchard wrote:
abs($balanceTest) = 15.22
abs($oldLineArray[16]) = 15.22
$diff = abs($balanceTest) - abs($oldLineArray[16]);
echo abs($diff) . \n;
1.7763568394E-15
WTF? This should be a big fat 0
I do not see how
Robert, when you do yours, it's performing the same function on two
different variable types and has to do a conversion before the function
works. He was doing a numeric function on a string which might be
giving the funky results.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
On Tue, 2008-08-12 at 23:23 -0500, Micah Gersten wrote:
Robert, when you do yours, it's performing the same function on two
different variable types and has to do a conversion before the function
works. He was doing a numeric function on a string which might be
giving the funky results.
29 matches
Mail list logo