php-general Digest 16 May 2002 11:53:17 -0000 Issue 1348

Topics (messages 97840 through 97895):

phpmysqladmin ?  still viable?
        97840 by: Erik Gilchrist
        97842 by: Jason Murray
        97843 by: Damian Harouff
        97844 by: Danny Shepherd
        97845 by: Erik Gilchrist
        97846 by: Erik Gilchrist
        97851 by: Erik Gilchrist

The future of call time pass-as-reference
        97841 by: Frank
        97847 by: Lars Torben Wilson

Re: Tellwhich browser
        97848 by: Justin French
        97878 by: Wolfram Kriesing

Re: Compiling PHP on Solaris 7
        97849 by: Billy S Halsey

Plz dont hate me for this
        97850 by: Salman Ahmed
        97856 by: Vinod Palan
        97867 by: Liam MacKenzie

method=post problem
        97852 by: Jule
        97855 by: John Holmes
        97857 by: Janet Valade
        97858 by: Miguel Cruz
        97859 by: Analysis & Solutions

Re: fopen failing to connect
        97853 by: Vail, Warren

Re: PHP editor (win)
        97854 by: Vinod Palan

newbie bigtime
        97860 by: k spellman
        97861 by: Miguel Cruz
        97862 by: k spellman
        97863 by: k spellman
        97864 by: Miguel Cruz
        97868 by: Craig Vincent

Re: textarea problem
        97865 by: Jason Morehouse

Generate every possible combination
        97866 by: Evan Nemerson
        97869 by: Martin Towell
        97871 by: Austin Marshall
        97872 by: Austin Marshall
        97886 by: Martin Wickman

Re: Uploading JPEG's - Security Issues?
        97870 by: Tom Rogers

class and error handling
        97873 by: Gerard Samuel
        97874 by: Martin Towell
        97875 by: Gerard Samuel

Re: PhP 4.2.1 (and various)
        97876 by: Olav Bringedal

is $HTTP_REFERER worth trusting?
        97877 by: Patrick Hsieh
        97880 by: Craig Vincent
        97881 by: Dan Hardiker
        97884 by: Dan Hardiker
        97890 by: Patrick Hsieh
        97892 by: Dan Hardiker

help with arrays
        97879 by: Josh Edwards
        97887 by: Martin Wickman
        97888 by: Dan Hardiker

Re: IF Statements
        97882 by: Martin Wickman

Re: Using Sessions under Win98/Apache
        97883 by: Neil Freeman

Re: I'm doing something wrong....
        97885 by: Martin Wickman

Mysql Query Help needed
        97889 by: Chris Kay
        97895 by: Jay Blanchard

select statement
        97891 by: Wilbert Enserink
        97893 by: John Holmes
        97894 by: Jason Wong

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
First off, I am a total newbie to php and DB stuff.  Pardon the intrusion on 
your busy schedules.  Really.

My host is having a hard time finding phpmysqladmin and he touted this as a 
solution to my wanting to get into the DB arena as well as php.  Does anyone 
know where to get it?   All of my evening has now been wasted googling 
looking for it and perhaps there is a better solution.

And no, I really am out of my game here, but I figured it was a good place 
to ask.  The only caveat the host said was that it MUST be PHP4.x 
compatible.

I sincerely apologize for the intrusion if it's not on topic enough.  I know 
I need to go further in my exploration that the net has via tutorials and 
PHP manual, but if anyone has time I would sincerely appreciate it.  I have 
been lurking for a week or two.  Good stuff to be found here.  Indeed.

I could have all the assumptions above all wrong and some bad 
data/opinions...  sorry.  please explain.  If I am in the wrong place to 
ask, please tell me where the best place to look/ask is.  I don't want to 
waste anybodys time.  I surely would not want mine wasted.

BTW-- I am on DIGEST, so a CC: would be appreciated dearly.

TIA.
Erik

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
Go to www.google.com -> enter "phpMyAdmin" -> hit "I'm Feeling Lucky"

:)

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

> -----Original Message-----
> From: Erik Gilchrist [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] phpmysqladmin ? still viable?
> 
> 
> First off, I am a total newbie to php and DB stuff.  Pardon 
> the intrusion on 
> your busy schedules.  Really.
> 
> My host is having a hard time finding phpmysqladmin and he 
> touted this as a 
> solution to my wanting to get into the DB arena as well as 
> php.  Does anyone 
> know where to get it?   All of my evening has now been wasted 
> googling 
> looking for it and perhaps there is a better solution.
> 
> And no, I really am out of my game here, but I figured it was 
> a good place 
> to ask.  The only caveat the host said was that it MUST be PHP4.x 
> compatible.
> 
> I sincerely apologize for the intrusion if it's not on topic 
> enough.  I know 
> I need to go further in my exploration that the net has via 
> tutorials and 
> PHP manual, but if anyone has time I would sincerely 
> appreciate it.  I have 
> been lurking for a week or two.  Good stuff to be found here.  Indeed.
> 
> I could have all the assumptions above all wrong and some bad 
> data/opinions...  sorry.  please explain.  If I am in the 
> wrong place to 
> ask, please tell me where the best place to look/ask is.  I 
> don't want to 
> waste anybodys time.  I surely would not want mine wasted.
> 
> BTW-- I am on DIGEST, so a CC: would be appreciated dearly.
> 
> TIA.
> Erik
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Are you sure you don't mean "phpmyadmin"?

http://phpmyadmin.sourceforge.net/

EG> First off, I am a total newbie to php and DB stuff.  Pardon the intrusion on 
EG> your busy schedules.  Really.

EG> My host is having a hard time finding phpmysqladmin and he touted this as a 
EG> solution to my wanting to get into the DB arena as well as php.  Does anyone 
EG> know where to get it?   All of my evening has now been wasted googling 
EG> looking for it and perhaps there is a better solution.

EG> And no, I really am out of my game here, but I figured it was a good place 
EG> to ask.  The only caveat the host said was that it MUST be PHP4.x 
EG> compatible.

EG> I sincerely apologize for the intrusion if it's not on topic enough.  I know 
EG> I need to go further in my exploration that the net has via tutorials and 
EG> PHP manual, but if anyone has time I would sincerely appreciate it.  I have 
EG> been lurking for a week or two.  Good stuff to be found here.  Indeed.

EG> I could have all the assumptions above all wrong and some bad 
EG> data/opinions...  sorry.  please explain.  If I am in the wrong place to 
EG> ask, please tell me where the best place to look/ask is.  I don't want to 
EG> waste anybodys time.  I surely would not want mine wasted.

EG> BTW-- I am on DIGEST, so a CC: would be appreciated dearly.

EG> TIA.
EG> Erik

--- End Message ---
--- Begin Message ---
I think you're looking for phpMyAdmin and yes, it's very viable and PHP4
compatible.

http://www.phpwizard.net/projects/phpMyAdmin/

HTH

Danny.

----- Original Message -----
From: "Erik Gilchrist" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 1:15 AM
Subject: [PHP] phpmysqladmin ? still viable?


> First off, I am a total newbie to php and DB stuff.  Pardon the intrusion
on
> your busy schedules.  Really.
>
> My host is having a hard time finding phpmysqladmin and he touted this as
a
> solution to my wanting to get into the DB arena as well as php.  Does
anyone
> know where to get it?   All of my evening has now been wasted googling
> looking for it and perhaps there is a better solution.
>
> And no, I really am out of my game here, but I figured it was a good place
> to ask.  The only caveat the host said was that it MUST be PHP4.x
> compatible.
>
> I sincerely apologize for the intrusion if it's not on topic enough.  I
know
> I need to go further in my exploration that the net has via tutorials and
> PHP manual, but if anyone has time I would sincerely appreciate it.  I
have
> been lurking for a week or two.  Good stuff to be found here.  Indeed.
>
> I could have all the assumptions above all wrong and some bad
> data/opinions...  sorry.  please explain.  If I am in the wrong place to
> ask, please tell me where the best place to look/ask is.  I don't want to
> waste anybodys time.  I surely would not want mine wasted.
>
> BTW-- I am on DIGEST, so a CC: would be appreciated dearly.
>
> TIA.
> Erik
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Damian,

