Why not let mysql do it? It has a function do to exactly that, I
think...
But php's date() is the function you're looking for...
-Original Message-
From: Ragnar [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Formating datevariables...
I think someone working on learning php after learning C was a little
too printf() happy :)
-Original Message-
From: B i g D o g [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 3:34 PM
To: PHP GEN
Subject: [PHP] Comma question
Tried to check the archive, but it is offline...
Wh
Yes. Write a daemon which listens on a socket and manages the
communications it gets from the satellite scripts and works the database
for them...
The scripts send off data, and process replies. They don't do the heavy
work...
-Original Message-
From: David Buerer [mailto:[EMAIL PROTECTE
I agree... its trivial when presented as is. But what would be the
difference when you're doing quite a lot more with only 10 iterations?
100? That's something to think about...
-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 5:21 PM
To: [E
ght matter greatly... its all
situational.
-Original Message-----
From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 1:04 PM
To: 'SP'; 'Remy Dufour'; 'Kondwani Spike Mkandawire';
[EMAIL PROTECTED]
Subject: RE: [PHP] Re: PHP and OO
Whoa! Good idea!
-Original Message-
From: Kurth Bemis (List Monkey) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 2:35 PM
To: Demitrious S. Kelly
Cc: 'Rick Kukiela'; [EMAIL PROTECTED]
Subject: RE: [PHP] ok what kind of crack is my computer smoking?
At 02:19 PM
You check and make sure the date was set right on the box?
You could try "make clean" for everything before configuring...
-Original Message-
From: Rick Kukiela [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 2:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ok what kind of crack i
Save time as a session variable... and if current time minute time is
greater than x seconds, then destroy the session and start over.
-Original Message-
From: Jefferson Cowart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 2:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Sessi
File() or fgets()
-Original Message-
From: Kelly Meeks [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 27, 2002 12:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] grabbing content of a web page...
Howdy,
I know there has to be a way to grab output of an url on another site?
Let's say you wa
Comparison (do not compare the speeds between the versions of php as
they are on different servers under different loads.) The only
conclusion that I can draw from this so far is that different versions
of php handle these situations differently, newer versions may handle
OOP code better that proc
Archives of the mailing list are available here: http://news.php.net/
Tutorials (good as books) check www.zend.com, www.hotscripts.com and
www.phpbuilder.net (com?org?)
-Original Message-
From: Natarajan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 6:40 PM
To: PHP
Subject: [P
No you can do
Index.php?name=apokalyptik&[EMAIL PROTECTED]&subscribe=n
o
&&
';
echo 'NAME: '.$name.chr(10);
echo 'EMAIL:'.$email.chr(10);
echo 'SUBSCRIBE:'.$subscribe;
echo '';
?>
-Original Message-
From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]]
Sent: Wedn
nd sample code if asked, Thanks in advance for the help!
-----------
Whatever works
And the function works fine for any year after 2000
Besides... it was just a quick and dirty example
-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 19, 2002 9:14 AM
To: Demitrious S. Kelly
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP
$refy++;
$refy++;
$refy++;
$refy++;
}
return($leap);
}
-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 19, 2002 8:52 AM
To: Demitrious S. Kelly
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Within th
Wouldn't it be easier to convert each date into a unix timestamp, then
subtract... the resulting number is the difference in seconds. Then
devide by 60 for minutes, again for hours 24 for days, etc, etc
-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Friday, April
Use the dir class
-Original Message-
From: Jeroen Timmers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 4:57 AM
To: [General]
Subject: [PHP] Directory
Hello,
can i read a directory for files and other directory's with a php
function
for exameple
d:\localhost\
had the foll
Use an array
1
2
3
$numberofitemids=count($itemid);
echo $itemid[0]; // == 1
echo $itemid[1]; // == 2
echo $itemid[2]; // == 3
cheers
-Original Message-
From: Alia Mikati [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 2:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms in PH
Use a multi-dimensional array... try this as a kind of 'proof of
concept'
';
foreach ( $array["ph10"] as $value ) {
echo ' PH10: '.$value.chr(10);
}
echo '';
echo '';
foreach ( $array["tu4r"] as $value ) {
echo ' TU4R: '.$value.chr(10);
}
echo '';
?>
cheers
-Original Messa
I don't know any offhand... but taking the easy road never produced
anything more secure then a bad IIS server...
Try my walkthrough... (ok... not walkthrough, but example)
http://www.apokalyptik.com/lsftgu/Apache-Frontpage-Mod_ASP-Mod_SSL-Mod_P
erl-Php/index.htm
-Original Message-
From
I believe this is done with mod_rewrite
-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 12:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] fetching a parameter from url like on php.net A mirarcle?
Hi there,
I am wondering how to get a parameter from url
Take a look at this:
";
foreach ( $ourdata as $data ) {
foreach ( $data as $array ) {
echo "Username: ".$array[0]."";
echo "Pnumber: ".$array[1]."";
echo "sec2: ".$array[2]."";
Try a foreach... it works well...
-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] On Behalf Of Lars
Torben Wilson
Sent: Saturday, March 30, 2002 4:38 PM
To: David Johansen
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] For Loop going too long
On Sat, 2002-03-30 at 15:40,
You could use sessions for the script... store a variable in the session
when the page has been completed and make sure the script does not
execute if the current session has the appropriate variable...
-Original Message-
From: David Johansen [mailto:[EMAIL PROTECTED]]
Sent: Saturday, Ma
Run a while loop on your data and pull it into an array
Heres an example (though this pulls from a text file the idea is the
same...) Hope this helps...
";
}
?>
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 4:22 PM
T
Well you'd have to work with inputs, etc... for the key... but the look
isn't hard
$loop=1;
$sleep=300;
while ( $loop == 1 ) {
code();
sleep($sleep);
if ( %%keypresscode%% ) {
$loop = 0;
}
}
I'd probably just touch a file somewhere when I want it t
Why not just limit it to one ?
stuff";
while ( stristr($string, '') ) {
$string=str_replace('', '', $string);
}
echo $string;
?>
something like that would wok well enough...
-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent:
You don't need to do this with PHP... a variable is created when you
assign a value to it. It is also unnecessary to assign a type. PHP will
typecast automatically as necessary
-Original Message-
From: Kjell Hansen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 12:47 PM
To: [
Either severely mis-configure, or make a mistake (damn us humans and our
mistakes :)
-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 11:15 PM
To: Demitrious S. Kelly
Cc: 'David McInnis'; [EMAIL PROTECTED]
Subject: RE: [PHP] Does
That's not entirely true... if php is running as cgi it would need the
execution bit set. Or if someone wanted to write a shell script in php
to be used to help compromise a server it would need to be executable as
well...
-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
The default file permission for new files on the *nix system may be set
to something like 755... that could be the problem...
-Original Message-
From: David McInnis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 11:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Does this seem odd?
Try echo ''.row["name"].'';
if $row["id"] still isn't shown, then you most likely aren't getting the
right data from the database to the correct variable...
-Original Message-
From: Omland Christopher m [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 7:53 PM
To: [EMAIL PROTECTE
I have no idea what you meant to ask... but instead of an ip address I
would use the hostname 'localhost' which most servers are setup by
default to understand as 127.0.0.1 (loopback). And you can add an entry
to /etc/hosts or C:\windows\hosts or c:\winnt\(?system(?32?)\?)hosts
But that's just me
I would check the mail logs on the smtp server ?(if you have access)
or... try this and see if ANY mail is bveing sent to you (assumes a unix
server with sendmail (or compatible) binary installed)
$fp=fopen('./tmp', 'w');
fputs($fp, 'Subject: '.$reportsubject.chr(10));
fputs($fp, $
http://www.apokalyptik.com/ftp/src/bin/ftp_indexer.phps
look at the "Create table" sql queries I used...
-Original Message-
From: Piotr Skorupski [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 24, 2002 11:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Creating table in mySQL db
Hello
Is t
I'm willing to help host the project...
I'd be on a slack 8 box with a cable connection... only one IP address.
It's my home connection so we'd have to share bandwidth... but I think
it could be a valuable resource...
-Original Message-
From: J. Scott Johnson [mailto:[EMAIL PROTECTED]]
Stristr()
-Original Message-
From: David Duong [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 4:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] What is the PHP version of Grep?
I was wondering what is the equvilent of the perl coommand: grep.
Can you list all the files in a certain
it in the future.
Thanks
Cheers!
-Original Message-
From: ...:: Rober2 ::... [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:25 PM
To: Demitrious S. Kelly
Subject: Re: [PHP] A Language Script?
Thanks!!
BTW: do you know about any site that provides the e.g. "en-us" ta
I've been watching the lists from time to time and I see a lot of
requests for information like this floating around. I wonder if people
know of the phpinfo() command... in my experience it's been an
invaluable tool to help with little issues that pop up with 'where do I
find out XXX about XXX' ma
$HTTP_ACCEPT_LANGUAGE
-Original Message-
From: ::: rObEr2 ::: [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] A Language Script?
Hey!
I want to have my website on English, Spanish and Norwegian so I want to
have a PHP script
This is actually a small excerpt from a program I've written in the
past... hope it helps...
function show_downtime_form() {
global $conf_file;
global $filter;
$data=file($conf_file);
foreach ( $data as $line ) {
$bang=explode(':', $line);
I agree. Unless there isn't a product which matches your needs I
personally would consider my time better spent contributing to a project
that has only a short distance left to go rather then starting a new
project which would take months/years before perfection (if there is
such a thing)
Onto m
With less preach and more answer
Using chr(9) will give you a tab
';
echo 'TAB'.chr(9).'TAB'.chr(9).'TAB';
echo '';
?>
cheers
-Original Message-
From: Analysis & Solutions [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 1:29 PM
To: PHP List
Subject: Re: [PHP] How do I make ta
The connection to the ftp may need to be put into passive mode to
transfer any files, and even the directory listings... try that and see
if the problem is fixed... this is especially true on machines accessing
the internet through NAT (network access translation) network
firewalls/servers
-O
Try to simplify the problem
$file='index.php?var=';
$file.=$var;
include($file);
-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] include() question
Why doesn't this work...
include("index.
And I just realized how redundant the checks for less then and grater
then the rand min and rand max are...
Oh well... I'm tired :)
-Original Message-
From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 9:45 PM
To: 'Jeff Sittler'; [
Something to the effect of
$num=0;
do {
$num=rand(33,146);
if ( $num > 90 && $num < 125 ) {
$num=0;
} else if ( $num > 146 || $num < 33 ) {
$num=0;
}
} while ( $num == 0 );
note: ths is just off the top of my head... check for va
Pass along a hidden form which documents exactly what rows have already
been shown
then you could use
$seen=explode(':', $seen); to break it into an array...
after that use a foreach to add a 'and id != '.$seen into the sql query
for every element in $seen... thus not allowing duplicates on
Something like this:
-Original Message-
From: Rodrigo Peres [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 10:11 AM
To: PHP
Subject: [PHP] php array
Hi list,
I think this could be an idiot question but I couldn't find an answer.
I have 4 input text in a html, and I'd like to
I may be wrong, but that's exactly what I ended up having to do... but
don't quote me - I'm just learning OOP
http://www.apokalyptik.com/forum/viewtopic.php?topic=140&forum=6&0
-Original Message-
From: Randall Perry [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 6:52 PM
To: [EM
You can use strtok() with ' ' as the delim
-Original Message-
From: Lee P Reilly [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 8:56 AM
To: PHP List
Subject: [PHP] removing ALL whitespace from a string
Can somebody tell me if there is a function that will remove *all*
whitespac
You haven't given anyone any specifics... nor a link to a phps, so I
cannot be any more specific with my advice
You could probably get away with looking through each of the elements in
the array and using something like
"
if ( substr($element, 0, 1) == $letter ( {
Stuff
If you are running a good mailserver (I use qmail + linux or freebsd)
you can send mail internally without being connected to anything...
generally address@localhost will send without a connection to the
internet, or [EMAIL PROTECTED] if the mail server is configured to
accept mail for domain.com.
I've often wondered the same thing... which is why I've never moved to
OOP
So I'm patiently waiting for a reply to this message as well :)
-Original Message-
From: mojo jojo [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 12:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OOP .. I j
$mail='';
foreach($automail as $mailline) {
$mail.=$mailline;
}
$to = $EMAILADDRESS
$subject = "Thank You for your submission!";
$message = eval($automail);
$fromaddress = "[EMAIL PROTECTED]";
mail($to, $subject, $mail, $fromaddress);
that's my $.02
-Original Message-
From: Kris
http://www.php.net/manual/en/language.variables.predefined.php
$HTTP_HOST
Contents of the Host: header from the current request, if there is one.
$HTTP_REFERER
The address of the page (if any) which referred the browser to the
current page. This is set by the user's browser; not all browsers w
Heres a script I wrote to pull the top viruses from antivirus.com
Hope this helps...
http://www.antivirus.com/');
unset($start);
unset($stop);
$count=0;
foreach($antivirus as $line) {
if ( ! isset($stop) ) {
if ( eregi('Top viruses', $line) ) {
$start=$count;
}
}
Type:
"find / -name mysql -type f 2> /dev/null"
if you see something like /usr/local/bin/mysql then you do (that dosent
mean that the demon is running, but the client is at least installed...
to see if you have the daemon installed
"find / -name safe_mysqld -type f 2> /dev/null"
and to see
function scramble($string) {
$count2++;
while ( $count2 != strlen($string) ) {
$bad=1;
while ( $bad == 1 ) {
$rand=rand(0, (strlen($string) - 1));
if ( $used[$rand] != 1 ) {
ailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 1:41 PM
To: Demitrious S. Kelly
Cc: 'Nick Richardson'; 'PHP General'
Subject: Re: [PHP] Variables containing HTML?
What's the difference between this and the serialize() function?
Erik
On Monday, February 25
Are there any win32 / *nix PHP compilers out there to make a binary
executable. I remember one for win32 a while back but that's no longer
even a glimmer in somebody's eyes anymore. Anyone have any info on the
subject? (I'm not even looking for something GTK compliant... just
something that works)
Yes and no.
The directory would use an inode, but splitting the stores into separate
directories would help drastically improve cpu and memory utilization
when working with large numbers of files (10's of thousands)
Right or wrong that's what I have to say
-Original Message-
From: Andy
Create a tmp file with the script and get the owner/group from that
My $.02
-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 1:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is_uploaded_file() emulation?
Hello all!
How do I find out if
well my site isn't 'big name' but it's got a very cool catch to it...
it's got an ftp indexer that I'm developing. You submit an ftp site, and
it logs onto the ftp, grabs all of the filenames and sizes, pops
everything into a mysql database, which is searchable from a web page
(located on the sam
Also, make sure that if you run the script with user input that you
validate the input...
Input like '; cat /etc/passwd' would be no fun at all
-Original Message-
From: Simon Willison [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 7:14 AM
To: bvr
Cc: php-general
Subject: R
A .phps would be helpful
-Original Message-
From: Nick Richardson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 10:05 PM
To: PHP General
Subject: [PHP] What's wrong w/ this line?
PHP seems to be completly ignoring this line...
Funny part is that i use this same line in ano
ing and un slashing and validating, and revalidating,
etc, etc, etc, etc so I made this. Which makes things 1000% simpler
-Original Message-
From: Nick Richardson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 8:11 PM
To: Demitrious S. Kelly; 'PHP General'
Subject:
Try these...
function encode($string) {
$string=stripslashes($string);
$temp='';
$newstring='';
for ( $counter=0; $counter != ; $counter++ ) {
$temp=substr($string, $counter, 1);
if ( $temp == '' ) {
break
You dont. md5 is one way encryption
-Original Message-
From: Jason G. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 2:06 PM
To: Nicolas Costes; Jose; [EMAIL PROTECTED]
Subject: Re: [PHP] How can I decrypt a password I previously coded with
md5()?
Hi Nicolas,
I would be
69 matches
Mail list logo