php-general Digest 28 Aug 2004 21:28:43 -0000 Issue 2963

Topics (messages 194992 through 195032):

Variable variables
        194992 by: JanBro
        194993 by: Marek Kilimajer
        195003 by: M. Sokolewicz
        195024 by: Justin Patrin

Re: Running system command or exec as differnet Users
        194994 by: Marek Kilimajer

mail filtering ... procmail + php query
        194995 by: vivek athalye
        194999 by: Jason Wong

Sessions NOT working - somebody please help me!
        194996 by: gregosh
        194997 by: Jason Wong
        194998 by: gregosh

Re: Open a stream to the shell..
        195000 by: M. Sokolewicz

Bouncer Test
        195001 by: Aidan Lister

Object Overloading in PHP5
        195002 by: Daniel Schierbeck
        195005 by: Stefan
        195006 by: Daniel Schierbeck

Re: Dynamic Function with return?
        195004 by: Michal Migurski

Re: PHP Oficial Certification
        195007 by: Chris Shiflett
        195008 by: Chris Shiflett
        195009 by: Chris Shiflett
        195010 by: Chris Shiflett
        195011 by: Chris Shiflett
        195012 by: Chris Shiflett
        195013 by: John Nichel
        195014 by: Yann Larrivee
        195019 by: Chris Shiflett
        195021 by: John Nichel

Why won't my echo won't work? [newbie question]
        195015 by: Bestman4unowwa.aol.com
        195017 by: John Nichel
        195018 by: Bestman4unowwa.aol.com
        195020 by: John Nichel
        195022 by: Bestman4unowwa.aol.com
        195023 by: Bestman4unowwa.aol.com

Re: PHP/MySQL fatal error
        195016 by: gc

Re: Dynamic HTML Creation
        195025 by: Sam Hobbs
        195026 by: Sam Hobbs
        195028 by: Sam Hobbs
        195029 by: Jason Davidson

html tabs
        195027 by: Michael Gale
        195030 by: Brent Clements

Newbie.  Posting to backend MySQL database
        195031 by: Aidan
        195032 by: M. Sokolewicz

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 ---
Hi List,



I'm  using PHP5 with global variables off. I've got  around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the manual this
is not possible.

Now comes my Questoin, how do I receive my variables  which have the form
$a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general?



Who do I make  $data = $_REQUEST['a_123'] work ??? I'd hate to set global
variables to on, as I'm dealing with sensitive data.



Thx

JanBro

--- End Message ---
--- Begin Message --- JanBro wrote:
Hi List,



I'm  using PHP5 with global variables off. I've got  around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the manual this
is not possible.

Now comes my Questoin, how do I receive my variables  which have the form
$a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general?



Who do I make  $data = $_REQUEST['a_123'] work ??? I'd hate to set global
variables to on, as I'm dealing with sensitive data.

$form_var = 'a_123';

$data = $_REQUEST[$form_var];
--- End Message ---
--- Begin Message ---
Janbro wrote:

Hi List,



I'm  using PHP5 with global variables off. I've got  around 20 dynamically
generated forms with a total of 300 different variables sent thru these
forms. I'd like to use variable variables, but according to the manual this
is not possible.

Now comes my Questoin, how do I receive my variables  which have the form
$a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general?
euh, if you're gonna do that automatically, then that's *exactly* the same as setting register_globals = On.



Who do I make $data = $_REQUEST['a_123'] work ???
what's wrong with that? if it gets sent under the name 'a_123' then that'll work fine.... I don't see your problem :S

I'd hate to set global
variables to on, as I'm dealing with sensitive data.



Thx

JanBro

--- End Message ---
--- Begin Message ---
On Sat, 28 Aug 2004 11:43:13 +0200, JanBro <[EMAIL PROTECTED]> wrote:
> Hi List,
> 
> I'm  using PHP5 with global variables off. I've got  around 20 dynamically
> generated forms with a total of 300 different variables sent thru these
> forms. I'd like to use variable variables, but according to the manual this
> is not possible.
> 
> Now comes my Questoin, how do I receive my variables  which have the form
> $a_123 or $a_124[]. Is there a workaround for PHP5 or PHP in general?
> 
> Who do I make  $data = $_REQUEST['a_123'] work ??? I'd hate to set global
> variables to on, as I'm dealing with sensitive data.
> 