Yes, I sent that to him, but who knows...  well, at least I don't know.  PHP 
is new to me.  SQL?  Even newer.

I created an account like that on L33T.ca last week, and just sent my host 
an email on that before posting here.  I just figured that phpmysqladmin was 
a different thing.

These are the same things. eh?

(DIGEST delayed - please CC:)
erik

>From: Damian Harouff <[EMAIL PROTECTED]>
>Reply-To: Damian Harouff <[EMAIL PROTECTED]>
>To: "Erik Gilchrist" <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] phpmysqladmin ?  still viable?
>Date: Wed, 15 May 2002 19:18:57 -0500
>
>Are you sure you don't mean "phpmyadmin"?
>
>http://phpmyadmin.sourceforge.net/
>
>EG> First off, I am a total newbie to php and DB stuff.  Pardon the 
>intrusion on
>EG> your busy schedules.  Really.
>
>EG> My host is having a hard time finding phpmysqladmin and he touted this 
>as a
>EG> solution to my wanting to get into the DB arena as well as php.  
>...............   >>>>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
AH!   That is how I got it the first time for my L33T.ca account.  I think I 
got it from SourceForge.net and he knows I now have it posted there after 
last weeks search.

Damn!  This list is fast!!!!!!!!   <BWG>

Erik


>From: Jason Murray <[EMAIL PROTECTED]>
>To: "'Erik Gilchrist'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: RE: [PHP] phpmysqladmin ?  still viable?
>Date: Thu, 16 May 2002 10:19:56 +1000
>
>Go to www.google.com -> enter "phpMyAdmin" -> hit "I'm Feeling Lucky"
>
>:)
>
>--
>Jason Murray
>[EMAIL PROTECTED]
>Web Developer, Melbourne IT
>"Work now, freak later!"
>
> > -----Original Message-----
> > From: Erik Gilchrist [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 16, 2002 10:15 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] phpmysqladmin ? still viable?
> >
> >
> > First off, I am a total newbie to php and DB stuff.  Pardon
> > the intrusion on
> > your busy schedules.  Really.
> >
> > My host is having a hard time finding phpmysqladmin 
>.....................    >>


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
Well, let's just say that my host is not a server farm and my hosting fees 
are incredibly hard to pass up on many levels (work that comes my way and 
theirs..) and the simple fact that i can actually email and get a quick 
response (or dare I say PHONE!) to Q's and exceptional service is one of my 
strong longings in any industry.

I am happy so far, but will forgo switching hosts for now.  It has simply 
worked up until now, and this is nothing more than a minor "blip" in the 
radar.

I do know exactly what you're talking bout tho...  appreciate the concern.  
I have had to mediate host v. client v. coder v. designer all too often.  
Maybe I should be in arbitrage.   LOL   (well, maybe not, but I will consult 
;-)

Still DIGEST dealyed, CC: prefered ----
erik
(Sorry for the double post Jeff...)

>From: "Jeff Lewis" <[EMAIL PROTECTED]>
>Reply-To: "Jeff Lewis" <[EMAIL PROTECTED]>
>To: "Erik Gilchrist" <[EMAIL PROTECTED]>
>Subject: Re: [PHP] phpmysqladmin ? still viable?
>Date: Wed, 15 May 2002 20:58:23 -0400
>
>Eek, was scares me is that your host didn't know about phpmyadmin :)
>
>Jeff
>----- Original Message -----
>From: "Erik Gilchrist" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Wednesday, May 15, 2002 8:26 PM
>Subject: Re: [PHP] phpmysqladmin ? still viable?
>
>
> > Damian,
> >
> > Yes, I sent that to him, but who knows...  well, at least I don't know.
>PHP
> > is new to me.  SQL?  Even newer.
> >
> > I created an account like that on L33T.ca last week, and just sent my 
>host
> > an email on that before posting here.  I just figured that phpmysqladmin
>was
> > a different thing.
> >
> > These are the same things. eh?
> >
> > (DIGEST delayed - please CC:)
> > erik
> >
> > >From: Damian Harouff <[EMAIL PROTECTED]>
> > >Reply-To: Damian Harouff <[EMAIL PROTECTED]>
> > >To: "Erik Gilchrist" <[EMAIL PROTECTED]>
> > >CC: [EMAIL PROTECTED]
> > >Subject: Re: [PHP] phpmysqladmin ?  still viable?
> > >Date: Wed, 15 May 2002 19:18:57 -0500
> > >
> > >Are you sure you don't mean "phpmyadmin"?
> > >
> > >http://phpmyadmin.sourceforge.net/
> > >
> > >EG> First off, I am a total newbie to php and DB stuff.  Pardon the
> > >intrusion on
> > >EG> your busy schedules.  Really.
> > >
> > >EG> My host is having a hard time finding phpmysqladmin and he touted
>this
> > >as a
> > >EG> solution to my wanting to get into the DB arena as well as php.
> > >...............   >>>>



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---

After installing PHP 4.2.0 I got the following error-message under a run:

"Warning: Call-time pass-by-reference has been deprecated - argument passed 
by value; If you would like to pass it by reference, modify the declaration 
of [runtime function name](). If you would like to enable call-time 
pass-by-reference, you can set allow_call_time_pass_reference to true in 
your INI file. However, future versions may not support this any longer. "

This is actually big news as parameter passing is a fundamental issue.

Traditionally

function foo($v)   called as
foo(&$myvar)

was regarded as safer coding than

function foo(&$v)   called as
foo($myvar)

as in the first case the user would automatically be aware that $myvar 
could be changed by the function, in the second not.

Worse is that in some functions it makes fine sense for the user to have a 
choice. These functions will be very hard to rewrite as the user will be 
forced to references in all cases.

Finally default parameters are not supported for reference-parameters in 
the function header.

Anyway - it seems that I have to choose between either starting to rewrite 
quite a lot of code right away or risk being forced to rewrite more later 
if I use the quick fix with setting allow_call_time_pass_reference to true.

Any thoughts?

Frank


--- End Message ---
--- Begin Message ---
On Wed, 2002-05-15 at 17:13, Frank wrote:
> 
> After installing PHP 4.2.0 I got the following error-message under a run:
> 
> "Warning: Call-time pass-by-reference has been deprecated - argument passed 
> by value; If you would like to pass it by reference, modify the declaration 
> of [runtime function name](). If you would like to enable call-time 
> pass-by-reference, you can set allow_call_time_pass_reference to true in 
> your INI file. However, future versions may not support this any longer. "
> 
> This is actually big news as parameter passing is a fundamental issue.

What version did you upgrade from? This has been the case for over two
years. Here's the actual commit which added this warning:

http://cvs.php.net/diff.php/Zend/zend_compile.c?r1=1.85&r2=1.86&ty=h&Horde=f1b8ac02f66b49090920734c03b780c1

...which is from Dec 15, 1999---5 months before PHP 4.0.0 was released. 
Chances are you had the error suppressed in php.ini.

> Anyway - it seems that I have to choose between either starting to rewrite 
> quite a lot of code right away or risk being forced to rewrite more later 
> if I use the quick fix with setting allow_call_time_pass_reference to true.
> 
> Any thoughts?
> 
> Frank

Yup. Start changing that code. :) 

