|
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 10 Mar 2005 05:17:52 -0000 Issue 3329
php-general-digest-help
lists.php.net
Date: Wed Mar 09 2005 - 23:17:52 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 10 Mar 2005 05:17:52 -0000 Issue 3329
Topics (messages 210324 through 210413):
Re: ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]
210324 by: Mat Harris
210336 by: Lester Caine
210385 by: Richard Lynch
210410 by: Nobody Special
PHP5.0.3-3 on RedHat
210325 by: Bronislav Klucka
210328 by: John Nichel
210331 by: Bronislav Klucka
210333 by: John Nichel
Re: Newbie Variable Question
210326 by: Jackson Linux
Question re empty query
210327 by: Jackson Linux
210330 by: M. Sokolewicz
210339 by: Jochem Maas
210347 by: Jochem Maas
210413 by: Jackson Linux
Re: Shared variable / exclusive locking?
210329 by: the_roibm
Re: a new it company
210332 by: Rory Browne
210335 by: Chris W. Parker
210337 by: Jochem Maas
210340 by: Brian Dunning
210341 by: John Nichel
210345 by: Dan Tappin
210349 by: Jochem Maas
210354 by: Ryan A
210404 by: dan
210412 by: James Williams
how can I determine the built options of PHP
210334 by: Uwe Galle
210344 by: Jason Barnett
210381 by: Richard Lynch
orphan functions, how can I find them?
210338 by: Al
210342 by: Jochem Maas
Re: PHP / JavaScript integration]
210343 by: Jochem Maas
Serious problem with Compiler?!?
210346 by: Stefan
210348 by: Jochem Maas
210352 by: Stefan
210377 by: Richard Lynch
Re: Help with dates
210350 by: Kevin
210355 by: Jochem Maas
210362 by: Jason Barnett
210367 by: Jochem Maas
210380 by: Richard Lynch
posix_getgroups() and effective grooup id's
210351 by: Marten Lehmann
210378 by: Richard Lynch
Best way to validate a date
210353 by: David Bevan
210357 by: Eli
shell script - disable log output
210356 by: Eli
210359 by: Matthew Fonda
210361 by: Eli
210363 by: John Nichel
210365 by: Jason Barnett
210366 by: Eli
210368 by: Eli
210369 by: John Nichel
210370 by: Eli
210372 by: John Nichel
210376 by: Eli
210379 by: Richard Lynch
210382 by: Eli
210398 by: Richard Lynch
Question regarding simplexml predefined constants
210358 by: Allan, David (ThomasTech)
210364 by: Jason Barnett
Quickform - edit form
210360 by: Leonie \(phpgroup\)
210373 by: Chris W. Parker
210374 by: Richard Lynch
210375 by: Marek Kilimajer
210387 by: Leonie \(phpgroup\)
210388 by: Leonie \(phpgroup\)
210393 by: Leonie \(phpgroup\)
210402 by: Leonie \(phpgroup\)
Creating Reports with PHP
210371 by: Mike Smith
Re: imagedestroy()
210383 by: Richard Lynch
Re: PHP 5.0.3 and base64 encoded cookie value issue?
210384 by: Richard Lynch
210411 by: Pink Floyd
Re: PHP5.0.3 and pam authentication
210386 by: Richard Lynch
Re: software catalog
210389 by: Richard Lynch
Re: warning & question about mysql sessions & concurrency
210390 by: Richard Lynch
comparison operator
210391 by: Sebastian
210396 by: Richard Lynch
210400 by: Jason Barnett
Re: MySQL - PHP - limits...
210392 by: Richard Lynch
Re: PHP / JavaScript integration
210394 by: Richard Lynch
Re: sorting arrays
210395 by: Richard Lynch
210399 by: Robert Cummings
incrementing a number from a text file
210397 by: Ross Hulford
210401 by: Jason Barnett
210408 by: Eli
210409 by: blackwater dev
PHP hangs when exec'ing SSH
210403 by: Ross Becker
PHP RegExp and HTML tags attributes values etc...
210405 by: BlackDex
210406 by: Eli
210407 by: Eli
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:
On Wed, Mar 09, 2005 at 07:30:57AM -0800, Rob Tanner wrote:
> Every ezmlm mailing list I'm on does that periodically. Lists that I'm
> on that use MailMan never seem to have that problem. What then does
> that tell us about ezmlm...
i get the same thing too....but as i run my own mail server i know when mail
should've been bouncing and this wasn't it.....
I am recieving other mail perfectly at the times these msgs should have bounced....
aah MailMan is waaaay better...even if its python ;)
>
> --On Wednesday, March 09, 2005 09:53:35 AM -0500
> tg-php
gryffyndevelopment.com wrote:
>
> > Yeah, same here. I thought it was my hosting service, but if other
> > people are having the same issue then what's the deal? Usually it's
> > only a message or two, but sometimes it says there are like 8 or 9
> > messages that bounced. Has anyone looked into this or have any
> > information regarding this?
> >
> > I was wondering of other emails were bouncing trying to get to me and
> > just hadn't taken the time to follow up with my hosting company about
> > it.
> >
> > -TG
> >
> > = = = Original message = = =
> >
> > Same here....
> >
> >
> > Christo van Rooyen
> >
> >
> > -----Original Message-----
> > From: Chris W. Parker [mailto:cparker
swatgear.com]
> > Sent: 08 March 2005 19:58
> > To: ceo
l-i-e.com; mattias
inreach.com
> > Cc: Kevin; PHP General Mail List
> > Subject: RE: [PHP] suspicious - maybe spam
> >
> > Richard Lynch <mailto:ceo
l-i-e.com>
> > on Tuesday, March 08, 2005 9:54 AM said:
> >
> >> Don't feel too bad.
> >>
> >> Every few weeks, I get an automated email from ezmlm warning me that
> >> php-general messages have bounced, and I might be removed from the
> >> list if it keeps up.
> >
> > Same here.
> >
> >
> > ___________________________________________________________
> > Sent by ePrompter, the premier email notification software.
> > Free download at http://www.ePrompter.com.
>
>
>
> --
> Rob Tanner
> UNIX Services Manager
> Linfield College, McMinnville OR
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Before making criticism, try to walk a mile in their shoes....that way when
you do criticise them, you will be a mile away and wearing their shoes :)
Never knock on Death's door : ring the doorbell and run (he hates that).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFCLzB+mbMTrp/jhicRAl0oAJwNLghuZ6XhehtR4mIKGU3xTKxH+QCfR25q
k22DygpdK05PcYzk5wcxzfs=
=+y1l
-----END PGP SIGNATURE-----
attached mail follows:
tg-php
gryffyndevelopment.com wrote:
> Yeah, same here. I thought it was my hosting service, but if other people are having the same issue then what's the deal? Usually it's only a message or two, but sometimes it says there are like 8 or 9 messages that bounced. Has anyone looked into this or have any information regarding this?
>
> I was wondering of other emails were bouncing trying to get to me and just hadn't taken the time to follow up with my hosting company about it.
>>Every few weeks, I get an automated email from ezmlm warning me that
>>php-general messages have bounced, and I might be removed from the
>>list if it keeps up.
Same here - but since I only use the newsgroup interface I suspect
something is wrong ;)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
attached mail follows:
> Yeah, same here. I thought it was my hosting service, but if other people
> are having the same issue then what's the deal? Usually it's only a
> message or two, but sometimes it says there are like 8 or 9 messages that
> bounced. Has anyone looked into this or have any information regarding
> this?
I did email my host and -owner for this list about it...
Not promising that will produce any action on either end.
While it seems to affect a lot of us, it doesn't seem to actually HURT
anything much, other than one more email to delete every few weeks.
A drop in the ocean, my friend.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Wed, 09 Mar 2005 07:30:57 -0800, Rob Tanner <rtanner
linfield.edu> wrote:
> Every ezmlm mailing list I'm on does that periodically. Lists that I'm
> on that use MailMan never seem to have that problem. What then does
> that tell us about ezmlm...
>
Everyone, eh. You must not be on many lists. I don't have any
problems with bugtraq or any of the other ezmlm lists I'm on.
php-general is the only one I've seen sending me ezmlm-warnings.
This sounds more like the php guys don't have their concurencyremote
set (it defaults to 120) or some other issue. I'm sure if the list
admin will ask on the ezmlm list someone would be glad to help them
get their setup tuned correctly.
--
Use Linux.
W=Wrong
Proud member of the reality-based community!
In opposing the Federalists, [Jefferson] ushered in a
kind of sustained partisan activity that had never existed
before. Initially called the Republican party, it became known
in the era of Andrew Jackson as simply the Democracy;
later on, it was called the Democratic party. But even the modern
Republican party, formed in 1854, chose its name in part to honor
Jefferson. -- Joyce Appleby on Jefferson
attached mail follows:
Hi,
does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap,
openssl, curl, etc. :)
I'm looking every day on internet, but I cannot find it.
Brona
attached mail follows:
Bronislav Klucka wrote:
> Hi,
> does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap,
> openssl, curl, etc. :)
>
> I'm looking every day on internet, but I cannot find it.
>
> Brona
>
You can build the RPM from the source....
rpmbuild -ta php-5.0.3xxx.tar.gz
It will put the RPM somewhere like /usr/src/redhat/RPMS/
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
John Nichel wrote:
> Bronislav Klucka wrote:
>
>> Hi,
>> does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap,
>> openssl, curl, etc. :)
>>
>> I'm looking every day on internet, but I cannot find it.
>>
>> Brona
>>
>
> You can build the RPM from the source....
>
> rpmbuild -ta php-5.0.3xxx.tar.gz
>
> It will put the RPM somewhere like /usr/src/redhat/RPMS/
>
I've done this... how can I specify php configure parameters?
(--with-mysql, etc)
Brona
attached mail follows:
Bronislav Klucka wrote:
> John Nichel wrote:
<snip>
>> You can build the RPM from the source....
>>
>> rpmbuild -ta php-5.0.3xxx.tar.gz
>>
>> It will put the RPM somewhere like /usr/src/redhat/RPMS/
>>
>
> I've done this... how can I specify php configure parameters?
> (--with-mysql, etc)
>
> Brona
It's been a long time since I've done it this way, but I think it's
something like this (I'm sure someone on the list will correct my
errors)....
Download and extract the source.
CD to the source directory...
>$ ./configure --add-your-options
>$ cd ..
>$ tar -cf php-5.0.3xx.tar php-5.0.3xx/
>$ rpmbuild -ta php-5.03xx.tar
Untested, but I think that's the steps. You can also try 'make rpm'
after you configure the source. I seem to remember something along
those lines.
Course, if you're going to go thru all that trouble, you could just
build it all from source, and bypass the whole RPM process. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Jochem and everyone,
Thanks, this solved the problem.
Regarding someone's much appreciated comment:
<snip>[this]...allows any user to simply change the value of "r" to
something more to
their liking. given the reset of the code that you included in your
first message, who knows what nice holes they'll find in your code when
they do that. depending on where you go with this, they could end up
with information for/about another user, a nice sql injection on your
database, the ability to hack your system, or something else equally
amusing.</snip>
I agree, and actually had thought of it. I appreciate your reminding
me. Because I am new enough that I still find a magical thrill every
time I pull *anything* from the database, I have been approaching this
from this point of view:
1. Make db
2. Try to get page to connect
3. Try to print what I want by setting the variable $r so I can point
to it
4. Fix it so that if someone asks for anything other than an existent
?r=x it kicks back a webpage which just shows links to existing pages.
Which brings me to the next question, which I'll post in a second!
Thanks again everyone!
--Jack
On 9 Mar 2005, at 11:43, Jochem Maas wrote:
> Jackson Linux wrote:
>> On 9 Mar 2005, at 11:15, Jason Barnett wrote:
>>> Jackson Linux wrote:
>>> ...
>>>
>>>> <php include_once "/path/to/cv.$r.include.php"; ?> asks for
>>>> cv.'1'.include.php ... And I need it to ask for cv.1.include.php
>>>>
>>>> How can I make a variable to fetch the literal number from the field
>>>> cv.category?
>>>
>>>
>>> Not 100% certain that it will work, but try casting the variable $r
>>> to
>>> an integer:
>>>
>>> <?php include_once "/path/to/cv." . (int) $r . ".include.php"; ?>
>>>
>>>
>> Hmmmm. If only. . .This returns, regardless of input and the value
>> of $r
>> cv.0.include.php'
>> For chuckles, I did check and the column is set in the table as INT.
>> If that matters.
>
> not really - what matters is that you understand typecasting in php.
>
> a string when cast to an integer will always be zero unless the string
> begins with numeric chars, in which case php will take all the numeric
> chars
> it finds until it comes across a char that is not numeric and return
> those chars
> (I don't know exactly how it handles decimal points and minus signs in
> such as case)
>
> echo (int) "1string";
> echo (int) "string1";
>
>> ...?
>> Jack
>
>
attached mail follows:
Hi,
This:
if (isset($_GET['r']) &&
!empty($_GET['r']) &&
($r = intval($_GET['r'])) ){
$r = "{$_GET['r']}"; //Set the variable $r to mean the category number
$fields = '*';
$sort = "ORDER BY cv.sort";
} else {
$where = '';
$fields =
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,
jobcat.category';
$sort = "ORDER BY cv.sort";
}
//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
jobcat.jobcat_id=cvjobcats.jobcat_id";
Works whenever there is an ?r= specified. When there is no r specified
it chokes on
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
jobcat.jobcat_id=cvjobcats.jobcat_id";
because there's no value to $r.
it also opens me up to allowing anyone to state *anything* after the ?.
So can I make an else statement which will say that if there's no r= or
a wrong r= or even no ? at all then it should print a menu to $r's
which actually exist in the database? How?
Thanks in advance!!!
attached mail follows:
Jackson Linux wrote:
> Hi,
> This:
>
> if (isset($_GET['r']) &&
> !empty($_GET['r']) &&
> ($r = intval($_GET['r'])) ){
> $r = "{$_GET['r']}"; //Set the variable $r to mean the category number
gods, that's an ugly statement... why don't you simply use $r =
$_GET['r']; ????
> $fields = '*';
> $sort = "ORDER BY cv.sort";
> } else {
> $where = '';
> $fields =
> 'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,
> jobcat.category';
> $sort = "ORDER BY cv.sort";
> }
>
> //Make the sql based on the joining of the table and intersection table
> $sql = "
> SELECT
> cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat
> .category
> FROM cv, cvjobcats, jobcat
> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
> jobcat.jobcat_id=cvjobcats.jobcat_id";
>
> Works whenever there is an ?r= specified. When there is no r specified
> it chokes on
>
> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
> jobcat.jobcat_id=cvjobcats.jobcat_id";
>
> because there's no value to $r.
>
> it also opens me up to allowing anyone to state *anything* after the ?.
>
> So can I make an else statement which will say that if there's no r= or
> a wrong r= or even no ? at all then it should print a menu to $r's
> which actually exist in the database? How?
>
> Thanks in advance!!!
You have 3 conditions in a single expression. Split that expression up
into multiple expressions, so you can check each (or a combination of 2)
individually.
so, instead of:
if (isset($_GET['r']) && !empty($_GET['r']) && ($r = intval($_GET['r']))){
do:
if (isset($_GET['r'])) {
if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
// do whatever
} else {
// something boring
}
} else {
// not set
}
attached mail follows:
Jackson Linux wrote:
> Hi,
> This:
>
> if (isset($_GET['r']) &&
> !empty($_GET['r']) &&
> ($r = intval($_GET['r'])) ){
> $r = "{$_GET['r']}"; //Set the variable $r to mean the category number
for starters WTF is the preceding statement for???
$r is already set if it exists by the expression in the if statement...
($r = intval($_GET['r'])
> $fields = '*';
> $sort = "ORDER BY cv.sort";
> } else {
this else block will fire if $r is invalid or not set.
that means this is where you should write some code that
either redirects to the 'list' page or outputs a list somehow.
> $where = '';
> $fields =
> 'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,
> jobcat.category';
> $sort = "ORDER BY cv.sort";
> }
>
> //Make the sql based on the joining of the table and intersection table
> $sql = "
> SELECT
> cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat
> .category
> FROM cv, cvjobcats, jobcat
> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
> jobcat.jobcat_id=cvjobcats.jobcat_id";
>
> Works whenever there is an ?r= specified. When there is no r specified
> it chokes on
>
> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
> jobcat.jobcat_id=cvjobcats.jobcat_id";
>
> because there's no value to $r.
>
> it also opens me up to allowing anyone to state *anything* after the ?.
>
> So can I make an else statement which will say that if there's no r= or
> a wrong r= or even no ? at all then it should print a menu to $r's
> which actually exist in the database? How?
you already have one - its just that your abusing it to set some completely pointless
vars that containing bits of SQL.
>
> Thanks in advance!!!
>
attached mail follows:
M. Sokolewicz wrote:
> Jackson Linux wrote:
>
>> Hi,
>> This:
>>
>> if (isset($_GET['r']) &&
>> !empty($_GET['r']) &&
>> ($r = intval($_GET['r'])) ){
does nobody notice the last 'bit' of the if expression??
if the IF statement evaluates to true then $r _has_ been set!!!
>> $r = "{$_GET['r']}"; //Set the variable $r to mean the category number
>
> gods, that's an ugly statement... why don't you simply use $r =
> $_GET['r']; ????
that leaves him completely open to SQL injection.
but your right in that writing this:
$r = "{$_GET['r']}";
... is just plain wasteful, pointless and looks ugly.
and given the fact that $r is already set (see above) there is
no need to set it again at all.
I think you almost there Jackson, keep hacking :-)
>
>> $fields = '*';
>> $sort = "ORDER BY cv.sort";
>> } else {
>> $where = '';
>> $fields =
>> 'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,
>> jobcat.category';
>> $sort = "ORDER BY cv.sort";
>> }
>>
>> //Make the sql based on the joining of the table and intersection table
>> $sql = "
>> SELECT
>> cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat
>> .category
>> FROM cv, cvjobcats, jobcat
>> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
>> jobcat.jobcat_id=cvjobcats.jobcat_id";
>>
>> Works whenever there is an ?r= specified. When there is no r
>> specified it chokes on
>>
>> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
>> jobcat.jobcat_id=cvjobcats.jobcat_id";
>>
>> because there's no value to $r.
>>
>> it also opens me up to allowing anyone to state *anything* after the ?.
>>
>> So can I make an else statement which will say that if there's no r=
>> or a wrong r= or even no ? at all then it should print a menu to
>> $r's which actually exist in the database? How?
>>
>> Thanks in advance!!!
>
> You have 3 conditions in a single expression. Split that expression up
Jackson got that bit from me - I don't think he is fully aware of what that
expression is doing!
the 'sum' of those conditions determines that either $r is 'good' or 'bad'
(whether $r is garbage or not set didn't seem like a difference worth bothering
with)
> into multiple expressions, so you can check each (or a combination of 2)
> individually.
this is a good idea to better understand what is going on!
>
> so, instead of:
> if (isset($_GET['r']) && !empty($_GET['r']) && ($r = intval($_GET['r']))){
>
> do:
> if (isset($_GET['r'])) {
> if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
> // do whatever
> } else {
> // something boring
> }
> } else {
> // not set
> }
>
attached mail follows:
Okay, guys,
I hope I'm getting closer with your help here but I am still highly
confused (that's actually a general blanket statement these days).
I've taken your advice and made several changes,
On 9 Mar 2005, at 13:44, Jochem Maas wrote:
> M. Sokolewicz wrote:
>> Jackson Linux wrote:
>>> Hi,
>>> This:
>>>
>>> if (isset($_GET['r']) &&
>>> !empty($_GET['r']) &&
>>> ($r = intval($_GET['r'])) ){
>
> does nobody notice the last 'bit' of the if expression??
> if the IF statement evaluates to true then $r _has_ been set!!!
That makes sense now.
>
>>> $r = "{$_GET['r']}"; //Set the variable $r to mean the category
>>> number
>> gods, that's an ugly statement... why don't you simply use $r =
>> $_GET['r']; ????
>
> that leaves him completely open to SQL injection.
> but your right in that writing this:
>
> $r = "{$_GET['r']}";
>
> ... is just plain wasteful, pointless and looks ugly.
> and given the fact that $r is already set (see above) there is
> no need to set it again at all.
I see that now; thanks, I removed it
> I think you almost there Jackson, keep hacking :-)
>
Thanks for the encouragement! But there's more...
>>>
>>> $sort = "ORDER BY cv.sort";
>>> } else {
>>> $where = '';
>>> $fields =
>>> 'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,
>>> jobcat.category';
>>> $sort = "ORDER BY cv.sort";
>>> }
>>>
>>> //Make the sql based on the joining of the table and intersection
>>> table
>>> $sql = "
>>> SELECT
>>> cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,job
>>> cat .category
>>> FROM cv, cvjobcats, jobcat
>>> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
>>> jobcat.jobcat_id=cvjobcats.jobcat_id";
>>>
>>> Works whenever there is an ?r= specified. When there is no r
>>> specified it chokes on
>>>
>>> WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
>>> jobcat.jobcat_id=cvjobcats.jobcat_id";
>>>
>>> because there's no value to $r.
>>>
>>> it also opens me up to allowing anyone to state *anything* after the
>>> ?.
>>>
>>> So can I make an else statement which will say that if there's no r=
>>> or a wrong r= or even no ? at all then it should print a menu to
>>> $r's which actually exist in the database? How?
>>>
>>> Thanks in advance!!!
>> You have 3 conditions in a single expression. Split that expression up
>
> Jackson got that bit from me - I don't think he is fully aware of what
> that
> expression is doing!
>
> the 'sum' of those conditions determines that either $r is 'good' or
> 'bad'
> (whether $r is garbage or not set didn't seem like a difference worth
> bothering
> with)
>
No, I didn't and I actually still don't. I've implemented the change
below, breaking up the if(isset)$_GET['r']) bit (making it easier to
follow indeed, thank you!) but I am confused as to how to break that
three-condition statement split based on that change.
>> into multiple expressions, so you can check each (or a combination of
>> 2) individually.
>
> this is a good idea to better understand what is going on!
>
>> so, instead of:
>> if (isset($_GET['r']) && !empty($_GET['r']) && ($r =
>> intval($_GET['r']))){
>> do:
>> if (isset($_GET['r'])) {
>> if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
>> // do whatever
>> } else {
>> // something boring
>> }
>> } else {
>> // not set
>> }
>
The code below is where I am now. I'm trying to document a bit better,
and clean it up. And I still don't have any clue as to how to make it
redirect if someone requests no ?r= or a bad one. Can someone help
please?
<snip>
if (isset($_GET['r'])) {
if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
$fields = '*';
$where = "WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id =
'$r' AND jobcat.jobcat_id=cvjobcats.jobcat_id";
$sort = "ORDER BY cv.sort"; // Assemble the category items in
r=x
} else {
// Is this where I'd say IF no $r is set then redirect?
}
}
//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat
.category
FROM cv, cvjobcats, jobcat
$where
$sort
";
$result = mysql_query($sql);
$cv = mysql_fetch_assoc($result);
$table_of_contents = array();
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " .
mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
</snip>
Thanks in advance!!
--Jack
attached mail follows:
ok, so the solution is shm or shmop, but there is something I'm not
sure about it...
the way I wanna go is shm and sem and the things that are clear are:
- use sem to block multiple processes(or threads) writing to the same shm block
- there is no need to use sem for reading since multiple
processes(threads) can read safely from the same shm block
what is not that clear is... what happens when a process reads and
another writes exactly at the same time? do the read operations behave
like some sort of transactions that ensure you get the content
available in the shm block at the beginning of the read even when it
is changed during the read? I guess this is not the case, so how would
you handle this properly?
regards
attached mail follows:
SPAMMER
From your email address I'm assuming that your name is Sharvan Saxena.
It seems like too much of a coincidence that the contact person on
that site(Tanuj Saxena), and your good self, have the same surname.
Because it seems your are a spammer, and a liar(you concealed your
alleged connection with aforementioned site), I hereby CALL FOR A
BOYCOTT ON http://www.bansalsetech.com/
On Wed, 9 Mar 2005 10:57:39 +0530, shar <sharvansaxena
hotmail.com> wrote:
> Hi members,
>
> How are you. I have seen a very good site www.bansalsetech.com, visit this site for your Seo / design / programming projects. Great people.
>
> Regards
>
>
attached mail follows:
Rory Browne <mailto:rory.browne
gmail.com>
on Wednesday, March 09, 2005 10:06 AM said:
> Because it seems your are a spammer, and a liar(you concealed your
> alleged connection with aforementioned site), I hereby CALL FOR A
> BOYCOTT ON http://www.bansalsetech.com/
Ironic thing here is that there name is *already* asking you to ban
Salsa Tech from the list of companies that you would do business with.
Easy!
8)
attached mail follows:
Rory Browne wrote:
> SPAMMER
>
> From your email address I'm assuming that your name is Sharvan Saxena.
> It seems like too much of a coincidence that the contact person on
> that site(Tanuj Saxena), and your good self, have the same surname.
>
> Because it seems your are a spammer, and a liar(you concealed your
I'd class him as stupid or ignorant maybe - but one hand sent email doesn't
really class someone as a spammer does it, I thought the bar was a little
higher than 1 email :-)
> alleged connection with aforementioned site), I hereby CALL FOR A
> BOYCOTT ON http://www.bansalsetech.com/
the joke is that this list is full of people who earn a living doing
seo / design / programming - then again I could outsource all my shit to this
guy for $1/hour and make a killing doing nothing ;-)
>
> On Wed, 9 Mar 2005 10:57:39 +0530, shar <sharvansaxena
hotmail.com> wrote:
>
>>Hi members,
>>
>>How are you. I have seen a very good site www.bansalsetech.com, visit this site for your Seo / design / programming projects. Great people.
>>
>>Regards
>>
>>
>
>
attached mail follows:
Sharvan -
You won't find too many fans of overseas outsourcing on this list.
attached mail follows:
Brian Dunning wrote:
> Sharvan -
>
> You won't find too many fans of overseas outsourcing on this list.
>
I'm a fan of it if they send ME overseas to outsource. Italy, Germany,
Greece, Australia....I'll go. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
I think Rory has trouble jumping to conclusions. I was attacked off
list by Rory thinking I was another list member... another dant
(remember the OT adult content rant / thread?).
I would agree that this is not really spam... just bad judgment. The
flood of angry replies to this poster should teach them their lesson
about mailing list etiquette. If it continues they will simply be
banned from the list.
With free speech you have to live with the odd incident like this.
Dan Tappin (Dan T)
On Mar 9, 2005, at 11:29 AM, Jochem Maas wrote:
> Rory Browne wrote:
>> SPAMMER
>> From your email address I'm assuming that your name is Sharvan Saxena.
>> It seems like too much of a coincidence that the contact person on
>> that site(Tanuj Saxena), and your good self, have the same surname.
>> Because it seems your are a spammer, and a liar(you concealed your
>
> I'd class him as stupid or ignorant maybe - but one hand sent email
> doesn't
> really class someone as a spammer does it, I thought the bar was a
> little
> higher than 1 email :-)
attached mail follows:
Dan Tappin wrote:
> I think Rory has trouble jumping to conclusions. I was attacked off
> list by Rory thinking I was another list member... another dant
> (remember the OT adult content rant / thread?).
who me? :-)
>
> I would agree that this is not really spam... just bad judgment. The
> flood of angry replies to this poster should teach them their lesson
> about mailing list etiquette. If it continues they will simply be
> banned from the list.
>
> With free speech you have to live with the odd incident like this.
here here - I thought It was kind of humourous, I also bare in mind
that these guys in the far east are just trying to make their way in the
world too, they are at a disadvantage with the language also. besides
which there is a quite a culture gap - I notice it alot in the way people
from India/FarEast ask questions in general - its a totally
different 'style'
>
>
attached mail follows:
> here here - I thought It was kind of humourous, I also bare in mind
>
> that these guys in the far east are just trying to make their way in the
>
> world too, they are at a disadvantage with the language also. besides
>
> which there is a quite a culture gap - I notice it alot in the way people
>
> from India/FarEast ask questions in general - its a totally
>
> different 'style'
I agree but thats not a reason to write to this list with that crap, I
replied to him with two words...the first word started with a F and was four
letters, the second was a three letter word :-)
I also agree with the bloke about boycotting that site and I vote we also
write "bad things" about that site on all the websites we control :-D
As for the spam part, writing one email to a person I think cannot be called
spam...but I think this falls into spam as he wrote to the list which spills
out to many many people....its as good as if he copied all the addresses
from the list and used a mass mailer to mail the message/crap/spam to all of
us individually
My $0.02
Cheers,
Ryan
> >
>
>
>
> --
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005
attached mail follows:
Dan Tappin wrote:
> I think Rory has trouble jumping to conclusions. I was attacked off
> list by Rory thinking I was another list member... another dant
> (remember the OT adult content rant / thread?).
>
> I would agree that this is not really spam... just bad judgment. The
> flood of angry replies to this poster should teach them their lesson
> about mailing list etiquette. If it continues they will simply be
> banned from the list.
>
> With free speech you have to live with the odd incident like this.
>
> Dan Tappin (Dan T)
>
> On Mar 9, 2005, at 11:29 AM, Jochem Maas wrote:
>
>> Rory Browne wrote:
>>
>>> SPAMMER
>>> From your email address I'm assuming that your name is Sharvan Saxena.
>>> It seems like too much of a coincidence that the contact person on
>>> that site(Tanuj Saxena), and your good self, have the same surname.
>>> Because it seems your are a spammer, and a liar(you concealed your
>>
>>
>> I'd class him as stupid or ignorant maybe - but one hand sent email
>> doesn't
>> really class someone as a spammer does it, I thought the bar was a little
>> higher than 1 email :-)
>
>
(top-post, please)
You guys are still sore about that? heh
Is this a solicitation, or a "manual spam"?
Thanks
-(the other dant)
attached mail follows:
I agree entirely... *down with bansalsetech.com*
Ryan A wrote:
>>here here - I thought It was kind of humourous, I also bare in mind
>>
>>that these guys in the far east are just trying to make their way in the
>>
>>world too, they are at a disadvantage with the language also. besides
>>
>>which there is a quite a culture gap - I notice it alot in the way people
>>
>>from India/FarEast ask questions in general - its a totally
>>
>>different 'style'
>
>
>
> I agree but thats not a reason to write to this list with that crap, I
> replied to him with two words...the first word started with a F and was four
> letters, the second was a three letter word :-)
>
> I also agree with the bloke about boycotting that site and I vote we also
> write "bad things" about that site on all the websites we control :-D
>
> As for the spam part, writing one email to a person I think cannot be called
> spam...but I think this falls into spam as he wrote to the list which spills
> out to many many people....its as good as if he copied all the addresses
> from the list and used a mass mailer to mail the message/crap/spam to all of
> us individually
>
> My $0.02
>
> Cheers,
> Ryan
>
>
>
>
>
>
>>
>>
>>--
>>
>
>
>
>
attached mail follows:
Hi,
some applications like Horde require special build options, eg.
--with-apache or: --with-apxs
--with-gettext
--with-mysql
--with-mcrypt
--with-iconv --enable-mbstring --with-mbstring=all
--with-gd
I don't want to setup my own build environment at the moment because I dont
have the tools available now. I downloaded the PHP 5.0.3 Windows Binaries
and want to know what options these Binaries were build with. How can I find
out this? With phpinfo I didn't find this information.
Thanks for any help.
attached mail follows:
I'm not 100% sure what options are used in the Windows build by default,
but for windows everything is wrapped up into extensions. You need
mysql, you enable the appropriate mysql .dll. You need Apache, you use
the appropriate apache .dll. And all of that is controlled through
php's ini and/or the apache conf file.
Now if you *really* want to build PHP on Windows you can get a free
(GPL) compiler. Just go download cygwin and use gcc.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
> Hi,
>
> some applications like Horde require special build options, eg.
>
> --with-apache or: --with-apxs
> --with-gettext
> --with-mysql
> --with-mcrypt
> --with-iconv --enable-mbstring --with-mbstring=all
> --with-gd
>
> I don't want to setup my own build environment at the moment because I
> dont
> have the tools available now. I downloaded the PHP 5.0.3 Windows Binaries
> and want to know what options these Binaries were build with. How can I
> find
> out this? With phpinfo I didn't find this information.
phpinfo() lists the paramters used to compile PHP, so they *should* be
there, even under Windows, I think.
If not, do this:
php -i | grep GD
Either you see GD, or it ain't in there.
That said, under Windows, you just uncomment the php_gd.dll line in
php.ini and you're done.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
I'm cleaning up some old php scripts and find I'm creating some orphans.
Anyone know of a tool, or a simple way, to identify all the unused functions in
a script's functions include file?
attached mail follows:
Al wrote:
> I'm cleaning up some old php scripts and find I'm creating some orphans.
>
> Anyone know of a tool, or a simple way, to identify all the unused
> functions in a script's functions include file?
>
grep.
attached mail follows:
this post was meant for the OP - I sent it to Chris W. (only) by mistake.
oops....
-------- Original Message --------
From: - Wed Mar 09 19:50:29 2005
Chris W. Parker wrote:
> Mário Gamito <mailto:lists
tuxdoit.com>
> on Tuesday, March 08, 2005 4:28 PM said:
>
>
>>I'm trying to integrate some JavaScript functions in PHP, but so far,
>>no good :(
>
>
> [snip]
>
>
>>Now... i want to call this JavaScript function from the regular PHP
>>files. In particular, before the HTML code.
>>Like this:
>
>
> [snip]
>
>
>>How can i do this ?
>>How to tell PHP, that def(word) is a JS function in js.php file ?
>>I've tried include ('js.php'), etc., but got no results :(
include ('js.php') will output the contents of that file to the browser,
assuming include() actually finds the file.
>
>
> You don't and you can't. PHP does not interact with the client (like you are thinking it does) and
> Javascript does not interact with the server. They are completely different and not related, except
> that PHP can send Javascript to the client for the client to interpret.
javascript is a scripting language, there is no theoretical reason that it can't be used as a serverside
scripting language, but the fact that practically nobody in the real does says something :-). anyway
its not strictly correct to say javascript is 'clientside'.
as for calling a javascript function directly from php code, forget about it.
>
> It's a bit confusing at first but once you understand it, you'll wonder why it ever didn't make sense.
1 round trip:
1. a (php) webserver gets a request for a page.
2. the server runs the requested (php) script.
3. the server sending some output to the browser.
4. the browser interprets the output.
the output is generally a webpage - this can include
<script> tags that contain/include javascript. when the
page is parsed and rendered by the browser the javascript you
included will be run.
>
>
>
> Chris.
>
attached mail follows:
Hi there,
my Server worked fine for several month now with php 4.3.4.
Since a few hours (without changing anything for the last days) PHP
doesn't 'know' basic commands as mysql_connect() or session_start() ...
(e.g.: Fatal error: Call to undefined function: mysql_connect() )
I have no idea where to start searching for the problem as the logs
don't tell anything about it!
Thx for help in advance.
Stefan
attached mail follows:
Stefan wrote:
> Hi there,
>
> my Server worked fine for several month now with php 4.3.4.
> Since a few hours (without changing anything for the last days) PHP
reboot? lame yes, but maybe it works.
otherwise specify some server details here.
check if files (e.g. the php binary, conf files) have changed
(maybe a very recent filetime?)
> doesn't 'know' basic commands as mysql_connect() or session_start() ...
> (e.g.: Fatal error: Call to undefined function: mysql_connect() )
>
> I have no idea where to start searching for the problem as the logs
> don't tell anything about it!
mysql is an extension but session_start is core I believe - very odd
that session_start() is not defined.
>
> Thx for help in advance.
>
> Stefan
>
attached mail follows:
I've found where the problem came from: I was using PHP 4.3.9 (sorry for
misinformation in the first mail) but it was overwritten by a suse
onlineupdate 4.3.4 last night. This is where the problems came from.
I have removed 4.3.4 via Yast and want to compile 4.3.10 now.
./configure and make test work fine, but when I use 'make', it only
shows a few lines and doesn't install successfull:
This is all text produced by make:
<-- begin
Installing PHP SAPI module: apache2handler
/usr/share/apache2/build/instdso.sh
SH_LIBTOOL='/usr/share/apache2/build/libtool' libphp4.la
/usr/lib/apache2-prefork
/usr/share/apache2/build/libtool --mode=install cp libphp4.la
/usr/lib/apache2-prefork/
cp .libs/libphp4.so /usr/lib/apache2-prefork/libphp4.so
cp .libs/libphp4.lai /usr/lib/apache2-prefork/libphp4.la
libtool: install: warning: remember to run `libtool --finish
/usr/local/src/php-4.3.10/libs'
chmod 755 /usr/lib/apache2-prefork/libphp4.so
[activating module `php4' in /etc/apache2/httpd2-prefork.conf]
Installing build environment: /usr/lib/php/build/
Installing header files: /usr/include/php/
Installing helper programs: /usr/bin/
program: phpize
program: php-config
program: phpextdist
--> end
What may be the source of this problem?
Jochem Maas wrote:
> Stefan wrote:
>
>> Hi there,
>>
>> my Server worked fine for several month now with php 4.3.4.
>> Since a few hours (without changing anything for the last days) PHP
>
>
> reboot? lame yes, but maybe it works.
> otherwise specify some server details here.
>
> check if files (e.g. the php binary, conf files) have changed
> (maybe a very recent filetime?)
>
>> doesn't 'know' basic commands as mysql_connect() or session_start() ...
>> (e.g.: Fatal error: Call to undefined function: mysql_connect() )
>>
>> I have no idea where to start searching for the problem as the logs
>> don't tell anything about it!
>
>
> mysql is an extension but session_start is core I believe - very odd
> that session_start() is not defined.
>
>>
>> Thx for help in advance.
>>
>> Stefan
>>
attached mail follows:
> I have removed 4.3.4 via Yast and want to compile 4.3.10 now.
> ./configure and make test work fine, but when I use 'make', it only
> shows a few lines and doesn't install successfull:
What few lines?
> This is all text produced by make:
> <-- begin
>
> Installing PHP SAPI module: apache2handler
> /usr/share/apache2/build/instdso.sh
> SH_LIBTOOL='/usr/share/apache2/build/libtool' libphp4.la
> /usr/lib/apache2-prefork
> /usr/share/apache2/build/libtool --mode=install cp libphp4.la
> /usr/lib/apache2-prefork/
> cp .libs/libphp4.so /usr/lib/apache2-prefork/libphp4.so
> cp .libs/libphp4.lai /usr/lib/apache2-prefork/libphp4.la
> libtool: install: warning: remember to run `libtool --finish
> /usr/local/src/php-4.3.10/libs'
> chmod 755 /usr/lib/apache2-prefork/libphp4.so
> [activating module `php4' in /etc/apache2/httpd2-prefork.conf]
> Installing build environment: /usr/lib/php/build/
> Installing header files: /usr/include/php/
> Installing helper programs: /usr/bin/
> program: phpize
> program: php-config
> program: phpextdist
>
> --> end
>
> What may be the source of this problem?
What problem?
Looks to me like you did "make install" and it worked fine...
Re-start Apache and see what happens.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Mr Lynch,
Thanks a lot for your help so far! I will answer or respond in message.
Yours,
Kevin
"Richard Lynch" <ceo
l-i-e.com> wrote in message
news:1815.66.99.91.45.1110305950.squirrel
www.l-i-e.com...
> Kevin wrote:
> > Right now I'm working on a script that would calculate dates from one
> > calendar to another. The normal calendar we use and a newly invented
one.
>
> [shudder]
> There are already WAY too many calendar systems.
>
> Inventing a new one is probably not such a good plan...
>
> Why re-invent the wheel?
It's part of a game. In the RPG there are dates which the players would like
to be able to convert from our calendar to that one, and back again..
>
> > In order to do that I need to find the exact days since the year 0
BC/AD.
> > However, the functions php provides only allow up to the unix epoch.
> >
> > Could you guys give me some pointers on how to accomplish this,
> > accurately?
>
> Take a look at the MySQL date ranges -- They may have a data type that
> allows for more than just 1/1/1970 to 3/??/2038
>
> If not, consider using PostgreSQL which has VERY extensive and flexible
> date support, for ranges MUCH larger than 0 BC/AD.
> http://postgresql.org
>
> I believe PostgreSQL even supports time scales on the order of geological
> events and for astronomical purposes, though not with "day" accuracy.
>
> I am assuming that by "accurately" you mean "to the nearest day" since you
> spoke of "exact days", right?
Aye.. it's nearest day, and according to calculations should have repeatable
results. So what is date X today should also be it tomorrow (after the
calculations of course). That's what i've noticed so far. when I add a date
and convert it and then convert it back it is a different date.
>
> But you didn't define how far into the future you need to go.
> Current time?
> A few years out?
> Stardates from Star Trek?
> You have to specify a start date, end date, and accuracy to choose a
> correct calendar system.
It's mostly the past. The RPG is set in Egypt and the beginning of the
society in egypt has been taken as year 0. The start date I think is
obvious, but I do not understand an end date of a calendar.. Perhaps I'm
just blond.. but could you perhaps explain that one?
attached mail follows:
...
>>
>>Why re-invent the wheel?
>
>
> It's part of a game. In the RPG there are dates which the players would like
> to be able to convert from our calendar to that one, and back again..
>
>
>>>In order to do that I need to find the exact days since the year 0
>
> BC/AD.
why is OBC relevant, I read later on that you take the start of egyptian
civilization as zero. is that not much earlier.
whats the structure of the egyptian|rpg calendar?
>
>>>However, the functions php provides only allow up to the unix epoch.
>>>
>>>Could you guys give me some pointers on how to accomplish this,
>>>accurately?
>>
>>Take a look at the MySQL date ranges -- They may have a data type that
>>allows for more than just 1/1/1970 to 3/??/2038
>>
>>If not, consider using PostgreSQL which has VERY extensive and flexible
>>date support, for ranges MUCH larger than 0 BC/AD.
>>http://postgresql.org
>>
>>I believe PostgreSQL even supports time scales on the order of geological
>>events and for astronomical purposes, though not with "day" accuracy.
>>
+1 on using a DB to calculate and format dates on this one :-)
I'm guessing Kevins probably written an SQL statement before and he's
already proved he can RTFPM (P for PHP)
>>I am assuming that by "accurately" you mean "to the nearest day" since you
>>spoke of "exact days", right?
>
>
> Aye.. it's nearest day, and according to calculations should have repeatable
> results. So what is date X today should also be it tomorrow (after the
> calculations of course). That's what i've noticed so far. when I add a date
> and convert it and then convert it back it is a different date.
>
show us some code :-)
>
>>But you didn't define how far into the future you need to go.
>>Current time?
>>A few years out?
>>Stardates from Star Trek?
>>You have to specify a start date, end date, and accuracy to choose a
>>correct calendar system.
>
>
> It's mostly the past. The RPG is set in Egypt and the beginning of the
> society in egypt has been taken as year 0. The start date I think is
> obvious, but I do not understand an end date of a calendar.. Perhaps I'm
> just blond.. but could you perhaps explain that one?
>
I must be blond, I don't even grok that question :-/
rgds,
jochem
attached mail follows:
Jochem Maas wrote:
> ....
>> It's mostly the past. The RPG is set in Egypt and the beginning of the
>> society in egypt has been taken as year 0. The start date I think is
>> obvious, but I do not understand an end date of a calendar.. Perhaps I'm
>> just blond.. but could you perhaps explain that one?
>>
>
> I must be blond, I don't even grok that question :-/
>
> rgds,
> jochem
It comes down to the amount of information that you can store in memory.
Consider: my start date is 6000 BC. And I believe that the universe
will end around, say, 320 Quadrillion AD. And I want accuracy in my
calendar (that is I can convert time) to the nearest second. Good luck
finding a computer that can easily handle that! Heck, good luck even
trying to store all of the seconds of the calendar as bytes on the computer!
This problem is related to the Y2K "bug". Back when hard drive storage
/ memory was more expensive they needed to find ways to express more
information with less technology. So they traded accuracy for
efficiency and dates were stored with two digits in each year. It was
ok though because the expected life of the program wasn't supposed to be
beyond 2000.
So getting back to *this* problem... what exactly is the relevant span
of time? Will game time in the RPG extend for thousands of years?
Hundreds of thousands? Would it really be ancient Egypt once you make
it past 0 BC?
So decide on an upper limit for the game calendar. And decide the
accuracy you need (nearest day, etc.) and then you can create functions
that will do the necessary date conversions. It can be in PHP or in the
DB itself... but that's the next step in the decision process. :)
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
Jason Barnett wrote:
> Jochem Maas wrote:
>
>>....
>>
>>>It's mostly the past. The RPG is set in Egypt and the beginning of the
>>>society in egypt has been taken as year 0. The start date I think is
>>>obvious, but I do not understand an end date of a calendar.. Perhaps I'm
>>>just blond.. but could you perhaps explain that one?
>>>
>>
>>I must be blond, I don't even grok that question :-/
>>
>>rgds,
>>jochem
>
>
> It comes down to the amount of information that you can store in memory.
> Consider: my start date is 6000 BC. And I believe that the universe
> will end around, say, 320 Quadrillion AD. And I want accuracy in my
> calendar (that is I can convert time) to the nearest second. Good luck
> finding a computer that can easily handle that! Heck, good luck even
> trying to store all of the seconds of the calendar as bytes on the computer!
er...grok.
thanks Jason :-)
>
> This problem is related to the Y2K "bug". Back when hard drive storage
> / memory was more expensive they needed to find ways to express more
> information with less technology. So they traded accuracy for
> efficiency and dates were stored with two digits in each year. It was
> ok though because the expected life of the program wasn't supposed to be
> beyond 2000.
>
> So getting back to *this* problem... what exactly is the relevant span
> of time? Will game time in the RPG extend for thousands of years?
> Hundreds of thousands? Would it really be ancient Egypt once you make
> it past 0 BC?
egypt is pre 0BC, even Discovery Channel admits that :-)
(0BC is 2005 years ago)
>
> So decide on an upper limit for the game calendar. And decide the
> accuracy you need (nearest day, etc.) and then you can create functions
> that will do the necessary date conversions. It can be in PHP or in the
> DB itself... but that's the next step in the decision process. :)
>
> --
> Teach a man to fish...
>
> NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
> STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
> STFM | http://php.net/manual/en/index.php
> STFW | http://www.google.com/search?q=php
> LAZY |
> http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
>> > Right now I'm working on a script that would calculate dates from one
>> > calendar to another. The normal calendar we use and a newly invented
> one.
>>
>> [shudder]
>> There are already WAY too many calendar systems.
>>
>> Inventing a new one is probably not such a good plan...
>>
>> Why re-invent the wheel?
>
> It's part of a game. In the RPG there are dates which the players would
> like
> to be able to convert from our calendar to that one, and back again..
You'll be way better off finding an existing calendar that "fits" your
criteria than inventing a new one.
>> But you didn't define how far into the future you need to go.
>> Current time?
>> A few years out?
>> Stardates from Star Trek?
>> You have to specify a start date, end date, and accuracy to choose a
>> correct calendar system.
>
> It's mostly the past. The RPG is set in Egypt and the beginning of the
> society in egypt has been taken as year 0. The start date I think is
> obvious, but I do not understand an end date of a calendar.. Perhaps I'm
> just blond.. but could you perhaps explain that one?
Here's your IDEAL calendar:
Your start date is 0 BC.
So let's make that be represented by: 0
Day 1 is, errr, December 26, 0 BC, represented by: 1
Day 2, December 27, 0 BC, represented by: 3
.
.
.
You can now calculate what's 2 billion+ (0xFFFFFFFF to be precise) days
later, and that would be the last date you could conveniently represent in
a 32-bit integer.
Do you expect the characters/events in your RPG to extend beyond 2 billion
days from December 25, 0 BC?
If so, then a 32-bit integer, one integer per day, simply won't cut it.
If not, then the above is an "ideal" date system.
Now, that was your "ideal" system. Find a system that comes close to that.
http://mysql.com
http://postgresql.org
PS Historians are ready to shoot me for using 12/25/0000 as 0 BC, but
that's their problem, not mine. It's an RPG. We're not looking for
historical accuracy here!
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hello,
while I can use posix_getgroups() to get groups additional to the
posix_getgid() value, I don't know which function to use to find out the
groups additional to posix_getegid(). There's no posix_getegroups()
function.
Regards
Marten
attached mail follows:
> Hello,
>
> while I can use posix_getgroups() to get groups additional to the
> posix_getgid() value, I don't know which function to use to find out the
> groups additional to posix_getegid(). There's no posix_getegroups()
> function.
You may be stuck with:
<?php
$uid = posix_getuid();
exec("groups $uid", $output, $error);
if ($error) echo "OS Error: $error<br />\n";
echo implode("<br />", $output);
?>
You'd want to do more than just echo the output, of course.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hi all,
I'm looking to validate a date submitted through a
form and I cannot decide which would be the best way
to do it. The form of the date needs to be:
YYYY-MM-DD.
At the moment I'm torn between using a regex,
something like: 20[\d][\d]-[0-1][\d]-[0-3][\d]
or using the checkdate() function.
Does anyone have any pros and/or cons to implement one
method over the other or other methods you may have
used?
Thanks,
David
attached mail follows:
David Bevan wrote:
> Hi all,
>
> I'm looking to validate a date submitted through a
> form and I cannot decide which would be the best way
> to do it. The form of the date needs to be:
> YYYY-MM-DD.
> At the moment I'm torn between using a regex,
> something like: 20[\d][\d]-[0-1][\d]-[0-3][\d]
> or using the checkdate() function.
>
> Does anyone have any pros and/or cons to implement one
> method over the other or other methods you may have
> used?
>
> Thanks,
> David
Better use checkdate, since it checks if the date really exists (not
just well formatted).
Mabye do something like this:
list($check_year,$check_month,$check_day) = explode("-",$date);
if (checkdate($check_month,$check_day,$check_year))
echo "Date is valid";
else
echo "Date is not valid";
attached mail follows:
Hello...
I'm writing a shell script that uses error_log function to log some
data, but it echos the error message to the output without logging the
message to the log file.
Code I use (php5 on unix):
*********************************************
#!/usr/local/php/bin/php -q
<?php
error_log("My error message");
?>
*********************************************
OUTPUT:
$ test.php
My error message
$
How can I prevent the error messages from being echoed to the client?
-thanks, Eli
attached mail follows:
I suppose error_log("My error message", 3, "/dev/null") would work.
On Wed, 2005-03-09 at 12:59, Eli wrote:
> Hello...
>
> I'm writing a shell script that uses error_log function to log some
> data, but it echos the error message to the output without logging the
> message to the log file.
>
> Code I use (php5 on unix):
> *********************************************
> #!/usr/local/php/bin/php -q
> <?php
> error_log("My error message");
> ?>
> *********************************************
> OUTPUT:
> $ test.php
> My error message
> $
>
> How can I prevent the error messages from being echoed to the client?
>
> -thanks, Eli
--
Regards,
Matthew Fonda
http://mfonda.info
attached mail follows:
> I suppose error_log("My error message", 3, "/dev/null") would work.
I cannot change the error_log() params, since it is cored in extern lib
I use.
Is there a way to prevent the default error_log() from being outputed?
-thanks, Eli
attached mail follows:
Eli wrote:
> Hello...
>
> I'm writing a shell script that uses error_log function to log some
> data, but it echos the error message to the output without logging the
> message to the log file.
>
> Code I use (php5 on unix):
> *********************************************
> #!/usr/local/php/bin/php -q
> <?php
> error_log("My error message");
> ?>
> *********************************************
> OUTPUT:
> $ test.php
> My error message
> $
>
> How can I prevent the error messages from being echoed to the client?
Try....
error_log ( "My error message" );
Don't know if it will work, but it's worth a shot.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Eli wrote:
>> I suppose error_log("My error message", 3, "/dev/null") would work.
>
http://php.net/manual/en/ref.errorfunc.php#ini.error-log
try:
ini_set('error_log', null)
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
John Nichel wrote:
> Try....
>
>
error_log ( "My error message" );
>
> Don't know if it will work, but it's worth a shot.
>
Checked. That's not working, since the
operator prevents logging of
errors/warnings/notices that caused by the expression following, but
doesn't prevent from the expression to be executed.
Besides, I can't change the syntax of the error_log which is used with
defaults: error_log(MSG);
-thanks, Eli
attached mail follows:
Jason Barnett wrote:
> Eli wrote:
>
>>>I suppose error_log("My error message", 3, "/dev/null") would work.
>>
>
> http://php.net/manual/en/ref.errorfunc.php#ini.error-log
>
> try:
>
> ini_set('error_log', null)
>
Doesn't work either.. :( but thanks for trying..
attached mail follows:
Eli wrote:
> John Nichel wrote:
>
>> Try....
>>
>>
error_log ( "My error message" );
>>
>> Don't know if it will work, but it's worth a shot.
>>
>
> Checked. That's not working, since the
operator prevents logging of
> errors/warnings/notices that caused by the expression following, but
> doesn't prevent from the expression to be executed.
>
> Besides, I can't change the syntax of the error_log which is used with
> defaults: error_log(MSG);
>
> -thanks, Eli
>
Try output buffering and dumping the buffer to /dev/null?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
John Nichel wrote:
>
> Try output buffering and dumping the buffer to /dev/null?
>
From all the suggestions the script now looks like this:
#!/usr/local/php5/bin/php -q
<?php
ob_start();
ini_set("error_log",null);
error_log("My error message");
ob_end_clean();
?>
But it still output the error to the screen.. :(
attached mail follows:
Eli wrote:
> From all the suggestions the script now looks like this:
>
> #!/usr/local/php5/bin/php -q
> <?php
> ob_start();
> ini_set("error_log",null);
>
error_log("My error message");
> ob_end_clean();
> ?>
>
> But it still output the error to the screen.. :(
>
I saw someone suggest this....
error_log ( "My error message", 3, "/dev/null" );
And that works fine on my machine...have you tried that?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
John Nichel wrote:
> Eli wrote:
>
>> From all the suggestions the script now looks like this:
>>
>> #!/usr/local/php5/bin/php -q
>> <?php
>> ob_start();
>> ini_set("error_log",null);
>>
error_log("My error message");
>> ob_end_clean();
>> ?>
>>
>> But it still output the error to the screen.. :(
>>
>
> I saw someone suggest this....
>
> error_log ( "My error message", 3, "/dev/null" );
>
> And that works fine on my machine...have you tried that?
>
Basically, I cannot change the line of the error_log() since it used in
extern lib. I can only add lines before the include (that calls it) to
prevent this, or call php with some other params (on the first exec line
#!/usr/...), but nothing helps so far for this situation.
attached mail follows:
> I'm writing a shell script that uses error_log function to log some
> data, but it echos the error message to the output without logging the
> message to the log file.
"the log file"...
*WHAT* log file?
A shell script has no pre-determined log file, really.
Actually, it's almost for sure STDOUT at that point, or maybe STDOUT, but
I doubt it. If you were coding PHP engine and needed to send error output
somewhere under shell circumstances, you'd think STDOUT would be "it"
right?...
So you can probably re-direct 2 (STDOUT) to somewhere to get the error_log
output where you want it.
I think in most shells that turns into:
test.php 2> /var/log/test
YMMV
It's up to you to figure out re-directs in your shell of choice. Good luck.
You should probably use can use set_error_handler to trap errors -- though
that will not catch error_log output, I don't think.
You can also use set_error_reporting() to get rid of errors entirely,
though that's not recommended.
> Code I use (php5 on unix):
> *********************************************
> #!/usr/local/php/bin/php -q
> <?php
> error_log("My error message");
> ?>
> *********************************************
> OUTPUT:
> $ test.php
> My error message
> $
>
> How can I prevent the error messages from being echoed to the client?
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Richard Lynch wrote:
>>I'm writing a shell script that uses error_log function to log some
>>data, but it echos the error message to the output without logging the
>>message to the log file.
>
>
> "the log file"...
>
> *WHAT* log file?
>
> A shell script has no pre-determined log file, really.
>
> Actually, it's almost for sure STDOUT at that point, or maybe STDOUT, but
> I doubt it. If you were coding PHP engine and needed to send error output
> somewhere under shell circumstances, you'd think STDOUT would be "it"
> right?...
>
> So you can probably re-direct 2 (STDOUT) to somewhere to get the error_log
> output where you want it.
>
> I think in most shells that turns into:
> test.php 2> /var/log/test
> YMMV
> It's up to you to figure out re-directs in your shell of choice. Good luck.
>
> You should probably use can use set_error_handler to trap errors -- though
> that will not catch error_log output, I don't think.
>
> You can also use set_error_reporting() to get rid of errors entirely,
> though that's not recommended.
>
I don't really need it to log into a file, but I wanted to prevent it
from echoing to the screen.
So I guess there's no way to prevent from error_log() (using defaults)
to echo to the screen (STDOUT).
error_reporting() affects on errors produced by PHP itself. I tried to
set it to 0 before the call, but it didn't help.
set_error_handler() affects on trigger_error() and not on error_log().
It seems that the extern lib I use should use trigger_error() (or
user_error()) function instead, which is the traditional way to report
user-defined errors.
Thanks for your help all...
attached mail follows:
>> test.php 2> /var/log/test
> I don't really need it to log into a file, but I wanted to prevent it
> from echoing to the screen.
test.php 2> /dev/null
You might even be able to put 2> /dev/null at the end of your #! line...
#!/usr/local/bin/php -q 2> /dev/null
But I dunno if that's gonna work...
> It seems that the extern lib I use should use trigger_error() (or
> user_error()) function instead, which is the traditional way to report
> user-defined errors.
An awful lot of scriptes use die() and error_log() when they should be
using trigger_error()...
http://php.net/trigger_error
die must die. :-)
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
In reading the documentation on simplexml predefined constants, I see a note
that says these were added to "PHP 5.1.0".
Am I reading that [future] version correctly, and I can expect that these
are to be released in a forthcoming stable release, and in fact do not yet
exist in the version I am using (5.0.3)?
TIA,
David Allan
mailto:David.Allan
thomastechsolutions.com
attached mail follows:
David Allan wrote:
> In reading the documentation on simplexml predefined constants, I see a note
> that says these were added to "PHP 5.1.0".
>
> Am I reading that [future] version correctly, and I can expect that these
> are to be released in a forthcoming stable release, and in fact do not yet
> exist in the version I am using (5.0.3)?
That is a safe assumption. The dev team has been working on the 5.1.0
release for some time now and I guess the documentation team got to this
one early. And no, they do not exist in your current version (5.0.3).
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
attached mail follows:
I've set up a form using Quickform. I've got it working a dream. My
problem is at the moment it only adds records to the database. I would
like to also have an edit form. I don't know what is easiest. Amend the
existing form so it enters data and edits it, or have two different
webpages.
Also I'm having trouble working out how to assign data to the form. Can
anyone point me to an example?
attached mail follows:
Leonie (phpgroup) <mailto:leonie
mungbeans.com.au>
on Wednesday, March 09, 2005 1:13 PM said:
> I've set up a form using Quickform. I've got it working a dream. My
> problem is at the moment it only adds records to the database. I would
> like to also have an edit form. I don't know what is easiest. Amend
> the existing form so it enters data and edits it, or have two
> different webpages.
I would use the same page. Have the page determine whether or not the
page is being used to add an entry or to edit an entry. Then act
accordingly.
> Also I'm having trouble working out how to assign data to the form.
> Can anyone point me to an example?
Without some code my response is going to be sarcastic.
DID YOU TRY THIS??
<?php
echo "<input type=\"text\" value=\"$yourVariable\" />\n";
?>
Look! I just assigned data to the form!
Chris.
attached mail follows:
> I've set up a form using Quickform. I've got it working a dream. My
> problem is at the moment it only adds records to the database. I would
> like to also have an edit form. I don't know what is easiest. Amend the
> existing form so it enters data and edits it, or have two different
> webpages.
>
> Also I'm having trouble working out how to assign data to the form. Can
> anyone point me to an example?
I always go for the "one form" system, because otherwise you have double
the work to do (opening two files) every little change, and invariably one
of the forms drifts out of sync when (not if, when) you forget to change
the other form and...
Assigning data to the form mostly consists of using the VALUE= attribute
in HTML tags, except TEXTAREA where it goes between opening/closing tag.
Basic logic flow:
<?php
if (...){ //Detect some indicator that you want a "new_record&qu