Your question makes absolutely no sense. You can do $_REQUEST['a_123']
just fine. If what you want is to loop through them...
foreach($_REQUEST as $key => $val) {
  //....
}

or

foreach($variableNames as $var) {
  $_REQUEST[$var]
}

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message --- Paul Danko wrote:
Is it possible to run a command on the system using the system() or
exec() commands run as a specific user if I have the username and
password?
i.e.
[EMAIL PROTECTED]>su userNo1
[EMAIL PROTECTED]>/home/server/executeScript
all in a php system() or exec() call..

http://expect.nist.gov/

--- End Message ---
--- Begin Message ---
hi,
 
after looking at the imap functions...i was wondering how the mail filtering works...
afaik procmail does that...but is there any std way / php functions to set the filters?
i know the filtering depends on mail server...but if we assume that it is done using 
procmail...
is it somehow possible to write some php code that will take the input from user and 
generate the .procmailrc file?
what problems could occure?
 
any ideas?
 
thanks
- Vivek
 

                
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

--- End Message ---
--- Begin Message ---
On Saturday 28 August 2004 18:36, vivek athalye wrote:

> after looking at the imap functions...i was wondering how the mail
> filtering works... afaik procmail does that...

If by filtering you mean imap_search() then that works in a completely 
different way to procmail.

> but is there any std way /
> php functions to set the filters? i know the filtering depends on mail
> server...but if we assume that it is done using procmail... is it somehow
> possible to write some php code that will take the input from user and
> generate the .procmailrc file? 

procmail recipes are simply plaint text files. Just use php's file handling 
functions to read and write them.

-- 
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 only function of economic forecasting is to make astrology look 
respectable.
                -- John Kenneth Galbraith
*/

--- End Message ---
--- Begin Message ---
Sorry for posting this problem again but it's been really driving me crazy.
I've reinstalled Apache and PHP for the 5th time and the result is still the
same - sessions work only when using <a href="b.php">click</a> link. When
using header("location: b.php"); the session information is lost and a new
cookie is set in the temp dir. My work has been waiting for a week because
of this problem and I can't go on with it. I'm out of ideas. What is going
on??

Greg

--- End Message ---
--- Begin Message ---
On Saturday 28 August 2004 18:52, gregosh wrote:
> Sorry for posting this problem again but it's been really driving me crazy.
> I've reinstalled Apache and PHP for the 5th time and the result is still
> the same - sessions work only when using <a href="b.php">click</a> link.
> When using header("location: b.php"); the session information is lost and a
> new cookie is set in the temp dir. My work has been waiting for a week
> because of this problem and I can't go on with it. I'm out of ideas. What
> is going on??

1) Use a fully qualified URL for the redirection
2) session_write_close() before you redirect
3) In future search the archives first, this type of problem has been asked 
and answered many times before

-- 
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
------------------------------------------
/*
Design flaws travel in groups
                -- Sad Truths of Life n2
*/

--- End Message ---
--- Begin Message ---
U�ytkownik "Jason Wong" <[EMAIL PROTECTED]> napisa� w wiadomo�ci
news:[EMAIL PROTECTED]
> On Saturday 28 August 2004 18:52, gregosh wrote:
> > Sorry for posting this problem again but it's been really driving me
crazy.
> > I've reinstalled Apache and PHP for the 5th time and the result is still
> > the same - sessions work only when using <a href="b.php">click</a> link.
> > When using header("location: b.php"); the session information is lost
and a
> > new cookie is set in the temp dir. My work has been waiting for a week
> > because of this problem and I can't go on with it. I'm out of ideas.
What
> > is going on??
>
> 1) Use a fully qualified URL for the redirection
> 2) session_write_close() before you redirect
> 3) In future search the archives first, this type of problem has been
asked
> and answered many times before


 session_write_close() didn't help. After yet another reinstallation fully
qualified URL seems to have started working. However it hadn't helped
before - I'd tried it several times. So to be honest I still don't know why
but it started working. Thanks

Greg