Sorry if this seems overly glib but it's just the way things work. This 
has been hashed over before--check the list archives. Essentially, the
feeling is that references are not what you might expect if you come 
from a C-like background and the call-time syntax doesn't give you
the benefits you might expect.

Hope that explains some of it. I believe there is more on the topic
on zend.com, too.


Cheers,

Torben


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506

--- End Message ---
--- Begin Message ---
A simple looks around at phpbuilder.com will result in an article on browser
detection & CSS... the browser detection function he writes can be used for
many things, including what you want.

Justin French


on 16/05/02 12:09 AM, Diana Castillo ([EMAIL PROTECTED])
wrote:

> What is the code to tell whether the user is on IE or Netscape?
> 
> 

--- End Message ---
--- Begin Message ---
Justin French wrote:

>A simple looks around at phpbuilder.com will result in an article on browser
>detection & CSS... the browser detection function he writes can be used for
>many things, including what you want.
>
>Justin French
>
>
>on 16/05/02 12:09 AM, Diana Castillo ([EMAIL PROTECTED])
>wrote:
>
>  
>
>>What is the code to tell whether the user is on IE or Netscape?
>>    
>>
checkout PEAR::Net_UserAgent
get it from pear.php.net
or cvs.php.net/cvs.php/pear

-- 
Wolfram

... translating template engine ....
  http://sf.net/projects/simpletpl

... authentication system ....
  http://sf.net/projects/auth



--- End Message ---
--- Begin Message ---
Greetings, Thomas.

Did you solve this problem? If not, I would suggest getting rid of the 
"--enable-libgcc" in your ./configure command. Here's how I configured 
my installation of 4.2.0 for Solaris 8: (Directory names XXX'ed out)

'./configure' '--prefix=XXX' '--enable-cli'
'--enable-magic-quotes' '--disable-short-tags' '--enable-bcmath'
'--enable-calendar' '--enable-dba=shared' '--enable-dbx' '--enable-dio'
'--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-shmop'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-tokenizer' '--enable-wddx' '--enable-yp'
'--enable-inline-optimization' '--with-apxs=XXX'
'--with-openssl=shared,XXX' '--with-zlib=shared,XXX'
'--with-bz2=shared,XXX' '--with-curl=shared,XXX'
'--with-gd=shared,XXX' '--with-ldap=shared,XXX'
'--with-mcal=shared,XXX' '--with-mcrypt=shared,XXX'
'--with-mnogosearch=shared,XXX'
'--with-mysql=shared,XXX'
'--with-sybase-ct=shared,XXX' '--with-expat-dir=XXX'

I'm building with gcc 3.0.3.

Regards,
/bsh/

Thomas Finley wrote:
> Pleas help. I'm installing php on a Solaris 7 server that is running
> iplanet 4.1.
> 
> PHP Version 4.2.1
> 
> Configure: (I had more compiled in (gd, gdbm...) but error below
> occured so I cut it down)
> 
> ./configure --with-nsapi=/usr/netscape/server4 --enable-libgcc \
> --prefix=/usr --with-mysql=/usr/local/mysql --enable-track-vars
> 
> The Error:
> 
> bash-2.05# make
> Making all in Zend
> make[1]: Entering directory `/usr/share/src/php-4.2.1/Zend'
> /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
> -I../main   -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS
> -D_REENTRANT -I../TSRM  -g -O2 -pthreads -DZTS -prefer-pic -c -o
> zend_language_parser.lo `test -f zend_language_parser.c || echo
> './'`zend_language_parser.c
> In file included from zend_compile.h:24,
>                  from zend_language_parser.c:147:
> zend.h:55: unix.h: No such file or directory
> make[1]: *** [zend_language_parser.lo] Error 1
> make[1]: Leaving directory `/usr/share/src/php-4.2.1/Zend'
> make: *** [all-recursive] Error 1
> 
> Thomas Finley
> [EMAIL PROTECTED]
> 
> 
-- 


/---------------------------------------------=[ BILLY S HALSEY ]=--\
| Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW  |
| "All opinions and technical advice offered in this message are my |
| own and not necessarily endorsed by my employer."                 |
\--=[ [EMAIL PROTECTED] ]=--------------------------------------------/

--- End Message ---
--- Begin Message ---
Hi,

I am also PHP lover plz dont hate me for this but I really need to know any free perl 
hosting company where I can host my perl script. Only circumstances has made this that 
I programming in perl. I have no idea where to put my question, as I always did 
programming in php and asked this list. So I am asking this question here to, plz tell 
me about free CGI hosting site.

Asking for the help and forgiveness
Statbat
--- End Message ---
--- Begin Message ---
hey ,
there is one that I have used.
http://free4sure.com/free-hosting.html
you can give a try here..

Vinod

--
Vinod Palan A
Calypso Technology, Inc.
[EMAIL PROTECTED]
(415) 817-2463 Phone



"Salman Ahmed" <[EMAIL PROTECTED]> wrote in message
001c01c1fc7e$1bb35160$4a8305ca@home">news:001c01c1fc7e$1bb35160$4a8305ca@home...
Hi,

I am also PHP lover plz dont hate me for this but I really need to know any
free perl hosting company where I can host my perl script. Only
circumstances has made this that I programming in perl. I have no idea where
to put my question, as I always did programming in php and asked this list.
So I am asking this question here to, plz tell me about free CGI hosting
site.

Asking for the help and forgiveness
Statbat



--- End Message ---
--- Begin Message ---
nononononon

www.vectorstar.net

EXCELLENT hosting and it's free!



----- Original Message -----
From: "Salman Ahmed" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 12:05 PM
Subject: [PHP] Plz dont hate me for this


Hi,

I am also PHP lover plz dont hate me for this but I really need to know any
free perl hosting company where I can host my perl script. Only
circumstances has made this that I programming in perl. I have no idea where
to put my question, as I always did programming in php and asked this list.
So I am asking this question here to, plz tell me about free CGI hosting
site.

Asking for the help and forgiveness
Statbat



--- End Message ---
--- Begin Message ---
Hey guys and gals,

i have a form with method=post which sends 

<input type=hidden name=quiz[quiz_title] value=$quiz[quiz_title]>
<input type=hidden name=quiz[owner_name] value=$quiz[owner_name]>
<input type=hidden name=quiz[owner_email] value=$quiz[owner_email]>
<input type=hidden name=quiz[number_answers] value=$quiz[number_answers]>
<input type=hidden name=submitted value=TRUE>

to the same page, and  picks it up in an 
if ($submitted) {....} loop.

but now here's the problem: 
when it comes back and goes into the loop. Only the first name from 
$quiz[owner_name] is left, so where it used to be John Doe, is now only Joe.
how do i fix this?

thanks

Jule
-- 
|\/\__________________________/\/|
|   Jule Slootbeek               |
|   [EMAIL PROTECTED]        |
|   http://blindtheory.cjb.net   |
|   __________________________   |
|/\/                          \/\|
--- End Message ---
--- Begin Message ---
Use quotes and a little common sense.

<input type=hidden name=quiz value=John Doe>

How do you expect HTML to know that you mean John Doe to be the entire
value? Computers only do what you tell them.

<input value=John Doe crap=foo name=quiz>

So what's the value there? Is it 'John', 'John Doe', 'John Doe crap=foo'
or what??

Hope you see the point...

<input type="hidden" name="quiz" value="John Doe">

---John Holmes...

> -----Original Message-----
> From: Jule [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 15, 2002 9:28 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] method=post problem
> 
> Hey guys and gals,
> 
> i have a form with method=post which sends
> 
> <input type=hidden name=quiz[quiz_title] value=$quiz[quiz_title]>
> <input type=hidden name=quiz[owner_name] value=$quiz[owner_name]>
> <input type=hidden name=quiz[owner_email] value=$quiz[owner_email]>
> <input type=hidden name=quiz[number_answers]
value=$quiz[number_answers]>
> <input type=hidden name=submitted value=TRUE>
> 
> to the same page, and  picks it up in an
> if ($submitted) {....} loop.
> 
> but now here's the problem:
> when it comes back and goes into the loop. Only the first name from
> $quiz[owner_name] is left, so where it used to be John Doe, is now
only
> Joe.
> how do i fix this?
> 
> thanks
> 
> Jule
> --
> |\/\__________________________/\/|
> |   Jule Slootbeek             |
> |   [EMAIL PROTECTED]      |
> |   http://blindtheory.cjb.net         |
> |   __________________________         |
> |/\/                        \/\|
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
You need double quotes around the value. E.g.,
<input type=hidden name=quiz[owner_name] value="$quiz[owner_name]">


----- Original Message -----
From: "Jule" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 6:27 PM
Subject: [PHP] method=post problem


Hey guys and gals,

i have a form with method=post which sends

<input type=hidden name=quiz[quiz_title] value=$quiz[quiz_title]>
<input type=hidden name=quiz[owner_name] value=$quiz[owner_name]>
<input type=hidden name=quiz[owner_email] value=$quiz[owner_email]>
<input type=hidden name=quiz[number_answers] value=$quiz[number_answers]>
<input type=hidden name=submitted value=TRUE>

to the same page, and  picks it up in an
if ($submitted) {....} loop.

but now here's the problem:
when it comes back and goes into the loop. Only the first name from
$quiz[owner_name] is left, so where it used to be John Doe, is now only Joe.
how do i fix this?

thanks

Jule
--
|\/\__________________________/\/|
|   Jule Slootbeek |
|   [EMAIL PROTECTED] |
|   http://blindtheory.cjb.net |
|   __________________________ |
|/\/       \/\|

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
On Wed, 15 May 2002, Jule wrote:
> <input type=hidden name=quiz[owner_name] value=$quiz[owner_name]>
> 
> but now here's the problem: 
> when it comes back and goes into the loop. Only the first name from 
> $quiz[owner_name] is left, so where it used to be John Doe, is now only Joe.
> how do i fix this?

Your HTML is invalid. You have to quote non-numeric values.

  <input type=hidden name=quiz[owner_name] value='$quiz[owner_name]'>

Otherwise it ends up looking like:

  <input type=hidden name=quiz[owner_name] value=John Doe>

and it thinks "Doe" is some other attribute to the input tag.

miguel

--- End Message ---
--- Begin Message ---
On Wed, May 15, 2002 at 09:27:55PM -0400, Jule wrote:
> 
> <input type=hidden name=quiz[owner_name] value=$quiz[owner_name]>
> 
> when it comes back and goes into the loop. Only the first name from 
> $quiz[owner_name] is left, so where it used to be John Doe, is now only Joe.

You're missing quotes around the attribute values.  Thus, the system is
assuming only the first thing following the value is the value.  Write
your HTML up to spec and you'll be fine.

 echo '<input type="hidden" name="quiz[owner_name]" value="' .
  $quiz['owner_name'] . '" />';

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
--- End Message ---
--- Begin Message ---
Based on the parts of this thread that I have read, I didn't see anything
about the failing platform. What is the OS, Webserver, etc.?  Does it have
to function thru a gateway or proxy server to get to URL you are trying to
open, perhaps security is tighter on this machine?  Are tcp/ip connections
to port 80 from this machine blocked in any way?

The "bad file number" message could be a clue.  Does this platform return -1
when the file does not exist (or is blocked)?

Using a browser, you get a series of numbers (mostly floats).  Perhaps if
you were to exercise a browser on this machine against the same URL, you
might get a few more clues.

just a few thoughts,

Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-----Original Message-----
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 4:49 PM
To: Miguel Cruz
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] fopen failing to connect


