How did you created the table? Can you count the Id's only? Wouldn't
this just count the entries in the index?
On 28/01/2011 12:57, AmirBehzad Eslami wrote:
Dear list,
The common solution for counting online users is to store sessions in a Table.
I've created a Table in MySQL to acheive the
On 1/28/2011 9:57 AM, AmirBehzad Eslami wrote:
Dear list,
The common solution for counting online users is to store sessions in a Table.
I've created a Table in MySQL to acheive the result, but it seems this
solution
is a little heavy for such a simple task.
Is there a better
Jim, I'm already using the solution you mentioned.
The problem is about the performance.
One solution is to increase the performance by using Memcached.
But counting online users always requires a __new__fresh__ COUNT(*) query, even
under Memcahched. Since the COUNT(*) result is very dynamic and
If you're using memcached already you could store the number in it and
update it only when a user logs in/out. If no one is logging in/out, the
number isn't changing.
If your site is so popular that hundreds of users are logging in every
second you might want to change the logic so that the
I'm looking for a faster way to count online users. COUNT(*) is time
consuming under MySQL.
If COUNTing is the heavy part, why not create a 'users_logged_in'
field somewhere and increment it when someone logs in and decrement it
when someone logs out? Then your query is just a straight
On Fri, Jan 28, 2011 at 11:03 AM, Marc Guay marc.g...@gmail.com wrote:
If COUNTing is the heavy part, why not create a 'users_logged_in'
field somewhere and increment it when someone logs in and decrement it
when someone logs out? Then your query is just a straight SELECT.
If this is like
On 1/28/2011 11:23 AM, David Harkness wrote:
On Fri, Jan 28, 2011 at 11:03 AM, Marc Guay marc.g...@gmail.com wrote:
If COUNTing is the heavy part, why not create a 'users_logged_in'
field somewhere and increment it when someone logs in and decrement it
when someone logs out? Then your query
If it's a simple x y, you might want to consider putting your if
statement in the SQL query so you don't return so many rows. To make a
counter, just set a variable like:
$counter = 0;
if ($x $y)
{
print $row;
$counter++
}
Thank you,
Micah Gersten
onShore Networks
Internal Developer
// glob returns an ordered list (rtfm: man glob)
// relies on the use of the operator ++ to generate string sequences.
function lastFileInSequence($path, $prefix, $first, $suffix) {
return array_pop(glob($path . / . $prefix . str_repeat('?',
strlen($first)) . $suffix));
}
function
On Sat, 2007-09-29 at 23:47 -0400, brian wrote:
It's not so much that i disrespect Rob. It's just that i felt i had to
call him out for being a dickhead by taking my statement out of context.
Ok, so I'm a dickhead. What does that make you? A vagina?
Name calling really is the lowest form of
gee you guys behave like kids. don't you all have other things to do than
whinge, swear and blame each other on the list? Take it elsewhere and sort
it out. This is bad for the PHP community in general. It doesn't reflect what
the community is about.
my 2c.
On Sunday 30 September 2007 13:47,
At 11:47 PM -0400 9/29/07, brian wrote:
You and i have had our run-ins on this list on more than one
occasion. Until now, i've chosen to take your crap in stride.
brian
I haven't noticed any run-ins. I don't care if you've been the
biggest prick on the net -- if you ask a question and it's
tedd wrote:
At 8:30 PM -0400 9/27/07, brian wrote:
I wasn't bitching! And i *thought* that my numerous attempts at
explaining such would have been enough. Obviously not, but wtf can you
do with people who seem to want only to stir up shit?
It sure sounded like you were bitching.
Gee,
At 8:30 PM -0400 9/27/07, brian wrote:
I wasn't bitching! And i *thought* that my numerous attempts at
explaining such would have been enough. Obviously not, but wtf can you
do with people who seem to want only to stir up shit?
It sure sounded like you were bitching.
And, your off-list fuck
: tedd [mailto:[EMAIL PROTECTED]
Sent: 28 September 2007 17:20
To: brian; php-general@lists.php.net
Subject: Re: [PHP] counting with leading zeros
At 8:30 PM -0400 9/27/07, brian wrote:
I wasn't bitching! And i *thought* that my numerous attempts at
explaining such would have been enough
On Wed, 2007-09-26 at 21:56 -0700, Jim Lucas wrote:
Now, if you plan to delete any images in the list, this will not work.
But if you don't expect to delete any images in the list and always want
the ($total_images + 1), then follow along.
?php
function getNextImage($path, $prefix) {
Robert Cummings wrote:
Suit yourself. But better programmer's don't just wave their hands in
the air and hope for the best.
Ah crap -- there's another technique I have to cross off my list.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
At 3:58 PM -0400 9/26/07, brian wrote:
Well, this is almost precisely the same thing i have, save for using
POSIX character classes, str_pad instead of sprintf(), and
incrementing elsewhere. What i was really wondering is if there was
a *much simpler* way to do this, not just re-arranging
At 10:39 PM -0400 9/26/07, brian wrote:
Now you're obviously just trying to be a dickhead.
While someone is, it's not Rob.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
tedd wrote:
At 3:58 PM -0400 9/26/07, brian wrote:
Well, this is almost precisely the same thing i have, save for
using POSIX character classes, str_pad instead of sprintf(), and
incrementing elsewhere. What i was really wondering is if there was
a *much simpler* way to do this, not just
On Wed, 2007-09-26 at 15:11 -0400, brian wrote:
I have a directory that contains many images (no, not pr0n,
unfortunately) and i'm working on an admin script for adding to it. I've
got something that works alright but i'm wondering if there's a Better Way.
Each image is named like:
Robert Cummings wrote:
On Wed, 2007-09-26 at 15:11 -0400, brian wrote:
I have a directory that contains many images (no, not pr0n,
unfortunately) and i'm working on an admin script for adding to it. I've
got something that works alright but i'm wondering if there's a Better Way.
Each image
On Wed, 2007-09-26 at 15:58 -0400, brian wrote:
Robert Cummings wrote:
On Wed, 2007-09-26 at 15:11 -0400, brian wrote:
I have a directory that contains many images (no, not pr0n,
unfortunately) and i'm working on an admin script for adding to it. I've
got something that works alright
Robert Cummings wrote:
On Wed, 2007-09-26 at 15:58 -0400, brian wrote:
Robert Cummings wrote:
On Wed, 2007-09-26 at 15:11 -0400, brian wrote:
I have a directory that contains many images (no, not pr0n,
unfortunately) and i'm working on an admin script for adding to
it. I've got
On Wed, 2007-09-26 at 19:10 -0400, brian wrote:
Robert Cummings wrote:
Well, this is almost precisely the same thing i have, save for
using POSIX character classes, str_pad instead of sprintf(), and
incrementing elsewhere. What i was really wondering is if there was
a *much simpler*
Robert Cummings wrote:
On Wed, 2007-09-26 at 19:10 -0400, brian wrote:
If my response to that gave you the impression i was
complaining, i assure you that i wasn't. I was simply suggesting
that i was wondering if there was a *much* simpler way to do this, ie.
without using several functions to
On Wed, 2007-09-26 at 22:39 -0400, brian wrote:
Robert Cummings wrote:
On Wed, 2007-09-26 at 19:10 -0400, brian wrote:
If my response to that gave you the impression i was
complaining, i assure you that i wasn't. I was simply suggesting
that i was wondering if there was a *much* simpler
Robert Cummings wrote:
When you use sort() the default behaviour is a lexical sort. This is why
the 100th index breaks your system. I'm not trying to be a dickhead,
just pointing out the flaw in your logic. You may be well aware that in
counting 100 comes after 99, but it would seem you are not
On Thu, 2007-09-27 at 00:23 -0400, brian wrote:
Robert Cummings wrote:
When you use sort() the default behaviour is a lexical sort. This is why
the 100th index breaks your system. I'm not trying to be a dickhead,
just pointing out the flaw in your logic. You may be well aware that in
brian wrote:
I have a directory that contains many images (no, not pr0n,
unfortunately) and i'm working on an admin script for adding to it. I've
got something that works alright but i'm wondering if there's a Better Way.
Each image is named like: foo_01.jpg, foo_02.jpg, bar_01.jpg, and so
On 21/06/07, Richard Davey [EMAIL PROTECTED] wrote:
Hi,
I've written a short regexp which will *count* how many capital letters
are in a given string (the woefully simple: '/[A-Z]/')
Although it's an English language web site, I'm curious how you'd
count capital letters that span beyond just
At 12:32 AM +0100 6/21/07, Richard Davey wrote:
Hi,
I've written a short regexp which will *count* how many capital letters
are in a given string (the woefully simple: '/[A-Z]/')
Although it's an English language web site, I'm curious how you'd
count capital letters that span beyond just the
On 6/15/07, Toni Torello [EMAIL PROTECTED] wrote:
hi guys,
just supposing...
which is the right way to to count the number of code lines in a php
application?
do you think that the raw:
$ find . -name '*.php' -exec cat {} \; | wc -l
can be a good estimate?
I recently desired to know a
Brad Bonkoski wrote:
I think the best way to do this would be to set an onClick (Javascript)
event handler for each of the links, and then use AJAX style stuff to
send the information to PHP on the server side, then PHP can log the
link that was clicked, and keep track of the most clicked
On Sat, February 17, 2007 1:53 pm, clive wrote:
Denis L. Menezes wrote:
Dear friends.
I have a site where I have news headers. I wish to count the clicks
on the
news headers so that I can see how many times each of the the news
has been
viewed. This way I can show the most viewed news.
Denis L. Menezes wrote:
Dear friends.
I have a site where I have news headers. I wish to count the clicks on the
news headers so that I can see how many times each of the the news has been
viewed. This way I can show the most viewed news.
Can one of you please advise hwo this can be done?
Denis L. Menezes wrote:
Dear friends.
I have a site where I have news headers. I wish to count the clicks on the
news headers so that I can see how many times each of the the news has been
viewed. This way I can show the most viewed news.
Can one of you please advise hwo this can be done?
Dotan Cohen wrote:
Has this wheel been invented, but simpler? I've an array of words that
I'd like to know how many occurences of each there are. For instance:
$fruits = array(
lemon,
orange,
banana,
apple,
orange,
banana,
orange);
And I'd like to create this:
At 8:35 PM +0200 12/24/06, Dotan Cohen wrote:
Has this wheel been invented, but simpler? I've an array of words that
I'd like to know how many occurences of each there are. For instance:
$fruits = array(
lemon,
orange,
banana,
apple,
orange,
banana,
orange);
And I'd
Thanks for the link to the function. Know that I did RTFM before
posting, but I missed that one.
Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/219/xyz.php
http://simplesniff.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
Anyone got a script so I can count clicks on adverts. Doesn't have tosve
to
myqsl or anything just a text file will do.
[/snip]
?php
if(yes == $adClicked){
$adClickCountFile = fopen(countClick.txt, w);
$getCount = fgets($adClickCountFile, 4096);
$newCount = $getCount + 1;
On Wed, November 29, 2006 11:21 am, Jay Blanchard wrote:
[snip]
Anyone got a script so I can count clicks on adverts. Doesn't have
tosve
to
myqsl or anything just a text file will do.
[/snip]
?php
if(yes == $adClicked){
$adClickCountFile = fopen(countClick.txt, w);
$getCount =
[snip]
This has a race condition where a busy server, or even a not-so-busy
one where 2 people happen to click at the same time, at least one of
them will be missed, at best.
There's also a distinct possiblity of the counter file getting
completely trashed, depending on the OS and its underlying
Ross wrote:
Anyone got a script so I can count clicks on adverts. Doesn't have tosve to
myqsl or anything just a text file will do.
What about using mysql, but use a memory resident heap table, then every
once in a while write this to a file or even better to a myisam table
Ta
Ross
On Mon, 30 Oct 2006 12:28:29 +0100, Robin Vickery wrote:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On Friday 27 October 2006 19:34, Richard Lynch wrote:
And the
# [EMAIL PROTECTED] / 2006-10-27 20:14:58 +0200:
And the header(Location: ...) requires a full URL.
Why?
HTTP protocol specification[1] says:
14.30 Location
The Location response-header field is used to redirect the recipient
to a location other than the Request-URI for completion of
On 30/10/06, Robert Cummings [EMAIL PROTECTED] wrote:
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On
On Tue, October 31, 2006 4:58 am, Robin Vickery wrote:
On 30/10/06, Robert Cummings [EMAIL PROTECTED] wrote:
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On
On Tue, 2006-10-31 at 11:58 +0100, Robin Vickery wrote:
On 30/10/06, Robert Cummings [EMAIL PROTECTED] wrote:
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On Friday 27 October 2006 19:34, Richard Lynch wrote:
And the header(Location: ...) requires a full URL.
No it doesn't. but he's missing an ' at first glance
Yes, it does:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On Friday 27 October 2006 19:34, Richard Lynch wrote:
And the header(Location: ...) requires a full URL.
No it doesn't. but
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
On 30/10/06, Ivo F.A.C. Fokkema [EMAIL PROTECTED] wrote:
On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On Friday 27 October 2006 19:34, Richard Lynch wrote:
And the
On Fri, October 27, 2006 12:14 pm, [EMAIL PROTECTED] wrote:
And the header(Location: ...) requires a full URL.
Why?
Because the docs say so?
Because some user agents will not do what you want them to if you don't?
--
Some people have a gift link here.
Know what I want?
I want you to buy a CD
On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
On Friday 27 October 2006 19:34, Richard Lynch wrote:
And the header(Location: ...) requires a full URL.
No it doesn't. but he's missing an ' at first glance
Yes, it does:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
- Original Message -
From: Paul Novitski [EMAIL PROTECTED]
While we're talking about optimization, I'd want to check to make sure
COUNT(*) didn't ask MySQL to generate a throw-away recordset consisting of
all fields. I wonder if it would be more machine-efficient to use
Your idea to use 'COUNT(Username)' is just about the ONLY part of that
script that you are doing correctly...
:-)
Start reading here:
http://phpsec.org/
And the header(Location: ...) requires a full URL.
And you should have better error-checking, probably.
[Though maybe you have a custom error
Your idea to use 'COUNT(Username)' is just about the ONLY part of that
script that you are doing correctly...
:-)
:D
And the header(Location: ...) requires a full URL.
Why?
And you should have better error-checking, probably.
[Though maybe you have a custom error handler not apparent]
On Friday 27 October 2006 19:34, Richard Lynch wrote:
Your idea to use 'COUNT(Username)' is just about the ONLY part of that
script that you are doing correctly...
:-)
Start reading here:
http://phpsec.org/
And the header(Location: ...) requires a full URL.
No it doesn't. but he's
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith');
$result = mysql_result($query, 0);
WOW! That was fast!
:D
Thanks Dave!
-afan
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith');
$result = mysql_result($query, 0);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Hm. There is a little problem - this doesn't work.
Warning: mysql_result(): supplied argument is not a valid MySQL result
resource in /var/www/html/xxx/tests/count.php on line 28
?
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
At 10/26/2006 10:38 AM, [EMAIL PROTECTED] wrote:
what would be better solution to count records in table (e.g., how many
customers have last name 'Smith'):
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name =
Sorry, my bad! It works jsut fine. I did misstake.
:)
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith');
$result = mysql_result($query, 0);
--
PHP General Mailing List (http://www.php.net/)
On Thu, October 26, 2006 12:57 pm, Paul Novitski wrote:
$query = mysql_query(
SELECT COUNT(*) as NoOfRecords
FROM customers
WHERE last_name = 'Smith');
$result = mysql_fetch_array($query);
$NoOfRecords = $result['NoOfRecords'];
This would be
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query(
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password');
if (mysql_result($query, 0) == 0)
{
echo
Why would you want to do that? Think about what you're trying to do. In the
first case you want a COUNT of records in the database, in the second you
just want to see if the user/password combination or whatever exist, so just
use a normal SELECT query, no need to use the wrong tool for the
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query(
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password = '$Password');
if (mysql_result($query, 0) == 0)
{
At 10/26/2006 11:16 AM, [EMAIL PROTECTED] wrote:
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query(
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password =
Would it be ok to use the same code to check if customer is loged in?
$query = mysql_query(
SELECT COUNT(Username) as NoOfRecords
FROM customers
WHERE Username = '$Username' AND Password =
'$Password');
if (mysql_result($query, 0) == 0)
I just
start here: http://www.php.net/readdir
check out as well: 'string functions' for finding 'amrs'
and loops to make recursive search...
t.
Nicholas Couloute wrote:
I want a script where it will count all the amrs in a folder and it's
sub folders like this setup:
amrs
50 cent amrs
You can start with looking at some code examples that do similar things :
Directory browser
http://www.weberdev.com/get_example-1539.html
How to get a dir listing of the current dir of php script in an array
http://www.weberdev.com/get_example-1855.html
filesystem Show Files Script
I have used these functions but how would I count them! here is my
attempt that doesn't work!:
$count = 0;
$dir = /amrs;
$files1 = scandir($dir);
if ($files1 !== '.' $files1 !== '..') {
foreach ($files1 as $files2){
$dir2 = /amrs/$files2;
$files3 = scandir($dir2);
if ($files3 !== '.' $files3
here is what I tried but it doesn't work! any advice suggestions or
something?
$count = 0;
$dir = /amrs;
$files1 = scandir($dir);
if ($files1 !== '.' $files1 !== '..') {
foreach ($files1 as $files2){
$dir2 = /amrs/$files2;
$files3 = scandir($dir2);
if ($files3 !== '.' $files3 !== '..') {
That is some nasty code...
Anything that has repitition like that needs a substantial rewrite, but
I'm guessing that you know that, hence the e-mail.
I just knocked up the following function, powered by the magic of
recursion. It should be close to what you were trying to do.
function
Never mind - wasn't adding properly. Found it after all on php.net, anyway.
Thanks anyway.
-Original Message-
From: Ben Miller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 04, 2006 5:01 PM
To: php-general@lists.php.net
Subject: [PHP] Counting in Hex
Is there a way in PHP to count
On 8/17/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
OK this the little function i made to solve this..
function countNested($array){
foreach($array as $value){
if(is_array($value))
$total=$this-countNested($value)+$total;
}else{
hahaha, thanks robin you save some seconds of mi life... it looks more
pro with that if...
On 8/17/05, Robin Vickery [EMAIL PROTECTED] wrote:
On 8/17/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
OK this the little function i made to solve this..
function countNested($array){
Ing. Josué Aranda wrote:
Hi to everyone..
now i have a little problem counting an nested array. Im using it to
fill a Java TreeView... it looks like this:
[snip]
The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested
On 8/16/05, Ing. Josué Aranda [EMAIL PROTECTED] wrote:
The number of the branches is not always the same.. (it depends on the
query).. when i use count($array, COUNT_RECURSIVE) for nested arrays..
it give to me the total including the nodes in the branches ( in this
case 28).. now here is the
OK this the little function i made to solve this..
[CODE]
function countNested($array){
foreach($array as $value){
if(is_array($value))
$total=$this-countNested($value)+$total;
}else{
$total=$total+1;
}
}
On Tuesday 17 May 2005 13:00, Merlin wrote:
Hi there,
I am trying to find a way to count the number of times (if any) words are
inside a string. So I played around with ereg, preg_match_all and so on,
but could not put together a working code.
Can anybody help me on that?
This is the
On Tue, 2005-05-17 at 06:00, Merlin wrote:
Hi there,
I am trying to find a way to count the number of times (if any) words are
inside
a string. So I played around with ereg, preg_match_all and so on, but could
not
put together a working code.
Maybe something like this?
?php
$words =
On Tuesday 17 May 2005 18:00, Merlin wrote:
I am trying to find a way to count the number of times (if any) words
are inside a string.
explode()
array_count_values()
--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design Hosting *
You basically dont need the for loop all you have to do is increment the
value of the variable by one each time in the while loop
Devraj
Louie Miranda wrote:
Hi, im trying to create a number loop on a table where the data came
in a database.
I have tried the for loop and counted
Hi Louie,
Excellent example! i wish more users would take the time to provide such
clear examples.
The strlen() exists for you :)
ie.
?php
$string = function yes good;
$display = strlen($string);
echo $display;
?
:)
Best Regards
Jake Press
Louie Miranda wrote:
?php
$string = function yes good;
On Thu, 2004-12-16 at 14:28 +0800, Louie Miranda wrote:
?php
$string = function yes good;
$display = count_chars($string);
echo $display;
?
i know this is wrong, but how can i count chars used here?
php.net/strlen ?
-Robby
--
/***
* Robby Russell |
On Tuesday 20 July 2004 16:44, Rausch Alexandru wrote:
I have a script that creates automatically a zip arhive.
The script works fine, but I want to count downloads, and I made that
to, but if the user click cancel in the download panel the download it
is also counting. How can I prevent this
Hi,
Friday, April 23, 2004, 11:50:56 PM, you wrote:
RD Hi all,
RD It's a warm sunny day and I'm trying to wrap my head around the
RD following:
RD I want to be able to check to see if, in a string, the user has
RD entered too many consecutive characters and not enough spaces. For
RD example
--- Richard Davey [EMAIL PROTECTED] wrote:
I want to be able to check to see if, in a string, the user has
entered too many consecutive characters and not enough spaces. For
example they might enter a subject like:
hello world! how arrre you today?!!
Does
Adriaan Nel wrote:
Hi,
I am using the following piece of code, to download files, but the files are
allways corrupt...what am I doing wrong?
if ($submit) {
$full_filename = $_POST[full_filename];
$filename = $_POST[filename];
$dir = $_POST['dir'];
$size = $_POST[size];
$id = $_POST[id];
The variables I submit, are retrieved from a database...so users can't enter
anything,
I do have a warning inserted at the beginning of the file, how do I remove
this warning?
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Adriaan Nel wrote:
Hi,
I am using the
Adriaan Nel wrote:
The variables I submit, are retrieved from a database...so users can't enter
anything,
What do you mean? Even if the variables are in a hidden input field,
anyone can change them. For example one can save the page and change
them in html source.
I do have a warning inserted
[snip]
can someone point me to the right place for a thing that would count
charactors in a string?
[/snip]
http://www.php.net/strlen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello Philip,
Tuesday, January 6, 2004, 6:25:34 PM, you wrote:
PJN can someone point me to the right place for a thing that
PJN would count charactors in a string?
count_chars() and strlen()
--
Best regards,
Richardmailto:[EMAIL PROTECTED]
--
PHP General Mailing
Hi Philip,
strlen() will work.
http://www.php.net/manual/en/function.strlen.php
Best Regards,
--
Tyler Longren
J.D. Web Services, L.C.
On Wed, 2004-01-07 at 01:25, Philip J. Newman wrote:
can someone point me to the right place for a thing that would count charactors in a
string?
---
Hello Tristan,
Monday, January 5, 2004, 11:29:16 AM, you wrote:
TPrsc But is there an easy was to calculate 90 days from the timestamp...
Based on the current time:
$previous_90_days_timestamp = strtotime (-90 day);
All in one:
$previous_90_days_date = date(Y-m-d, strtotime(-90 day));
--
Hi Tris,
But is there an easy was to calculate 90 days
from the timestamp...
There are 86400 seconds in a day... can't you just do something like:
$timestamp -= (86400 * 90);
Or even
$timestamp -= 7776000; // 90 days
Cheers
Jon
--
PHP General Mailing List (http://www.php.net/)
To
Easier way to do that is like so:
$archive_date = date(Y-m-d, (time()-(86400*90)));
I use this same kind of calculation for getting a date in the future.
86400 is the number of seconds in a day. Time returns the Unix
Timestamp, just like you would get with mktime(). Makes for a lot less
code and
My word...
6 odd lines, to one...
you're a genius...
Cheers for that...
Tris...
Richard Davey [EMAIL PROTECTED]
05/01/2004 11:45
Please respond to
Richard Davey [EMAIL PROTECTED]
To
[EMAIL PROTECTED]
cc
[EMAIL PROTECTED] [EMAIL PROTECTED]
Subject
Re: [PHP] Counting back 90 days
Richard Davey [EMAIL PROTECTED] 05/01/2004 11:45:
Based on the current time:
$previous_90_days_timestamp = strtotime (-90 day);
All in one:
$previous_90_days_date = date(Y-m-d, strtotime(-90 day));
On Mon, Jan 05, 2004 at 11:55:36AM +, [EMAIL PROTECTED] wrote:
My word...
6 odd
1 - 100 of 162 matches
Mail list logo