|
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 4 Aug 2004 04:03:33 -0000 Issue 2916
php-general-digest-help
lists.php.net
Date: Tue Aug 03 2004 - 23:03:33 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 4 Aug 2004 04:03:33 -0000 Issue 2916
Topics (messages 192541 through 192671):
javascript type cast
192541 by: Josh Close
192542 by: John Nichel
192543 by: Josh Close
192544 by: Josh Close
192547 by: Jason Wong
192548 by: Josh Close
192550 by: Jason Wong
192555 by: Vail, Warren
192556 by: Matthew Sims
192557 by: John Nichel
192560 by: raditha dissanayake
192561 by: raditha dissanayake
192568 by: Jason Wong
192570 by: Alex Hogan
192583 by: Josh Close
192587 by: raditha dissanayake
192588 by: Jason Wong
192590 by: Alex Hogan
192594 by: Josh Close
192609 by: Monty
192617 by: Justin Patrin
running a script
192545 by: Aaron Todd
192546 by: John Nichel
192549 by: Aaron Todd
192551 by: Jason Wong
192552 by: John Nichel
192553 by: Vail, Warren
192559 by: Aaron Todd
192565 by: John Nichel
192569 by: John Holmes
192598 by: Aaron Todd
192604 by: John Nichel
192607 by: Matthew Sims
192611 by: Ed Lazor
192613 by: John Nichel
Re: good book on PEAR
192554 by: Greg Donald
First day of the month
192558 by: David Hansen Jr.
192563 by: John Nichel
192566 by: Matthew Sims
192571 by: Vail, Warren
192572 by: John Holmes
192576 by: David Hansen Jr.
192580 by: Matthew Sims
Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$
192562 by: John Holmes
192589 by: Josh Acecool M
192599 by: Josh Acecool M
192616 by: Justin Patrin
192622 by: Josh Acecool M
192623 by: Josh Acecool M
Re: javascript type cast OT
192564 by: Jay Blanchard
192582 by: Jay Blanchard
192584 by: Alex Hogan
192585 by: raditha dissanayake
192586 by: John Nichel
192592 by: John Nichel
192597 by: Josh Close
192601 by: John Nichel
192602 by: Ed Lazor
192603 by: Jay Blanchard
192630 by: Curt Zirzow
192635 by: Jim Grill
192663 by: Alex Hogan
192670 by: Ed Lazor
[Q] Converting SQL Datetimes to timestamps
192567 by: Michael T. Peterson
192574 by: Vail, Warren
192575 by: Matthew Sims
192577 by: Jason Wong
192578 by: John Holmes
192579 by: John Nichel
192581 by: Ed Lazor
Re: Cannot compile
192573 by: Will Collins
smarty and db
192591 by: Amanda Hemmerich
192595 by: John Nichel
192610 by: Justin Patrin
192666 by: John Holmes
Re: configure --with-pear but there's no pear?
192593 by: Jacob Friis Larsen
192596 by: John Nichel
Location header does not work?
192600 by: Bing Du
192605 by: John Nichel
192606 by: Jason Wong
192608 by: Matthew Sims
192612 by: Bing Du
192614 by: Ed Lazor
192615 by: Ed Lazor
192619 by: Monty
192620 by: Matthew Sims
192621 by: Justin Patrin
192624 by: Ed Lazor
PHP + FDF and Opera
192618 by: Nicklas Bondesson
192625 by: Nicklas Bondesson
192627 by: Curt Zirzow
XML Breaking Help!
192626 by: Gerard Samuel
Re: [tcphp] alternating highlights
192628 by: Josh Close
RSS / eregi_replace()
192629 by: Anthony Ritter
192631 by: Justin Patrin
192641 by: Curt Zirzow
192645 by: Anthony Ritter
192647 by: Richard Bewley
Re: I need ob_write($string, $start, $length)
192632 by: jtl_phpdotnet.spamex.com
192634 by: Justin Patrin
192636 by: jtl_phpdotnet.spamex.com
Re: Handles for multiple output buffers?
192633 by: jtl_phpdotnet.spamex.com
Manipulate web content
192637 by: Richard Bewley
192638 by: Justin Patrin
192639 by: Richard Bewley
Query Results Question
192640 by: Harlequin
192642 by: Richard Bewley
192643 by: Curt Zirzow
192644 by: Harlequin
192646 by: Richard Bewley
192648 by: Harlequin
192649 by: Richard Bewley
192650 by: Curt Zirzow
192651 by: Harlequin
192652 by: Richard Bewley
192653 by: Harlequin
Order by
192654 by: Karl-Heinz Schulz
192655 by: Jake McHenry
192656 by: Karl-Heinz Schulz
192658 by: Wesley Furgiuele
192659 by: Jim Grill
192661 by: Karl-Heinz Schulz
Re: Query Results Question - Solved
192657 by: Harlequin
192660 by: Richard Bewley
192662 by: Harlequin
problem with php script
192664 by: asolomon15
HOWTO run PHP4 and PHP5 on Apache/Linux
192665 by: AJL
Easy Question (I think)
192667 by: Robert Frame
192668 by: Richard Bewley
192669 by: Robert Cummings
POST superglobal is empty
192671 by: AJL
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:
Is there any way to do a typecast in javascript? I know you can in
2.0, but that won't work here.
I have an input field and I need to add a number to it's value.
var + 123 == 'var123'
You would think that it would automatically typecast var to an int
since it's being added to one, but it just concatenates it instead.
How can I add (or sum) the two values?
P.S. I'm doing this in a php page... that's why I'm asking here.
-Josh
attached mail follows:
On Tuesday 03 August 2004 12:28, Josh Close wrote:
> P.S. I'm doing this in a php page... that's why I'm asking here.
But this doesn't make it a php problem.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
.......I found you can do var*1 to get it to type cast.
Thanks.
-Josh
On Tue, 3 Aug 2004 11:28:16 -0500, Josh Close <narshe
gmail.com> wrote:
> Is there any way to do a typecast in javascript? I know you can in
> 2.0, but that won't work here.
>
> I have an input field and I need to add a number to it's value.
>
> var + 123 == 'var123'
>
> You would think that it would automatically typecast var to an int
> since it's being added to one, but it just concatenates it instead.
>
> How can I add (or sum) the two values?
>
> P.S. I'm doing this in a php page... that's why I'm asking here.
>
> -Josh
>
attached mail follows:
Yes, but most php users do some web programming and might have come
across this before.
-Josh
On Tue, 3 Aug 2004 12:34:40 -0400, John Nichel <john
kegworks.com> wrote:
> On Tuesday 03 August 2004 12:28, Josh Close wrote:
> > P.S. I'm doing this in a php page... that's why I'm asking here.
>
> But this doesn't make it a php problem.
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john
kegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Wednesday 04 August 2004 00:38, Josh Close wrote:
> Yes, but most php users do some web programming and might have come
> across this before.
Most people on this list eat as well, but that doesn't make this list an
appropriate forum for discussing food.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Time will end all my troubles, but I don't always approve of Time's methods.
*/
attached mail follows:
Wow, no need to be an ass. I just wanted a little help and this list
is usually pretty friendly and willing to help..... but I guess not.
On Wed, 4 Aug 2004 01:01:47 +0800, Jason Wong <php-general
gremlins.biz> wrote:
> On Wednesday 04 August 2004 00:38, Josh Close wrote:
> > Yes, but most php users do some web programming and might have come
> > across this before.
>
> Most people on this list eat as well, but that doesn't make this list an
> appropriate forum for discussing food.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Time will end all my troubles, but I don't always approve of Time's methods.
> */
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Wednesday 04 August 2004 01:06, Josh Close wrote:
> Wow, no need to be an ass. I just wanted a little help and this list
> is usually pretty friendly and willing to help..... but I guess not.
So you're saying you're taking advantage of (or abusing) the list's readiness
to help by asking OT questions?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The enemy diversion you're ignoring is their main attack
-- Murphy's Military Laws n79
*/
attached mail follows:
I, for one, am not convinced that this all that far off topic.
Since the accepted method to generate browser interaction with server side
PHP, is to use Javascript, it doesn't seem any more off-topic than dealing
with database questions about MySQL.
I am probably like most PHP developers, with a very weak knowledge of
Javascript, and while that makes the question "feel" like being off-topic,
I'm not sure it should be. I wish I knew of another list I could recommend
as a resource for Javascript, but I don't, and that is probably a result of
knowing so little.
Only abuse occurring here, IMHO is the content police's treatment of Josh.
Warren Vail
-----Original Message-----
From: Jason Wong [mailto:php-general
gremlins.biz]
Sent: Tuesday, August 03, 2004 10:13 AM
To: php-general
lists.php.net
Subject: Re: [PHP] javascript type cast
On Wednesday 04 August 2004 01:06, Josh Close wrote:
> Wow, no need to be an ass. I just wanted a little help and this list
> is usually pretty friendly and willing to help..... but I guess not.
So you're saying you're taking advantage of (or abusing) the list's
readiness
to help by asking OT questions?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The enemy diversion you're ignoring is their main attack
-- Murphy's Military Laws n79
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> On Wednesday 04 August 2004 00:38, Josh Close wrote:
>> Yes, but most php users do some web programming and might have come
>> across this before.
>
> Most people on this list eat as well, but that doesn't make this list an
> appropriate forum for discussing food.
>
Unless it's about PEAR.
;)
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
On Tuesday 03 August 2004 13:38, Vail, Warren offered up the following
tid-bit of information :
> I, for one, am not convinced that this all that far off topic.
>
> Since the accepted method to generate browser interaction with server
> side PHP, is to use Javascript, it doesn't seem any more off-topic than
> dealing with database questions about MySQL.
Most DB questions you see here come from php problems...or people who don't
realize 'proper mailing list conduct'. But the OP stated that he knew it
was OT, and decided to ask here anyway, instead of on a JS mailing list, or
going to Google (I say this, because five minutes after his original post
he posted back that he found the answer)
> I am probably like most PHP developers, with a very weak knowledge of
> Javascript, and while that makes the question "feel" like being
> off-topic, I'm not sure it should be. I wish I knew of another list I
> could recommend as a resource for Javascript, but I don't, and that is
> probably a result of knowing so little.
Most PHP developers I know, and have worked with over the past 6 or 7 years
have a pretty strong grasp of JS, but that doesn't change the point. I
know quite a few on this list come from a Perl background, but it would
still be bad form of me to pose a Perl question to this list.
> Only abuse occurring here, IMHO is the content police's treatment of
> Josh.
We're under a high security alert....rougher treatment is allowed.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Vail, Warren wrote:
>I, for one, am not convinced that this all that far off topic.
>
>Since the accepted method to generate browser interaction with server side
>PHP, is to use Javascript, it doesn't seem any more off-topic than dealing
>with database questions about MySQL.
>
>
unfortunately it's not quite so. javascript is javascript and has
nothing at all to do with php. Perhaps a good place to ask questions
about javascript might be the list (thelist
lists.evolt.org)
pure mysql questions are off topic for this list as well - however you
will notice that most of the questions are about the PHP mysql API pure
sql questions rarely get polite answers.
>
>Only abuse occurring here, IMHO is the content police's treatment of Josh.
>
>
Well it's hardly abuse While i symphathise with josh - the point is that
when there are lots of off topic discussions taking place in a list it
loses it's value. If you posted these questions on a perl list or the
qmail list you will see how polite the content police in this list
really is.
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
attached mail follows:
Matthew Sims wrote:
>>On Wednesday 04 August 2004 00:38, Josh Close wrote:
>>
>>
>>>Yes, but most php users do some web programming and might have come
>>>across this before.
>>>
>>>
>>Most people on this list eat as well, but that doesn't make this list an
>>appropriate forum for discussing food.
>>
>>
>>
>
>Unless it's about PEAR.
>
>
or the muscat API.
>;)
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
attached mail follows:
On Wednesday 04 August 2004 01:38, Vail, Warren wrote:
> I, for one, am not convinced that this all that far off topic.
OK if I asked the question "how do I do type casting in Cobol?", would you
agree that it is OT? Cobol has nothing to do with the zend engine, Javascript
has nothing to do with the zend engine so where' the relationship with PHP?
> Since the accepted method to generate browser interaction with server side
> PHP, is to use Javascript,
I would have thought links and forms were more common. Anyway you're missing
the point, the question was OT, period. It was not asking about interaction
with PHP, it was a Javascript question, pure and simple. Comprendez?
> it doesn't seem any more off-topic than dealing
> with database questions about MySQL.
OT questions come and go, they are asked and get answered, but what is
annoying is the weak justification given by the OP for something that is
blatantly OT. Hence my rebuttal.
> I am probably like most PHP developers, with a very weak knowledge of
> Javascript, and while that makes the question "feel" like being off-topic,
> I'm not sure it should be. I wish I knew of another list I could recommend
> as a resource for Javascript, but I don't, and that is probably a result of
> knowing so little.
google > javascript weenie
> Only abuse occurring here, IMHO is the content police's treatment of Josh.
If it pleases you.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A diva who specializes in risque arias is an off-coloratura soprano.
*/
attached mail follows:
I have been on a number of lists over the years, as what ever technology
I'm using at the time has demanded.
I would have to say that this list is one of the most curt and
condescending lists I've ever been on. Perhaps it's because the long
time users don't realize they're being so, (unless of course you read
the FAQ about asking smart questions which they are so happy to throw at
you), or maybe it's because they are so much better at this particular
technology that they don't have to even be civil.
What ever the reason it leaves a bad impression for anyone embracing php
and wanting to gather additional information that can sometimes only be
obtained from an individual with experience and not a book. (imagine
that)
Now I fully expect that some one will come back and say something like,
"Well you don't have to stay on this list" or something equally as
moronic. Quite frankly I don't care. Flame away...
Over the last seven months that I have been on this list I have seen the
same questions addressed several times. Sometimes worded different, but
nothing really new. Maybe that is what creates such animosity to the
newer members of this list from the older ones. Then again maybe it's
nothing more than the age old trait of chastising someone else to give
themselves a feeling of importance.
My point is a little temperance goes a lot farther and shows a lot more
than self importance.
BTW.., Yes I'm top posting so go ahead and flame away for that too.
alex hogan
> -----Original Message-----
> From: Vail, Warren [mailto:Warren.Vail
schwab.com]
> Sent: Tuesday, August 03, 2004 12:38 PM
> To: 'Jason Wong'; php-general
lists.php.net
> Subject: RE: [PHP] javascript type cast
>
> I, for one, am not convinced that this all that far off topic.
>
> Since the accepted method to generate browser interaction
> with server side PHP, is to use Javascript, it doesn't seem
> any more off-topic than dealing with database questions about MySQL.
>
> I am probably like most PHP developers, with a very weak
> knowledge of Javascript, and while that makes the question
> "feel" like being off-topic, I'm not sure it should be. I
> wish I knew of another list I could recommend as a resource
> for Javascript, but I don't, and that is probably a result of
> knowing so little.
>
> Only abuse occurring here, IMHO is the content police's
> treatment of Josh.
>
> Warren Vail
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
Ok. I write most my web apps in php. I rarely will use js for
anything, but I needed it on this rare occasion. I didn't want to have
to post to the same php page to get the results to change, so I though
a little js would do the job.
Being a php list, I thought that a few others would have run into the
same issue while doing this. Would it have made it better if I talked
a little about the php work that was being done on the page also?
All this is doing is making me like php less and less. And what about
the newer users to the list? This also makes me not want to answer
other peoples questions either. I've also noticed that a lot of
answers to peoples questions get flamed on this list also. It's like
you think you're better than them and came take them down for whatever
reason.
Yes, the question was OT and I knew it. Yes, I found the answer via
google 5-10 mins later. I had already searched a while before for it.
And I'm not going to go and get on a js list for one question I may
have once every 3 months. I figured someone here has ran into the same
situation before. Especially since type casting is a common thing
among most languages (even php).
All I have to say is, sorry I asked. I really wasn't worth it.
-Josh
On Tue, 03 Aug 2004 13:09:19 -0500, Alex Hogan
<alex.hogan
alliedelec.com> wrote:
> I have been on a number of lists over the years, as what ever technology
> I'm using at the time has demanded.
>
> I would have to say that this list is one of the most curt and
> condescending lists I've ever been on. Perhaps it's because the long
> time users don't realize they're being so, (unless of course you read
> the FAQ about asking smart questions which they are so happy to throw at
> you), or maybe it's because they are so much better at this particular
> technology that they don't have to even be civil.
>
> What ever the reason it leaves a bad impression for anyone embracing php
> and wanting to gather additional information that can sometimes only be
> obtained from an individual with experience and not a book. (imagine
> that)
>
> Now I fully expect that some one will come back and say something like,
> "Well you don't have to stay on this list" or something equally as
> moronic. Quite frankly I don't care. Flame away...
>
> Over the last seven months that I have been on this list I have seen the
> same questions addressed several times. Sometimes worded different, but
> nothing really new. Maybe that is what creates such animosity to the
> newer members of this list from the older ones. Then again maybe it's
> nothing more than the age old trait of chastising someone else to give
> themselves a feeling of importance.
>
> My point is a little temperance goes a lot farther and shows a lot more
> than self importance.
>
> BTW.., Yes I'm top posting so go ahead and flame away for that too.
>
> alex hogan
>
>
> > -----Original Message-----
> > From: Vail, Warren [mailto:Warren.Vail
schwab.com]
> > Sent: Tuesday, August 03, 2004 12:38 PM
> > To: 'Jason Wong'; php-general
lists.php.net
> > Subject: RE: [PHP] javascript type cast
> >
> > I, for one, am not convinced that this all that far off topic.
> >
> > Since the accepted method to generate browser interaction
> > with server side PHP, is to use Javascript, it doesn't seem
> > any more off-topic than dealing with database questions about MySQL.
> >
> > I am probably like most PHP developers, with a very weak
> > knowledge of Javascript, and while that makes the question
> > "feel" like being off-topic, I'm not sure it should be. I
> > wish I knew of another list I could recommend as a resource
> > for Javascript, but I don't, and that is probably a result of
> > knowing so little.
> >
> > Only abuse occurring here, IMHO is the content police's
> > treatment of Josh.
> >
> > Warren Vail
> *************************************************************************************
> The contents of this e-mail and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is addressed. The
> views stated herein do not necessarily represent the view of the company. If you are
> not the intended recipient of this e-mail you may not copy, forward, disclose, or
> otherwise use it or any part of it in any form whatsoever. If you have received this
> e-mail in error please e-mail the sender.
> *************************************************************************************
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Josh Close wrote:
>Ok. I write most my web apps in php. I rarely will use js for
>anything, but I needed it on this rare occasion. I didn't want to have
>to post to the same php page to get the results to change, so I though
>a little js would do the job.
>
>Being a php list, I thought that a few others would have run into the
>same issue while doing this. Would it have made it better if I talked
>a little about the php work that was being done on the page also?
>
>All this is doing is making me like php less and less.
>
ah I get it because you can't understand javascript you dislike PHP.
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
attached mail follows:
On Wednesday 04 August 2004 02:44, Josh Close wrote:
> Being a php list, I thought that a few others would have run into the
> same issue while doing this. Would it have made it better if I talked
> a little about the php work that was being done on the page also?
OT is OT, trying to justify it by linking it to PHP through a dozen degrees of
separation will not change that fact.
> Yes, the question was OT and I knew it. Yes, I found the answer via
> google 5-10 mins later. I had already searched a while before for it.
> And I'm not going to go and get on a js list for one question I may
> have once every 3 months. I figured someone here has ran into the same
> situation before.
There you go, that says it all. I'm too lazy to subscribe to another list so
I'll use the PHP list as a general dumping ground.
> Especially since type casting is a common thing
> among most languages (even php).
And most people on this list eat as well ... whoops I'm repeating myself.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
There are two times when a man doesn't understand a woman -- before
marriage and after marriage.
*/
attached mail follows:
> All I have to say is, sorry I asked.
OK.., now you're really making me want to take a poke at you.
You posted off topic, knew it was off topic, you got spanked for it.
Don't make things worse by whining.
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
On Tue, 03 Aug 2004 14:15:32 -0500, Alex Hogan
<alex.hogan
alliedelec.com> wrote:
>
> > All I have to say is, sorry I asked.
>
> OK.., now you're really making me want to take a poke at you.
>
> You posted off topic, knew it was off topic, you got spanked for it.
>
> Don't make things worse by whining.
Not trying to whine for you. I was just surprised that people would
take several hours out of their day to complain about this, instead of
just saying it's OT and to not post OT.
I won't happen again, so you can stop whining.
-Josh
>
> alex hogan
>
>
> *************************************************************************************
> The contents of this e-mail and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is addressed. The
> views stated herein do not necessarily represent the view of the company. If you are
> not the intended recipient of this e-mail you may not copy, forward, disclose, or
> otherwise use it or any part of it in any form whatsoever. If you have received this
> e-mail in error please e-mail the sender.
> *************************************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Well, all I have to say is thank god for this newsgroup and the core group
of people who answer most of the questions here. I can understand some
crankiness now and then after answering the same questions over and over or
dealing with people who don't read the online manual and come here to post
first.
I've been slapped down once or twice myself for asking a stupid or vague
question. But, it's no big deal because the people here have helped me out
time and time again by answering many PHP questions and providing sample
code over the past two years, so for that I'm grateful. It would be nice,
however, if there were some way to post a link to the FAQ here, because
unless someone specifically posts the URL, there's no way to know it exists
or how to reach it.
I recommend that you first do a Google newsgroup search for any problems you
have: http://www.google.com/grphp?hl=en&tab=wg - 80% of the time I find the
answer I need without having to post at all. Also, read the user-contributed
comments in the online PHP manual, they are often very helpful and provide a
lot of useful sample code. Plus, there are lots of PHP sites out there, some
of which have PHP forums, such as sitepoint.com.
Monty
> From: narshe
gmail.com (Josh Close)
> Newsgroups: php.general
> Date: Tue, 3 Aug 2004 13:44:28 -0500
> To: PHP <php-general
lists.php.net>
> Subject: Re: [PHP] javascript type cast
>
> Ok. I write most my web apps in php. I rarely will use js for
> anything, but I needed it on this rare occasion. I didn't want to have
> to post to the same php page to get the results to change, so I though
> a little js would do the job.
>
> Being a php list, I thought that a few others would have run into the
> same issue while doing this. Would it have made it better if I talked
> a little about the php work that was being done on the page also?
>
> All this is doing is making me like php less and less. And what about
> the newer users to the list? This also makes me not want to answer
> other peoples questions either. I've also noticed that a lot of
> answers to peoples questions get flamed on this list also. It's like
> you think you're better than them and came take them down for whatever
> reason.
>
> Yes, the question was OT and I knew it. Yes, I found the answer via
> google 5-10 mins later. I had already searched a while before for it.
> And I'm not going to go and get on a js list for one question I may
> have once every 3 months. I figured someone here has ran into the same
> situation before. Especially since type casting is a common thing
> among most languages (even php).
>
> All I have to say is, sorry I asked. I really wasn't worth it.
>
> -Josh
>
attached mail follows:
On Tue, 03 Aug 2004 16:21:00 -0400, Monty <monty3
hotmail.com> wrote:
> Well, all I have to say is thank god for this newsgroup and the core group
> of people who answer most of the questions here. I can understand some
> crankiness now and then after answering the same questions over and over or
> dealing with people who don't read the online manual and come here to post
> first.
>
> I've been slapped down once or twice myself for asking a stupid or vague
> question. But, it's no big deal because the people here have helped me out
> time and time again by answering many PHP questions and providing sample
> code over the past two years, so for that I'm grateful. It would be nice,
> however, if there were some way to post a link to the FAQ here, because
> unless someone specifically posts the URL, there's no way to know it exists
> or how to reach it.
>
Which FAQ do you mean? I've started my own FAQ for frequently asked
questions. Perhaps I should be merging with the other.
https://www.reversefold.com/tikiwiki/tiki-index.php?page=PHPFAQs
> I recommend that you first do a Google newsgroup search for any problems you
> have: http://www.google.com/grphp?hl=en&tab=wg - 80% of the time I find the
> answer I need without having to post at all. Also, read the user-contributed
> comments in the online PHP manual, they are often very helpful and provide a
> lot of useful sample code. Plus, there are lots of PHP sites out there, some
> of which have PHP forums, such as sitepoint.com.
>
> Monty
>
> > From: narshe
gmail.com (Josh Close)
> > Newsgroups: php.general
> > Date: Tue, 3 Aug 2004 13:44:28 -0500
> > To: PHP <php-general
lists.php.net>
> > Subject: Re: [PHP] javascript type cast
>
>
> >
> > Ok. I write most my web apps in php. I rarely will use js for
> > anything, but I needed it on this rare occasion. I didn't want to have
> > to post to the same php page to get the results to change, so I though
> > a little js would do the job.
> >
> > Being a php list, I thought that a few others would have run into the
> > same issue while doing this. Would it have made it better if I talked
> > a little about the php work that was being done on the page also?
> >
> > All this is doing is making me like php less and less. And what about
> > the newer users to the list? This also makes me not want to answer
> > other peoples questions either. I've also noticed that a lot of
> > answers to peoples questions get flamed on this list also. It's like
> > you think you're better than them and came take them down for whatever
> > reason.
> >
> > Yes, the question was OT and I knew it. Yes, I found the answer via
> > google 5-10 mins later. I had already searched a while before for it.
> > And I'm not going to go and get on a js list for one question I may
> > have once every 3 months. I figured someone here has ran into the same
> > situation before. Especially since type casting is a common thing
> > among most languages (even php).
> >
> > All I have to say is, sorry I asked. I really wasn't worth it.
> >
> > -Josh
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> !DSPAM:410ffa04171961451115590!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
Is there any way to run a php script by clicking a link?
Thanks,
Aaron
attached mail follows:
On Tuesday 03 August 2004 12:25, Aaron Todd offered up the following tid-bit
of information :
> Is there any way to run a php script by clicking a link?
>
> Thanks,
>
> Aaron
Anytime you click on a link to a php document, you are 'running' a php
script. Could you be a bit more specific as to what you want to do?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
The program I am working on so far will take input from a form and email it
out. This information needs to be verified by a human and then somehow the
human that verifys the info needs to click some link in order to for all
that data to be entered into an SQL database.
I was thinking of somehow having a link in the email so when I click on it,
it runs a script that will enter all my info into the database.
Any help/suggestions is appreciated.
Thanks,
Aaron
"John Nichel" <john
kegworks.com> wrote in message
news:200408031245.45735.john
kegworks.com...
On Tuesday 03 August 2004 12:25, Aaron Todd offered up the following tid-bit
of information :
> Is there any way to run a php script by clicking a link?
>
> Thanks,
>
> Aaron
Anytime you click on a link to a php document, you are 'running' a php
script. Could you be a bit more specific as to what you want to do?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Wednesday 04 August 2004 01:08, Aaron Todd wrote:
> The program I am working on so far will take input from a form and email it
> out. This information needs to be verified by a human and then somehow the
> human that verifys the info needs to click some link in order to for all
> that data to be entered into an SQL database.
>
> I was thinking of somehow having a link in the email so when I click on it,
> it runs a script that will enter all my info into the database.
>
> Any help/suggestions is appreciated.
There's nothing special you need to do to make that happen. If your mail
client is configure to open URLs when they are clicked on then you're all
set. Just make sure that if your app is important you have some mechanism to
check that the person using the link has the authority to do so.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I'm prepared for all emergencies but totally unprepared for everyday life.
*/
attached mail follows:
On Tuesday 03 August 2004 13:08, Aaron Todd offered up the following tid-bit
of information :
> The program I am working on so far will take input from a form and email
> it out. This information needs to be verified by a human and then
> somehow the human that verifys the info needs to click some link in order
> to for all that data to be entered into an SQL database.
>
> I was thinking of somehow having a link in the email so when I click on
> it, it runs a script that will enter all my info into the database.
>
> Any help/suggestions is appreciated.
>
> Thanks,
>
> Aaron
You could :
A) Build the link in the email with a query string of all the data you want
to enter into the db, eg.
http://www.mydomain.com/processForm.php?key1=val1&key2=val2&key3=val3
And these will be passed to your script in the $_GET array.
Or :
B) Store all the info that is entered in your form in a temporary table,
with a unique id, and attach that id to the link in your email, eg.
http://www.mydomain.com/processForm.php?id=<some id>
And have the script (processForm.php), read the info from the temporary
table and insert it into it's final destination.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Sounds like a good plan, but if this is outside a firewall on the open
internet, it could present some security risks. I'll assume for the moment
that it's not.
If your script that sends the email can store the information from the form
into the database and assign it a unique number, then your hotlink on the
email only needs to have the number.
My expectation would be, that after giving this some thought you will decide
you need the person receiving the email to have the ability to change some
of the data on the email.
Another approach might be to send an email alert that contains a url to a
page that presents a list of pending requests, and your user could then
authorize several at once.
I also know you can send an email form in html (you can google for help on
this one), but I am not sure if the form can post the data, perhaps if the
person receiving email is using outlook, don't know.
Hope this stimulates a few more options,
Warren Vail
-----Original Message-----
From: Aaron Todd [mailto:aaloki88
hotmail.com]
Sent: Tuesday, August 03, 2004 10:08 AM
To: php-general
lists.php.net
Subject: Re: [PHP] running a script
The program I am working on so far will take input from a form and email it
out. This information needs to be verified by a human and then somehow the
human that verifys the info needs to click some link in order to for all
that data to be entered into an SQL database.
I was thinking of somehow having a link in the email so when I click on it,
it runs a script that will enter all my info into the database.
Any help/suggestions is appreciated.
Thanks,
Aaron
"John Nichel" <john
kegworks.com> wrote in message
news:200408031245.45735.john
kegworks.com...
On Tuesday 03 August 2004 12:25, Aaron Todd offered up the following tid-bit
of information :
> Is there any way to run a php script by clicking a link?
>
> Thanks,
>
> Aaron
Anytime you click on a link to a php document, you are 'running' a php
script. Could you be a bit more specific as to what you want to do?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I like both of these methods...Is one of them more used regularly with PHP.
I don't want to start down a road that will eventually dead end if you know
what I mean.
Thanks,
Aaron
"John Nichel" <john
kegworks.com> wrote in message
news:200408031319.15749.john
kegworks.com...
On Tuesday 03 August 2004 13:08, Aaron Todd offered up the following tid-bit
of information :
> The program I am working on so far will take input from a form and email
> it out. This information needs to be verified by a human and then
> somehow the human that verifys the info needs to click some link in order
> to for all that data to be entered into an SQL database.
>
> I was thinking of somehow having a link in the email so when I click on
> it, it runs a script that will enter all my info into the database.
>
> Any help/suggestions is appreciated.
>
> Thanks,
>
> Aaron
You could :
A) Build the link in the email with a query string of all the data you want
to enter into the db, eg.
http://www.mydomain.com/processForm.php?key1=val1&key2=val2&key3=val3
And these will be passed to your script in the $_GET array.
Or :
B) Store all the info that is entered in your form in a temporary table,
with a unique id, and attach that id to the link in your email, eg.
http://www.mydomain.com/processForm.php?id=<some id>
And have the script (processForm.php), read the info from the temporary
table and insert it into it's final destination.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tuesday 03 August 2004 13:32, Aaron Todd offered up the following tid-bit
of information :
> I like both of these methods...Is one of them more used regularly with
> PHP. I don't want to start down a road that will eventually dead end if
> you know what I mean.
>
> Thanks,
>
> Aaron
<snip>
>
> B) Store all the info that is entered in your form in a temporary table,
> with a unique id, and attach that id to the link in your email, eg.
>
> http://www.mydomain.com/processForm.php?id=<some id>
>
> And have the script (processForm.php), read the info from the temporary
> table and insert it into it's final destination.
I don't know if it's more common, but I would use the second option to do
something like this. No 'personal' infomation is passed to the script via
http.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Aaron Todd wrote:
> I like both of these methods...Is one of them more used regularly with PHP.
> I don't want to start down a road that will eventually dead end if you know
> what I mean.
Relating the information to a unique ID and using that in the email is a
better approach.
Appending all of the data to the URL will eventually run into problems
depending upon the length and format of the data, your email reader,
data changes, etc.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
attached mail follows:
Thanks for the tips.
After clicking http://www.mydomain.com/processForm.php?id=<some id> is 'id'
a variable containing 'some id'. Can I access that by '$id'
I am just trying to figure out how to write the SELECT statement for that
script. I am guessing, but I would do:
"SELECT * FROM temp_users WHERE ID=$id"
Thanks again.
Aaron
"John Nichel" <john
kegworks.com> wrote in message
news:200408031402.51034.john
kegworks.com...
On Tuesday 03 August 2004 13:32, Aaron Todd offered up the following tid-bit
of information :
> I like both of these methods...Is one of them more used regularly with
> PHP. I don't want to start down a road that will eventually dead end if
> you know what I mean.
>
> Thanks,
>
> Aaron
<snip>
>
> B) Store all the info that is entered in your form in a temporary table,
> with a unique id, and attach that id to the link in your email, eg.
>
> http://www.mydomain.com/processForm.php?id=<some id>
>
> And have the script (processForm.php), read the info from the temporary
> table and insert it into it's final destination.
I don't know if it's more common, but I would use the second option to do
something like this. No 'personal' infomation is passed to the script via
http.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tuesday 03 August 2004 15:24, Aaron Todd offered up the following tid-bit
of information :
> Thanks for the tips.
>
> After clicking http://www.mydomain.com/processForm.php?id=<some id> is
> 'id' a variable containing 'some id'. Can I access that by '$id'
>
> I am just trying to figure out how to write the SELECT statement for that
> script. I am guessing, but I would do:
> "SELECT * FROM temp_users WHERE ID=$id"
>
> Thanks again.
>
> Aaron
If you have register_globals on, you can access it via $id, otherwise use
$_GET['id']
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
> Thanks for the tips.
>
> After clicking http://www.mydomain.com/processForm.php?id=<some id> is
> 'id'
> a variable containing 'some id'. Can I access that by '$id'
>
> I am just trying to figure out how to write the SELECT statement for that
> script. I am guessing, but I would do:
> "SELECT * FROM temp_users WHERE ID=$id"
>
> Thanks again.
>
> Aaron
>
More like:
"SELECT * FROM temp_users WHERE ID=\"".$_GET["id"]."\"";
Use $_GET to access variables from the url.
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
> -----Original Message-----
> If you have register_globals on, you can access it via $id, otherwise use
> $_GET['id']
Or $_POST['id'] if you're receiving data from a form (ie. processForm.php).
-Ed
attached mail follows:
On Tuesday 03 August 2004 16:29, Ed Lazor offered up the following tid-bit
of information :
> > -----Original Message-----
> > If you have register_globals on, you can access it via $id, otherwise
> > use $_GET['id']
>
> Or $_POST['id'] if you're receiving data from a form (ie.
> processForm.php).
>
> -Ed
The thread's been snipped to death. The variable is going to be passed via
a link (query string) from an email (the processForm.php was just the 'page
name' I used in an earlier example).
We could just go with $_REQUEST['id'], and cover all the bases. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tue, 3 Aug 2004 10:39:42 -0500 (EST), Amanda Hemmerich
<ahemmeri
indiana.edu> wrote:
> I need a solid foundation on using PEAR. ANy books or websites you
> would recommend?
You might try http://pear.php.net/
--
Greg Donald
http://destiney.com/
attached mail follows:
I'm trying to make a custom calendar script for my school district, and
I'm hitting a little obstacle. I know how I can accomplish what I'm
after, but it's a lot of extra coding. I'm wondering if there's a
simple way to figure out what day of the week the first day of the month
lands on. I can take the info pulled with date() and use several
switch() and if statements, but that's ugly. Anyone have any
suggestions?
Thanks!
~ David
attached mail follows:
On Tuesday 03 August 2004 13:46, David Hansen Jr. offered up the following
tid-bit of information :
> I'm trying to make a custom calendar script for my school district, and
> I'm hitting a little obstacle. I know how I can accomplish what I'm
> after, but it's a lot of extra coding. I'm wondering if there's a
> simple way to figure out what day of the week the first day of the month
> lands on. I can take the info pulled with date() and use several
> switch() and if statements, but that's ugly. Anyone have any
> suggestions?
>
> Thanks!
> ~ David
$firstDayOfMonth = mktime (0,0,0, $month, 1, $year );
http://us4.php.net/mktime
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
> I'm trying to make a custom calendar script for my school district, and
> I'm hitting a little obstacle. I know how I can accomplish what I'm
> after, but it's a lot of extra coding. I'm wondering if there's a
> simple way to figure out what day of the week the first day of the month
> lands on. I can take the info pulled with date() and use several
> switch() and if statements, but that's ugly. Anyone have any
> suggestions?
>
> Thanks!
> ~ David
>
You mean like:
$firstWkDay = date("l", mktime(0,0,0,7,1,2004));
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
I was going to suggest;
$dayofweek = date("D",strtotime(date("Y-m-01")));
Warren Vail
-----Original Message-----
From: John Nichel [mailto:john
kegworks.com]
Sent: Tuesday, August 03, 2004 11:00 AM
To: php-general
lists.php.net
Subject: Re: [PHP] First day of the month
On Tuesday 03 August 2004 13:46, David Hansen Jr. offered up the following
tid-bit of information :
> I'm trying to make a custom calendar script for my school district,
> and I'm hitting a little obstacle. I know how I can accomplish what
> I'm after, but it's a lot of extra coding. I'm wondering if there's a
> simple way to figure out what day of the week the first day of the
> month lands on. I can take the info pulled with date() and use
> several
> switch() and if statements, but that's ugly. Anyone have any
> suggestions?
>
> Thanks!
> ~ David
$firstDayOfMonth = mktime (0,0,0, $month, 1, $year );
http://us4.php.net/mktime
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
David Hansen Jr. wrote:
> I'm trying to make a custom calendar script for my school district, and
> I'm hitting a little obstacle. I know how I can accomplish what I'm
> after, but it's a lot of extra coding. I'm wondering if there's a
> simple way to figure out what day of the week the first day of the month
> lands on. I can take the info pulled with date() and use several
> switch() and if statements, but that's ugly. Anyone have any
> suggestions?
echo date('D',mktime(0,0,1,1,date('m'),date('Y'));
http://us2.php.net/date
http://us2.php.net/mktime
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
attached mail follows:
On Tue, 2004-08-03 at 11:09, Matthew Sims wrote:
> > I'm trying to make a custom calendar script for my school district, and
> > I'm hitting a little obstacle. I know how I can accomplish what I'm
> > after, but it's a lot of extra coding. I'm wondering if there's a
> > simple way to figure out what day of the week the first day of the month
> > lands on. I can take the info pulled with date() and use several
> > switch() and if statements, but that's ugly. Anyone have any
> > suggestions?
> >
> > Thanks!
> > ~ David
> >
>
> You mean like:
>
> $firstWkDay = date("l", mktime(0,0,0,7,1,2004));
That's much simpler that what I had in my head.
Thanks so much!
~ David
attached mail follows:
> I was going to suggest;
>
> $dayofweek = date("D",strtotime(date("Y-m-01")));
>
> Warren Vail
>
>
That probably works but if you look, you're calling a function inside a
function that's inside another function.
$dayofweek = date("D", mktime(0,0,0,$m,1,$y));
A little more simpler.
BTW, "D" or "l" pretty much do the same thing. It depends on whether you
wan Mon or Monday.
D = abbrviated name
l = full name
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
Josh Acecool M wrote:
> var $The_Template_Sys;
>
> $this -> The_Template_Sys = file_get_contents("$The_Template_File");
>
> $this -> Sub_Template = TRUE;
Please respond to the list and not me personally.
you say you're getting a parse error. How could anyone possibly help you
troubleshoot that parse error unless they had an example of what was in
the file being eval()'d??
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
attached mail follows:
It has a preg_match in there that looks for \$variable = blah;
I cant help that a file works without Eval, and then to eval it, it messes
it up...
"John Holmes" <holmes072000
charter.net> wrote in message
news:410FD249.9010004
charter.net...
> Josh Acecool M wrote:
> > var $The_Template_Sys;
> >
> > $this -> The_Template_Sys = file_get_contents("$The_Template_File");
> >
> > $this -> Sub_Template = TRUE;
>
> Please respond to the list and not me personally.
>
> you say you're getting a parse error. How could anyone possibly help you
> troubleshoot that parse error unless they had an example of what was in
> the file being eval()'d??
>
> --
>
> John Holmes
>
> php|architect - The magazine for PHP professionals -
http://www.phparch.com
attached mail follows:
Also, variables do not get passed correctly from the engine to the evaluated
pages.
"Josh Acecool M" <webmaster
acecoolco.com> wrote in message
news:20040803191106.70146.qmail
pb1.pair.com...
> It has a preg_match in there that looks for \$variable = blah;
>
> I cant help that a file works without Eval, and then to eval it, it messes
> it up...
>
> "John Holmes" <holmes072000
charter.net> wrote in message
> news:410FD249.9010004
charter.net...
> > Josh Acecool M wrote:
> > > var $The_Template_Sys;
> > >
> > > $this -> The_Template_Sys = file_get_contents("$The_Template_File");
> > >
> > > $this -> Sub_Template = TRUE;
> >
> > Please respond to the list and not me personally.
> >
> > you say you're getting a parse error. How could anyone possibly help you
> > troubleshoot that parse error unless they had an example of what was in
> > the file being eval()'d??
> >
> > --
> >
> > John Holmes
> >
> > php|architect - The magazine for PHP professionals -
> http://www.phparch.com
attached mail follows:
On Tue, 3 Aug 2004 12:11:02 -0700, Josh Acecool M
<webmaster
acecoolco.com> wrote:
> It has a preg_match in there that looks for \$variable = blah;
>
> I cant help that a file works without Eval, and then to eval it, it messes
> it up...
And why again are you using *eval* on a file? Why not
include('file.php')? If you're doing parsing on the file contents,
look there for your problem. It's likely you're adding backslashes
somewhere. Look at the contents of the string you're trying to eval
and see if it looks the same as the file you want to run. If not,
that's your problem.
If you're not adding slashes, perhaps magic_quotes_runtime or
magic_quotes_gpc is? (These are php.ini settings)
What vars aren't getting passed in? Globals? Looks like this is OOP,
in which case globals aren't in scope while you're in a function. You
call a function to run the template and the globals are automtically
out of scope. You can do several things here.
1) Use $GLOBALS['varname'] instead of $varname in your eval'd script.
2) If you're using globals for request vars (GET or POST) then you
should switch to the superglobals $_GET and $_POST (or $_REQUEST).
3) global everything in $GLOBALS before you run eval()
foreach ($GLOBALS as $key => $val) {
$$key =& $GLOBALS[$key];
}
If none of this works, perhaps safe mode is stopping this? (I'm not
sure if it even can, but it's a possibility.)
>
> "John Holmes" <holmes072000
charter.net> wrote in message
> news:410FD249.9010004
charter.net...
>
>
> > Josh Acecool M wrote:
> > > var $The_Template_Sys;
> > >
> > > $this -> The_Template_Sys = file_get_contents("$The_Template_File");
> > >
> > > $this -> Sub_Template = TRUE;
> >
> > Please respond to the list and not me personally.
> >
> > you say you're getting a parse error. How could anyone possibly help you
> > troubleshoot that parse error unless they had an example of what was in
> > the file being eval()'d??
> >
> > --
> >
> > John Holmes
> >
> > php|architect - The magazine for PHP professionals -
> http://www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> !DSPAM:410fe2cd117221951811678!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
Globals are off,
Magic_quotes are off
The file is the same
I cant use include with a preg_replace (I replace X with file_get_contents
blah because if I dont then the file thats included wont be included in
place of the replaced variable, it will be included on the top of the page
and not where its supposed to me.)
And using buffer is 8x slower than eval.
"Justin Patrin" <papercrane
gmail.com> wrote in message
news:432beae040803133911d3932b
mail.gmail.com...
> On Tue, 3 Aug 2004 12:11:02 -0700, Josh Acecool M
> <webmaster
acecoolco.com> wrote:
> > It has a preg_match in there that looks for \$variable = blah;
> >
> > I cant help that a file works without Eval, and then to eval it, it
messes
> > it up...
>
> And why again are you using *eval* on a file? Why not
> include('file.php')? If you're doing parsing on the file contents,
> look there for your problem. It's likely you're adding backslashes
> somewhere. Look at the contents of the string you're trying to eval
> and see if it looks the same as the file you want to run. If not,
> that's your problem.
>
> If you're not adding slashes, perhaps magic_quotes_runtime or
> magic_quotes_gpc is? (These are php.ini settings)
>
> What vars aren't getting passed in? Globals? Looks like this is OOP,
> in which case globals aren't in scope while you're in a function. You
> call a function to run the template and the globals are automtically
> out of scope. You can do several things here.
> 1) Use $GLOBALS['varname'] instead of $varname in your eval'd script.
> 2) If you're using globals for request vars (GET or POST) then you
> should switch to the superglobals $_GET and $_POST (or $_REQUEST).
> 3) global everything in $GLOBALS before you run eval()
> foreach ($GLOBALS as $key => $val) {
> $$key =& $GLOBALS[$key];
> }
>
> If none of this works, perhaps safe mode is stopping this? (I'm not
> sure if it even can, but it's a possibility.)
>
> >
> > "John Holmes" <holmes072000
charter.net> wrote in message
> > news:410FD249.9010004
charter.net...
> >
> >
> > > Josh Acecool M wrote:
> > > > var $The_Template_Sys;
> > > >
> > > > $this -> The_Template_Sys = file_get_contents("$The_Template_File");
> > > >
> > > > $this -> Sub_Template = TRUE;
> > >
> > > Please respond to the list and not me personally.
> > >
> > > you say you're getting a parse error. How could anyone possibly help
you
> > > troubleshoot that parse error unless they had an example of what was
in
> > > the file being eval()'d??
> > >
> > > --
> > >
> > > John Holmes
> > >
> > > php|architect - The magazine for PHP professionals -
> > http://www.phparch.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > !DSPAM:410fe2cd117221951811678!
> >
> >
>
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--
attached mail follows:
Another note:
I code for globals off.
"Justin Patrin" <papercrane
gmail.com> wrote in message
news:432beae040803133911d3932b
mail.gmail.com...
> On Tue, 3 Aug 2004 12:11:02 -0700, Josh Acecool M
> <webmaster
acecoolco.com> wrote:
> > It has a preg_match in there that looks for \$variable = blah;
> >
> > I cant help that a file works without Eval, and then to eval it, it
messes
> > it up...
>
> And why again are you using *eval* on a file? Why not
> include('file.php')? If you're doing parsing on the file contents,
> look there for your problem. It's likely you're adding backslashes
> somewhere. Look at the contents of the string you're trying to eval
> and see if it looks the same as the file you want to run. If not,
> that's your problem.
>
> If you're not adding slashes, perhaps magic_quotes_runtime or
> magic_quotes_gpc is? (These are php.ini settings)
>
> What vars aren't getting passed in? Globals? Looks like this is OOP,
> in which case globals aren't in scope while you're in a function. You
> call a function to run the template and the globals are automtically
> out of scope. You can do several things here.
> 1) Use $GLOBALS['varname'] instead of $varname in your eval'd script.
> 2) If you're using globals for request vars (GET or POST) then you
> should switch to the superglobals $_GET and $_POST (or $_REQUEST).
> 3) global everything in $GLOBALS before you run eval()
> foreach ($GLOBALS as $key => $val) {
> $$key =& $GLOBALS[$key];
> }
>
> If none of this works, perhaps safe mode is stopping this? (I'm not
> sure if it even can, but it's a possibility.)
>
> >
> > "John Holmes" <holmes072000
charter.net> wrote in message
> > news:410FD249.9010004
charter.net...
> >
> >
> > > Josh Acecool M wrote:
> > > > var $The_Template_Sys;
> > > >
> > > > $this -> The_Template_Sys = file_get_contents("$The_Template_File");
> > > >
> > > > $this -> Sub_Template = TRUE;
> > >
> > > Please respond to the list and not me personally.
> > >
> > > you say you're getting a parse error. How could anyone possibly help
you
> > > troubleshoot that parse error unless they had an example of what was
in
> > > the file being eval()'d??
> > >
> > > --
> > >
> > > John Holmes
> > >
> > > php|architect - The magazine for PHP professionals -
> > http://www.phparch.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > !DSPAM:410fe2cd117221951811678!
> >
> >
>
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--
attached mail follows:
[snip]
Since the accepted method to generate browser interaction with server
side
PHP, is to use Javascript, it doesn't seem any more off-topic than
dealing
with database questions about MySQL.
[/snip]
Actually the accepted method to generate browser interaction with server
side PHP is http requests, JavaScript is a little more off topic. Just
picking nits, but we all know that I am an arse! ;) And many MySQL (or
plain old SQL) questions get flamed too.
attached mail follows:
[snip]
I have been on a number of lists over the years, as what ever technology
I'm using at the time has demanded.
I would have to say that this list is one of the most curt and
condescending lists I've ever been on.
[/snip]
Hmmm, you should see the C++ newsgroup(s).
Actually I would have to say that when it comes to lists (I myself and
many others here are on several) that this one and perhaps the MySQL
general list get more OT posts. Since PHP can be a entry point for first
time programmers it also ramps up the number of posts where the user has
not been familiarized with terms and actions such as RTFM, STFW or STFA.
Common and well established list courtesies established years ago are
expected to be suspended here....why?
Having said that I suppose that those of us who are curt and
condescending (of which I am one) can shut up or go somewhere else,
which we have been asked to do several times. I was just here to learn
and to help where I could.
attached mail follows:
> Hmmm, you should see the C++ newsgroup(s).
Point taken...
> Common and well established list courtesies established years
> ago are expected to be suspended here....why?
Nope and that's wasn't my point. My point was temperance.
> Having said that I suppose that those of us who are curt and
> condescending (of which I am one) can shut up or go somewhere
> else, which we have been asked to do several times. I was
> just here to learn and to help where I could.
And I will be the first to admit that you have been one of the people on
this list that has answered every one of my questions, no matter how
stupid they have been. (And there has been some real boners)
However there is a difference between list courtesy and blatant
aggression. I understand that there are going to be more newbie's to
programming here than on most language lists. Does this mean that they
don't get the same consideration that those get who it is apparent that
they have been hacking code for a while?
This is a general list.
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
Jay Blanchard wrote:
>[snip]
>I have been on a number of lists over the years, as what ever technology
>I'm using at the time has demanded.
>
>I would have to say that this list is one of the most curt and
>condescending lists I've ever been on.
>[/snip]
>
>
>
>Having said that I suppose that those of us who are curt and
>condescending (of which I am one) can shut up or go somewhere else,
>which we have been asked to do several times. I was just here to learn
>and to help where I could.
>
>
If all those who are curt and Curt and condensceding go away there will
be a lot of questions but very few answers in this list.
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
attached mail follows:
On Tuesday 03 August 2004 14:39, Jay Blanchard offered up the following
tid-bit of information :
> [snip]
> I have been on a number of lists over the years, as what ever technology
> I'm using at the time has demanded.
>
> I would have to say that this list is one of the most curt and
> condescending lists I've ever been on.
> [/snip]
>
> Hmmm, you should see the C++ newsgroup(s).
Or the qmail lists....or usenet.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tuesday 03 August 2004 14:54, Alex Hogan offered up the following tid-bit
of information :
> However there is a difference between list courtesy and blatant
> aggression. I understand that there are going to be more newbie's to
> programming here than on most language lists. Does this mean that they
> don't get the same consideration that those get who it is apparent that
> they have been hacking code for a while?
>
> This is a general list.
And when 'newbies' sign up to this list, they get a copy of the 'Newbie
Guide', with a wealth of information on how to ask smart questions, how to
find answers to common problems, etc. If they are not going to use that
advice, and just blast the list with an OT question, or one that's been
asked a zillion times, why should we take the time out to help those who
are not going to help themselves?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tue, 3 Aug 2004 15:30:20 -0400, John Nichel <john
kegworks.com> wrote:
> On Tuesday 03 August 2004 14:54, Alex Hogan offered up the following tid-bit
> of information :
> > However there is a difference between list courtesy and blatant
> > aggression. I understand that there are going to be more newbie's to
> > programming here than on most language lists. Does this mean that they
> > don't get the same consideration that those get who it is apparent that
> > they have been hacking code for a while?
> >
> > This is a general list.
>
> And when 'newbies' sign up to this list, they get a copy of the 'Newbie
> Guide', with a wealth of information on how to ask smart questions, how to
> find answers to common problems, etc. If they are not going to use that
> advice, and just blast the list with an OT question, or one that's been
> asked a zillion times, why should we take the time out to help those who
> are not going to help themselves?
Well, you shouldn't. But you did take the time to flame on and on and
on and on (not you specifically).
>
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john
kegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
On Tuesday 03 August 2004 15:38, Josh Close offered up the following tid-bit
of information :
> On Tue, 3 Aug 2004 15:30:20 -0400, John Nichel <john
kegworks.com> wrote:
> > On Tuesday 03 August 2004 14:54, Alex Hogan offered up the following
> > tid-bit
> >
> > of information :
> > > However there is a difference between list courtesy and blatant
> > > aggression. I understand that there are going to be more newbie's to
> > > programming here than on most language lists. Does this mean that
> > > they don't get the same consideration that those get who it is
> > > apparent that they have been hacking code for a while?
> > >
> > > This is a general list.
> >
> > And when 'newbies' sign up to this list, they get a copy of the 'Newbie
> > Guide', with a wealth of information on how to ask smart questions, how
> > to find answers to common problems, etc. If they are not going to use
> > that advice, and just blast the list with an OT question, or one that's
> > been asked a zillion times, why should we take the time out to help
> > those who are not going to help themselves?
>
> Well, you shouldn't. But you did take the time to flame on and on and
> on and on (not you specifically).
Oh, I like being knee deep in the fray. We practice tough love on this
list. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
The person starting this thread has been flogged. The flogger has been
flogged. The flogging floggers flogger has been flogged.
And now, back to the further adventures of PHP...
Hint: please kill lame thread
> -----Original Message-----
> From: John Nichel [mailto:john
kegworks.com]
> Sent: Tuesday, August 03, 2004 12:30 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] javascript type cast OT
>
> On Tuesday 03 August 2004 14:54, Alex Hogan offered up the following tid-
> bit
> of information :
> > However there is a difference between list courtesy and blatant
> > aggression. I understand that there are going to be more newbie's to
> > programming here than on most language lists. Does this mean that they
> > don't get the same consideration that those get who it is apparent that
> > they have been hacking code for a while?
> >
> > This is a general list.
>
> And when 'newbies' sign up to this list, they get a copy of the 'Newbie
> Guide', with a wealth of information on how to ask smart questions, how to
> find answers to common problems, etc. If they are not going to use that
> advice, and just blast the list with an OT question, or one that's been
> asked a zillion times, why should we take the time out to help those who
> are not going to help themselves?
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john
kegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip]
... flame on and on and on and on ...
[/snip]
It must be the heat :)
attached mail follows:
* Thus wrote Alex Hogan:
> > Hmmm, you should see the C++ newsgroup(s).
>
> Point taken...
>
> > Common and well established list courtesies established years
> > ago are expected to be suspended here....why?
>
> Nope and that's wasn't my point. My point was temperance.
>
> > Having said that I suppose that those of us who are curt and
> > condescending (of which I am one) can shut up or go somewhere
> > else, which we have been asked to do several times. I was
> > just here to learn and to help where I could.
>
> And I will be the first to admit that you have been one of the people on
> this list that has answered every one of my questions, no matter how
> stupid they have been. (And there has been some real boners)
Perhaps we need a:
Subject: [Elite Guide] for the seasoned php poster.
Post everyweek :)
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Was just wondering... Can you compile php with javascript support on a Game
Boy? lol
Is it ok to just filter out this subject to deleted items now???
Jim Grill
----- Original Message -----
From: "Curt Zirzow" <php-general
zirzow.dyndns.org>
To: <php-general
lists.php.net>
Sent: Tuesday, August 03, 2004 5:58 PM
Subject: Re: [PHP] javascript type cast OT
> * Thus wrote Alex Hogan:
> > > Hmmm, you should see the C++ newsgroup(s).
> >
> > Point taken...
> >
> > > Common and well established list courtesies established years
> > > ago are expected to be suspended here....why?
> >
> > Nope and that's wasn't my point. My point was temperance.
> >
> > > Having said that I suppose that those of us who are curt and
> > > condescending (of which I am one) can shut up or go somewhere
> > > else, which we have been asked to do several times. I was
> > > just here to learn and to help where I could.
> >
> > And I will be the first to admit that you have been one of the people on
> > this list that has answered every one of my questions, no matter how
> > stupid they have been. (And there has been some real boners)
>
> Perhaps we need a:
>
> Subject: [Elite Guide] for the seasoned php poster.
>
> Post everyweek :)
>
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid
schemes
> you've been hearing about. No, sir. Our model is the trapezoid!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
[snip]
Perhaps we need a:
Subject: [Elite Guide] for the seasoned php poster.
Post everyweek :)
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
[/snip]
I don't care who you are that's funny right there - ;-)
alex
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
> -----Original Message-----
> Was just wondering... Can you compile php with javascript support on a
> Game Boy? Lol
Nope, javascript is client-side and not part of PHP :P
-Ed
attached mail follows:
Evidently the strtotime() function will not convert an SQL datetime to a
timestamp. Am I missing something? Here's an example of what I mean:
$sql_datetime = '1948-30-03 01:30:00';
$ts = strtotime( $sql_datetime );
print( $ts.'<br>');
When this script is executed, strtotime() returns -1.
If true, that strtotime() is unable to convert SQL datetimes into
timestamps, how are others accomplishing this?
Cheers,
Michael
attached mail follows:
Try reversing the order in the date to yyyy-mm-dd and I believe it should
work.
Keep in mind that the time variable $ts is not the same as a Mysql timestamp
for example. It conforms to the unix epoch time variable.
Warren Vail
-----Original Message-----
From: news [mailto:news
sea.gmane.org] On Behalf Of Michael T. Peterson
Sent: Tuesday, August 03, 2004 11:05 AM
To: php-general
lists.php.net
Subject: [PHP] [Q] Converting SQL Datetimes to timestamps
Evidently the strtotime() function will not convert an SQL datetime to a
timestamp. Am I missing something? Here's an example of what I mean:
$sql_datetime = '1948-30-03 01:30:00';
$ts = strtotime( $sql_datetime );
print( $ts.'<br>');
When this script is executed, strtotime() returns -1.
If true, that strtotime() is unable to convert SQL datetimes into
timestamps, how are others accomplishing this?
Cheers,
Michael
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'<br>');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps, how are others accomplishing this?
>
> Cheers,
>
> Michael
From http://us4.php.net/manual/en/function.strtotime.php a user comments
about this:
cryogen at mac dot com
06-Apr-2004 09:39
I neglected to include the solution in my last post for using strtotime()
with date-time data stored in GMT. Append the string "GMT" to all of your
datetimes pulled from MySQL or other database that store date-times in the
format "yyyy-mm-dd hh:ii:ss" just prior to converting them to a unix
timestamp with strtotime(). This will ensure you get a valid GMT result
for times during daylight savings.
EXAMPLE:
<?php
$date_time1 = strtotime("2004-04-04 02:00:00"); // returns bad value -1
due to DST
$date_time2 = strtotime("2004-04-04 02:00:00 GMT"); // works great!
?>
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
On Wednesday 04 August 2004 02:05, Michael T. Peterson wrote:
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'<br>');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps,
No it's not true, RTFM.
> how are others accomplishing this?
If you're need to process a wider range of dates use the Julian day functions
manual > Calendar Functions
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It takes two to tell the truth: one to speak and one to hear.
*/
attached mail follows:
Michael T. Peterson wrote:
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'<br>');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps, how are others accomplishing this?
strtotime() will work, actually, but not for dates before 1970. If you
want to convert a database timestamp to a Unix timestamp that's before
1970, you need to be on an OS that supports negative timestamps (not
windows, as far as I know).
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
attached mail follows:
On Tuesday 03 August 2004 14:05, Michael T. Peterson offered up the
following tid-bit of information :
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'<br>');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps, how are others accomplishing this?
>
> Cheers,
>
> Michael
It works with SQL datestamps....just not with that one above. The year
(1948) will return a negative timestamp....
<quote from http://us4.php.net/strtotime>
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
correspond to the minimum and maximum values for a 32-bit signed integer.)
Additionally, not all platforms support negative timestamps, therefore your
date range may be limited to no earlier than the Unix epoch. This means
that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux
distributions, and a few other operating systems.
</quote>
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
Check out strtotime in the PHP manual. It gives a few examples of how to
use the function that I think will answer your first question. Next, check
out mktime, time, and date.
> -----Original Message-----
> From: news [mailto:news
sea.gmane.org] On Behalf Of Michael T. Peterson
> Sent: Tuesday, August 03, 2004 11:05 AM
> To: php-general
lists.php.net
> Subject: [PHP] [Q] Converting SQL Datetimes to timestamps
>
> Evidently the strtotime() function will not convert an SQL datetime to a
> timestamp. Am I missing something? Here's an example of what I mean:
>
> $sql_datetime = '1948-30-03 01:30:00';
> $ts = strtotime( $sql_datetime );
> print( $ts.'<br>');
>
> When this script is executed, strtotime() returns -1.
>
> If true, that strtotime() is unable to convert SQL datetimes into
> timestamps, how are others accomplishing this?
>
> Cheers,
>
> Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Try running 'make clean' before you run 'make' again. I had a problem when
trying to run 'make' for the umpteenth time during my recent troubles, and
apparently it was because things got a little too cluttered, and this did
the trick.
Will
-----Original Message-----
From: Jason Wong [mailto:php-general
gremlins.biz]
Sent: Tuesday, August 03, 2004 1:44 AM
To: php-general
lists.php.net
Subject: Re: [PHP] Cannot compile
On Tuesday 03 August 2004 14:30, Andrew W wrote:
> It doesn't work regardless of whether I include any options or not.
"doesn't work" can include umpteen billions of things. Please try to narrow
it
down a bit.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you want your spouse to listen and pay strict attention to every
word you say, talk in your sleep.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Ok, I am starting a new job and learning a new person's code, and trying
to learn Smarty at the same time.
This question is so basic, but I have no idea where to look for an answer.
ANyway, I need to change the code so that, when there are no row returned
by the database, a message is displayed saying, "There are no events
scheduled." or what have you.
Now, the way I would have done this before using smarty would be to check
the number of records, and if there were none, I would display the
message, otherwise, I would loop through and display the results,
However, I know one of the points of smarty is to keep code out of the
presentation layer, so I don't want to go into the template and add an if
statement in there.
Any help directing me to an example or whatever would be helpful.
Here is what is going on right now in the code:
(in the PHP page)
$events = $db->getAll($sql_events, DB_FETCHMODE_ASSOC);
$tpl->assign("events",$events);
(in the template page)
{section name=id loop=$events}
<tr>
<td class="event">
<b>{$events[id].type}</b>: <a class="menulink"
href="{$url_prefix}/community/events/?id={$events[id].id}">{$events[id].date|date_format:"%B
%e, %Y"}, {$events[id].speaker}</a><br />
{$events[id].title}
</td>
</tr>
{/section}
Thanks,
Amanda
attached mail follows:
On Tuesday 03 August 2004 15:21, Amanda Hemmerich offered up the following
tid-bit of information :
> Ok, I am starting a new job and learning a new person's code, and trying
> to learn Smarty at the same time.
>
> This question is so basic, but I have no idea where to look for an
> answer.
>
> ANyway, I need to change the code so that, when there are no row returned
> by the database, a message is displayed saying, "There are no events
> scheduled." or what have you.
>
> Now, the way I would have done this before using smarty would be to check
> the number of records, and if there were none, I would display the
> message, otherwise, I would loop through and display the results,
>
> However, I know one of the points of smarty is to keep code out of the
> presentation layer, so I don't want to go into the template and add an if
> statement in there.
>
> Any help directing me to an example or whatever would be helpful.
>
> Here is what is going on right now in the code:
>
> (in the PHP page)
> $events = $db->getAll($sql_events, DB_FETCHMODE_ASSOC);
> $tpl->assign("events",$events);
>
> (in the template page)
> {section name=id loop=$events}
> <tr>
> <td class="event">
> <b>{$events[id].type}</b>: <a class="menulink"
> href="{$url_prefix}/community/events/?id={$events[id].id}">{$events[id].d
>ate|date_format:"%B %e, %Y"}, {$events[id].speaker}</a><br />
> {$events[id].title}
> </td>
> </tr>
> {/section}
>
> Thanks,
> Amanda
According to this page
http://smarty.php.net/manual/en/language.function.if.php you should be able
to do something like.....
{ if is_array ( $events ) }
do smarty stuff
{ /if }
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Tue, 3 Aug 2004 14:21:45 -0500 (EST), Amanda Hemmerich
<ahemmeri
indiana.edu> wrote:
> Ok, I am starting a new job and learning a new person's code, and trying
> to learn Smarty at the same time.
>
> This question is so basic, but I have no idea where to look for an answer.
>
> ANyway, I need to change the code so that, when there are no row returned
> by the database, a message is displayed saying, "There are no events
> scheduled." or what have you.
>
> Now, the way I would have done this before using smarty would be to check
> the number of records, and if there were none, I would display the
> message, otherwise, I would loop through and display the results,
>
> However, I know one of the points of smarty is to keep code out of the
> presentation layer, so I don't want to go into the template and add an if
> statement in there.
>
> Any help directing me to an example or whatever would be helpful.
>
> Here is what is going on right now in the code:
>
> (in the PHP page)
> $events = $db->getAll($sql_events, DB_FETCHMODE_ASSOC);
> $tpl->assign("events",$events);
>
> (in the template page)
> {section name=id loop=$events}
> <tr>
> <td class="event">
> <b>{$events[id].type}</b>: <a class="menulink"
> href="{$url_prefix}/community/events/?id={$events[id].id}">{$events[id].date|date_format:"%B
> %e, %Y"}, {$events[id].speaker}</a><br />
> {$events[id].title}
> </td>
> </tr>
> {/section}
>
My solution to this would be to change the template. IMHO it's a
"view" funciton to display something different when there is no data.
However, if you're averse to that, I would suggest using a different template.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
Amanda Hemmerich wrote:
> ANyway, I need to change the code so that, when there are no row returned
> by the database, a message is displayed saying, "There are no events
> scheduled." or what have you.
[snip]
> (in the PHP page)
> $events = $db->getAll($sql_events, DB_FETCHMODE_ASSOC);
> $tpl->assign("events",$events);
>
> (in the template page)
> {section name=id loop=$events}
> <tr>
> <td class="event">
> <b>{$events[id].type}</b>: <a class="menulink"
> href="{$url_prefix}/community/events/?id={$events[id].id}">{$events[id].date|date_format:"%B
> %e, %Y"}, {$events[id].speaker}</a><br />
> {$events[id].title}
> </td>
> </tr>
> {/section}
{section name="id" loop=$events}
...
{sectionelse}
No results
{/section}
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
attached mail follows:
When I do configure --with-pear I would assume that pear would be
available after make install, but it isn't. Any ideas?
Thanks,
Jacob
attached mail follows:
On Tuesday 03 August 2004 15:30, Jacob Friis Larsen offered up the following
tid-bit of information :
> When I do configure --with-pear I would assume that pear would be
> available after make install, but it isn't. Any ideas?
>
> Thanks,
> Jacob
How is it 'not available'?
Did the PEAR directory/files not install? Is your system not finding them?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
I've been struggling with this redirect thing for a while but still cannot
get it work. I'm desperately needing help, please.
What I want to do is redirect
http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162
to
https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162.
The only difference between the above two URLs is one is http and the
other is https.
==========
if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid ==
162)
{
session_write_close();
header("Location:
https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162");
exit;
}
==========
Am I doing anything wrong with the Location header?
Any help would be greatly appreciated.
Bing
attached mail follows:
On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit of
information :
> I've been struggling with this redirect thing for a while but still
> cannot get it work. I'm desperately needing help, please.
>
> What I want to do is redirect
> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
>&id=159&Itemid=162 to
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
>w&id=159&Itemid=162. The only difference between the above two URLs is one
> is http and the other is https.
>
> ==========
> if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid
> == 162)
> {
> session_write_close();
> header("Location:
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
>w&id=159&Itemid=162"); exit;
> }
> ==========
>
> Am I doing anything wrong with the Location header?
What's the error? Is it just not forwarding? Headers already sent?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john
kegworks.com
attached mail follows:
On Wednesday 04 August 2004 03:41, Bing Du wrote:
> ==========
> if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid ==
> 162)
> {
> session_write_close();
> header("Location:
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&
>id=159&Itemid=162"); exit;
> }
> ==========
>
> Am I doing anything wrong with the Location header?
It looks OK.
> Any help would be greatly appreciated.
Add an else cause:
else { echo "if clause failed"; }
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The reason why worry kills more people than work is that more people
worry than work.
*/
attached mail follows:
> I've been struggling with this redirect thing for a while but still cannot
> get it work. I'm desperately needing help, please.
>
> What I want to do is redirect
> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162
> to
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162.
> The only difference between the above two URLs is one is http and the
> other is https.
>
> ==========
> if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid ==
> 162)
> {
> session_write_close();
> header("Location:
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162");
> exit;
> }
> ==========
>
> Am I doing anything wrong with the Location header?
>
> Any help would be greatly appreciated.
>
> Bing
Looks correct to me. Are you meeting all the requirements for that if
statement? You have a lot of and's there.
For testing you could try:
if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid ==
162) {
echo "It works! Yay me! Gimme a cookie, dammit!";
}
If you don't get that echo statement, then you should look into your if
statement.
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
The latest message I got was 'Redirection limit for this URL exceeded.
Unable to load the requested page.This may be caused by cookies that are
blocked.'.
Bing
> On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit
> of
> information :
>> I've been struggling with this redirect thing for a while but still
>> cannot get it work. I'm desperately needing help, please.
>>
>> What I want to do is redirect
>> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
>>&id=159&Itemid=162 to
>> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
>>w&id=159&Itemid=162. The only difference between the above two URLs is
>> one
>> is http and the other is https.
>>
>> =========> if ($option == 'content' and $task == 'view' and $id == 159
>> and $Itemid
>> == 162)
>> {
>> session_write_close();
>> header("Location:
>> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
>>w&id=159&Itemid=162"); exit;
>> }
>> =========>
>> Am I doing anything wrong with the Location header?
>
> What's the error? Is it just not forwarding? Headers already sent?
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john
kegworks.com
>
>
attached mail follows:
header("Location: " . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
> -----Original Message-----
> From: John Nichel [mailto:john
kegworks.com]
> Sent: Tuesday, August 03, 2004 12:59 PM
> To: Bing Du; php-general
lists.php.net
> Subject: Re: [PHP] Location header does not work?
>
> On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit
> of
> information :
> > I've been struggling with this redirect thing for a while but still
> > cannot get it work. I'm desperately needing help, please.
> >
> > What I want to do is redirect
> >
> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
> >&id=159&Itemid=162 to
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> >w&id=159&Itemid=162. The only difference between the above two URLs is
> one
> > is http and the other is https.
> >
> > ==========
> > if ($option == 'content' and $task == 'view' and $id == 159 and $Itemid
> > == 162)
> > {
> > session_write_close();
> > header("Location:
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> >w&id=159&Itemid=162"); exit;
> > }
> > ==========
> >
> > Am I doing anything wrong with the Location header?
>
> What's the error? Is it just not forwarding? Headers already sent?
>
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> john
kegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Oops... forgot to add https
Header("Location: https://" . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI']);
> -----Original Message-----
> From: Ed Lazor [mailto:Ed.Lazor
d20News.com]
> Sent: Tuesday, August 03, 2004 1:36 PM
> To: 'John Nichel'; 'Bing Du'; 'php-general
lists.php.net'
> Subject: RE: [PHP] Location header does not work?
>
> header("Location: " . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
>
>
> > -----Original Message-----
> > From: John Nichel [mailto:john
kegworks.com]
> > Sent: Tuesday, August 03, 2004 12:59 PM
> > To: Bing Du; php-general
lists.php.net
> > Subject: Re: [PHP] Location header does not work?
> >
> > On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-
> bit
> > of
> > information :
> > > I've been struggling with this redirect thing for a while but still
> > > cannot get it work. I'm desperately needing help, please.
> > >
> > > What I want to do is redirect
> > >
> >
> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
> > >&id=159&Itemid=162 to
> > >
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> > >w&id=159&Itemid=162. The only difference between the above two URLs is
> > one
> > > is http and the other is https.
> > >
> > > ==========
> > > if ($option == 'content' and $task == 'view' and $id == 159 and
> $Itemid
> > > == 162)
> > > {
> > > session_write_close();
> > > header("Location:
> > >
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> > >w&id=159&Itemid=162"); exit;
> > > }
> > > ==========
> > >
> > > Am I doing anything wrong with the Location header?
> >
> > What's the error? Is it just not forwarding? Headers already sent?
> >
> > --
> > John C. Nichel
> > ÜberGeek
> > KegWorks.com
> > 716.856.9675
> > john
kegworks.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Do you have a valid and functioning SSL certificate on the IP that points to
your "iastate.edu" domain?
Have you tried deleting all sites cookies and auto-login passwords that your
browser stores, then retrying?
Are you using pop-up blocker software?
Does this happen on ALL browsers, or just Netscape?
Monty
> From: bdu
iastate.edu (Bing Du)
> Newsgroups: php.general
> Date: Tue, 3 Aug 2004 15:34:27 -0500 (CDT)
> To: php-general
lists.php.net
> Subject: Re: [PHP] Location header does not work?
>
> The latest message I got was 'Redirection limit for this URL exceeded.
> Unable to load the requested page.This may be caused by cookies that are
> blocked.'.
>
> Bing
attached mail follows:
> The latest message I got was 'Redirection limit for this URL exceeded.
> Unable to load the requested page.This may be caused by cookies that are
> blocked.'.
>
> Bing
>
Correct me if I'm wrong but I think this is an Apache error.
--
--Matthew Sims
--<http://killermookie.org>
attached mail follows:
On Tue, 3 Aug 2004 15:34:27 -0500 (CDT), Bing Du <bdu
iastate.edu> wrote:
> The latest message I got was 'Redirection limit for this URL exceeded.
> Unable to load the requested page.This may be caused by cookies that are
> blocked.'.
>
Your page is redirecting you over and over again. Your problem is that
you're not checking for https before you redirect! If the user comes
in with the https URL, you're still redirecting them. Try checking the
value of $_SERVER['HTTPS'].
> Bing
>
>
>
> > On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit
> > of
> > information :
> >> I've been struggling with this redirect thing for a while but still
> >> cannot get it work. I'm desperately needing help, please.
> >>
> >> What I want to do is redirect
> >> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
> >>&id=159&Itemid=162 to
> >> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> >>w&id=159&Itemid=162. The only difference between the above two URLs is
> >> one
> >> is http and the other is https.
> >>
> >> =========> if ($option == 'content' and $task == 'view' and $id == 159
> >> and $Itemid
> >> == 162)
> >> {
> >> session_write_close();
> >> header("Location:
> >> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> >>w&id=159&Itemid=162"); exit;
> >> }
> >> =========>
> >> Am I doing anything wrong with the Location header?
> >
> > What's the error? Is it just not forwarding? Headers already sent?
> >
> > --
> > John C. Nichel
> > ÜberGeek
> > KegWorks.com
> > 716.856.9675
> > john
kegworks.com
> >
> >
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
> -----Original Message-----
> From: Ed Lazor [mailto:Ed.Lazor
d20News.com]
> Sent: Tuesday, August 03, 2004 2:33 PM
> To: 'Bing Du'
> Subject: RE: [PHP] Location header does not work?
>
> I tried the https address and it lagged badly on me as well. It did
> eventually display, so I looked at the source and found that you're mixing
> http and https references. That slows things down. There are also
> references to unavailable images. For example:
>
> http://computing.eng.iastate.edu/mambo/components/com_akocomment/images/co
> mment.png
>
>
> The redirection limit means you're creating a referal loop.
>
> If (!IsSet($_SERVER["HTTPS"]))
> Header("Location: https://" . $_SERVER["HTTP_HOST"] .
> $_SERVER["REQUEST_URI"]);
>
>
>
> > -----Original Message-----
> > From: Bing Du [mailto:bdu
iastate.edu]
> > Sent: Tuesday, August 03, 2004 2:23 PM
> > To: Ed Lazor
> > Subject: RE: [PHP] Location header does not work?
> >
> > Hi Ed, I just put other things I was doing aside and tried what you
> > suggested. But I did not see much difference. I tried both IE 6 and
> > Netscape 7.1. In IE, it seemed to take forever to load. Finally it
> > returned back with 'The page can not be displayed'. In Netscape, I
> still
> > got the same message which is 'Redirection limit for this URL exceeded.
> > Unable to load the requested page. This may be caused by cookies that
> are
> > blocked.' Any other ideas?
> >
> > Thanks so much for taking time to help!
> >
> > Bing
> >
> > > Bing, did you try the solution I sent?
> > >
> > >
> > >> -----Original Message-----
> > >> From: Bing Du [mailto:bdu
iastate.edu]
> > >> Sent: Tuesday, August 03, 2004 1:34 PM
> > >> To: php-general
lists.php.net
> > >> Subject: Re: [PHP] Location header does not work?
> > >>
> > >> The latest message I got was 'Redirection limit for this URL
> exceeded.
> > >> Unable to load the requested page.This may be caused by cookies that
> > are
> > >> blocked.'.
> > >>
> > >> Bing
> > >>
> > >> > On Tuesday 03 August 2004 15:41, Bing Du offered up the following
> > tid-
> > >> bit
> > >> > of
> > >> > information :
> > >> >> I've been struggling with this redirect thing for a while but
> still
> > >> >> cannot get it work. I'm desperately needing help, please.
> > >> >>
> > >> >> What I want to do is redirect
> > >> >>
> > >>
> >
> http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view
> > >> >>&id=159&Itemid=162 to
> > >> >>
> > >>
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> > >> >>w&id=159&Itemid=162. The only difference between the above two URLs
> > is
> > >> >> one
> > >> >> is http and the other is https.
> > >> >>
> > >> >> =========> if ($option == 'content' and $task == 'view' and $id ==
> > >> 159
> > >> >> and $Itemid
> > >> >> == 162)
> > >> >> {
> > >> >> session_write_close();
> > >> >> header("Location:
> > >> >>
> > >>
> >
> https://computing.eng.iastate.edu/mambo/index.php?option=content&task=vie
> > >> >>w&id=159&Itemid=162"); exit;
> > >> >> }
> > >> >> =========>
> > >> >> Am I doing anything wrong with the Location header?
> > >> >
> > >> > What's the error? Is it just not forwarding? Headers already
> sent?
> > >> >
> > >> > --
> > >> > John C. Nichel
> > >> > ÜberGeek
> > >> > KegWorks.com
> > >> > 716.856.9675
> > >> > john
kegworks.com
> > >> >
> > >> >
> > >>
> > >> --
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> > >
attached mail follows:
Hi!
Have anyone sucessfully used the FDF functionallity together with the Opera
browser?
This code works like a charm in IE6 but not in Opera.
fdf_header();
$outfdf = fdf_create();
fdf_set_value($outfdf, "our_ref", $our_ref, 0);
fdf_set_value($outfdf, "your_ref", $your_ref, 0);
fdf_set_file($outfdf, "http://xxx/test.pdf");
fdf_save($outfdf);
fdf_close($outfdf);
Any ideas?
Cheers,
Nicke
attached mail follows:
The code should go like this.
fdf_header();
$outfdf = fdf_create();
fdf_set_value($outfdf, "our_ref", $our_ref, 0);
fdf_set_value($outfdf, "your_ref", $your_ref, 0);
fdf_set_file($outfdf, "http://xxx/test.pdf");
fdf_save($outfdf);
fdf_close($outfdf);
Nicke
-----Original Message-----
From: Nicklas Bondesson [mailto:nicke
nicke.nu]
Sent: den 3 augusti 2004 21:56
To: php-general
lists.php.net
Subject: [PHP] PHP + FDF and Opera
Hi!
Have anyone sucessfully used the FDF functionallity together with the Opera
browser?
This code works like a charm in IE6 but not in Opera.
fdf_header();
$outfdf = fdf_create();
fdf_set_value($outfdf, "our_ref", $our_ref, 0); fdf_set_value($outfdf,
"your_ref", $your_ref, 0); fdf_set_file($outfdf, "http://xxx/test.pdf");
fdf_save($outfdf); fdf_close($outfdf);
Any ideas?
Cheers,
Nicke
attached mail follows:
* Thus wrote Nicklas Bondesson:
> The code should go like this.
>
> fdf_header();
> $outfdf = fdf_create();
> fdf_set_value($outfdf, "our_ref", $our_ref, 0);
> fdf_set_value($outfdf, "your_ref", $your_ref, 0);
> fdf_set_file($outfdf, "http://xxx/test.pdf");
> fdf_save($outfdf);
> fdf_close($outfdf);
Are you using sessions?
you might be running into the cache limiter issue, try this before
starting the session:
session_cache_limiter('public');
or
session_cache_limiter('private');
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Im parsing a document, and its stopping prematurely.
I get this error ->
not well-formed (invalid token)
Its breaking on the word ->
Exposé
in the document.
Is the "é" an illegal character?
Any ideas how to work around this???
Thanks for any pointers...
attached mail follows:
This is very simple actually....
<?
$result = mysql_query($sql);
$flag = 0;
while($row = mysql_fetch_array($result)){
$field1 = $row['field1'];
$field2 = $row['field2'[;
if($flag){
?>
<tr style="background: blue;">
<td><?=$field1?></td>
</tr>
<?
$flag = 1;
}
else{
?>
<tr>
<td><?=$field1?></td>
</tr>
<?
$flag = 0;
}
}
?>
That was very quick, but I hope it helps.
-Josh
attached mail follows:
Greetings,
I'm using an RSS feed from the New York Times and right now the a href link
takes the user to the same window.
I'd like the link to open in it's own window by using the target .html
attribute.
I was hoping that I could use the eregi_replace() call by inserting:
<a href="http://\\0">target="_blank">\\0</a>
where it matches any character between the <link></link> string in the URL.
However it is not working for me.
Viewing the xhtml of thr NY Times feed below, there are many areas of
<links></links> so I'm not sure whether this is the correct way to go.
Any leads or assistance will be greatly appreciated.
TR
..................
<?
$string="<link>http://www.nytimes.com/2004/08/03/national/03tape.html?
ex=1249272000&en=484f82ff258ab8c7&ei=5088&partner=rssnyt</link>"; // the
string URL
$pattern = "^(<link>.+</link>)$"; //match any character between the <link>
and <link>
$replace_pattern= '<a href="http://\\0">target="_blank">\\0</a>';
$new_string=eregi_replace($pattern,$replace_pattern,$string);
echo $new_string;
?>
................
// snippet of NYTimes RSS feed
<link>http://www.nytimes.com/2004/08/03/politics/03intel.html?ex=1249272000&
en=e061516bea792668&ei=5088&partner=rssnyt</link>
<description>Much of the information that led to the new terror alert was
three or four years old, but even the dated evidence was
troubling.</description>
<author>By DOUGLAS JEHL and DAVID JOHNSTON</author>
<pubDate>Tue, 03 Aug 2004 00:00:00 EDT</pubDate>
</item>
- <item>
<title>Tape of Kennedy's Killing Is Getting Digital Analysis</title>
<link>http://www.nytimes.com/2004/08/03/national/03tape.html?ex=1249272000&e
n=484f82ff258ab8c7&ei=5088&partner=rssnyt</link>
attached mail follows:
On Tue, 3 Aug 2004 18:36:02 -0400, Anthony Ritter
<tony
gonefishingguideservice.com> wrote:
> Greetings,
>
> I'm using an RSS feed from the New York Times and right now the a href link
> takes the user to the same window.
>
> I'd like the link to open in it's own window by using the target .html
> attribute.
>
> I was hoping that I could use the eregi_replace() call by inserting:
>
> <a href="http://\\0">target="_blank">\\0</a>
>
> where it matches any character between the <link></link> string in the URL.
>
> However it is not working for me.
>
> Viewing the xhtml of thr NY Times feed below, there are many areas of
> <links></links> so I'm not sure whether this is the correct way to go.
>
> Any leads or assistance will be greatly appreciated.
>
> TR
> ...................
>
> <?
> $string="<link>http://www.nytimes.com/2004/08/03/national/03tape.html?
> ex=1249272000&en=484f82ff258ab8c7&ei=5088&partner=rssnyt</link>"; // the
> string URL
>
> $pattern = "^(<link>.+</link>)$"; //match any character between the <link>
> and <link>
>
> $replace_pattern= '<a href="http://\\0">target="_blank">\\0</a>';
>
> $new_string=eregi_replace($pattern,$replace_pattern,$string);
>
> echo $new_string;
> ?>
> .................
>
> // snippet of NYTimes RSS feed
>
> <link>http://www.nytimes.com/2004/08/03/politics/03intel.html?ex=1249272000&
> en=e061516bea792668&ei=5088&partner=rssnyt</link>
> <description>Much of the information that led to the new terror alert was
> three or four years old, but even the dated evidence was
> troubling.</description>
> <author>By DOUGLAS JEHL and DAVID JOHNSTON</author>
> <pubDate>Tue, 03 Aug 2004 00:00:00 EDT</pubDate>
> </item>
> - <item>
> <title>Tape of Kennedy's Killing Is Getting Digital Analysis</title>
>
> <link>http://www.nytimes.com/2004/08/03/national/03tape.html?ex=1249272000&e
> n=484f82ff258ab8c7&ei=5088&partner=rssnyt</link>
>
Thanks, lots of good info here. It's nice to have all of the info at once.
I don't know about eregs myself, but I'll try a preg solution:
$new_text = preg_replace('!<link>(.*?)</link>!', '<a href="\1"
target="_blank">\1</a>', $text);
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
* Thus wrote Anthony Ritter:
> Greetings,
>
> I'm using an RSS feed from the New York Times and right now the a href link
> takes the user to the same window.
>
> I'd like the link to open in it's own window by using the target .html
> attribute.
>
> I was hoping that I could use the eregi_replace() call by inserting:
>
> <a href="http://\\0">target="_blank">\\0</a>
>
> where it matches any character between the <link></link> string in the URL.
You might want to look into just getting a plain old rss parser.
It'll probably save a lot of headaches.
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Justin Patrin <papercrane
gmail.com> wrote in message:
> Thanks, lots of good info here. It's nice to have all of the info at once.
>
> I don't know about eregs myself, but I'll try a preg solution:
>
> $new_text = preg_replace('!<link>(.*?)</link>!', '<a href="\1"
> target="_blank">\1</a>', $text);
........
Thank you.
I tried the following:
<?
$text="<link>http://www.nytimes.com/2004/08/03/national/03tape.html?
ex=1249272000&en=484f82ff258ab8c7&ei=5088&partner=rssnyt</link>";
$new_text = preg_replace('!<link>(.*?)</link>!', '<a href="\1"
target="_blank">\1</a>', $text);
echo $new_text;
?>
The output in my browser is the URL with no link - and no target="_blank".
http://www.nytimes.com/2004/08/03/national/03tape.html?
ex=1249272000&en=484f82ff258ab8c7&ei=5088&partner=rssnyt
If you get a chance run the script through your server and see.
I'm on apache.
Any throughts?
Many thanks for your time.
TR
attached mail follows:
* Thus wrote Anthony Ritter:
> Greetings,
>
> I'm using an RSS feed from the New York Times and right now the a href
link
> takes the user to the same window.
>
> I'd like the link to open in it's own window by using the target .html
> attribute.
>
> I was hoping that I could use the eregi_replace() call by inserting:
>
> <a href="http://\\0">target="_blank">\\0</a>
>
> where it matches any character between the <link></link> string in the
URL.
Hi,
I'm not sure what format the url's are in, but here are a few pieces of
code you can try.
Format: <a href="http://www.news.com/article.php?aid=4">News Article</a>
<?php
$articleurl = "<a href=\"http://www.news.com/article.php?aid=4\">News
Article</a>";
$broken = explode("\">", $articleurl);
$modified_url = "$broken[0]\" target=\"_blank\">$broken[1]";
Result: <a href="http://www.news.com/article.php?aid=4" target="_blank">News
Article</a>
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
Hi Curt,
You could use a function of the name and signature you gave, but if you implement it in PHP, you're still creating the substring objects that I don't want created. Notice your call to substr(). Object creation is expensive. If the function were implemented natively, the language need only copy bytes directly from a portion of the source string over to the output buffer.
Thanks for taking a stab!
~joe
On 8/3/2004 Curt Zirzow wrote:
>I'm not entirely clear at what your trying to do but perhaps you
>want something like this:
>
>function print_substr_direct($string, $start, $len) {
> static $fp = null;
>
> if ($fp === null ) {
> // Open a connection directly to the output
> $fp = fopen('php://stdout', 'r');
> }
> if ($fp) {
> fputs($fp, substr($string, $start, $len));
> }
>}
attached mail follows:
On Mon, 02 Aug 2004 23:58:58 -0400, jtl_phpdotnet
spamex.com
<jtl_phpdotnet
spamex.com> wrote:
> The guys in the internals list sent me to this forum.
>
> I am trying to write some serious parsing software in PHP. I need to use plain, vanilla PHP and no add-on modules, because I need to be able to distribute to people who don't have sufficient privileges.
>
> In the process of parsing I create a new document composed of concatenated pieces of the original document. I am efficiently catting the new document using output buffer, but when I have to copy non-contiguous pieces form the original document, I am forced to create substrings, as in:
>
> echo substr($originalDoc, $startOfSnippet, $snippetLength)
>
> My documents are potentially large with possibly thousands of such substrings. I know from writing Java parsers for high-throughput servers that object creation, and in particular string creation, is the greatest source of degraded performance.
>
> I'd like to copy the contents of a substring directly to the output buffer without creating an intermediate object, as in:
>
> ob_write($string, $start, $length)
>
> I can find no such function and could envision no other way to do this at present.
>
> When can I expect broad support for such a function in the base PHP release? Or do you know of a workaround?
>
> BTW, because I had to ditch my last email address due to spam, I'm subscribed to this list through spamex.com. But because the list makes the emails it distributes appear to original from the people who posted, I have no way to reply through spamex back to this forum, at least no way to keep the reply in the same thread. Suggestions, are welcome. Otherwise I'll be starting a new thread.
>
If you want this to be an internal function (and you seem to), then
you'll either have to write an extension which does this or have the
internals guys add it for you. You can't implement something like this
in PHP code.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
Another way to provide this ob_write() feature is to give me a start offset on fwrite(), as in:
fwrite($handle, $string, $length, $stringStartOffset)
~joe
P.S. I think I see why the internals group sent me here. I didn't know about the handle-based stream functions, but looking over them they still don't address the problem.
attached mail follows:
Hi again Curt,
On 8/3/2004 Curt Zirzow wrote:
>You may be seeking: http://php.net/stream-wrapper-register
>
>With the example listed, you can have as many buffers as you
>please.
Yeah, I could do what I'm already doing by implementing the interface you pointed me to.
The problem is that stdout appears to be the only in-memory buffered character stream available to me. I need an abitrary number of such streams.
Emulating these streams, as one might do by implementing the interfaces you pointed me to, doesn't solve the problem; this is what I'm doing. In my emulation I have to constantly cache and restore the contents of stdout.
Am I correct in saying that PHP only has this one in-memory buffered character stream? (I need it to be in-memory because the goal is to maximize performance.)
Again, it's crucial that buffering be done natively by PHP, since otherwise you're just creating string objects that buffering is supposed to prevent you from having to create.
Thanks again for your suggestion!
~joe
attached mail follows:
Hi,
I am trying to do some work that involves parsing through the HTML of
some webpages. But, I cannot find an easy way in PHP to actually get that
HTML. Say, for example, I need the HTML returned from
http://www.yahoo.com/, I tried doing an fopen(), but the only way I can do
it is if I use passthru, or exec and use the linux wget, then use fopen() on
that file. Does anyone know if there's an easy function or way of doing it?
I essentially need to download the web file, and store the contents of it in
a variable to manipulate with my program.
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
On Tue, 3 Aug 2004 20:00:56 -0400, Richard Bewley <rbewley
eq-sys.com> wrote:
> Hi,
> I am trying to do some work that involves parsing through the HTML of
> some webpages. But, I cannot find an easy way in PHP to actually get that
> HTML. Say, for example, I need the HTML returned from
> http://www.yahoo.com/, I tried doing an fopen(), but the only way I can do
> it is if I use passthru, or exec and use the linux wget, then use fopen() on
> that file. Does anyone know if there's an easy function or way of doing it?
> I essentially need to download the web file, and store the contents of it in
> a variable to manipulate with my program.
>
There are many ways to do this. The simplest is with the file
functions, such as fopen and file_get_contents:
$html = file_get_contents('http://www.yahoo,com');
These will only work if you have the fopen wrappers turned on in your php.ini.
If this won't work for you, I would suggest using PEAR's HTTP_Request.
http://pear.php.net/package/HTTP_Request
It's a package that implements all of that in PHP code with sockets.
It's also got lots of useful features. FYI, the HTTP_Client package is
based on HTTP_Request and can take care of cookies and such for you so
that it looks like a user ir browsing a site. :-)
If you are new to PEAR, please go to this page to learn about it and
how to install:
http://pear.php.net/manual/en/introduction.php
http://pear.php.net/manual/en/installation.php
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
> $html = file_get_contents('http://www.yahoo,com');
Thanks! It works perfectly.
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
I have the following query which should return just two rows:
SELECT 'ID', 'Vacancy Role', 'Vacancy Salary', 'Vacancy Location', 'Vacancy
Type'
FROM vacancy_details
WHERE Publish = 'Yes'
As only two rows have Publish set to "Yes".
yet even if I execute the query through phpMyAdmin I get two rows with field
headings as field values.
Any suggestions on where I'm going wrong...? I'm pretty sure my query syntax
is accurate as I've used this type of query many times before and have even
checked the syntax by using a query window.
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
attached mail follows:
Hi,
Take the spaces out of your field names, and then use this:
<?php
$query = mysql_query("SELECT
id,vacancy_role,vacancy_salary,vacancy_location,vacancy_type FROM
vacancy_details WHERE Public='yes'");
while($result = mysql_fetch_array($query)) {
echo "$result[id] - $result[vacancy_role]";
}
?>
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
attached mail follows:
* Thus wrote Harlequin:
> I have the following query which should return just two rows:
>
> SELECT 'ID', 'Vacancy Role', 'Vacancy Salary', 'Vacancy Location', 'Vacancy
> Type'
> FROM vacancy_details
> WHERE Publish = 'Yes'
>
> As only two rows have Publish set to "Yes".
>
> yet even if I execute the query through phpMyAdmin I get two rows with field
> headings as field values.
>
> Any suggestions on where I'm going wrong...? I'm pretty sure my query syntax
> is accurate as I've used this type of query many times before and have even
> checked the syntax by using a query window.
<stab in="the dark">mysql_error()</stab>
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Richard
Thanks firstly for your help. I renamed the fields so the spaces are
underscores and amended your query but still receive an error:
"not a valid MySQL result resource "
Still tinkering though...
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192642
news.php.net...
> Hi,
>
> Take the spaces out of your field names, and then use this:
>
> <?php
> $query = mysql_query("SELECT
> id,vacancy_role,vacancy_salary,vacancy_location,vacancy_type FROM
> vacancy_details WHERE Public='yes'");
>
> while($result = mysql_fetch_array($query)) {
> echo "$result[id] - $result[vacancy_role]";
> }
> ?>
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
attached mail follows:
> Richard
> Thanks firstly for your help. I renamed the fields so the spaces are
underscores and amended your query but still receive an error:
> "not a valid MySQL result resource "
> Still tinkering though...
Can you paste me
a.) Your database structure
b.) The exact query you are using
Also, you may want to do $query = mysql_query("SELECT * from
vacancy_details") or die(mysql_error());
I don't care about the first part of that, but try putting in the
mysql_error() in the form I used above, and see if it gives you any other
information.
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
Richard.
Public. I changed it to "Publish".
But if I use a query window to interrogate the database I still get just two
rows using the following query with field names not values for the row cell
contents:
SELECT
'ID','Vacancy_Role','Vacancy_Salary','Vacancy_Location','Vacancy_Type'
FROM vacancy_details WHERE Publish='Yes'
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192646
news.php.net...
> > Richard
>
> > Thanks firstly for your help. I renamed the fields so the spaces are
> underscores and amended your query but still receive an error:
>
> > "not a valid MySQL result resource "
>
> > Still tinkering though...
>
> Can you paste me
> a.) Your database structure
> b.) The exact query you are using
>
> Also, you may want to do $query = mysql_query("SELECT * from
> vacancy_details") or die(mysql_error());
>
> I don't care about the first part of that, but try putting in the
> mysql_error() in the form I used above, and see if it gives you any other
> information.
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
>
> Also, please look at our webhosting services, specializing in business web
> hosting starting from $15 per month!
attached mail follows:
> Richard.
> Public. I changed it to "Publish".
> But if I use a query window to interrogate the database I still get just
two
rows using the following query with field names not values for the row cell
contents:
> SELECT
'ID','Vacancy_Role','Vacancy_Salary','Vacancy_Location','Vacancy_Type'
FROM vacancy_details WHERE Publish='Yes'
Take out the quotes. Make your query say:
SELECT
ID,Vacancy_Role,Vacancy_Salary,Vacancy_Location,Vacancy_Type FROM
vacancy_details WHERE Publish='Yes';
Also, if you are selecting every field, then why not do a SELECT *?
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192646
news.php.net...
> > Richard
>
> > Thanks firstly for your help. I renamed the fields so the spaces are
> underscores and amended your query but still receive an error:
>
> > "not a valid MySQL result resource "
>
> > Still tinkering though...
>
> Can you paste me
> a.) Your database structure
> b.) The exact query you are using
>
> Also, you may want to do $query = mysql_query("SELECT * from
> vacancy_details") or die(mysql_error());
>
> I don't care about the first part of that, but try putting in the
> mysql_error() in the form I used above, and see if it gives you any other
> information.
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
>
> Also, please look at our webhosting services, specializing in business web
> hosting starting from $15 per month!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
* Thus wrote Harlequin:
> Richard
>
> Thanks firstly for your help. I renamed the fields so the spaces are
> underscores and amended your query but still receive an error:
>
> "not a valid MySQL result resource "
>
> Still tinkering though...
All this tinkering and database schema's are simply the long way
around things. Just use mysql_error() after you query.
mysql_query($sql) or die(mysql_error());
You'll know exactly whats wrong.
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
I'm only selecting a few fields Richard as I want to try and drop them into
an array and display in a table.
I know I'm probably going the long way around doing this but I need to learn
from scratch exactly how to do it.
I appreciate your help and patience very much.
I've managed to get the query returning some results now. An array. I'm
going to have to spend a little, well actually quite a bit, of time now
working out how to present these in a table.
I assume a for statement will get me pointing in the right direction...?
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192649
news.php.net...
> > Richard.
>
> > Public. I changed it to "Publish".
>
> > But if I use a query window to interrogate the database I still get just
> two
> rows using the following query with field names not values for the row
cell
> contents:
>
> > SELECT
> 'ID','Vacancy_Role','Vacancy_Salary','Vacancy_Location','Vacancy_Type'
> FROM vacancy_details WHERE Publish='Yes'
>
> Take out the quotes. Make your query say:
> SELECT
> ID,Vacancy_Role,Vacancy_Salary,Vacancy_Location,Vacancy_Type FROM
> vacancy_details WHERE Publish='Yes';
>
> Also, if you are selecting every field, then why not do a SELECT *?
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
>
> Also, please look at our webhosting services, specializing in business web
> hosting starting from $15 per month!
>
>
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
> "Richard Bewley" <rbewley
eq-sys.com> wrote in message
> news:php.general-192646
news.php.net...
> > > Richard
> >
> > > Thanks firstly for your help. I renamed the fields so the spaces are
> > underscores and amended your query but still receive an error:
> >
> > > "not a valid MySQL result resource "
> >
> > > Still tinkering though...
> >
> > Can you paste me
> > a.) Your database structure
> > b.) The exact query you are using
> >
> > Also, you may want to do $query = mysql_query("SELECT * from
> > vacancy_details") or die(mysql_error());
> >
> > I don't care about the first part of that, but try putting in the
> > mysql_error() in the form I used above, and see if it gives you any
other
> > information.
> >
> > -----------------------------------------------------------------
> > Thank you,
> > Richard Bewley
> > rbewley
eq-sys.com
> >
> > Equinox Systems and Development
> > Website: http://www.eq-dev.com/
> >
> > Also, please look at our webhosting services, specializing in business
web
> > hosting starting from $15 per month!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
> I'm only selecting a few fields Richard as I want to try and drop them
into
an array and display in a table.
> I know I'm probably going the long way around doing this but I need to
learn
from scratch exactly how to do it.
> I appreciate your help and patience very much.
> I've managed to get the query returning some results now. An array. I'm
going to have to spend a little, well actually quite a bit, of time now
working out how to present these in a table.
> I assume a for statement will get me pointing in the right direction...?
You are correct that the mysql_fetch_array will return an array which you
can format into a table. You can use a while loop if you would like, which
is probably the simplest.
<?<php
$query = mysql_query("SELECT
ID,Vacancy_Role,Vacancy_Salary,Vacancy_Location,Vacancy_Type FROM
vacancy_details WHERE Publish='Yes'");
echo "<table cellspacing=\"4\" cellpadding=\"4\" width=\"50%\">\n";
echo "<tr><td><b>ID:</b></td><td><b>Vacancy Role:</b></td><td><b>Vacancy
Salary</b></td><td><b>Vacancy Location</b></td><td>Vacancy
Type</b></td></tr>\n";
while($result = mysql_fetch_array($query)) {
echo
"<tr><td>$result[id]</td><td>$result[Vacancy_Role]</td><td>$result[Vacancy_S
alary]</td><td>$result[Vacancy_Location]</td><td>$result[Vacancy_Type]</td><
/tr>\n";
}
echo "</table>";
?>
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
Curt.
Thanks for the pointer and yes, I should be doing that and overlooked it
this time.
It's working now as I seem to be echoing the second record in the table and
will plug away at getting the table defined.
Thanks for all your help Curt.
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Curt Zirzow" <php-general
zirzow.dyndns.org> wrote in message
news:20040804015853.GH6522
bagend.shire...
> * Thus wrote Harlequin:
> > Richard
> >
> > Thanks firstly for your help. I renamed the fields so the spaces are
> > underscores and amended your query but still receive an error:
> >
> > "not a valid MySQL result resource "
> >
> > Still tinkering though...
>
> All this tinkering and database schema's are simply the long way
> around things. Just use mysql_error() after you query.
>
> mysql_query($sql) or die(mysql_error());
>
> You'll know exactly whats wrong.
>
>
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid
schemes
> you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
How can I use the "Order" statement for this query?
$specs_query = mysql_query("select title, information from spec where
product=".$id);
I tried to use
$specs_query = mysql_query("select title, information from spec where
product=".$id order by id asc);
But it will create the error.
Parse error: parse error, unexpected T_STRING in /www/docs/view_product.php
on line 144
What am I doing wrong?
TIA
Karl-Heinz
Tracking #: 28B73BEA7EBF0B4D89E64E5EA406BF5EC2EA6912
attached mail follows:
----- Original Message -----
From: "Karl-Heinz Schulz" <karlheinz
khschulz.com>
To: <php-general
lists.php.net>
Sent: Tuesday, August 03, 2004 10:19 PM
Subject: [PHP] Order by
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
>
> But it will create the error.
>
> Parse error: parse error, unexpected T_STRING in
/www/docs/view_product.php
> on line 144
start the quotes again...
$specs_query = mysql_query("select title, information from spec where
product=".$id." order by id asc");
Thanks,
Jake McHenry
MIS Coordinator
Nittany Travel
http://www.nittanytravel.com
570.748.6611 x108
attached mail follows:
Thank you - stupid me
-----Original Message-----
From: Wesley Furgiuele [mailto:wesley
furgiuele.net]
Sent: Tuesday, August 03, 2004 10:27 PM
To: Karl-Heinz Schulz
Cc: php-general
lists.php.net
Subject: Re: [PHP] Order by
Looks like you just forgot some quotes:
$specs_query = mysql_query( "select title, information from spec where
product=".$id." order by id asc" );
Or just move your quotes to the end -- I think you should be fine:
$specs_query = mysql_query( "select title, information from spec where
product = $id order by id asc" );
Wes
On Aug 3, 2004, at 10:19 PM, Karl-Heinz Schulz wrote:
> How can I use the "Order" statement for this query?
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id);
>
> I tried to use
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
>
> But it will create the error.
>
> Parse error: parse error, unexpected T_STRING in
> /www/docs/view_product.php
> on line 144
>
> What am I doing wrong?
>
> TIA
>
> Karl-Heinz
>
> Tracking #: 28B73BEA7EBF0B4D89E64E5EA406BF5EC2EA6912
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Looks like you just forgot some quotes:
$specs_query = mysql_query( "select title, information from spec where
product=".$id." order by id asc" );
Or just move your quotes to the end -- I think you should be fine:
$specs_query = mysql_query( "select title, information from spec where
product = $id order by id asc" );
Wes
On Aug 3, 2004, at 10:19 PM, Karl-Heinz Schulz wrote:
> How can I use the "Order" statement for this query?
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id);
>
> I tried to use
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
>
> But it will create the error.
>
> Parse error: parse error, unexpected T_STRING in
> /www/docs/view_product.php
> on line 144
>
> What am I doing wrong?
>
> TIA
>
> Karl-Heinz
>
> Tracking #: 28B73BEA7EBF0B4D89E64E5EA406BF5EC2EA6912
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
----- Original Message -----
From: "Karl-Heinz Schulz" <karlheinz
khschulz.com>
To: <php-general
lists.php.net>
Sent: Tuesday, August 03, 2004 9:19 PM
Subject: [PHP] Order by
> How can I use the "Order" statement for this query?
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id);
>
> I tried to use
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
>
> But it will create the error.
>
> Parse error: parse error, unexpected T_STRING in
/www/docs/view_product.php
> on line 144
>
> What am I doing wrong?
>
> TIA
>
> Karl-Heinz
>
> Tracking #: 28B73BEA7EBF0B4D89E64E5EA406BF5EC2EA6912
>
>
Hi Karl,
The problem is in your formatting.
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
Try this instead
$specs_query = mysql_query('SELECT title, information FROM spec WHERE
product=' . $id . ' ORDER BY id ASC');
Note the use of single quotes (it's faster)
You could have just done this with double quotes:
$specs_query = mysql_query("SELECT title, information FROM spec WHERE
product=$id ORDER BY id ASC");
It might also be a good idea to put single quotes around $id if it comes
from user input:
$specs_query = mysql_query('SELECT title, information FROM spec WHERE
product=\'' . $id . '\' ORDER BY id ASC');
- OR -
$specs_query = mysql_query("SELECT title, information FROM spec WHERE
product='$id' ORDER BY id ASC");
Have fun!
Regards,
Jim Grill
Web-1 Hosting
http://www.web-1hosting.net
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thank you for your help!
-----Original Message-----
From: Jim Grill [mailto:jgrill
web-1hosting.net]
Sent: Tuesday, August 03, 2004 10:33 PM
To: Karl-Heinz Schulz; php-general
lists.php.net
Subject: Re: [PHP] Order by
----- Original Message -----
From: "Karl-Heinz Schulz" <karlheinz
khschulz.com>
To: <php-general
lists.php.net>
Sent: Tuesday, August 03, 2004 9:19 PM
Subject: [PHP] Order by
> How can I use the "Order" statement for this query?
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id);
>
> I tried to use
>
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
>
> But it will create the error.
>
> Parse error: parse error, unexpected T_STRING in
/www/docs/view_product.php
> on line 144
>
> What am I doing wrong?
>
> TIA
>
> Karl-Heinz
>
> Tracking #: 28B73BEA7EBF0B4D89E64E5EA406BF5EC2EA6912
>
>
Hi Karl,
The problem is in your formatting.
> $specs_query = mysql_query("select title, information from spec where
> product=".$id order by id asc);
Try this instead
$specs_query = mysql_query('SELECT title, information FROM spec WHERE
product=' . $id . ' ORDER BY id ASC');
Note the use of single quotes (it's faster)
You could have just done this with double quotes:
$specs_query = mysql_query("SELECT title, information FROM spec WHERE
product=$id ORDER BY id ASC");
It might also be a good idea to put single quotes around $id if it comes
from user input:
$specs_query = mysql_query('SELECT title, information FROM spec WHERE
product=\'' . $id . '\' ORDER BY id ASC');
- OR -
$specs_query = mysql_query("SELECT title, information FROM spec WHERE
product='$id' ORDER BY id ASC");
Have fun!
Regards,
Jim Grill
Web-1 Hosting
http://www.web-1hosting.net
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Many thanks Richard.
I have the table presenting neatly now, thanks for all your help with this
one...!
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192652
news.php.net...
> > I'm only selecting a few fields Richard as I want to try and drop them
> into
> an array and display in a table.
>
> > I know I'm probably going the long way around doing this but I need to
> learn
> from scratch exactly how to do it.
>
> > I appreciate your help and patience very much.
>
> > I've managed to get the query returning some results now. An array. I'm
> going to have to spend a little, well actually quite a bit, of time now
> working out how to present these in a table.
>
> > I assume a for statement will get me pointing in the right direction...?
>
> You are correct that the mysql_fetch_array will return an array which you
> can format into a table. You can use a while loop if you would like,
which
> is probably the simplest.
>
> <?<php
> $query = mysql_query("SELECT
> ID,Vacancy_Role,Vacancy_Salary,Vacancy_Location,Vacancy_Type FROM
> vacancy_details WHERE Publish='Yes'");
>
> echo "<table cellspacing=\"4\" cellpadding=\"4\" width=\"50%\">\n";
> echo "<tr><td><b>ID:</b></td><td><b>Vacancy Role:</b></td><td><b>Vacancy
> Salary</b></td><td><b>Vacancy Location</b></td><td>Vacancy
> Type</b></td></tr>\n";
>
> while($result = mysql_fetch_array($query)) {
> echo
>
"<tr><td>$result[id]</td><td>$result[Vacancy_Role]</td><td>$result[Vacancy_S
>
alary]</td><td>$result[Vacancy_Location]</td><td>$result[Vacancy_Type]</td><
> /tr>\n";
> }
>
> echo "</table>";
> ?>
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
>
> Also, please look at our webhosting services, specializing in business web
> hosting starting from $15 per month!
attached mail follows:
Looks good :)
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
attached mail follows:
I know what's going to happen though Richard. I'll dump it in their site and
it'll look terrible because they don't know how to use CSS effectively. But
hey - that's part of the fun.
Hyperlinks tomorrow though :|
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Richard Bewley" <rbewley
eq-sys.com> wrote in message
news:php.general-192660
news.php.net...
> Looks good :)
>
> -----------------------------------------------------------------
> Thank you,
> Richard Bewley
> rbewley
eq-sys.com
>
> Equinox Systems and Development
> Website: http://www.eq-dev.com/
>
> Also, please look at our webhosting services, specializing in business web
> hosting starting from $15 per month!
attached mail follows:
Hello everyone I have a problem with this php script that gives this error
*Fatal error*: Unsupported operand types in
*/usr/local/www/data-dist/brisk/php/classes/PageContent.php* on line *64
here is the part of the code that gives the error
$this->currentWebPageCount += 1;
$this->previousPage -= 1;
This code is contained in a class called testPage and this class extends
another class in a file called PageContent.
the currentWebPageCount is initalized from a HTTP_GET_VARS['rows']; and
I also check to see if it has been initalized with a isset() function.
If anyone can help thanks
*
attached mail follows:
I ran into so many problems trying to set this up that I thought I'd
post my notes to hopefully save others some trouble.
I found most of the information I needed at:
http://rayh.co.uk/archives/13_PHP5__PHP4_side_by_side.html
but the link doesn't seem to be working anymore, so here are my notes.
Versions:
PHP4.x module (already compiled and installed, this was
straightforward in docs at www.php.net)
PHP5.0.0 cgi
RedHat linux 6.x
Apache 1.3.22
PHP5 configure command:
./configure \
--prefix=/usr/local/php/php5.0.0 \
--with-config-file-path=/usr/local/php/php5.0.0/ \
--with-config-file=/usr/local/php/php5.0.0/php.ini \
--enable-force-cgi-redirect \
--disable-path-info-check \
--enable-safe-mode \
--disable-short-tags \
--with-regex=system \
--with-mysql \
--enable-debug \
--with-mcrypt \
--enable-versioning \
--disable-libxml
NOTE: when I enabled '--enable-discard-path', pages would load blank.
Don't use this unless you know what you are doing. I don't understand
exactly what this does.
NOTE: The options '--with-apxs' and '--with-apache' tell configure to
build apache module and CLI. The absence of these tells it to build
the CGI version. So DO NOT USE them if you want the CGI version.
make
make test
make install
Add the following to httpd.conf (must be in the generic server
settings, NOT in a virtual host):
ScriptAlias /cgi-php5/ "/usr/local/php/php5.0.0/bin/"
<Directory "/usr/local/php/php5.0.0/bin/">
Options +ExecCGI
Allow From All
</Directory>
Foreach virtual host you want to use php5 on:
Create a directory named 'cgi-php5' one level above the document root.
This will most likely be in the same directory that has the cgi-bin
directory in it.
Foreach directory that you want to us php5 for:
Add the following to .htaccess file (or virtual host inside a
Directory container):
Action php5-script /cgi-php5/php
AddHandler php5-script .php
Options +ExecCGI
This is an excellent solution because:
- You only have to restart apache once. After that, you can add
.htaccess files to enable php5 interpretation whereever you want.
- You can upgrade/downgrade php5 without touching apache.
- You don't have clunky file extensions like .php5 or anything else
that will be difficult to change later on down the road.
PROBLEMS: So far, I cannot figure out why $_POST is empty when an html
form is sent with method=post. GET works fine. In all my searching,
I think it has something to do with how apache is setup; not with how
php is configured. I've tried the default php-dist ini file, I've tried
many different variations of php configure commands. None of them do
the trick. PHP bug list has some posts from people with the same problem
and then they said they found a problem in apache setup that fixed it.
attached mail follows:
I am sure this is an obvious answer, but dang if I could find it.
How do you chop off a decimal value in PHP? I know I can do it using a
combination of modulus, subtraction and division, but isn't there a function
that does this? I think I am suffering from a giant mental block =)
attached mail follows:
Are you looking for the round function?
$number = "4.3392";
$number = round($number);
-----------------------------------------------------------------
Thank you,
Richard Bewley
rbewley
eq-sys.com
Equinox Systems and Development
Website: http://www.eq-dev.com/
Also, please look at our webhosting services, specializing in business web
hosting starting from $15 per month!
-----Original Message-----
From: Robert Frame [mailto:Robert_M_Frame
verizon.net]
Sent: Tuesday, August 03, 2004 11:25 PM
To: php-general
lists.php.net
Subject: [PHP] Easy Question (I think)
I am sure this is an obvious answer, but dang if I could find it.
How do you chop off a decimal value in PHP? I know I can do it using a
combination of modulus, subtraction and division, but isn't there a function
that does this? I think I am suffering from a giant mental block =)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Tue, 2004-08-03 at 23:25, Robert Frame wrote:
> I am sure this is an obvious answer, but dang if I could find it.
>
> How do you chop off a decimal value in PHP? I know I can do it using a
> combination of modulus, subtraction and division, but isn't there a function
> that does this? I think I am suffering from a giant mental block =)
floor()
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Does anyone have any ideas as to why $_POST would be empty when
submitting a form to php?
I am running PHP5 as CGI in apache 1.3.22 on redhat linux.
I've also tried php4.3.8 CGI (same php configuration and .ini file)
and I get the same behavior.
When I submit an html form with method=post, the $_POST superglobal
array is empty. GET works fine. I've tried many different
configuration options with PHP but none seem to help. I've tried the
default php.ini-dist config file with no luck.
I've gone through all the relevant bug reports and search all the
mailing lists, FAQ's and newsgroups. I can't find any useful,
applicable information.
My configure command is:
./configure \
--prefix=/usr/local/php/php5.0.0 \
--with-config-file-path=/usr/local/php/php5.0.0/ \
--with-config-file=/usr/local/php/php5.0.0/php.ini \
--enable-force-cgi-redirect \
--disable-path-info-check \
--enable-safe-mode \
--disable-short-tags \
--with-regex=system \
--with-mysql \
--enable-debug \
--with-mcrypt \
--enable-versioning \
--disable-libxml
--
Andy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]