i looked at the php.ini file and f wrapper is configured. thanks for the
suggestion. i am still looking for any suggestions anyone has. thanks.

-jennifer

Miguel Cruz wrote:

> Sounds like maybe the fopen url wrapper is not installed. I've never taken
> any particular steps to install it, so I'm not sure how that would come
> about.
>
> miguel
>
> On Wed, 15 May 2002, jennifer jefferson wrote:
> > thanks for looking. my guess is that it could be a
> > server configuration issue. i am really not sure. the
> > actual script works.... just not on the server i need
> > it to work on. maybe it has something to do with the
> > .ini file or the installation. i am not very familiar
> > with that. does this sound likely as a problem?
> > thanks.
> >
> > -jennifer
> >
> > --- Kevin Stone <[EMAIL PROTECTED]> wrote:
> > > Jennifer, works just fine here..
> > >
> > > ---------
> > > $fp =
> > >
> >
fopen("http://www.thedeal.com/NASApp/cs/ContentServer?pagename=TheDeal/xmlfe
> > > ed","r");
> > > if ($fp !== FALSE)
> > >      echo "The file exists!";
> > > else
> > >     echo "The file does not exist";
> > > ---------
> > >
> > > This prints "The file exists!" so it may be
> > > something else in your code
> > > cuasing the problem.  And when I read the file it
> > > displays a bunch of
> > > numbers.  Don't know what you could be doing wrong
> > > but if you continue to
> > > experiece problems post some more of your code and
> > > maybe we can decipher the
> > > error from that.
> > >
> > > -Kevin
> >
> > __________________________________________________
> > Do You Yahoo!?
> > LAUNCH - Your Yahoo! Music Experience
> > http://launch.yahoo.com
> >
> >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I am using Editplus and I feel satisfied while using it.
you can give a try..
Vinod

--
Vinod Palan A
Calypso Technology, Inc.
[EMAIL PROTECTED]
(415) 817-2463 Phone



"Juan Pablo Aqueveque" <[EMAIL PROTECTED]> wrote in message
5.1.0.14.2.20020515102655.00a86040@www2">news:5.1.0.14.2.20020515102655.00a86040@www2...
Hi guys

I know this question it's very recurrent but the problem of Jon Yates make
me think again this stuff.

Somebody knows a quick editor, simply and with highlight?

:) Jp

I have tried : PHPEdit, DevPad


________________________________________________________
Juan Pablo Aqueveque <[EMAIL PROTECTED]>
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628





--- End Message ---
--- Begin Message ---
Just opened a "How to" book today on PHP. Already
having problems and wouldn't mind an extra set of
eyes. My basic form does not produce results.Any
thoughts on this one?

http://www.hermengoode.com/php/form.html

Thanks!
spellman

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--- End Message ---
--- Begin Message ---
On Wed, 15 May 2002, k spellman wrote:
> Just opened a "How to" book today on PHP. Already
> having problems and wouldn't mind an extra set of
> eyes. My basic form does not produce results.Any
> thoughts on this one?
> 
> http://www.hermengoode.com/php/form.html

Well, you don't show your source code, but if I had to guess I'd say you
have a newish install of PHP and an oldish book, and you're trying to get
the value of $LastName rather than $_GET['LastName'].

miguel

--- End Message ---
--- Begin Message ---
The code for form.html is

<HTML>
<HEAD>
<TITLE>HTML Form</TITLE>
</HEAD>
<BODY>
<FORM ACTION="HandleForm.php" METHOD=POST>
First Name <INPUT TYPE=TEXT NAME="FirstName"
SIZE=40><BR>
Last Name <INPUT TYPE=TEXT NAME="LastName"
SIZE=40><BR>
E-mail Address <INPUT TYPE=TEXT NAME="Email"
SIZE=40><BR>
Comments <TEXTAREA NAME="Comments" ROWS=5
COLS=40></TEXTAREA><BR>
<INPUT TYPE=SUBMIT NAME="Submit" VALUE="Submit">
<INPUT TYPE=RESET NAME="Reset" VALUE="Reset">
</FORM>
</BODY>
</HTML>