--- End Message ---
--- Begin Message --- As of PHP 4.3.0 you can use the proc_* functions (proc_open & proc_close in PHP 4.3.0+ and proc_get_status, proc_nice and proc_terminate as of PHP 5).

If you don't have access to that, you can use the following:
use shell_exec to create a process, and make it send all output to some temporary file. Then, instead of getting it directly, you just read the contents of that temporary file :)


eg:
$stream = fopen('cvs server .... > /tmp/cvsOutput', 'w+');
just read it from /tmp/cvsOutput, and write to the $stream :)

hope it helps,
- Tul

Joel Kitching wrote:
Hello, is it possible to open a stream in which I can write commands
and read output from them to a shell like bash?  I want to do this
because this program can not be completed with just a `backtick` or
shell_exec() command, as it's somewhat user-interactive.

As an example, let's say I want to get cdecl to explain to me what
"char *horse" means.  I would type:

# <i>cdecl</i>
Type `help' or `?' for help
cdecl> <i>explain char *horse</i>
declare horse as pointer to char
cdecl> <i>exit</i>

...where input is surrounded by <i>these</i>.  This would be difficult
or impossible to do with shell_exec, especially if halfway-through you
have to do some calculating before you can know what to ask cdecl
next.

So I want to know whether you can somehow open a stream to a shell,
and execute commands there.  Like...

$fp = fopen('/bin/bash', 'rw');
$output = fgets($fp);
fputs($fp, 'cdecl');
$output = fgets($fp);
$output = fgets($fp);
fputs($fp, 'explain char *horse');
$expl = fgets($fp);
/* Right now you could do some calculations and figure out what to do next. */
$output = fgets($fp);
fputs($fp, 'exit');
$output = fgets($fp);
fclose($fp);

Now this obviously wouldn't work, as it would overwrite the bash
executable if you had proper access, but it's just to get the idea
across.

So, does anyone know how I can do this?


--- End Message ---
--- Begin Message ---
Hello,

Another test to ensure we don't have any automatic replies or bouncing
addresses. Please don't reply, or you will be removed.

Thanks

--- End Message ---
--- Begin Message ---
Do you guys have any idea why this code:

        <?php

        class Foo
        {
                private $elem = array();
        
                public function __get ($prop)
                {
                        if (isset($this->elem[$prop])) {
                                return $this->elem[$prop];
                        } else {
                                trigger_error("Property '$prop' not defined", 
E_USER_ERROR);
                        }
                }
        
                public function __set ($prop, $val)
                {
                        $this->elem[$prop] = $val;
                }
        }

        $obj            = new Foo;
        $obj->a      = new Foo;
        $obj->a->b        = "Foobar";

        ?>

returns this:

Fatal error: Cannot access undefined property for object with overloaded property access in ... on line 24

Where line 24 is:

        $obj->a->b        = "Foobar";

?

--
Daniel Schierbeck

--- End Message ---
--- Begin Message ---
It's a bug.

     * Siehe http://bugs.php.net/bug.php?id=28444 ... und ...
     *       http://news.php.net/php.bugs/63652

A workaround is possible using __call( $name, $args) { return( $this->__get( $name)); }. But it sucks, since constructs using array indices are impossible as $obj->not_existing_attr()[0]

regards

Daniel Schierbeck wrote:

Do you guys have any idea why this code:

    <?php

class Foo
{
private $elem = array();
public function __get ($prop)
{
if (isset($this->elem[$prop])) {
return $this->elem[$prop];
} else {
trigger_error("Property '$prop' not defined", E_USER_ERROR);
}
}
public function __set ($prop, $val)
{
$this->elem[$prop] = $val;
}
}


    $obj         = new Foo;
    $obj->a     = new Foo;
    $obj->a->b     = "Foobar";

    ?>

returns this:

Fatal error: Cannot access undefined property for object with overloaded property access in ... on line 24

Where line 24 is:

    $obj->a->b     = "Foobar";

?


--- End Message ---
--- Begin Message --- Stefan wrote:
It's a bug.

     * Siehe http://bugs.php.net/bug.php?id=28444 ... und ...
     *       http://news.php.net/php.bugs/63652

