|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 22 Dec 2003 21:00:30 -0000 Issue 2488
php-general-digest-help
lists.php.net
Date: Mon Dec 22 2003 - 15:00:30 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 22 Dec 2003 21:00:30 -0000 Issue 2488
Topics (messages 173139 through 173198):
include_path
173139 by: Alain Williams
173140 by: Chris Hobden
Small riddle with classes and references, or bug?
173141 by: rush
173142 by: messju mohr
173144 by: rush
Can't use HTTPS with fgets
173143 by: Homer
Re: New member
173145 by: David T-G
debugger listener
173146 by: Alberto M.
173147 by: Alberto M.
sorting multi-dimensional arrays
173148 by: Phil Ewington - 43 Plc
173149 by: Phil Ewington - 43 Plc
combining two variables to make one???
173150 by: Tristan.Pretty.risk.sungard.com
173152 by: Chris Boget
173155 by: Tristan.Pretty.risk.sungard.com
173156 by: Chris Boget
173157 by: Tristan.Pretty.risk.sungard.com
Apache 2.0.48 won't play nice with php 4.3.4 ?
173151 by: Danny Anderson
How can i build e-commerce site with php?
173153 by: pehepe php
173154 by: pete M
user running PHP
173158 by: Niklas Saers
sorting a mulit-dimensional array
173159 by: Chakravarthy Cuddapah
need help getting one variable
173160 by: webmaster.multiwebmastertools.com
173162 by: Matt Matijevich
Re: serialize and unserialize
173161 by: Marek Kilimajer
Working pop-up progress window
173163 by: Ed Curtis
173164 by: Steve Murphy
173165 by: Matt Matijevich
173166 by: Ed Curtis
173176 by: Marek Kilimajer
Parse error in mysql_query()
173167 by: Tyler Longren
173168 by: Sam Masiello
173169 by: Tyler Longren
173172 by: Matt Matijevich
173174 by: John W. Holmes
173177 by: Tyler Longren
173178 by: Tyler Longren
173180 by: Matt Matijevich
173182 by: John W. Holmes
Re: HTTP headers, IE and downloading
173170 by: Andreas Magnusson
173194 by: Marek Kilimajer
reading excell and writing to text file..
173171 by: Andrew Kwiczola
173173 by: Matt Matijevich
173175 by: John W. Holmes
173191 by: jon
Re: PHP LDAP query - need to add Exchange fields
173179 by: Phil Dowson
Re: progress in php (was "Re: [PHP] Working pop-up progress window")
173181 by: David T-G
173188 by: Steve Murphy
evaluating a variable
173183 by: Carey Baird
173185 by: Brad Pauly
173186 by: Matt Matijevich
173189 by: Carey Baird
173192 by: Matt Matijevich
173193 by: Brad Pauly
173195 by: John W. Holmes
173197 by: Brad Pauly
onChange
173184 by: Chakravarthy Cuddapah
173187 by: Larry E. Ullman
173190 by: Matt Matijevich
Re: progress in php
173196 by: David T-G
overload() problem
173198 by: Cliff Wells
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Is there a way of modifying the include_path within a script, I want to add to it,
not completely change it. The sort of thing that I want to do is equivalent to
the following bit of shell code:
PATH="$HOME/bin:$PATH"
ie add a user specific part to the path - so that a production/test 'require'
gets the production/test version of a file.
Please CC me on any reply since I don't subscribe to this list.
Thanks
--
Alain Williams
#include <std_disclaimer.h>
FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
best interests of our children. See http://www.fathers-4-justice.org
attached mail follows:
set_include_path(get_include_path().":"/new/incude/path");
> -----Original Message-----
> From: Alain Williams [mailto:addw
phcomp.co.uk]
> Sent: 22 December 2003 10:16
> To: php-general
lists.php.net
> Subject: [PHP] include_path
>
> Is there a way of modifying the include_path within a script,
> I want to add to it, not completely change it. The sort of
> thing that I want to do is equivalent to the following bit of
> shell code:
>
> PATH="$HOME/bin:$PATH"
>
> ie add a user specific part to the path - so that a
> production/test 'require'
> gets the production/test version of a file.
>
> Please CC me on any reply since I don't subscribe to this list.
>
> Thanks
>
> --
> Alain Williams
>
> #include <std_disclaimer.h>
>
> FATHERS-4-JUSTICE - Campaigning for equal rights for parents
> and the best interests of our children. See
> http://www.fathers-4-justice.org
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Hello,
I have a problem understanding following chunk of code. It seems that global
$rme does not remember an reference to $this, but instead it is remembering
null or something like that:
<?PHP
class A {
function rememberMe() {
global $rme;
$rme = & $this;
$this->someInstanceVar =77;
}
function report() {
global $rme;
echo 'X'; print_r($rme); echo 'X';
}
}
$a = new A();
$a->rememberMe();
$a->report();
?>
This little script outputs:
XX
While I would expect it to return:
Xa Object ( [someInstanceVar] => 77 ) X
rush
--
http://www.templatetamer.com/
attached mail follows:
On Mon, Dec 22, 2003 at 11:57:58AM +0100, rush wrote:
> Hello,
>
> I have a problem understanding following chunk of code. It seems that global
> $rme does not remember an reference to $this, but instead it is remembering
> null or something like that:
>
> <?PHP
>
> class A {
> function rememberMe() {
> global $rme;
this creates a reference from $rme to $GLOBALS['rme']
> $rme = & $this;
this create a *new* reference from $rme to $this. so only a local $rme
is referencing $this now. change the line to
$GLOBALS['rme'] = & $this;
to get the expected behaviour.
> $this->someInstanceVar =77;
> }
>
> function report() {
> global $rme;
> echo 'X'; print_r($rme); echo 'X';
> }
> }
>
> $a = new A();
> $a->rememberMe();
> $a->report();
>
> ?>
>
> This little script outputs:
> XX
>
> While I would expect it to return:
>
> Xa Object ( [someInstanceVar] => 77 ) X
>
> rush
attached mail follows:
"Messju Mohr" <messju
lammfellpuschen.de> wrote in message
news:20031222113341.GA18833
dpo.de...
> this creates a reference from $rme to $GLOBALS['rme']
>
> > $rme = & $this;
>
> this create a *new* reference from $rme to $this. so only a local $rme
> is referencing $this now. change the line to
>
> $GLOBALS['rme'] = & $this;
>
> to get the expected behaviour.
Thank you very much, I was not aware that global $something is just a syntax
sugar for reference into the $GLOBALS array.
Very spookey indeed, but thanks again :)
rush
--
http://www.templatetamer.com/
attached mail follows:
Hello!
I have search for info in this group about this topic and found it but can't
get working my program.
These are the steps I have done:
1ş Download and install latest php version (4.3.4)
2ş Test that it works (IIS)
3ş Change php.ini:
extension_dir = install_dir/extensions/
uncomment "extension=php_openssl.dll"
4ş Copy from dlls folder to win\system32
libeay32.dll and ssleay32.dll
The code I'm using is:
$sFinalUrl = https://www.alsa.es/compra/com_csimpleidavuelta.asp;
$handle = fopen($sFinalUrl, "r");
$lExpireDate = fgets($handle);
fclose($handle);
And the errors are
Notice: fopen(): Unable to find the wrapper "https" - did you forget to
enable it when you configured PHP? in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62
Warning: fopen(https://www.alsa.es/compra/com_comprasimple.htm): failed to
open stream: Invalid argument in C:\Inetpub\PostNuke-0.726\mpValidar.php on
line 62
Warning: fgets(): supplied argument is not a valid stream resource in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 63
Warning: fclose(): supplied argument is not a valid stream resource in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 64
What else must I do? What I'm doing wrong?
Thanks!
attached mail follows:
Janos --
...and then Kovy said...
%
% Hi!
Hi, and welcome to the list! We're glad to have you.
In the future, though, please don't just reply to any old list message
and start a new subject; it doesn't really separate your message from its
parents.
%
% I'm new here. Where found I listarchive?
It looks like http://php.net and http://lists.php.net are good places to
start.
% Otherwise I'm looking for mailing list develope with php (SMTP or...)
Mailing list software written in php? I don't know of any, but there's
bound to be some out there :-) It's not the best choice, though; yould
almost certainly be better off with a real listmanager such as ezmlm.
%
% Regards,
% Janos from HU
HTH & HAND & Happy Holidays
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/5uY6Gb7uCXufRwARAhJaAKCOn/10UpnkSlftTW9pdohwTwYPlQCg6i0v
1cUTJE3DqYW5avwFubxbmfc=
=mc6z
-----END PGP SIGNATURE-----
attached mail follows:
php 4.3.0 + apache + linux suse 8.2
I tried to install xdebug (http://www.xdebug.org/install.php) as an
precompiled module, but it seems not running when I did reload apache.
I mean, I can't see it in the module list in phpinfo() page.
Also, I don't know how to catch up events sent by debugger, may I need
to build a tcp listener? Any hint about how to do it?
Bye, Alberto.
--
"Imagination is more important than knowledge"
attached mail follows:
Alberto M. wrote:
>
> php 4.3.0 + apache + linux suse 8.2
>
> I tried to install xdebug (http://www.xdebug.org/install.php) as an
> precompiled module, but it seems not running when I did reload apache.
> I mean, I can't see it in the module list in phpinfo() page.
>
> Also, I don't know how to catch up events sent by debugger, may I need
> to build a tcp listener? Any hint about how to do it?
>
> Bye, Alberto.
>
as usual, I answer myself:
http://www.xdebug.org/docs-settings.php
there are several options to set in php.ini file in order to get the
xdebug work.
BTW I would know if someone has tried xdebug and has some hints.
bye, alberto.
--
"Imagination is more important than knowledge"
attached mail follows:
Hi All,
I am trying to sort a multi-dimensional array using a value in the second
dimension. I have looked at the usort examples but don't fully understand
what usort is actually doing so am struggling. I have tried the following:
if (! getmxrr($this->_Domain, $as_hosts, $ai_weights))
{
return false;
}
for ($i = 0; $i < count($as_hosts); $i++)
{
$this->MXRecs[] = array($as_hosts[$i], $ai_weights[$i]);
}
function IsBestMX($a, $b)
{
if ($a[1] == $b[1])
{
return 0;
}
return ($a[1] < $b[1]) ? -1 : 1;
}
usort($this->MXRecs);
Can anyone point me in the right direction?
TIA
Phil.
---
Phil Ewington - Technical Director
43 Plc - Ashdale House
35 Broad Street, Wokingham
Berkshire RG40 1AU
T: +44 (0)1189 789 500
F: +44 (0)1189 784 994
E: mailto:phil.ewington
43plc.com
W: www.soyouthink.com
attached mail follows:
Ooops, forgot to specify the compare function with usort(); all working now.
Phil.
-----Original Message-----
From: Phil Ewington - 43 Plc [mailto:phil.ewington
43plc.com]
Sent: 22 December 2003 14:08
To: php-general
lists.php.net
Subject: [PHP] sorting multi-dimensional arrays
Hi All,
I am trying to sort a multi-dimensional array using a value in the second
dimension. I have looked at the usort examples but don't fully understand
what usort is actually doing so am struggling. I have tried the following:
if (! getmxrr($this->_Domain, $as_hosts, $ai_weights))
{
return false;
}
for ($i = 0; $i < count($as_hosts); $i++)
{
$this->MXRecs[] = array($as_hosts[$i], $ai_weights[$i]);
}
function IsBestMX($a, $b)
{
if ($a[1] == $b[1])
{
return 0;
}
return ($a[1] < $b[1]) ? -1 : 1;
}
usort($this->MXRecs);
Can anyone point me in the right direction?
TIA
Phil.
---
Phil Ewington - Technical Director
43 Plc - Ashdale House
35 Broad Street, Wokingham
Berkshire RG40 1AU
T: +44 (0)1189 789 500
F: +44 (0)1189 784 994
E: mailto:phil.ewington
43plc.com
W: www.soyouthink.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I want to out put three bits of text...
I want my end page to look like this...
=============
result 1
result 2
result 3
=============
here's the code I've got...
=======================
<?
$i = 1;
while ($i >= 3) {
$options$i = "result $i";
}
?>
<html>
<body>
<?=$option1 ?>
<?=$option2 ?>
<?=$option3 ?>
</body>
</html>
=======================
yet I get an error...?
Anyone know who to make $option$i work?
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************
attached mail follows:
> <?
> $i = 1;
> while ($i >= 3) {
> $options$i = "result $i";
> }
> ?>
You want this:
${"$options{$i}"} = "result $i";
For the sake of clarity I typically do something like the following:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
Chris
attached mail follows:
Cheers...
Doesn't work for me though...?
What do the '{' mean when declaring the variable?
"Chris Boget" <chris
wild.net>
22/12/2003 14:16
To
<php-general
lists.php.net>, <Tristan.Pretty
risk.sungard.com>
cc
Subject
Re: [PHP] combining two variables to make one???
> <?
> $i = 1;
> while ($i >= 3) {
> $options$i = "result $i";
> }
> ?>
You want this:
${"$options{$i}"} = "result $i";
For the sake of clarity I typically do something like the following:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************
attached mail follows:
> Doesn't work for me though...?
Which isn't working?
This:
${"$options{$i}"} = "result $i";
or this:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
> What do the '{' mean when declaring the variable?
I can't remember where it is in the documentation, but the '{' '}' symbols
basically clear up any ambiguity for the parser indicatig where the actual
variables are in a statement.
Chris
attached mail follows:
I am a monkey...
I had me angle bracket the wrong way round... what a stoner...!
"Chris Boget" <chris
wild.net>
22/12/2003 15:04
To
<Tristan.Pretty
risk.sungard.com>
cc
<php-general
lists.php.net>
Subject
Re: [PHP] combining two variables to make one???
> Doesn't work for me though...?
Which isn't working?
This:
${"$options{$i}"} = "result $i";
or this:
$i = 1;
while ($i >= 3) {
$varName = $options . $i;
${$varName} = "result $i";
}
> What do the '{' mean when declaring the variable?
I can't remember where it is in the documentation, but the '{' '}' symbols
basically clear up any ambiguity for the parser indicatig where the actual
variables are in a statement.
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************
attached mail follows:
Hola, PHP folk!
I hope this is an appropriate forum for this:
I am setting up a Redhat 9 webserver to serve as my testbed for a little
php/mysql app I want to develop. I installed RH9 without the
webserver/php/mysql so I could manually install the most current versions.
MySQL 4.0.16 installed fine, Apache (httpd-2.0.48) installed fine. PHP
4.3.4 seemed to install fine. Unfortunately, when I try to start the
webserver with php, I get the following error:
'...httpd: module
"/usr/local/php-4.3.4/sapi/apache2handlers/sapi_apache2.c" is not
compatible with this version of Apache."
Help! Is there a work around for this? Apache will start fine if I
don't try to enable php via LoadModule in the Apache configuration file.
Any comments and suggestions appreciated.
Thanks,
Danny
attached mail follows:
Hello. How can i build e-commerce site with php. Do you know any
source,documentation,e-book.
Please help me.
if you use msn messenger, please add me your contact list.
messenger : pehepe
hotmail.com
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
attached mail follows:
go and check out www.hotscripts.com - there's load of ecomerecce scripts
there.
regards
Pete
Pehepe Php wrote:
> Hello. How can i build e-commerce site with php. Do you know any
> source,documentation,e-book.
> Please help me.
>
>
> if you use msn messenger, please add me your contact list.
> messenger : pehepe
hotmail.com
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
attached mail follows:
Hi,
I've got an Apache 2 setup with PHP 4.3.4 running many virtual hosts. Each
user has a virtual host of his own, and many use php. I've set
SuexecUserGroup to the username and group of the individual user, yet
running phpinfo() as that user reveals under section apache2handler that
it runs as user "www" and group "www" rather than the user and group I set
with SuexecUserGroup. Why is that, and how can I make it use the user and
group the user belongs to? People are starting to complain that they have
problems using fopen() and the like.
Cheers
Niklas Saers
attached mail follows:
Can anyone pls tell me with an example on how to select distinct values from a multi-dimensional array. Moving distinct values into another array is ok.
Thanks !
attached mail follows:
hello all i need help to enter one variable in a cookie and then retreive it back later, i know this probably sounds dumb to most but this is really the first time ive tried working with cookies so please bear with me, thanks for any help.
attached mail follows:
[snip]
hello all i need help to enter one variable in a cookie and then
retreive it back later, i know this probably sounds dumb to most but
this is really the first time ive tried working with cookies so please
bear with me, thanks for any help.
[/snip]
this should give you a good start http://www.php.net/setcookie
attached mail follows:
You should use stripslashes to get rid of escaped characters in
$_COOKIE['data']. Then remember to use addslashes when you want to use
$data or $chksum in sql queries.
webmaster
multiwebmastertools.com wrote:
>
>
> Hello all i need a little help with serialize and unserialize
>
> here is my code
> <?php
> session_start();
> if(!isset($_COOKIE['data'])) { //Check to see if cookie is there.
> include("cookie_num.dat");
> $y = "$password";
> //Assign a special number for each cookie.
> $data = array('x' => 'cart', 'y' => $password);
> session_register("y");
> $var = serialize($data);
> //$chksum = md5($data . md5('secret salt here'));
> //$var = serialize(array($data,$chksum));
> setcookie('data', $var, time() + 3600);
>
>
>
>
> } else {
>
> $var = unserialize($_COOKIE['data']);
> list($data, $chksum) = $var;
> if (md5($data . md5('secret salt here')) == $chksum)
> {
> // Data is valid
> $data = unserialize($_COOKIE['data']);
> list($y, $chksum) = $data;
> $x = $data['x'];
> $y = $data['y'];
> session_register("y");
> }
> //session_register("y");
>
>
>
>
>
>
> }
>
> ?>
>
> the problem is when i try to pull it back out to use the number that is generated by $password it gives me this error
> Notice: unserialize(): Error at offset 9 of 118 bytes in c:\program files\apache group\apache\htdocs\header.php on line 24
>
> any ideas towards fixin this would be appreciated
>
>
>
>
>
>
>
attached mail follows:
I've read through the archives and run through some of the suggestions
given for progress bars and pop ups with animated gifs and haven't had
much luck.
I've had the most luck using the pop-up window method. In the <form>
element I call onSubmit="{open some window here}" This works as the pop-up
appears while the file is transferring. Here's where I run into problems.
I've tried all kinds of examples found on google and can never get it to
work right.
In the script where my form goes to, I'm supposed to use a <body
onLoad="window.close()" call to close my pop-up. I've actually tried this
2 ways. I've used it as afore mentioned as well as <body onUnload=""> on
the page containing the form. Either my pop-up stays open or I close the
parent window.
Does anybody have a working example I could work off of so I could please
my boss. Personally, I didn't want to do this but he thinks we should have
these flashy things on out site.
Thanks,
Ed
attached mail follows:
Hi Ed,
Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here:
http://www.pfohlsolutions.com/projects/upload/
You will need to recompile PHP but its a very convenient tool that many of my clients ask for, enjoy.
Steve
-----Original Message-----
From: Ed Curtis [mailto:ed
homes2see.com]
Sent: Monday, December 22, 2003 12:19 PM
To: php-general
lists.php.net
Subject: [PHP] Working pop-up progress window
I've read through the archives and run through some of the suggestions
given for progress bars and pop ups with animated gifs and haven't had
much luck.
I've had the most luck using the pop-up window method. In the <form>
element I call onSubmit="{open some window here}" This works as the pop-up
appears while the file is transferring. Here's where I run into problems.
I've tried all kinds of examples found on google and can never get it to
work right.
In the script where my form goes to, I'm supposed to use a <body
onLoad="window.close()" call to close my pop-up. I've actually tried this
2 ways. I've used it as afore mentioned as well as <body onUnload=""> on
the page containing the form. Either my pop-up stays open or I close the
parent window.
Does anybody have a working example I could work off of so I could please
my boss. Personally, I didn't want to do this but he thinks we should have
these flashy things on out site.
Thanks,
Ed
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
[snip]
I've had the most luck using the pop-up window method. In the <form>
element I call onSubmit="{open some window here}" This works as the
pop-up
appears while the file is transferring. Here's where I run into
problems.
I've tried all kinds of examples found on google and can never get it
to
work right.
In the script where my form goes to, I'm supposed to use a <body
onLoad="window.close()" call to close my pop-up. I've actually tried
this
2 ways. I've used it as afore mentioned as well as <body onUnload="">
on
the page containing the form. Either my pop-up stays open or I close
the
parent window.
[/snip]
If I understand you correctly, when you call window.close on the next
page you want it to close the child window. I am not sure if this is
possible
with Javascript if you go to a new page, it might be. You would want
to not call window.close but something like myPopUp.close() on the next
page.
Someone else might be able to shed so more light on it. Keep in mind
that more and more users are blocking all pop ups.
attached mail follows:
> If I understand you correctly, when you call window.close on the next
> page you want it to close the child window. I am not sure if this is
> possible
> with Javascript if you go to a new page, it might be. You would want
> to not call window.close but something like myPopUp.close() on the next
> page.
>
> Someone else might be able to shed so more light on it. Keep in mind
> that more and more users are blocking all pop ups.
That's correct. I didn't make that clear enough in my first post. When I
call the popup I give it a name (i.e. MyWindow) and when I try to close it
I call MyWindow.close() and it still will not close.
Ed
attached mail follows:
Ed Curtis wrote:
>
>
>>If I understand you correctly, when you call window.close on the next
>>page you want it to close the child window. I am not sure if this is
>>possible
>>with Javascript if you go to a new page, it might be. You would want
>>to not call window.close but something like myPopUp.close() on the next
>>page.
>>
>>Someone else might be able to shed so more light on it. Keep in mind
>>that more and more users are blocking all pop ups.
>
>
> That's correct. I didn't make that clear enough in my first post. When I
> call the popup I give it a name (i.e. MyWindow) and when I try to close it
> I call MyWindow.close() and it still will not close.
>
> Ed
>
There might be a proper way, but this should work:
MyWindow = window.open('', 'MyWindow');
MyWindow.close();
attached mail follows:
Error:
Parse error: parse error, expecting `']'' in
/usr/local/apache/htdocs/UP/index.php on line 871
Line 871:
mysql_query("INSERT INTO domainregistrations (domain,type,years,price)
VALUES
('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_POST[domainregister_years$i]','$_POST[domainregister_price$i]')");
Anyone know why that parse error is happening? I can't find a missing
"]" anywhere.
Any help would be greatly appreciated.
Thanks,
Tyler Longren
attached mail follows:
Perhaps it doesn't like the fact that you don't have quotes around your
array keys?
--Sam
Tyler Longren wrote:
> Error:
> Parse error: parse error, expecting `']'' in
> /usr/local/apache/htdocs/UP/index.php on line 871
>
> Line 871:
> mysql_query("INSERT INTO domainregistrations
> (domain,type,years,price) VALUES
>
('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO
ST[domainregister_years$i]','$_POST[domainregister_price$i]')");
>
> Anyone know why that parse error is happening? I can't find a
> missing "]" anywhere.
>
> Any help would be greatly appreciated.
>
> Thanks,
> Tyler Longren
attached mail follows:
Sorry, should have mentioned that I tried quoting them already. That
gives a T_VARIABLES parse error.
Thanks for the reply,
Tyler
On Mon, 2003-12-22 at 12:30, Sam Masiello wrote:
> Perhaps it doesn't like the fact that you don't have quotes around your
> array keys?
>
> --Sam
>
>
> Tyler Longren wrote:
> > Error:
> > Parse error: parse error, expecting `']'' in
> > /usr/local/apache/htdocs/UP/index.php on line 871
> >
> > Line 871:
> > mysql_query("INSERT INTO domainregistrations
> > (domain,type,years,price) VALUES
> >
> ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO
> ST[domainregister_years$i]','$_POST[domainregister_price$i]')");
> >
> > Anyone know why that parse error is happening? I can't find a
> > missing "]" anywhere.
> >
> > Any help would be greatly appreciated.
> >
> > Thanks,
> > Tyler Longren
attached mail follows:
[snip]
Sorry, should have mentioned that I tried quoting them already. That
gives a T_VARIABLES parse error.
Thanks for the reply,
Tyler
[/snip]
What happens if you comment out the mysql statement and just echo the
variables?
echo $_POST[domainregister_domain$i]
$_POST[domainregister_type$i]....;
attached mail follows:
Tyler Longren wrote:
> Error:
> Parse error: parse error, expecting `']'' in
> /usr/local/apache/htdocs/UP/index.php on line 871
>
> ('$_POST[domainregister_domain$i]',
If you're going to be creating array keys like that, break out of the
string to do it.
('" . $_POST['domainregister_domain' . $i] . "', ...
Having a key like that kind of begs the question of why you're not just
using $_POST['domainregister_domain'][$i], though...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
Hi Matt,
I put this right above like 871:
print "<br><br>$_POST[domainregister_domain$i]<br><br>";
So now that "print" line is 871. It produces the exact same error as
the mysql_query() line.
The reason I'm doin it like this is cuz I'm dynamically generating
forms, and lots of the fields are the same, just with different numbers
at the end:
ex:
domainregister_domain1
domainregister_domain2
Those field names are generated by PHP for the form, and now I'm doing
the page to process that form. Would doing
$_POST['domainregister_domain'][$i] get the correct value from my
"domainregister_domain1" field if $i=1?
Thanks,
Tyler
Thanks,
Tyler
On Mon, 2003-12-22 at 12:47, Matt Matijevich wrote:
> [snip]
> Sorry, should have mentioned that I tried quoting them already. That
> gives a T_VARIABLES parse error.
>
> Thanks for the reply,
> Tyler
> [/snip]
>
> What happens if you comment out the mysql statement and just echo the
> variables?
>
> echo $_POST[domainregister_domain$i]
> $_POST[domainregister_type$i]....;
attached mail follows:
Doing this fixed it:
mysql_query("INSERT INTO domainregistrations (domain,type,years,price)
VALUES
('$_POST[domainregister_domain]$i','$_POST[domainregister_type]$i','$_POST[domainregister_years]$i','$_POST[domainregister_price]$i')");
I just moved the $i to the outside of the [] and it works now.
Thanks for everyone's input..helped me open my eyes a bit.
Tyler
On Mon, 2003-12-22 at 12:51, John W. Holmes wrote:
> Tyler Longren wrote:
> > Error:
> > Parse error: parse error, expecting `']'' in
> > /usr/local/apache/htdocs/UP/index.php on line 871
> >
> > ('$_POST[domainregister_domain$i]',
>
> If you're going to be creating array keys like that, break out of the
> string to do it.
>
> ('" . $_POST['domainregister_domain' . $i] . "', ...
>
> Having a key like that kind of begs the question of why you're not just
> using $_POST['domainregister_domain'][$i], though...
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
[snip]
I put this right above like 871:
print "<br><br>$_POST[domainregister_domain$i]<br><br>";
So now that "print" line is 871. It produces the exact same error as
the mysql_query() line.
[/snip]
I should have mentioned this in my last email. You should try a
print_r of the $_POST array.
print "<pre>";
print_r($_POST);
print "</pre>";
that will give you every value in the array and all of the array keys.
I would probably put togethere the sql string like John Holmes'
example. ('" . $_POST['domainregister_domain' . $i] . "', ...
attached mail follows:
Tyler Longren wrote:
> Hi Matt,
>
> I put this right above like 871:
> print "<br><br>$_POST[domainregister_domain$i]<br><br>";
>
> So now that "print" line is 871. It produces the exact same error as
> the mysql_query() line.
>
> The reason I'm doin it like this is cuz I'm dynamically generating
> forms, and lots of the fields are the same, just with different numbers
> at the end:
> ex:
> domainregister_domain1
> domainregister_domain2
>
> Those field names are generated by PHP for the form, and now I'm doing
> the page to process that form. Would doing
> $_POST['domainregister_domain'][$i] get the correct value from my
> "domainregister_domain1" field if $i=1?
So name all of your form elements "domainregister_domain[]" and now
you'll be submitting an array.
You'll end up with $_POST['domainregister_domain'][0] as the value of
the first one, $_POST['domainregister_domain'][1] as the second, etc.
You can then use them directly in a string/echo:
echo "Value is: {$_POST['domainregster_domain'][0]}.";
If you continue to do it the way you are, then break out of the string.
echo "Value is " . $_POST['domainregister_domain' . $i] . ".";
or
echo "Value is " . $_POST["domainregister_domain$i"] . ".";
The reason you can't do it the way you are now is that you're expecting
PHP to evaluate the variables twice. First, evaluate $i, then evaluate
$_POST with the evaluated value of $i. PHP gets confused (rightfully so).
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
Thanks for your reply!
> Have a look at: http://pear.php.net/package/HTTP_Download
I looked at it and it's hard to see what it does differently from what I
do...
> And the first comment of:
> http://www.php.net/manual/en/function.session-cache-limiter.php
Thanks, I've read that and I'm not using output compression.
> Perhaps you should not use ouput-compression, and look at the headers
> generated by PHP
>
> What headers are sent? Do you use sessions?
I use sessions, and I've tried to send the same headers as the webserver
sends if I download a file directly (rather than through PHP).
It doesn't work... Maybe I should just create a temporary file and relocate
the browser to it in case the browser is IE...
> you can see this using Mozilla + Live Headers, Ethereal,
> http://schroepl.net/cgi-bin/http_trace.pl ...
Thanks, I've written my own HTTP header tracer in C++, but it hasn't been
able to help me since the headers looks good to me...
/Andreas
attached mail follows:
Did you try session_cache_limiter('private_no_expire')?
Andreas Magnusson wrote:
> Thanks for your reply!
>
>
>>Have a look at: http://pear.php.net/package/HTTP_Download
>
>
> I looked at it and it's hard to see what it does differently from what I
> do...
>
>
>
>>And the first comment of:
>>http://www.php.net/manual/en/function.session-cache-limiter.php
>
>
> Thanks, I've read that and I'm not using output compression.
>
>
>
>>Perhaps you should not use ouput-compression, and look at the headers
>>generated by PHP
>>
>>What headers are sent? Do you use sessions?
>
>
> I use sessions, and I've tried to send the same headers as the webserver
> sends if I download a file directly (rather than through PHP).
> It doesn't work... Maybe I should just create a temporary file and relocate
> the browser to it in case the browser is IE...
>
>
>>you can see this using Mozilla + Live Headers, Ethereal,
>>http://schroepl.net/cgi-bin/http_trace.pl ...
>
>
> Thanks, I've written my own HTTP header tracer in C++, but it hasn't been
> able to help me since the headers looks good to me...
>
> /Andreas
>
attached mail follows:
I was wondering a good place I could get started on reading excel
spreadsheets in PHP ive seen a couple of things out there that will take
data from the web and transform it into a .xls file. I was wondering if I
could take a XLS file with php and read it, and rip out certain data from it
:-) but just knowing how to read it to the screen would be enough to get me
going. Thanks!
Dragoonkain
attached mail follows:
[snip]
I was wondering a good place I could get started on reading excel
spreadsheets in PHP ive seen a couple of things out there that will
take
data from the web and transform it into a .xls file. I was wondering if
I
could take a XLS file with php and read it, and rip out certain data
from it
:-) but just knowing how to read it to the screen would be enough to
get me
going. Thanks!
[/snip]
you could use the excel com object if you are on windows
http://fi.php.net/manual/en/ref.com.php
I know there is a pear package to write excel files but not sure if
there is one to read them yet.
If you can use perl you can use Spreadsheet::ParseExcel, I have used it
before and it works really well.
http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2602/ParseExcel.pm
attached mail follows:
Andrew Kwiczola wrote:
> I was wondering a good place I could get started on reading excel
> spreadsheets in PHP ive seen a couple of things out there that will take
> data from the web and transform it into a .xls file. I was wondering if I
> could take a XLS file with php and read it, and rip out certain data from it
> :-) but just knowing how to read it to the screen would be enough to get me
> going. Thanks!
To actually read the XLS file, you'll probably need to use COM. Or if
you convert / save-as the file to a .csv, then you can read it as a
normal text file.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
Hey there...
Are you using a windows server? If so, I can provide you with code
examples as to how to select fields and write new excel docs using the
COM stuff built into windows.
For linux, things get a little bit more complicated -- really, you just
need some sort of external app to do the conversion. Something like this
might help:
http://chicago.sourceforge.net/xlhtml/
-- jon
-----Original Message-----
From: Andrew Kwiczola [mailto:Akwiczola
EFFICIENTELECTRIC.COM]
Sent: Monday, December 22, 2003 11:47 AM
To: 'php-general
lists.php.net'
Subject: [PHP] reading excell and writing to text file..
I was wondering a good place I could get started on reading excel
spreadsheets in PHP ive seen a couple of things out there that will take
data from the web and transform it into a .xls file. I was wondering if
I could take a XLS file with php and read it, and rip out certain data
from it
:-) but just knowing how to read it to the screen would be enough to get
me going. Thanks!
Dragoonkain
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 12/11/2003
attached mail follows:
Ben,
I was trying the same thing, but I am not sure you are using the same
setup as me. My office runs a windows 2000 domain with a Exchange server
2000 box. All profile information is stored in the windows 2000 domain
controller, and the exchange server accesses the information from there.
So it doesnt use its own LDAP. And to make it all the more interesting,
this script is running on our Intranet, on a FreeBSD 5 box with the
OpenLDAP client.
The following script will bring back all the fields available in LDAP,
as long as they are filled out. In this script you need to have a valid
<DOMAIN_USER> and a valid <DOMAIN_PASS>. There are ways to do this
anonymously, you just need to change the $ldap_bind line to remove the
$ldaprdn and $ldappass.
To change the search criteria, you can change the "$filter" variable, at
the moment it filters on the domain user's userid, or "samaccountname".
At the bottom of this post, I have included search results based on my
user, I have removed everything except the fields you might want.
<?
$ldapuser = "<DOMAIN_USER>";
$ldappass = "<DOMAIN_PASS>";
$ldaprdn = 'DOMAIN\\'.$ldapuser;
$ldapconn =
ldap_connect("dns.domain.com", 3268);
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
if ($ldapconn) {
$ldapbind =
ldap_bind($ldapconn, $ldaprdn, $ldappass);
}
$base_dn = "DC=dns,DC=domain,DC=com";
$filter="samaccountname=$ldapuser";
$read = ldap_search($ldapconn, $base_dn, $filter);
$info = ldap_get_entries($ldapconn, $read);
$ii=0;
for ($i=0; $ii<$info[$i]["count"]; $ii++){
$data = $info[$i][$ii];
echo $data.": ".$info[$i][$data][0]."<br>";
}
?>
Hope it helps
Phil Dowson
Ben Crothers wrote:
> Hoping this is an easy question to answer, apologise upfront if this is so
> basic, but just been put in charge of a PHP app with LDAP interface to M$
> Exchange, and trying to figure out how it works.
>
> At the moment it works fine and extracts fields like first- and surname,
> title, department, etc. I need to add the 'office' field, and added it at
> the end of this filter line:
>
> ---------------------------------------------------
> $filter =
> "(|(sn=$search[$i]*)(givenname=$search[$i]*)(title=$search[$i]*)(department=
> $search[$i]*)(office=$search[$i]*))";
> ----------------------------------------------------
>
> ...but so far it's not working. I *know* there's data in the 'office'
> field -- any ideas as to what I'm missing?
>
> Thanks a lot in advance,
>
> Ben
----------------
---Field List---
----------------
homemdb:
manager:
memberof:
altrecipientbl:
publicdelegatesbl:
streetaddress:
info:
cn:
company:
c:
department:
description:
displayname:
mail:
facsimiletelephonenumber:
givenname:
initials:
instancetype:
legacyexchangedn:
l:
distinguishedname:
objectcategory:
objectclass:
objectguid:
objectsid:
homephone:
mobile:
pager:
physicaldeliveryofficename:
postofficebox:
postalcode:
primarygroupid:
proxyaddresses:
name:
samaccountname:
samaccounttype:
showinaddressbook:
st:
sn:
telephonenumber:
co:
textencodedoraddress:
title:
useraccountcontrol:
userprincipalname:
usnchanged:
usncreated:
whenchanged:
whencreated:
wwwhomepage:
mailnickname:
msexchuseraccountcontrol:
deliverandredirect:
homemta:
msexchhomeservername:
msexchmailboxguid:
msexchmailboxsecuritydescriptor:
mdbusedefaults:
protocolsettings:
----------------
---Field List---
----------------
attached mail follows:
Steve, et al --
...and then Steve Murphy said...
%
% Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here:
Heh :-) I always ask "what's wrong with progress bar in your browser?"
%
% http://www.pfohlsolutions.com/projects/upload/
That didn't keep me from trying this, though; it would be interesting.
Unfortunately I tried the demo and uploaded a 466k zip file and got
nothing until I then got the "File Upload Complete" result page. Um,
what is it supposed to do?
TIA & HAND & Happy Holidays
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/50PGGb7uCXufRwARAnM6AKClwK2USLKqxRsEhtOCSKMXoL0oNACcD1Lv
AVdM42JXn3x10ncWhdDbwDM=
=E6so
-----END PGP SIGNATURE-----
attached mail follows:
David,
A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly.
Steve
-----Original Message-----
From: David T-G [mailto:davidtg-php
justpickone.org]
Sent: Monday, December 22, 2003 2:20 PM
To: PHP General list
Cc: Steve Murphy
Subject: [PHP] Re: progress in php (was "Re: [PHP] Working pop-up
progress window")
Steve, et al --
...and then Steve Murphy said...
%
% Every time I see someone ask about an upload meter a hardcore programmer writes back saying no one ever asks for it so why should anyone work on one? I have a demo up of what you might be looking for, check it out here:
Heh :-) I always ask "what's wrong with progress bar in your browser?"
%
% http://www.pfohlsolutions.com/projects/upload/
That didn't keep me from trying this, though; it would be interesting.
Unfortunately I tried the demo and uploaded a 466k zip file and got
nothing until I then got the "File Upload Complete" result page. Um,
what is it supposed to do?
TIA & HAND & Happy Holidays
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
attached mail follows:
Hey,
I have stored the name of a function as a variable. I have then passed the
variable to another function as follows:
//put function name in a variable
$contentfunction = “newsadmincontent()”;
//pass variable to another function
Html_content($contentfunction);
//function is:
function html_content($contentfunction)
{
?>
<tr>
<td colspan="2" valign="top">
<table width="100%" height="390" border="1" cellpadding="0"
cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF">
<tr>
<td valign="top">
<?
$contentfunction; //doesn’t work
Echo $contentfunction; //outputs the name of the
function but does not evaluate it
Echo “<? “.$contentfunction.” ?>”; //outputs <?
Newsadmincontent() ?> but does not evaluate it
?>
</td>
</tr>
</table>
</td>
</tr>
<?
}
This does seem like a simple question but I cannot find any information to
help me. Can anyone tell me how to get the function to be executed here?
Thanks
Carey
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
attached mail follows:
On Mon, 2003-12-22 at 12:36, Carey Baird wrote:
> Hey,
>
> I have stored the name of a function as a variable. I have then passed the
> variable to another function as follows:
>
> //put function name in a variable
> $contentfunction = “newsadmincontent()”;
>
> //pass variable to another function
> Html_content($contentfunction);
>
> //function is:
> function html_content($contentfunction)
> {
> ?>
>
> <tr>
> <td colspan="2" valign="top">
> <table width="100%" height="390" border="1" cellpadding="0"
> cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF">
> <tr>
> <td valign="top">
> <?
> $contentfunction; //doesn’t work
> Echo $contentfunction; //outputs the name of the
> function but does not evaluate it
> Echo “<? “.$contentfunction.” ?>”; //outputs <?
> Newsadmincontent() ?> but does not evaluate it
> ?>
> </td>
> </tr>
> </table>
> </td>
> </tr>
>
> <?
> }
>
>
> This does seem like a simple question but I cannot find any information to
> help me. Can anyone tell me how to get the function to be executed here?
Try $$contentfunction
- Brad
attached mail follows:
try eval($contentfunction);
attached mail follows:
Eval ($contentfunction); gave me a parse error:
Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145)
: eval()'d code on line 1
$$contentfunction didn’t output anything
Any other ideas?
-----Original Message-----
From: Brad Pauly [mailto:brad
robinsontech.com]
Sent: 22 December 2003 19:43
To: Carey Baird
Cc: php-gen
Subject: Re: [PHP] evaluating a variable
On Mon, 2003-12-22 at 12:36, Carey Baird wrote:
> Hey,
>
> I have stored the name of a function as a variable. I have then passed the
> variable to another function as follows:
>
> //put function name in a variable
> $contentfunction = “newsadmincontent()”;
>
> //pass variable to another function
> Html_content($contentfunction);
>
> //function is:
> function html_content($contentfunction)
> {
> ?>
>
> <tr>
> <td colspan="2" valign="top">
> <table width="100%" height="390" border="1" cellpadding="0"
> cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF">
> <tr>
> <td valign="top">
> <?
> $contentfunction; //doesn’t work
> Echo $contentfunction; //outputs the name of the
> function but does not evaluate it
> Echo “<? “.$contentfunction.” ?>”; //outputs <?
> Newsadmincontent() ?> but does not evaluate it
> ?>
> </td>
> </tr>
> </table>
> </td>
> </tr>
>
> <?
> }
>
>
> This does seem like a simple question but I cannot find any information to
> help me. Can anyone tell me how to get the function to be executed here?
Try $$contentfunction
- Brad
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
attached mail follows:
[snip]
Eval ($contentfunction); gave me a parse error:
Parse error: parse error in
/home/pickled/public_html/main/inc/html.php(145)
: eval()'d code on line 1
[/snip]
try to add a semicolon to the end of the variable $contentfunction =
"newsadmincontent();";
attached mail follows:
On Mon, 2003-12-22 at 12:43, Carey Baird wrote:
> Eval ($contentfunction); gave me a parse error:
>
> Parse error: parse error in /home/pickled/public_html/main/inc/html.php(145)
> : eval()'d code on line 1
>
>
> $$contentfunction didn’t output anything
>
> Any other ideas?
What are you trying to do exactly? Looking at your code again maybe you
want:
$contenctfunction();
- Brad
attached mail follows:
Carey Baird wrote:
> Hey,
>
> I have stored the name of a function as a variable. I have then passed the
> variable to another function as follows:
>
> //put function name in a variable
> $contentfunction = “newsadmincontent()”;
Take off the parenthesis...
$contentfunction = 'newsadmincontent';
To call the function, you simply use:
$contentfunction();
Which will call the "newsadmincontent" function.
$contentfunction = 'newsadmincontent';
html_function($contentfunction);
function html_function($func_name)
{
echo "You requested to execute the function: $func_name.";
echo 'The output of the function is: ' . $func_name();
}
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
On Mon, 2003-12-22 at 13:09, John W. Holmes wrote:
> Carey Baird wrote:
> > Hey,
> >
> > I have stored the name of a function as a variable. I have then passed the
> > variable to another function as follows:
> >
> > //put function name in a variable
> > $contentfunction = “newsadmincontent()”;
>
> Take off the parenthesis...
>
> $contentfunction = 'newsadmincontent';
>
> To call the function, you simply use:
>
> $contentfunction();
>
> Which will call the "newsadmincontent" function.
>
>
> $contentfunction = 'newsadmincontent';
>
> html_function($contentfunction);
>
> function html_function($func_name)
> {
> echo "You requested to execute the function: $func_name.";
> echo 'The output of the function is: ' . $func_name();
> }
Nicely explained!
Please disregard my earlier suggestions. Typing too fast and not paying
enough attention. I'll go sit in the corner now =)
- Brad
attached mail follows:
I have 2 list fields in a form. The second is populated basing on selection in field 1. Can anyone pls tell me how to do this in PHP ?
attached mail follows:
> I have 2 list fields in a form. The second is populated basing on
> selection in field 1. Can anyone pls tell me how to do this in PHP ?
You can't do this with PHP. PHP is server side which means it only
reacts after a request has been made to the server (by loading a Web
page or submitting a form, for example). For what you're trying to do,
you'll need to use JavaScript, which is client side. You can use PHP to
help create the JavaScript, though. There are some ready-made scripts
available for this purpose (search Google).
Hope that helps,
Larry
attached mail follows:
[snip]
I have 2 list fields in a form. The second is populated basing on
selection in field 1. Can anyone pls tell me how to do this in PHP ?
[/snip]
you can't, onchange is fired with javascript on the client. You have a
number of ways you can do it a few are.
1. have on change submit the form to a php page, grab the form variable
from the first drop down and build the second select box.
2. if the data set is small, output it all to the page as javascript
arrays, then onchange, rebuild the second drop down box.
3. take a look at
http://developer.apple.com/internet/javascript/iframe.html
these are just a few options.
attached mail follows:
Steve --
...and then Steve Murphy said...
%
% David,
% A window will popup with the progress meter. Obviously don't block popups and try using a larger file if you have a high speed line, it takes a second for the meter to start and if the upload is done it won't popup properly.
Ah. Since I don't use javascript I probably won't get a lot out of it :-)
Darn; I was hoping for something non-JS. I guess I'll stick with my
browser status window.
%
% Steve
Thanks & HAND & Happy Holidays
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/51DaGb7uCXufRwARAl+cAJ9hsAv8Pqptnhq2CHrNaVYkVFwo9ACgyJqL
lGwffFB5g27D9UolI7QhYqM=
=POHY
-----END PGP SIGNATURE-----
attached mail follows:
I'm trying to write a class for abstracting some aspects
of database programming and am running into a problem:
http://hashphp.org/pastebin.php?pid=567
The code works fine for the first instantiation of the DbTable (Product)
class,
but not the second. It seems clear that the reason it works the first
time is that overload() isn't called until after describe() in DbTable's
constructor,
so DbTable can "see" its actual properties. The second time it's
instantiated, the
class is already overloaded, so it can't and describe() fails to
populate the columns
array. Unfortunately, seeing the problem is not helping me see the
solution =P
Does anyone have an idea for a workaround for this?
BTW, the DbTable class isn't tied to any particular table, so it should
be easy to test against
any spare PostgreSQL tables you might have lying around (just change the
test code).
TIA,
Cliff
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]