[PHP] Using PHP4 4.3.4 as a CGI

2004-05-12 Thread Mark Constable
Debian testing system with a recent update to php-cgi 4.3.4.

I have been using the /usr/bin/php4 binary as a some.cgi with
a shbang line of "#!/usr/bin/php4" which worked fine up until
this recent 4.3.4 update. Now the new 4.3.4 php4 binary does
not produce a "Content-type: index/html\n\n" header nor does
it receive any GPC (GET POST etc) variables at all. I've been
throught the new php.ini and I cannot see any parameters or
advice as to what may have changed.

Could anyone advise me how to re-enable receiving incoming
variables for a /usr/bin/php4 binary used as a CGI please ?

--markc

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



Re: [PHP] default and another constructor

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 11:27 pm, Rudy Metzger wrote:
> On Wed, 2004-05-12 at 15:18, Mark Constable wrote:
> > You can at least make the below work by removing the first
> > forum() instance and using
> >
> >  function forum($naam=NULL,$tijd=NULL,$tekst=NULL)
> >
> > and test the incoming variables with isset() before attempting
> > to use any of them.
>
> If you assign default values to the method arguments, you cannot test
> them with isset() anymore, as they will be set.

# cat null_test.php

# php null_test.php
'hi'
NULL
NULL

--markc

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



Re: [PHP] default and another constructor

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 10:43 pm, Lieve Vissenaeken wrote:
> Please ,could anybody help me ? I'm not so familiar with PHP.
>
> I've the following problem with my code  when I try to make an object from
> the class "forum" with the code "$test=new forum()".  I always get a
> warning on this: "Warning: Missing argument 1 for forum() in
> /lvdata/www/tennis/php/sql.inc"
> Is it not possible to just make a default constructor and an other
> constructor like in JAVA ?
> Thanks for helping

No, you cannot do this kind of method overloading, not like 
this anyway. If you are using PHP5 you can kind of emulate 
overloading by using the __call() function... some googling 
will find examples.

You can at least make the below work by removing the first
forum() instance and using

 function forum($naam=NULL,$tijd=NULL,$tekst=NULL)

and test the incoming variables with isset() before attempting
to use any of them.

> class forum
> {
>  var $naam;
>  var $tijd;
>  var $tekst;
>
>  function forum()
>  {
>  }
>
>  function forum($naam,$tijd,$tekst)
>  {
>   $this->naam=$naam;
>   $this->tijd=$tijd;
>   $this->tekst=$tekst;
> }
> }
>
>
> $test=new forum();

--markc

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



Re: [PHP] parsing value by URL

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 09:42 pm, gowthaman ramasamy wrote:
> I have a problem in passing the value to another PHP script from the
> first one. can any one help me to debug it.
>
>  ENCTYPE="text/plain">
>  if(isset($_POST['submit']))
> {
>   does many things
>
> $detail_file='testrun_hetero_srtdout';
> echo " HREF=\"http:/gowtham/forphp/detailedresults.php?name=$detail_file&firstfile
>=$files\"> clik to see detailed page" }

> second script ... that is detailedresults.php
>print $name;
>   print "$name";
> ?>

Perhaps "register_globals = Off" ? Here is one debugging hint...

 ';
 // do whatever else
 ?>

and view the source of the resulting page. Assumes PHP v4.1.0+

--markc

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



Re: [PHP] Methods for instatiating an object

2004-05-12 Thread Mark Constable
On Wed, 12 May 2004 08:41 pm, Jordi Canals wrote:
> A)$object = new MyClass;
> B)$object =& new MyClass;

> 1) In case A, PHP creates a new object and returns a Copy of this new
> object, so really I will have the object two instances for the object in
> memory ...
>
> 2) In case B, PHP creates a noew object and returns a reference to this
> newly created object. In this case there is only one instance of the
> object.
>
> Does it works that way? If not, What is exactly the difference?

You are quite correct...

 http://php.net/references

--markc

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



[PHP] Using PHP4 4.3.4 as a CGI

2004-05-12 Thread Mark Constable
Debian testing system with a recent update to php-cgi 4.3.4.

I have been using the /usr/bin/php4 binary as a some.cgi with
a shbang line of "#!/usr/bin/php4" which worked fine up until
this recent 4.3.4 update. Now the new 4.3.4 php4 binary does
not produce a "Content-type: index/html\n\n" header nor does
it receive any GPC (GET POST etc) variables at all. I've been
throught the new php.ini and I cannot see any parameters or
advice as to what may have changed.

Could anyone advise me how to re-enable receiving incoming
variables for a /usr/bin/php4 binary used as a CGI please ?

--markc

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