A workaround is possible using __call( $name, $args) { return( $this->__get( $name)); }. But it sucks, since constructs using array indices are impossible as $obj->not_existing_attr()[0]

regards

Daniel Schierbeck wrote:

Do you guys have any idea why this code:

    <?php

class Foo
{
private $elem = array();
public function __get ($prop)
{
if (isset($this->elem[$prop])) {
return $this->elem[$prop];
} else {
trigger_error("Property '$prop' not defined", E_USER_ERROR);
}
}
public function __set ($prop, $val)
{
$this->elem[$prop] = $val;
}
}


    $obj         = new Foo;
    $obj->a     = new Foo;
    $obj->a->b     = "Foobar";

    ?>

returns this:

Fatal error: Cannot access undefined property for object with overloaded property access in ... on line 24

Where line 24 is:

    $obj->a->b     = "Foobar";

?

&"%&&!#�%�%&(/)((%&"&�%!#�%&%#!%#!"&�

--
Daniel Schierbeck

--- End Message ---
--- Begin Message ---
> This code works.  It calls the function and receives the appropriate
> return value.
>  But, is there a better way of doing this? It seems a bit round-a-bout.

Two options, details in the manual: call_user_func() or create_function().

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

--- End Message ---
--- Begin Message ---
--- Yann Larrivee <[EMAIL PROTECTED]> wrote:
> I personally dont beleive in this. It is juste another way to make
> money ;) Every body in the indeustry should know that.

Disclaimer: I assisted in the creation of the Zend PHP Certification.

You're right - this is another way to make money. However, based on my
interpretation of what you're suggesting, I think you're wrong about where
Zend intends to make that money. You really think they're going to make a
significant amount of money from people paying to take this certification?

Zend is a major company that will grow as PHP itself grows. This
certification helps PHP in the enterprise and make it seem like a more
legitimate option for companies looking to spend a lot of money on their
Web infrastructure. It also helps the entire PHP community, whether we get
certified or not. The more PHP is used, the more demand for PHP developers
there will be, the higher the salaries will be, etc.

> PHP.net has nothing to do with it, execpt that some people from the
> php.net team help put it together.

I assume you mean the PHP Group has nothing to do with it (php.net is a
domain name with no other significance), and you're right. Of course, Zend
is a much more appropriate entity for this. I'd prefer that the PHP Group
spend their time making PHP better and better.

> Hostely, what kind of market value does the certification has? Go get
> sun certified at least it has some sort of history and value.

You should think about that for a minute (apply some good common sense).

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- Yann Larrivee <[EMAIL PROTECTED]> wrote:
> Sorry another reply, there use to be the .geek php certification that
> was annonced on php.net then was removed right off like 2 days
> after)
> 
> Was it cause of some pressure of a companie and group of people?
> You tell me.

OK, I will. No.

> It was not really professional according to me, but you cant kill the
> competition like this, well at least not in opensource world.

I'd suggest that you not speak until you know what you're talking about. I
had volunteered to assist with the DotGeek certifications, and I can tell
you that no group of people other than the PHP community itself had
anything to do with that effort being stopped. In fact, in the forum
discussion surrounding it, most people were calling for Zend to create an
official one.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- John Nichel <[EMAIL PROTECTED]> wrote:
> Know what helps me get php jobs?  A resume that details almost 6
> years of php programming.

Disclaimer: I assisted in the creation of the Zend PHP Certification.

This is a very good point. However, and I'm speaking from experience, how
do you verify these types of statements when you're looking at more than a
hundred resumes? Zend gives me a place online to verify whether someone is
certified. With a pretty simple PHP script, I can automate this process.

What I've done in the past is have a simple online test that people take
when they apply, and this at least gives me some idea whether the
applicant is worth bringing in for an interview (or calling for a phone
interview). This has worked fairly well, but it's pretty time consuming
for me, and it definitely has problems: It has to either be very long (or
narrow in scope), I have no assurance that the applicant is the one taking
the test, and the applicant can't use these test results anywhere else.