and the code for the HandleForm.php is 

<HTML>
<HEAD>
<TITLE>Form Results</TITLE>
</HEAD>
<BODY>
<?php

/* This page receives and handles the data generated
by "form.html". */
print "Your first name is $FirstName.<BR>\n";
print "Your last name is $LastName.<BR>\n";
print "Your E-mail Address is $Email.<BR>\n";
print "This is what you had to say:<BR>\n
$Comments<BR>\n";

?>
</BODY>
</HTML>

And the book suggested POST instead of GET because it
is stated that Post is secure and GET is not.

Thanks,
spellman


--- Miguel Cruz <[EMAIL PROTECTED]> wrote:
> On Wed, 15 May 2002, k spellman wrote:
> > Just opened a "How to" book today on PHP. Already
> > having problems and wouldn't mind an extra set of
> > eyes. My basic form does not produce results.Any
> > thoughts on this one?
> > 
> > http://www.hermengoode.com/php/form.html
> 
> Well, you don't show your source code, but if I had
> to guess I'd say you
> have a newish install of PHP and an oldish book, and
> you're trying to get
> the value of $LastName rather than
> $_GET['LastName'].
> 
> miguel
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--- End Message ---
--- Begin Message ---
The code for form.html is

<HTML>
<HEAD>
<TITLE>HTML Form</TITLE>
</HEAD>
<BODY>
<FORM ACTION="HandleForm.php" METHOD=POST>
First Name <INPUT TYPE=TEXT NAME="FirstName"
SIZE=40><BR>
Last Name <INPUT TYPE=TEXT NAME="LastName"
SIZE=40><BR>
E-mail Address <INPUT TYPE=TEXT NAME="Email"
SIZE=40><BR>
Comments <TEXTAREA NAME="Comments" ROWS=5
COLS=40></TEXTAREA><BR>
<INPUT TYPE=SUBMIT NAME="Submit" VALUE="Submit">
<INPUT TYPE=RESET NAME="Reset" VALUE="Reset">
</FORM>
</BODY>
</HTML>

and the code for the HandleForm.php is 

<HTML>
<HEAD>
<TITLE>Form Results</TITLE>
</HEAD>
<BODY>
<?php

/* This page receives and handles the data generated
by "form.html". */
print "Your first name is $FirstName.<BR>\n";
print "Your last name is $LastName.<BR>\n";
print "Your E-mail Address is $Email.<BR>\n";
print "This is what you had to say:<BR>\n
$Comments<BR>\n";

?>
</BODY>
</HTML>

And the book suggested POST instead of GET because it
is stated that Post is secure and GET is not.

Thanks,
spellman

--- Justin French <[EMAIL PROTECTED]> wrote:
> Show us the code for processing the form!
> 
> My guess is your book uses code with $firstname
> rather than
> $_POST['firstname']... given that your version of
> PHP is probably new
> (4.2.x), register_globals is prolly OFF in your
> php.ini config file.
> 
> Justin
> 
> 
> 
> on 16/05/02 12:13 PM, k spellman
> ([EMAIL PROTECTED]) wrote:
> 
> > Just opened a "How to" book today on PHP. Already
> > having problems and wouldn't mind an extra set of
> > eyes. My basic form does not produce results.Any
> > thoughts on this one?
> > 
> > http://www.hermengoode.com/php/form.html
> > 
> > Thanks!
> > spellman
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > LAUNCH - Your Yahoo! Music Experience
> > http://launch.yahoo.com
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--- End Message ---
--- Begin Message ---
On Wed, 15 May 2002, k spellman wrote:
> /* This page receives and handles the data generated
> by "form.html". */
> print "Your first name is $FirstName.<BR>\n";
> print "Your last name is $LastName.<BR>\n";
> print "Your E-mail Address is $Email.<BR>\n";
> print "This is what you had to say:<BR>\n
> $Comments<BR>\n";

With newer installations of PHP, form data does not by default show up in 
eponymous variables. This has been discussed at great length here - just 
check the archives for any random day in the past month or so. 

For best results, write the print statement like this:

   print "Your first name is {$_REQUEST['FirstName']}.<br>\n";

and you'll get the results you're after.

> And the book suggested POST instead of GET because it
> is stated that Post is secure and GET is not.

That's ridiculous. Buy a new book.

miguel

--- End Message ---
--- Begin Message ---
> /* This page receives and handles the data generated
> by "form.html". */
> print "Your first name is $FirstName.<BR>\n";
> print "Your last name is $LastName.<BR>\n";
> print "Your E-mail Address is $Email.<BR>\n";
> print "This is what you had to say:<BR>\n
> $Comments<BR>\n";

More than likely you're using 4.2.0 which had global variables turned off by
default.  You're not the first one to experience this problem and probably
won't be the last.

You'll need to call the files using a global array....since you're using the
post method

$_POST['$FirstName']

would be the correct variable to use to get the FirstName data from the
form.
Or an easier approach would be

$_REQUEST['$FirstName']

which will provide you with the results no matter what method you use to
post the form.

> And the book suggested POST instead of GET because it
> is stated that Post is secure and GET is not.

hehehahaha =)  The book is dead wrong.  Both formats are insecure, the main
difference is that the GET method displays the variables in the url string
whereas post caches the variable values in the browser.  There are
advantages and disadvantages to both but neither of which have the advantage
of security.  IMO POST is better to use generally since it presents much
cleaner URLs to the end user, but I find the GET method much better when
debugging a script designed to process a form submission.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
Are you using post or get?  I imagine you'd run into some limitations
using get.

On Tue, 14 May 2002 12:33:22 +1200, Enrique Vadillo wrote:

> Hi,
> 
> I'm not sure if this is purely a PHP problem but here it goes:
> 
> i have a form that sends text data to a PHP script, i have some textarea
> field which goes like this:
> 
> <TEXTAREA wrap="soft" NAME="mynote" ROWS=15 COLS=70></TEXTAREA>
> 
> everytime i POST this, $mynote is truncated to 1867 bytes, i have
> repeatedly tried to submit text 2500 bytes long but it's always
> truncated to that size -btw there is no javascript or anything in the
> middle that might modify the size- my questions is: do i have to setup
> anything special in my php.ini? i have this in my php.ini:
> 
> post_max_size = 30M
> 
> I have also noticed that Hotmail has no problem sending textarea input
> 2500 bytes long or more using exactly the same tags.. what's wrong then?
> I use Apache 1.3.23 and PHP 4.1.1 (on RedHat 7.1)
> 
> if anyone has encountered this problem b4, i'd appreciate some help.
> 
> Enrique-
> 
> 
> 
> _________________________________________________________________ Únase
> con MSN Hotmail al servicio de correo electrónico más grande del mundo.
> http://www.hotmail.com
--- End Message ---
--- Begin Message ---
I need to generate every possible combination of the the values in an array. 
For example, if...

$array = Array("A", "B", "C");

I want to be able to do something like

print_r(magic_function($array));

which would output

Array
(
        [0] => "ABC"
        [1] => "ACB"
        [2] => "BAC"
        [3] => "BCA"
        [4] => "CAB"
        [5] => "CBA"
)

I really have no idea where to begin. The best lead I can think of is that 
there are going to be n! elements in the output array, where n is the size of 
the input array.

Any help would be greatly appreciated.


Evan



-- 
Think not those faithful who praise all thy words and actions, but those who 
kindly reprove thy faults.

Socrates

