php-general Digest 20 Oct 2005 22:07:59 -0000 Issue 3748

Topics (messages 224357 through 224371):

Re: Putting Form Variables / URL Parameters in to an associative array?
        224357 by: Jasper Bryant-Greene

Re: some problems with php form
        224358 by: Ford, Mike

Re: No redirect with header()
        224359 by: ac

Problem returning private member array variables
        224360 by: Fernando Alvarez
        224361 by: Fernando Alvarez

Re: LDAPS agaisnt Active Directory
        224362 by: Aaron Axelsen

PHP4.4 and installing PEAR?
        224363 by: Kim Madsen

Re: No redirect with header() [solved]
        224364 by: Dotan Cohen

php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok
        224365 by: Petr Smith

install issue (affects 4.4.0 and 5.0.5) [/usr/include/rpc/rpc_msg.h, 
/usr/include/rpc/rpc.h, /usr/include/crypt.h, standard/crypt.c
        224366 by: Administrator

LDAP and a pain in my neck
        224367 by: Jay Blanchard
        224368 by: Greg Donald
        224369 by: Jay Blanchard
        224370 by: André Medeiros

Executing process in background
        224371 by: Surya Mishra

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 ---
On Thu, 2005-10-20 at 10:01 +0200, Jacques wrote:
> How can I grab parameters / key-value-pairs from a query string and put them 
> in to an associative array where each key-value pair inside the array 
> exactly corresponds with the key-value pairs inside the querystring?

http://php.net/parse_str

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

--- End Message ---
--- Begin Message ---
On 19 October 2005 19:24, Jay Blanchard wrote:

> [snip]
> <input class="<?PHP if ($error_msg) {echo "error"} else {echo
> "normal"}?>" id="firstname" name="firstname" type="text" value="<?php
> echo $_POST['firstname'] ?>"> 
> 
>   how would I fix this error?
> [/snip]
> 
> You are missing several semi-colons;
> 
> <input class="<?PHP if ($error_msg) {echo "error";} else {echo
> "normal";}?>" id="firstname" name="firstname" type="text"

Hands up to those two, I didn't check carefully enough!!  (Actually, I so 
seldom use the brace style that I probably just forgot PHP doesn't let you omit 
that semicolon ;)

> value="<?php echo $_POST['firstname']; ?>"> 

Nope, that one's definitely not necessary -- I actually think it looks ugly, so 
never put one in just before ?>

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
On 10/20/05, Dotan Cohen <[EMAIL PROTECTED]> wrote:
> On 10/18/05, Oliver Grätz <[EMAIL PROTECTED]> wrote:
> > Snippets are bad ;-)
> >
> > Please post a full example that is _not_ working on your server.
> > Perhaps this is no PHP problem at all.
> >
>
> I know, but I don't want to post my tracking code. I am certain,
> however, that it is not returning anything to the browser. The <?php
> is at the top of the page, no echo, ...