Of course, certifications are only useful when the employer places the
right amount of value in them. I've seen certifications discussed in
several different communities over the past 10 years, and there always
seem to be extremists on both sides - certifications are worthless or
certifications will get you hired. A PHP certification only tells me that
the applicant knows PHP pretty well at a fundamental level. Whether they
can apply this knowledge, have the experience I'm looking for, have a
personality that works well in my team, and questions like these are
things I need to answer for myself in the hiring process. A certification
does not replace the need to do any work to find a good employee.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> OSS doesn't make a person better programmer, you can easily write
> an OSS app and still lack any knowledge of proper writting.

As a PHP security advocate for the last few years, I can tell you that
Curt is absolutely correct. In fact, poor open source applications written
in PHP are the top reason why PHP is considered insecure by the
programming community at large. This is a myth that is very difficult to
dispel, and it shows how powerful perception can be.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- Dan Joseph <[EMAIL PROTECTED]> wrote:
> Its good that there's a PHP Cert, PHP/Zend should endorse one.

http://www.zend.com/store/education/certification/zend-php-certification.php

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- John Nichel <[EMAIL PROTECTED]> wrote:
> I'm not big on certs myself. How many MCSE's have we seen who can't 
> find the power switch?  ;)

This was a big concern for me when working with Zend on their
certification. Especially in the open source communities, certifications
are not considered to be very valuable, and MCSE is the top reason for
this.

Of course, we tried very hard to make this one have a fair amount of value
but not just be difficult for the sake of being difficult. I think we did
a pretty good job, but only time will tell. Regardless of whether we did a
good job with it, the perception of certifications that comes from seeing
clueless MCSEs everywhere is definitely an obstacle within the community.
Outside of the community (where the PHBs reign), this certification is
definitely a good thing for all of us.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message --- Chris Shiflett wrote:
--- John Nichel <[EMAIL PROTECTED]> wrote:

I'm not big on certs myself. How many MCSE's have we seen who can't find the power switch? ;)


This was a big concern for me when working with Zend on their
certification. Especially in the open source communities, certifications
are not considered to be very valuable, and MCSE is the top reason for
this.

Of course, we tried very hard to make this one have a fair amount of value
but not just be difficult for the sake of being difficult. I think we did
a pretty good job, but only time will tell. Regardless of whether we did a
good job with it, the perception of certifications that comes from seeing
clueless MCSEs everywhere is definitely an obstacle within the community.
Outside of the community (where the PHBs reign), this certification is
definitely a good thing for all of us.

Chris

I understand where you're coming from, and I'm sure with your involvement in the project it will be top notch. I've always been impressed with your work, and am eagerly awaiting your O'Reilly book. ;) There used to be a time when certifications actually meant something (back when I got A+ certified, it was still considered to be a good thing in the tech community). Microsoft and their cookie cutter 'engineers' have really hurt the whole value of a certification in the tech sector. Those in management (non-tech) still like that piece of paper though, so that will help all legitimacy to PHP in that area. The geeks are going to be a tougher crowd to convince though.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Well i think in a way that getting programmers certified is one thing. I
also think that there might be a need for software certification.
Where it would validate that the standars have been fallowed, check the
quality of the code, check for security, check for proper docummentation
(comments, uml, user docs)
Some what like the ISO 9002 certification but more software oriented.

I think this would help php be more accepted by large compagnies, banks
and gouvernements. It would also reassure the company that buy a
software. The problem with this it would requiert alot of work!

Certify programmers is just solving one part of the problem.
Certifying software and business is the big piece and where money will
be involed.!