--- End Message ---
--- Begin Message ---
recursive function, passing back in the array, minus the current position
and current combination. when array is empty, use current combination.

um... something like (but not tested)

function comby($arr, $comb = "")
{
  $num = count($arr);
  if ($num == 0)
  {
    echo $comb;
    return;
  }

  for ($i = 0; $i < $num; $i++)
  {
    $tmp_comb = $comb . $arr[$i];
    $tmp_arr = $arr;
    array_splice($arr, $i, 1);
    comby($tmp_arr, $comb);
  }
}

$array = Array("A", "B", "C");
comby($array);

-----Original Message-----
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 2:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Generate every possible combination


I need to generate every possible combination of the the values in an array.

For example, if...

$array = Array("A", "B", "C");

I want to be able to do something like

print_r(magic_function($array));

which would output

Array
(
        [0] => "ABC"
        [1] => "ACB"
        [2] => "BAC"
        [3] => "BCA"
        [4] => "CAB"
        [5] => "CBA"
)

I really have no idea where to begin. The best lead I can think of is that 
there are going to be n! elements in the output array, where n is the size
of 
the input array.

Any help would be greatly appreciated.


Evan



-- 
Think not those faithful who praise all thy words and actions, but those who

kindly reprove thy faults.

Socrates


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Evan Nemerson wrote:
> I need to generate every possible combination of the the values in an array. 
> For example, if...
> 
> $array = Array("A", "B", "C");
> 
> I want to be able to do something like
> 
> print_r(magic_function($array));
> 
> which would output
> 
> Array
> (
>       [0] => "ABC"
>       [1] => "ACB"
>       [2] => "BAC"
>       [3] => "BCA"
>       [4] => "CAB"
>       [5] => "CBA"
> )
> 
> I really have no idea where to begin. The best lead I can think of is that 
> there are going to be n! elements in the output array, where n is the size of 
> the input array.
> 
> Any help would be greatly appreciated.
> 
> 
> Evan
> 
> 
> 

for ($x=ord("A");$x<=ord("Z");$x++)
{ for($y=ord("A");$y<=ord("Z");$y++)
   { for($z=ord("A");$z<=ord("Z");$z++)
     { $array[]=chr($x).chr($y).char($z);
     }
   }
}

is a quick suggestion.  Haven't tested it.


--- End Message ---
--- Begin Message ---
Austin Marshall wrote:
> Evan Nemerson wrote:
> 
>> I need to generate every possible combination of the the values in an 
>> array. For example, if...
>>
>> $array = Array("A", "B", "C");
>>
>> I want to be able to do something like
>>
>> print_r(magic_function($array));
>>
>> which would output
>>
>> Array
>> (
>>     [0] => "ABC"
>>     [1] => "ACB"
>>     [2] => "BAC"
>>     [3] => "BCA"
>>     [4] => "CAB"
>>     [5] => "CBA"
>> )
>>
>> I really have no idea where to begin. The best lead I can think of is 
>> that there are going to be n! elements in the output array, where n is 
>> the size of the input array.
>>
>> Any help would be greatly appreciated.
>>
>>
>> Evan
>>
>>
>>
> 
> for ($x=ord("A");$x<=ord("Z");$x++)
> { for($y=ord("A");$y<=ord("Z");$y++)
>   { for($z=ord("A");$z<=ord("Z");$z++)
>     { $array[]=chr($x).chr($y).char($z);
>     }
>   }
> }
> 
> is a quick suggestion.  Haven't tested it.
> 
> 

never mind, wasn't paying attention.

--- End Message ---
--- Begin Message ---
Evan Nemerson wrote:
> I need to generate every possible combination of the the values in an array. 
> For example, if...
> 
> $array = Array("A", "B", "C");
> I really have no idea where to begin. The best lead I can think of is that 
> there are going to be n! elements in the output array, where n is the size of 
> the input array.

Correct, this also implies that using more than say 20 elements (20!) 
will take *loads* of CPU time and memory. Anyway, I did such a program 
once to test the performance of VB versus Java but alas I dont keep it 
around. It was recursive tho.

A quick check on google came up with some code here:

http://www.delphiforfun.org/Programs/Permutes_1.htm

and som theory here:

http://www.theory-of-evolution.org/Main/chap4/permutations_7.htm

--- End Message ---
--- Begin Message ---
Hi
What I do is use the function GetImageSize(), if that returns x and/or y = 
0 it probably isn't an image file and dump it.
Tom

At 05:06 AM 16/05/2002, you wrote:
>On Wed, 15 May 2002, Andre Dubuc wrote:
> > Actually, I figured out how to do it: a combination of  checking:
> > if ( $_REQUEST['pix']['type'] == "image/jpeg")}  blah, blah, blah
>
>I'm pretty certain that the 'type' that appears here is just derived from
>the file name, and therefore is not trustworthy. Someone please correct me
>if I'm wrong (as if that's ever a problem...)
>
>miguel
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
2 things that are foriegn to me.  Im trying to construct a class to 
handle errors.
I started out trying to make it recognise errors in the first place and 
then expand, but Im having difficulty.

class.php
<?php

class eh
{
    function eh()
    {
        error_reporting (E_ERROR | E_WARNING | E_PARSE);
        set_error_handler($this->errorhandler);
    }

    function errorhandler($type, $str, $file, $line)
    {
        switch ($type)
        {
            case E_ERROR:
            echo 'ERROR OCCURED';
            break;

            case E_WARNING:
            echo 'YOUR WARNING!';
            break;
        }
    }
}

?>
-----------------------------------------------------------
test.php
<?php

require_once('./class.php');
$eh = new eh();

join (':', $next);

?>

Whenever I run test.php, I get the regular php error page instead 'ERROR 
OCCURED'.  Im not sure if I can feed set_error_handler the way I did.
Does anyone see anything wrong with this piece of code?
Thanks

--- End Message ---
--- Begin Message ---
Have a look at this page

http://www.php.net/manual/en/function.set-error-handler.php

and at the user comments dated: "09-Sep-2001 03:16" and "01-Mar-2002 11:52"

these might help you

Martin


-----Original Message-----
From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 3:52 PM
To: PHP
Subject: [PHP] class and error handling


2 things that are foriegn to me.  Im trying to construct a class to 
handle errors.
I started out trying to make it recognise errors in the first place and 
then expand, but Im having difficulty.

class.php
<?php

class eh
{
    function eh()
    {
        error_reporting (E_ERROR | E_WARNING | E_PARSE);
        set_error_handler($this->errorhandler);
    }

    function errorhandler($type, $str, $file, $line)
    {
        switch ($type)
        {
            case E_ERROR:
            echo 'ERROR OCCURED';
            break;

            case E_WARNING:
            echo 'YOUR WARNING!';
            break;
        }
    }
}

?>
-----------------------------------------------------------
test.php
<?php

require_once('./class.php');
$eh = new eh();

join (':', $next);

?>

Whenever I run test.php, I get the regular php error page instead 'ERROR 
OCCURED'.  Im not sure if I can feed set_error_handler the way I did.
Does anyone see anything wrong with this piece of code?
Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I modified my example against user comment dated "01-Mar-2002 11:52" and 
I got the desired output.
Thanks


Martin Towell wrote:

>Have a look at this page
>
>http://www.php.net/manual/en/function.set-error-handler.php
>
>and at the user comments dated: "09-Sep-2001 03:16" and "01-Mar-2002 11:52"
>
>these might help you
>
>Martin
>
>
>-----Original Message-----
>From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, May 16, 2002 3:52 PM
>To: PHP
>Subject: [PHP] class and error handling
>
>
>2 things that are foriegn to me.  Im trying to construct a class to 
>handle errors.
>I started out trying to make it recognise errors in the first place and 
>then expand, but Im having difficulty.
>
>class.php
><?php
>
>class eh
>{
>    function eh()
>    {
>        error_reporting (E_ERROR | E_WARNING | E_PARSE);
>        set_error_handler($this->errorhandler);
>    }
>
>    function errorhandler($type, $str, $file, $line)
>    {
>        switch ($type)
>        {
>            case E_ERROR:
>            echo 'ERROR OCCURED';
>            break;
>
>            case E_WARNING:
>            echo 'YOUR WARNING!';
>            break;
>        }
>    }
>}
>
>?>
>-----------------------------------------------------------
>test.php
><?php
>
>require_once('./class.php');
>$eh = new eh();
>
>join (':', $next);
>
>?>
>
>Whenever I run test.php, I get the regular php error page instead 'ERROR 
>OCCURED'.  Im not sure if I can feed set_error_handler the way I did.
>Does anyone see anything wrong with this piece of code?
>Thanks
>
>
>  
>


--- End Message ---
--- Begin Message ---
 --- Analysis & Solutions
<[EMAIL PROTECTED]> wrote: > Olav:

> Perhaps because you're ignoring what I said.
 
> This will generate an error message if there's no
> player variable in the 
> request string and you have error reporting set high
> enough.  Evaluate 
> for "empty($_GET['player'])"
> 
> 
> 
> Why are you testing for playername again?  You
> already know it's there 
> because your'e in the else after the "if
> (!$playername)" statement.
> 
> 
> Hmm...  You're sticking playername into the Session
> array.  I haven't
> used PHP's session handling, but some things seem
> odd here.  Where did
> you start the session?  Also, how is your relocated
> page going to know 
> about the session?  I don't see any code here that
> performs those tasks.
> 
> Enjoy,
> 
> --Dan
> 
> -- 


>From the manual:
With $_SESSION or  $HTTP_SESSION_VARS, there is no
need to use
session_register()/session_unregister()/session_is_registered()
functions. Users can access session variable like a
normal variable. 

I'm pretty sure the sessioning works perfectly. And it
is not the problem. The problem is Header(), which
fails without any error or other output. You can only
look at the other mails posted on this subject, that
it is a major problem in v 4.2.1. Until it is solved,
I'll work on something else...

Thanks for your time.


=====
Olav Bringedal
jaggu.org

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
Hello list,

I have a php program which executes a heavy mysql query upon request.
Normally, it should not be requested too often, but I am afraid
malicious user trying to massively call this program.  I am considering
to use $HTTP_REFERER to restrict the connection source, but is it worth
trusting? Is it possible for a hacker to make an identical $HTT_REFERER
in the header? I have no idea how $HTTP_REFERER is made, is it made from
the http client and put in the http header?

If I can't trust $HTTP_REFERER, how can I deny malicious attack like
that?


-- 
Patrick Hsieh <[EMAIL PROTECTED]>
GPG public key http://pahud.net/pubkeys/pahudatpahud.gpg

--- End Message ---
--- Begin Message ---
> I have a php program which executes a heavy mysql query upon request.
> Normally, it should not be requested too often, but I am afraid
> malicious user trying to massively call this program.  I am considering
> to use $HTTP_REFERER to restrict the connection source, but is it worth
> trusting? Is it possible for a hacker to make an identical $HTT_REFERER
> in the header? I have no idea how $HTTP_REFERER is made, is it made from
> the http client and put in the http header?
>
> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

An HTTP_REFERER header is sent by the client browser...which means it is
mimicable (and quite easily I might add).  Although adding HTTP_REFERER
restrictions to a script may add a small bit of security against script
kiddies it by no means is a true method of defence against hackers.  The
best thing you can do is temporarily record the IPs of connections to your
script, and then block IPs that connect to the script too often directly
from your routing table.  It doesn't necessarily stop those using proxies
but definately is more reliable than an HTTP_REFERER protection scheme.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
> Is it possible for a hacker to make an identical $HTT_REFERER
> in the header? I have no idea how $HTTP_REFERER is made, is it made
> from the http client and put in the http header?

Thats exactly how its done. The user agent (browser) takes the URL it was
on when a link was clicked / form submitted etc and places that into a
HTTP header which is sent back to the server. This information can be very
easily faked and is widely implemented into spam / attack bots.
> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

The best way is authentication. I dont know what the load on your server
is generating, but Im pretty sure there will be an alternative way of
doing it.
eg: on request do the load-based method and dump the details into a
temporary table with a timestamp of the last time it was updated. If you
get the same request within x minutes (or hours / days) then serve up the
generated information from the table.
This would mean that your db no longer gets hammered if malitious users
were to launch 5000 requests at it in the space of 10 mins, it would just 
do the big DB operation the once.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer


--- End Message ---
--- Begin Message ---
> Craig Vincent wrote:
> The best thing you can do is temporarily record the
> IPs of connections to your script, and then block IPs that connect to
> the script too often directly from your routing table.  It doesn't
> necessarily stop those using proxies but definately is more reliable
> than an HTTP_REFERER protection scheme.

If you are expecting to have a wide (uncontrolled) audience for the data
you are outputting I would strongly suggest against doing this as the
majority of major ISPs operate transparent web proxies - where everyone
from that ISP will appear to be coming from the same IP.
If I was a malitious user, I would get a block of 50 IPs, place them on a
unix box and then bind randomly to the IPs when making the calls... making
the work around for this security measure trivial.
Im not saying you shouldnt implement any method of security, as some
security is far better than none! Just making sure that everyone is aware
of the consequences and implications.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer


--- End Message ---
--- Begin Message ---
Hello "Dan Hardiker" <[EMAIL PROTECTED]>,

Then, it is not safe to do IP-based blocking, right? Any alternative?


On Thu, 16 May 2002 10:10:44 +0100 (BST)
"Dan Hardiker" <[EMAIL PROTECTED]> wrote:

> > Craig Vincent wrote:
> > The best thing you can do is temporarily record the
> > IPs of connections to your script, and then block IPs that connect to
> > the script too often directly from your routing table.  It doesn't
> > necessarily stop those using proxies but definately is more reliable
> > than an HTTP_REFERER protection scheme.
> 
> If you are expecting to have a wide (uncontrolled) audience for the data
> you are outputting I would strongly suggest against doing this as the
> majority of major ISPs operate transparent web proxies - where everyone
> from that ISP will appear to be coming from the same IP.
> If I was a malitious user, I would get a block of 50 IPs, place them on a
> unix box and then bind randomly to the IPs when making the calls... making
> the work around for this security measure trivial.
> Im not saying you shouldnt implement any method of security, as some
> security is far better than none! Just making sure that everyone is aware
> of the consequences and implications.
> 
> -- 
> Dan Hardiker [[EMAIL PROTECTED]]
> ADAM Software & Systems Engineer
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Patrick Hsieh <[EMAIL PROTECTED]>
GPG public key http://pahud.net/pubkeys/pahudatpahud.gpg

--- End Message ---
--- Begin Message ---
> Then, it is not safe to do IP-based blocking, right? Any alternative?

As I mentioned in an earlier post (my original reply to you):

> If I can't trust $HTTP_REFERER, how can I deny malicious attack like
> that?

The best way is authentication... that is asking the user for a username
and password before doing getting the data (then you can block out
specific users should they attack you - but you can only do that after the
incident). There are other methods - I dont know what the load on your
server is generating, but Im pretty sure there will be an alternative way
of doing it.

eg: on request do the load-based method and dump the details into a
temporary table with a timestamp of the last time it was updated. If you
get the same request within x minutes (or hours / days) then serve up the
generated information from the table.


This would mean that your db no longer gets hammered if malitious users
were to launch 5000 requests at it in the space of 10 mins, it would just
do the big DB operation the once.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer


--- End Message ---
--- Begin Message ---
This is a basic question but I'm  a basic fellow. If I have an array

$timespread = array("12am-01am"=>0);
$timespread["01am-02am"]=0;
$timespread["02am-03am"]=0; etc

Using $time which is a number, I want to add 1 to the value of
$timespread[$time] without changing the key so if $time =1
I want to have $timespread["01am-02am"]=1;

Using $timespread[$time]+=1; doesn't work.

any ideas?




--- End Message ---
--- Begin Message ---
Josh Edwards wrote:
> This is a basic question but I'm  a basic fellow. If I have an array
> 
> $timespread = array("12am-01am"=>0);
> $timespread["01am-02am"]=0;
> $timespread["02am-03am"]=0; etc
> 
> Using $time which is a number, I want to add 1 to the value of
> $timespread[$time] without changing the key so if $time =1
> I want to have $timespread["01am-02am"]=1;
> 
> Using $timespread[$time]+=1; doesn't work.

Nope, you must say

$timespread["01am-02am"] += 1

--- End Message ---
--- Begin Message ---
>> This is a basic question but I'm  a basic fellow. If I have an array
>>
>> $timespread = array("12am-01am"=>0);
>> $timespread["01am-02am"]=0;
>> $timespread["02am-03am"]=0; etc
>>
>> Using $time which is a number, I want to add 1 to the value of
>> $timespread[$time] without changing the key so if $time =1
>> I want to have $timespread["01am-02am"]=1;
>>
>> Using $timespread[$time]+=1; doesn't work.
>
> Nope, you must say
>
> $timespread["01am-02am"] += 1

I think the problem here is your understanding on how array key's work.
The following method would be far more appropriate:
<?php

// Create 00 to 23 in the array
//  00 will store hits between midnight and 1am,
//  01 for 1am - 2am ...
//  23 for 11pm - midnight
$timespread = array();
for ($cnt=0; $cnt<24; $cnt++) {
  $timespread[str_pad($cnt,2,'0',STR_PAD_LEFT)] = 0;
}

/* here you must work out the hour, and round *DOWN* (truncate off the
minutes .. eg: for the current time */
$timespread[date("H")]++;

?>

follow or have I lost ya?

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer


--- End Message ---
--- Begin Message ---
Jon Yates wrote:
> People, hope you can help. The below IF statement is getting a PARSE error.
> Can anyone spot why?
> 
>   if (($this->checkReferralCB($this->benefitRef, $this->benefitNo,
> $this->childDOB)) 
>   && (!$this->checkLocation($this->post, "W")) && (!empty($this->childDOB)))
>   || ($this->checkPregnancy($this->benefitRef, $this->benefitNo))

Geez, use your editors paren-matching capabilities. Any modern editor 
should notify you that you are missing the last parentheses in if 
clause. I recommend emacs or vi.

--- End Message ---
--- Begin Message ---
FYI...

I'm using sessions successfully using PHP v4.1.0 on Windows NT.

Neil

Edward Marczak wrote:
> 
> 
>*************************************************************************************************************
> This Message Was Virus Checked With : SAVI 3.57 May 2002 Last Updated 13th May 2002
> 
>*************************************************************************************************************
> 
> On 5/15/02 4:30 PM, "SHEETS,JASON (Non-HP-Boise,ex1)"
> [EMAIL PROTECTED] pressed the keys forming the message:
> 
> > Sessions under windows were broken for 4.1.x
> >
> > They were fixed in 4.2.x so you should upgrade.
> 
> Great - a definitive answer.  Thank you.  I'll just have to make note of the
> differences between 4.2.x and older versions.
> 
> Thanks everyone who sent over tips and suggestions.
> --
> Ed Marczak
> [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Neil Freeman                   Design Engineer          |
| Phone: +44 (0)1420 526600      Fax  : +44 (0)1420 23741 |
| Email: [EMAIL PROTECTED]                           |
|        [EMAIL PROTECTED]                            |
| Web  : www.curvedvision.com                             |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
--- End Message ---
--- Begin Message ---
Robert Rothe wrote:

 > Thanks.  So the next() and prev() functions just traverse an array
 > some type of linked list?  This is what precludes direct access to
 > specific elements?

Yup, there is an internal position pointer in every array which are 
used by most array_ functions.

--- End Message ---
--- Begin Message ---

I have a query 

"select cust_fnn, cust_name, agroup_access.group_access_cust from cust,
agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by cust.cust_name"

The 2 tables are as follows

agroup_access

agroup_access_id                agroup_access_group
agroup_access_cust

1                               9
1610005847
2                               9
0265478986
3                               9
1610010254

Cust

cst_id  cust_name               cust_fnn                (ect....)
1               xxx                     1610005847
2               xxxxx                   0265478986

And so on.... 200+ records

What I am trying to do is pull all records from cust where cust_fnn !=
agroup_access_cust && agroup_access_group=9..

What I am getting is all cust_fnn records but 3 of each and only 2 in
the case of it matching the
agroup_access_cust..

Can anyone see what I may have dome wrong..

I am trying to display them in a drop down box, below is the function
for the drop down box and the line to call the function..

combo5("fnn","select cust_fnn, cust_name,
agroup_access.group_access_cust from cust, agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by
cust.cust_name","");

function combo5($name, $query, $sel) {
        $dbq=mysql_query($query);
        $html="<select name=\"$name\" class=\"longdd\">\n";
        while( $data = mysql_fetch_array($dbq) ) {
                if($data[cust_fnn]==$sel)
                        $html.="<option value=$data[cust_fnn]
selected>$data[cust_name] : $data[cust_fnn]</option>\n";
                else
                        $html.="<option
value=$data[cust_fnn]>$data[cust_name]: $data[cust_fnn]</option>\n";
        }
        $html.="</select>\n";
        return $html;
}

Hope someone can help...

-------
Chris Kay, Eleet Internet Services
[EMAIL PROTECTED]
-------

--- End Message ---
--- Begin Message ---
[snip]
"select cust_fnn, cust_name, agroup_access.group_access_cust from cust,
agroup_access where
agroup_access.group_access_group='$id' &&
cust.cust_fnn!=agroup_access.group_access_cust order by cust.cust_name"
[/snip]

try this (note syntactical differences);
"select cust_fnn, cust_name, agroup_access.group_access_cust
from cust, agroup_access
where agroup_access.group_access_group = '$id'
and cust.cust_fnn <> agroup_access.group_access_cust
order by cust.cust_name"

HTH!

Jay

--- End Message ---
--- Begin Message ---
Hi all,


I want to select some records with e.g. ID's 1,3,7 and 8
How can this be done best?

is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??


thx. Wilbert


-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
Nothing to do with PHP...

SELECT * FROM myTable WHERE ID IN (1,3,7,9);

If you're using MySQL, read the manual:

http://www.mysql.com/documentation/mysql/bychapter/

---John Holmes...

> -----Original Message-----
> From: Wilbert Enserink [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 7:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] select statement
> 
> Hi all,
> 
> 
> I want to select some records with e.g. ID's 1,3,7 and 8
> How can this be done best?
> 
> is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??
> 
> 
> thx. Wilbert
> 
> 
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -------------------------

--- End Message ---
--- Begin Message ---
On Thursday 16 May 2002 19:19, Wilbert Enserink wrote:
> Hi all,
>
>
> I want to select some records with e.g. ID's 1,3,7 and 8
> How can this be done best?
>
> is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ??

Is this a PHP question?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It took me fifteen years to discover that I had no talent for writing,
but I couldn't give it up because by that time I was too famous.
                -- Robert Benchley
*/

--- End Message ---

Reply via email to