are you sure?
sometimes there _do_ have something before `<?php',
for ex., if your files is saved by windows notepad using unicode.

>
> Also, other people seem to be getting redirected, just not me! Paul
> Waring mentioned here that he got redirected, as did a friend who
> checked for me. I don't think that it is a php problem anymore,
> rather, a problem at my end!
>
> Thanks, though. I always appreciate the help I receive here. I
> wouldn't get very far without it!
>
> Dotan Cohen
> http://lyricslist.com
>
> 3
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
all born, to be dying

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

I was wondering if someone out there has had the same
problem as I have; fetching from an object a private array variable
through a get method. And instead of getting a copy of
the array, you get access to the original array, being able to access
the object's internal data!

I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and
on a FreeBSD 5.4 running PHP 5.0.5. Bellow is the test script:

<?php
class Atom {
}


?>

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

I was wondering if someone out there has had the same
problem as I have; fetching from an object a private array variable
through a get method. And instead of getting a copy of
the array, you get access to the original array, being able to access
the object's internal data!

I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and
on a FreeBSD 5.4 running PHP 5.0.5 obtaining the same results
on both systems. Bellow is the test script:

==========================================
#!/usr/local/bin/php
<?php
class Atom {
private $x=0;

public function __construct($x) {
$this->x = $x;
}
public function setX($x) {
$this->x = $x;
}
public function getX() {
return $this->x;
}
}

class Element {
private $atoms = array();

public function __construct($NMAX) {
for ($i = 0; $i < $NMAX; ++$i)
$this->atoms[] = new Atom($i);
}
public function setAtoms($atoms) {
$this->atoms = $atoms;
}
public function getAtoms() {
return $this->atoms;
}
}

echo "Starting testing on returning private member array variables\n";
echo "System details: PHP ".PHP_VERSION." on ".PHP_OS."\n";

$element = new Element(3);

$v = $element->getAtoms();
print_r($v);

$v[0]->setX(79);
print_r($v);

$w = $element->getAtoms();
print_r($w);

echo "Testing finished\n";
?>
==========================================

The results are :
==========================================
Starting testing on returning private member array variables
System details: PHP 5.0.4 on Linux
Array
(
[0] => Atom Object
(
[x:private] => 0
)

[1] => Atom Object
(
[x:private] => 1
)

[2] => Atom Object
(
[x:private] => 2
)

)
Array
(
[0] => Atom Object
(
[x:private] => 79
)

[1] => Atom Object
(
[x:private] => 1
)

[2] => Atom Object
(
[x:private] => 2
)

)
Array
(
[0] => Atom Object
(
[x:private] => 79
)

[1] => Atom Object
(
[x:private] => 1
)

[2] => Atom Object
(
[x:private] => 2
)

)
Testing finished
==========================================

Is this expected behavior, or shouldn't the third Array print-out
have also a zero in its first objects's x variable? Thanks to everyone for
their time.

--Best regards
FNanDO

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
I have been successful in getting apache to use the cert for .htaccess
authentication.  But i'm not seeing a clear way on how to make this
happen with php.  Can anyone offer any suggestions?


- --
Aaron Axelsen
[EMAIL PROTECTED]

Great hosting, low prices.  Modevia Web Services LLC --
http://www.modevia.com



Aaron Axelsen wrote:
> Hello,
>
> I am trying to authenticate against an Active Directory 2003 server
>  using LDAPS.  I have the cert from the server, however i'm not
> exactly sure how to set it up so that php will recognize it.  I
> have read the docs and googled a bit, but everyone seems to have a
> different way. What is the best way to accomplish this?
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFDV6HCuucONIvD0AMRAnvMAKCZ259ydN/ZSeiMdmz9U2c7NtjmHACg3iY8
ODRThzU6AuiniDUT58tDHHc=
=2atb
-----END PGP SIGNATURE-----

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

I installed PHP 4.4 on a new server and missed the Pear packages after that. I 
looked in the docs, I searched the php maillist and googled without finding an 
answer. I solved it by installing 4.3.9 and after this upgrade to 4.4, but I´m 
just damn curious... How do I install the pear packages next time? And where 
can one read about this?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

--- End Message ---
--- Begin Message ---
On 10/20/05, Oliver Grätz <[EMAIL PROTECTED]> wrote:
> I mentioned that it could be possible that this in no PHP problem just
> as you did but I wanted to see the code to ensure myself before saying
> this out loud.
> The redirection not working on your end would mean that you browser
> doesn't comply with the HTTP protocol.
> You could try other ways of redirection (JavaScript document.location,
> Meta-Redirect-Header) to see if they work.
> This might help you in narrowing down the problem.
>
> And switching to Firefox if you haven't already done it wouldn't hurt ;-)
>
> OLLi


Thanks, I already am on firefox!

It turns out that because I was not recording 'hits' from my own IP, I
was throwing an error whenever I tried from home! The error for
whatever reason never got shown in the browser, but did get sent
before the Loctation header. I discovered this when I /**/'ed that
part of the code.

Thanks, all. Another lesson learned!

Dotan Cohen
http://technology-sleuth.com/index.php


.

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

I've just installed php 5.0.5 to newest ubuntu breezy and apache2
started (sometimes) segfaulting (teste two computers with ubuntu hoary
and ubuntu breezy - same results).

Is says something like this:

[Thu Oct 20 12:32:21 2005] [notice] child pid 13161 exit signal
Segmentation fault (11)
[Thu Oct 20 12:32:21 2005] [notice] child pid 13191 exit signal
Segmentation fault (11)

Apache2 is breezy version Server version: Apache/2.0.54
Server built:   Oct  4 2005 07:42:46

It does this only in some applications (for example phpMyAdmin works ok)
 but PHP 5.0.4 worked ok. I tried to isolate some code which do the
segfaults but withou big success.

This code could be involved.. I don't know. It works sometimes,
sometimes not.

------------------------------------
this line maybe?: parent::__construct($config['host'],
$config['username'], $config['password'], $config['db']);
------------------------------------

class MySQL extends mysqli {
        static function &getInstance($configuration) {
            static $dbObj = null;
        
            if (is_null($dbObj)) {
                $dbObj = new Mysql($configuration);
            }
            return $dbObj;
        }
        
        function __construct($configuration) {
                $config = $configuration->getDbConfig();

                try {
                        parent::__construct($config['host'], 
$config['username'],
$config['password'], $config['db']);
                } catch (WarningException $we) {
            if (mysqli_connect_error()){
                throw new DBConnectException(mysqli_connect_error(),
mysqli_connect_errno());
                        }
                }       
                parent::query("SET NAMES 'utf8'");
        }

   function __destruct() {
                @$this->close();     
   }
        
        function query($query) {
                if (($result = parent::query($query)) != false) {
                        if (eregi("^select", $query)) {
                                return new QueryResult($result);
                        } else {
                                return new QueryResult(false, 
$this->affected_rows);
                        }
                } else {
                        throw new SQLException($this->error, $this->errno, 
$query);
                }
        }
        
        function getInsertId() {
                return $this->insert_id;
        }
}

------------------------------------

I think this is some new bug in 5.0.5 version and I want to help to fix
it. But I don't know how. What should I do?

Thanks,

Petr

--- End Message ---
--- Begin Message ---
Running FreeBSD 5.4/RELEASE on Sparc64 and Apache 1.3.33

When attempting to install 4.4.0 and 5.0.5, from ports or from source, I am
getting the following error: (This specific error is from 4.4.0 from ports
[/usr/ports/lang/php4]

/bin/sh /usr/ports/lang/php4/work/php-4.4.0/libtool --silent
--preserve-dup-deps --mode=compile cc  -Iext/standard/
-I/usr/ports/lang/php4/work/php-4.4.0/ext/standard/ -DPHP_ATOM_INC
-I/usr/ports/lang/php4/work/php-4.4.0/include
-I/usr/ports/lang/php4/work/php-4.4.0/main
-I/usr/ports/lang/php4/work/php-4.4.0
-I/usr/ports/lang/php4/work/php-4.4.0/TSRM
-I/usr/ports/lang/php4/work/php-4.4.0/Zend    -O -pipe   -c
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c -o
ext/standard/crypt.lo
In file included from /usr/include/rpc/rpc.h:59,
                 from /usr/include/crypt.h:9,
                 from
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c:31:
/usr/include/rpc/rpc_msg.h:66: error: syntax error before numeric constant
*** Error code 1

Stop in /usr/ports/lang/php4/work/php-4.4.0.
*** Error code 1

Stop in /usr/ports/lang/php4.

Any ideas would  be helpful.  If anyone requires more information, just ask
& I will provide.

--- End Message ---
--- Begin Message ---
Farking windoblows environment!

The extension is uncommented, I have OpenLDAP for W2k installed and running,
the dll's have been copied to the proper place and I execute a test and get

Call to undefined function: ldap_connect() 

What am I missing? TIA.

--- End Message ---
--- Begin Message ---
On 10/20/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> Farking windoblows environment!
>
> The extension is uncommented, I have OpenLDAP for W2k installed and running,
> the dll's have been copied to the proper place and I execute a test and get
>
> Call to undefined function: ldap_connect()
>
> What am I missing? TIA.


Did you uncomment (and properly define) the 'extension_dir' directive
in your php.ini?


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

--- End Message ---
--- Begin Message ---
[snip]
> Call to undefined function: ldap_connect()
>
> What am I missing? TIA.


Did you uncomment (and properly define) the 'extension_dir' directive
in your php.ini?
[/snip]

Yep.

--- End Message ---
--- Begin Message ---
Check your webserver logs. If PHP couldn't use the extension, it will
accuse that in the logs.

On 10/20/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> [snip]
> > Call to undefined function: ldap_connect()
> >
> > What am I missing? TIA.
>
>
> Did you uncomment (and properly define) the 'extension_dir' directive
> in your php.ini?
> [/snip]
>
> Yep.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

I have to start a task on the server side that is going to take pretty long
to process in the server side. So I would like to show a message to the user
and ask him/her to check again later. But starting a new task holds up the
thread and won't let me exit the php. The user's browser does keeps showing
busy.
I tried to create a new thread using pcntl_fork, but my php doesn't allow
that as it has not been compiled with pcntl support and its not possible to
change that.
I also tried to create a script that would do the task and called the script
using system command and passed an '&' at the end to make it process in
background, but that also keeps the main thread busy.

Any solutions?

Thanks
-Surya

--- End Message ---

Reply via email to