On Sat, 2004-08-28 at 11:57, Chris Shiflett wrote:
> --- Yann Larrivee <[EMAIL PROTECTED]> wrote:
> > I personally dont beleive in this. It is juste another way to make
> > money ;) Every body in the indeustry should know that.
> 
> Disclaimer: I assisted in the creation of the Zend PHP Certification.
> 
> You're right - this is another way to make money. However, based on my
> interpretation of what you're suggesting, I think you're wrong about where
> Zend intends to make that money. You really think they're going to make a
> significant amount of money from people paying to take this certification?
> 
> Zend is a major company that will grow as PHP itself grows. This
> certification helps PHP in the enterprise and make it seem like a more
> legitimate option for companies looking to spend a lot of money on their
> Web infrastructure. It also helps the entire PHP community, whether we get
> certified or not. The more PHP is used, the more demand for PHP developers
> there will be, the higher the salaries will be, etc.
> 
> > PHP.net has nothing to do with it, execpt that some people from the
> > php.net team help put it together.
> 
> I assume you mean the PHP Group has nothing to do with it (php.net is a
> domain name with no other significance), and you're right. Of course, Zend
> is a much more appropriate entity for this. I'd prefer that the PHP Group
> spend their time making PHP better and better.
> 
> > Hostely, what kind of market value does the certification has? Go get
> > sun certified at least it has some sort of history and value.
> 
> You should think about that for a minute (apply some good common sense).
> 
> Chris
> 
> =====
> Chris Shiflett - http://shiflett.org/
> 
> PHP Security - O'Reilly
>      Coming Fall 2004
> HTTP Developer's Handbook - Sams
>      http://httphandbook.org/
> PHP Community Site
>      http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
--- John Nichel <[EMAIL PROTECTED]> wrote:
>    I understand where you're coming from, and I'm sure with your 
> involvement in the project it will be top notch. I've always been 
> impressed with your work, and am eagerly awaiting your O'Reilly
> book. ;)

Thanks for the compliments. :-)

I'm behind schedule on the book but am working very hard on it right now.
It should hit shelves by the end of the year at least. In the meantime, I
did write a lot of stuff down in a PDF:

http://shiflett.org/php-security.pdf

It's certainly not complete, since this was just the workbook for a 3 hour
tutorial I gave at OSCON, but it has a few important topics. Plus, it's
free. :-)

> Those in management (non-tech) still like that piece of paper
> though, so that will help all legitimacy to PHP in that area. The
> geeks are going to be a tougher crowd to convince though.

Yeah, and being a part of the geek crowd, I'm more interested in what my
peers think. :-)

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:

--- John Nichel <[EMAIL PROTECTED]> wrote:

I understand where you're coming from, and I'm sure with your involvement in the project it will be top notch. I've always been impressed with your work, and am eagerly awaiting your O'Reilly
book. ;)


Thanks for the compliments. :-)

I'm behind schedule on the book but am working very hard on it right now.
It should hit shelves by the end of the year at least. In the meantime, I
did write a lot of stuff down in a PDF:

http://shiflett.org/php-security.pdf

It's certainly not complete, since this was just the workbook for a 3 hour
tutorial I gave at OSCON, but it has a few important topics. Plus, it's
free. :-)

Yeah, I grabbed that last week or so, and printed it out. Some of the items I've seen posted to this list (either by you, or that damn Holmes guy ;) But there were quite a few points that made be go back and check my code.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
The first two of these 3 echo statements work. But my last echo doesn't. 'username' is 
the name of the element I want to echo. To the right of each is what I see echoed.

echo $_SERVER['REQUEST_METHOD'];  echos -> POST
echo $_POST;                      echos -> Array
echo $_POST['username'];          echos -> nothing

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

The first two of these 3 echo statements work. But my last echo doesn't. 'username' is 
the name of the element I want to echo. To the right of each is what I see echoed.

echo $_SERVER['REQUEST_METHOD'];  echos -> POST
echo $_POST;                      echos -> Array
echo $_POST['username'];          echos -> nothing


How are you setting $_POST['username']? Let's see the code for the form.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
John,

Thanks for the reply. It is done in software called ToolBook, runs in windows.

The toolbook translates to dhtml and then is executed froma browser.  The command in 
toolbook for the data is:

Set HTTP POST parameter username to "ahttptest"

I don't expect anyone to know ToolBook, but everything else seems to work as far as 
getting a post array from the HTTP communications but I'm struggling to render the 
data from it.

I guess I was hoping someone would see something wrong with the way I coded the echo 
statement.

Dennis

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

John,

Thanks for the reply. It is done in software called ToolBook, runs in windows.

The toolbook translates to dhtml and then is executed froma browser.  The command in 
toolbook for the data is:

Set HTTP POST parameter username to "ahttptest"

I don't expect anyone to know ToolBook, but everything else seems to work as far as 
getting a post array from the HTTP communications but I'm struggling to render the 
data from it.

I guess I was hoping someone would see something wrong with the way I coded the echo 
statement.

Dennis



Try this on the page receiving the post data...

echo ( "<pre>" );
print_r ( $_POST );
echo ( "</pre>" );

And you'll see exactly what it's sending thru. Maybe it's sending a numerical array instead of an associative array.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
Thanks, I'll give it a try.

--- End Message ---
--- Begin Message ---
John, Thanks for your help. I got it all to work. In my toolbook set parameter stmt I 
needed to put quotes around username - "username". No where is this documented in 
ToolBook.

Thnaks for your help!

Dennis

--- End Message ---
--- Begin Message ---
Please accept my appologies, it won't happen again. I didn't realize. I must
have missed this in the welcome message. 

gene

-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 27, 2004 11:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP/MySQL fatal error


On Saturday 28 August 2004 09:43, gc wrote:
> Hi all,
>
> I'm Gene Candelaria and I'm a PHP and MySQL newbie.

You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

--- End Message ---
--- Begin Message ---
"Justin Patrin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 27 Aug 2004 23:17:29 -0700, Sam Hobbs <[EMAIL PROTECTED]>
wrote:
> > Is it possible to use the DOM to add (HTML) elements to a page at the
time
> > the page is being shown? The HTML and VBScript shown below is a
simplified
> > version of what I need to do but of course I need to do it in PHP. Since
PHP
> > is server-side (right?) perhaps it is not possible.
> >
>
> You're right, it's not possible. You'd have to create the whole page
> with DOM and output it at the end.
>
> You may be able to use DOM to make a specific piece and inject it....
> You could always just use JavaScript to inject things as wel.

Thank you. You understand the question. I am not sure of the details of what
you were suggesting, but that is not important. The general idea is probably
what I will do.

This is for osCommerce, which is a shopping cart system written in PHP. Many
of it's pages (the HTML) are not modifiable directly using a WYSIWYG editor,
which make the content difficult to modify, especially for non-technical
people. So what I can do is to make a page that is stored as a HTML page and
then in a separate PHP script add stuff (in this situation, it is left
and/or right menu columns) using the DOM. Since the system is written using
PHP, this improvement should also use PHP. I think PHP will do quite well
using it in this manner yet the system (osCommerce) can be easier to use.

--- End Message ---
--- Begin Message ---
"Ramil Sagum" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Yes, it is possible. And you are right,  PHP is a server side
> language. In addition to PHP,
> use a client-side scripting language (like JavaScript). JavaScript
> also has functions for accessing the DOM (createElement and
> getElementByID).

I have used so many languages that for me the differences between VBScript
and JavaScript is insignificant. Yes, I know that JavaScript will work too,
essentially the same (for me) as VBScript.

The question is not whether it cn be done using a non-PHP language; the
question only is if it can be done using PHP. The answer is no; at least not
using the design I asked about. At the time that PHP executes, the HTML is
still incomplete, right? More specifically, the HTML document is not
available (to PHP) to be accessed by the DOM. It is the document object that
is a critical part of the design in my original question.

--- End Message ---
--- Begin Message ---
Read the original question again; it is quite clear about the relevance to
PHP.


"Jason Davidson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> its possible to add HTML elements with DOM, im not sure what it has to
> do with php though?

--- End Message ---
--- Begin Message ---
I suppose it was too much to ask for some clearification.  I hope
someone else helps you.  Good luck, by they way, the difference between
VBScript and Javascript is monumental when using Gecko based browsers.

Jason

"Sam Hobbs" <[EMAIL PROTECTED]> wrote: 
> 
> Read the original question again; it is quite clear about the relevance to
> PHP.
> 
> 
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > its possible to add HTML elements with DOM, im not sure what it has to
> > do with php though?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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

        I was working on a web site that will be using TABS, the page will have
three TABS. 

All the data will be dynamic on all the pages, the first tab will be a
search page. After submit is hit the page will be reloaded to display
the results. 

Each result will be a link to detailed information about the result you
clicked on. Can I make is so the link loads the page in the second tab ?

Thanks.


-- 
Hand over the Slackware CD's and back AWAY from the computer, your geek
rights have been revoked !!!

Michael Gale
Slackware user :)
Bluesuperman.com 


-- 
Hand over the Slackware CD's and back AWAY from the computer, your geek
rights have been revoked !!!

Michael Gale
Slackware user :)
Bluesuperman.com 

--- End Message ---
--- Begin Message ---
One suggestion that I have is to use curl to get the web page that you want,
put that into a buffer variable and then when you click on the link to the
second page, you would then output the variable to the "page".

-Brent

----- Original Message ----- 
From: "Michael Gale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 28, 2004 12:05 AM
Subject: [PHP] html tabs


> Hello
>
> I was working on a web site that will be using TABS, the page will have
> three TABS.
>
> All the data will be dynamic on all the pages, the first tab will be a
> search page. After submit is hit the page will be reloaded to display
> the results.
>
> Each result will be a link to detailed information about the result you
> clicked on. Can I make is so the link loads the page in the second tab ?
>
> Thanks.
>
>
> -- 
> Hand over the Slackware CD's and back AWAY from the computer, your geek
> rights have been revoked !!!
>
> Michael Gale
> Slackware user :)
> Bluesuperman.com
>
>
> -- 
> Hand over the Slackware CD's and back AWAY from the computer, your geek
> rights have been revoked !!!
>
> Michael Gale
> Slackware user :)
> Bluesuperman.com
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Please help, I'm tearing what remains of my hair out here.
I've got a MySQL database where I've defined one of the table fields as an
integer.
Using PSP I've passed a session variable and can echo it to the screen using
<?php echo intval($clin_id) ?>.  So the session variable exists and can be
echoed
I now want to pass this session variable to the database into the field I've
defined as an integer

I've set up a form to submit other variables to the backend database and
they all work apart from this field.

I'm using a hidden field to pass the variable and I am using

<input name="p_clin_id" type="hidden" id="p_clin_id"
value="intval('$clin_id')">

What I don't understand is that if I can echo the variable what am I missing
in formatting a sessio variable to make it passable to the database.  It mus
be something basic and I've looked through several books (from where I got
the intval function) but obviously in the wrong place.

I would be grateful for any advice.

--- End Message ---
--- Begin Message --- Aidan wrote:
Please help, I'm tearing what remains of my hair out here.
I've got a MySQL database where I've defined one of the table fields as an
integer.
Using PSP I've passed a session variable and can echo it to the screen using
<?php echo intval($clin_id) ?>.  So the session variable exists and can be
echoed
I now want to pass this session variable to the database into the field I've
defined as an integer

I've set up a form to submit other variables to the backend database and
they all work apart from this field.

I'm using a hidden field to pass the variable and I am using

<input name="p_clin_id" type="hidden" id="p_clin_id"
value="intval('$clin_id')">
that line doesn't make any sense to me... what are you doing there? you're freely mixing PHP and HTML without denoting what is what.
an example that WOULD work would be:
echo '<input name="p_clin_id" type="hidden" id="p_clin_id" value="'.intval($clin_id).'">';


or maybe
?>
<input name="p_clin_id" type="hidden" id="p_clin_id"
 value="<?php echo intval($clin_id);?>">
<?php

So, mixing HTML and PHP without denoting what is what is the first mistake. The second one is the actual function call:
intval('$clin_id');


Now, when you put something between SINGLE quotes, it is read LITERALLY, meaning it *will not* substitute variables for their value. eg:
echo '$clin_id';


will output:
$clin_id

However,
echo "$clin_id";
will output the VALUE of $clin_id (eg. 12)

So, I think that instead of
intval('$clin_id') you actually meant intval("$clin_id"), or, cleaner, intval($clin_id) (since intval isn't expecting a string anyway, and even if it were, it would change it to one itself. No need to do extra work for nothing.)


The 3rd point about this all... if you get the value from the database, and it's an integer there, then why are you converting it to an integer AGAIN?? :| just using $clin_id instead of intval($clin_id) is surely faster (seen as no extra functions need to be called).


What I don't understand is that if I can echo the variable what am I missing in formatting a sessio variable to make it passable to the database. It mus be something basic and I've looked through several books (from where I got the intval function) but obviously in the wrong place.

I would be grateful for any advice.

--- End Message ---

Reply via email to