php-general Digest 11 Oct 2005 13:45:36 -0000 Issue 3731
Topics (messages 223873 through 223893):
Re: Seg Faults with PHP 5.0.5, now on Solaris and SLES9
223873 by: Jochem Maas
223890 by: Jochem Maas
Re: Problem w/ Hidden Input Fields
223874 by: Jochem Maas
223882 by: Jochem Maas
223883 by: Kim Madsen
Re: str_replace
223875 by: Jochem Maas
Re: Can I call .html file as a form action instead of .php?
223876 by: Michael Crute
223877 by: Jasper Bryant-Greene
Performance of server-side DOM?
223878 by: Jeff Schmidt
NZ Aegir Users/Developers
223879 by: Tim Haines
Template Security Advice (WASP - http://wasp.sourceforge.net)
223880 by: Brian Fioca
Re: Help with logic :(
223881 by: Jochem Maas
Re: PHP5 Soap + .NET Webservice
223884 by: Chris Hemmings
Sequential multiple file download?
223885 by: David Merritt
223891 by: Jay Blanchard
Re: storing passwords in $_SESSION
223886 by: Terence
php5.1RC/COM/Word
223887 by: George Pitcher
223888 by: Jochem Maas
Re: Get Mac Address
223889 by: Ben Sagal
Run a php script as a separate thread/process
223892 by: Tommy Jensehaugen
223893 by: Tommy Jensehaugen
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 ---
Chuck wrote:
After 3 months of headache and intermittent seg faults on Solaris 9, we
decided to give SLES 9 a try.
Now we get continuous seg faults.
I am running apache 2.0.54 on SLES 9 with all updates, and Oracle
10.2.0.1<http://10.2.0.1>.
(everything is the 32-bit flavor)
I built PHP as follows:
adcinfops02:/usr/local/httpd-2.0.54/htdocs #./configure
--prefix=/usr/local/php-5.0.5 --with-apxs2=/usr/local/httpd-2.0.54/bin/apxs
long shot: which worker module do you have enabled in httpd.conf?
you can only use 'pre-fork' with php.
--enable-cli --enable-debug --with-config-file-path=/usr/local/php-5.0.5/lib
--enable-sigchild --with-zlib --with-bz2 --enable-ftp --with-gettext
--enable-mbstring --with-ncurses --with-oci8=/u01/app/oracle/product/10.2
--enable-session --enable-sockets --enable-shared --disable-xml
--disable-libxml --disable-dom --with-jpeg-dir=/usr/lib
--with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-xpm-dir=/usr/lib
--disable-simplexml --without-pear
Here is the simply php page that seg faults _every_ time it is called. (On
solaris, it only seg faulted 25% of the time)
<?php
putenv("ORACLE_HOME=/u01/app/oracle/product/10.2");
putenv("ORACLE_SID=ADCDM02");
putenv("TNS_ADMIN=/var/opt/oracle");
$ora = ociplogon("dm","mypassword", "MYSID");
$stmt=OCIParse($ora, "select USERNAME from dba_users");
$res=OCIExecute($stmt);
$rows = OCIFetchstatement($stmt, $results);
print "DEBUG: rows=$rows<BR>\n";
$keys = array_keys($results);
foreach($keys as $key)
{
print "$key<BR>\n";
}
for($i=0; $i < $rows; $i++)
{
print " " . $results["USERNAME"][$i] . "<BR>\n";
}
OCIFreeStatement($stmt);
OCILogoff($ora);
?>
I can run this script 100 times from the command line ( # php oratest.php )
and not a single seg fault.
Anyone have any idea why this is happenning?
Also, is there a config, any OS, any version, and combination AT ALL, where
PHP is reliable when using Oracle 10g as the back end? Any configuration at
all?
Thx,
CC
--
--- End Message ---
--- Begin Message ---
Chuck wrote:
Yes, prefork is what I am using.
ah ok.
Also made sure and linked with pthread
php + threads are not bedfellows - maybe try dropping
pthread as your AcceptMutex apache directive?
otherwise it could be time to crack open gdb and run apache
through it try and figure out exactly where the problem lies:
something like (I googled for it):
$> gdb /usr/local/apache/bin/httpd
> run -X -DSSL -f /usr/local/apache/conf/httpd.conf
<then view a pagfe and grab a BT>
also/alternatively try recompiling php with only the --with-apxs configure
flag - if that works recompile, each time adding a single flag,
this may pinpoint the problem some more.
... and you could try stepping down to 5.0.4 and wait until 5.1 has
a stable release.
as well.
-CC
On 10/10/05, *Jochem Maas* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Chuck wrote:
> After 3 months of headache and intermittent seg faults on Solaris
9, we
> decided to give SLES 9 a try.
>
> Now we get continuous seg faults.
>
> I am running apache 2.0.54 on SLES 9 with all updates, and Oracle
> 10.2.0.1 <http://10.2.0.1><http://10.2.0.1>.
> (everything is the 32-bit flavor)
>
> I built PHP as follows:
> adcinfops02:/usr/local/httpd-2.0.54/htdocs #./configure
> --prefix=/usr/local/php-5.0.5
--with-apxs2=/usr/local/httpd-2.0.54/bin/apxs
long shot: which worker module do you have enabled in httpd.conf?
you can only use 'pre-fork' with php.
> --enable-cli --enable-debug
--with-config-file-path=/usr/local/php-5.0.5/lib
> --with-zlib --with-bz2 --enable-ftp --with-gettext
> --enable-mbstring --with-ncurses
--with-oci8=/u01/app/oracle/product/10.2
> --enable-session --enable-sockets --enable-shared --disable-xml
> --disable-libxml --disable-dom --with-jpeg-dir=/usr/lib
> --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib
--with-xpm-dir=/usr/lib
> --disable-simplexml --without-pear
>
> Here is the simply php page that seg faults _every_ time it is
called. (On
> solaris, it only seg faulted 25% of the time)
> <?php
>
> putenv("ORACLE_HOME=/u01/app/oracle/product/10.2");
> putenv("ORACLE_SID=ADCDM02");
> putenv("TNS_ADMIN=/var/opt/oracle");
>
>
> $ora = ociplogon("dm","mypassword", "MYSID");
>
> $stmt=OCIParse($ora, "select USERNAME from dba_users");
> $res=OCIExecute($stmt);
>
> $rows = OCIFetchstatement($stmt, $results);
>
> print "DEBUG: rows=$rows<BR>\n";
>
> $keys = array_keys($results);
> foreach($keys as $key)
> {
> print "$key<BR>\n";
> }
> for($i=0; $i < $rows; $i++)
> {
> print " " . $results["USERNAME"][$i] . "<BR>\n";
> }
>
> OCIFreeStatement($stmt);
> OCILogoff($ora);
>
> ?>
>
>
> I can run this script 100 times from the command line ( # php
oratest.php )
> and not a single seg fault.
>
> Anyone have any idea why this is happenning?
>
> Also, is there a config, any OS, any version, and combination AT
ALL, where
> PHP is reliable when using Oracle 10g as the back end? Any
configuration at
> all?
>
> Thx,
> CC
> --
>
--
To reply to this message, remove 'N_O_S_P_A_M' from the reply-to address.
--- End Message ---
--- Begin Message ---
hi Jason,
Jason Ferguson wrote:
I have a <input type="hidden"> field with a value 86 characters long.
Here is the entire form:
<form name="frmWizard" id="frmWizard" method="post" action="">
<table>
<tr>
<td><input type="radio" name="radioKey"
value="2"
checked="checked" />Rootsweb
<input type="hidden" name="txtKeyValue"
id="txtKeyValue"
maxlength="90"
value="ABQIAAAAh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ"
/>
</td>
</tr>
<tr>
<td><input type="radio" name="radioKey"
value="2" />Other Site:
<input type="text" name="txtKeyValue" id="txtKeyOther" /></td>
this text input has the same name, seeing as it comes after the
hidden field it will be submitted after it (in terms of the order
of the POST vars) too. the value of second incoming txtKeyValue
effectively overwrites the first - result is you always see an empty value.
after thought:
you can work around it with javascript or php (and possibly changing
'txtKeyValue' to 'txtKeyValue[]'), or just change the name of
one of the fields :-)
</tr>
<tr>
<td class="center">
<input type="button"
name="btnGenTemplate" id="btnGenTemplate"
value="Generate HTML" onclick="setWizardAction('genHTML.php')" />
</td>
<tr>
<td class="center">
<input type="button" name="btnPrev"
id="btnPrev" value="<--
Prev" disabled="true" />
<input type="button" name="btnNext"
id="btnNext" value="Next
-->" onclick="setWizardAction('mmwizard1.php')"/>
<input type="button" name="btnFinish"
id="btnFinish" value =" Finish" />
</td>
</tr>
</table>
</form>
However, when I submit and do a print_r($_POST), there is no value for
$_POST['txtKeyValue'].
Note: the setWizardAction() function sets the <form action="">
attribute so the Prev/Next buttons work correctly.
The application is very close to being complete, so I need help ASAP
don't quite follow that logic ;-)
.
Jason
--- End Message ---
--- Begin Message ---
Jason Ferguson wrote:
Jochem,
Thanks for the response. I actually solved the problem a few days
ago... I'm suprised this message never went out to the list until
today.
I actually WANTED one to override the other in this case. The user
should be able to choose one of the default radio buttons (in which
case the hidden field would work) or be able to provide their own by
typing/pasting it into the text box.
I see - then I recommend that you reNAME both elements to 'txtKeyValue[]'.
this will cause php to create an array for you so you can always get to
both values. e.g.
print_r($_POST['txtKeyValue']); // Array
that will give you a numerically indexed array, if you rename the textboxes
individually to 'txtKeyValue[default]' and 'txtKeyValue[other]'
you will have an associative array with a structure like:
$arr = array(
'default' =>
'ABQIAAAAh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ',
'other' => '',
);
there is no intrisic need to give the elements an id at all (regardless
never give 2 elements on one page the same id.)
I got around the problem by temporarily using a rather ugly switch
statement until I revist the problem in a later release.
I like switch statements, my favorite is the rather evil use
of switch()'ing on true:
switch (true) {
case (/* arbitrary boolean expression */):
break;
// .. and so on
}
Jason
On 10/10/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
hi Jason,
Jason Ferguson wrote:
I have a <input type="hidden"> field with a value 86 characters long.
Here is the entire form:
<form name="frmWizard" id="frmWizard" method="post" action="">
<table>
<tr>
<td><input type="radio" name="radioKey"
value="2"
checked="checked" />Rootsweb
<input type="hidden" name="txtKeyValue"
id="txtKeyValue"
maxlength="90"
value="ABQIAAAAh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx36BXXgbYZONZls0B1LQ"
/>
</td>
</tr>
<tr>
<td><input type="radio" name="radioKey"
value="2" />Other Site:
<input type="text" name="txtKeyValue" id="txtKeyOther" /></td>
this text input has the same name, seeing as it comes after the
hidden field it will be submitted after it (in terms of the order
of the POST vars) too. the value of second incoming txtKeyValue
effectively overwrites the first - result is you always see an empty value.
after thought:
you can work around it with javascript or php (and possibly changing
'txtKeyValue' to 'txtKeyValue[]'), or just change the name of
one of the fields :-)
</tr>
<tr>
<td class="center">
<input type="button" name="btnGenTemplate"
id="btnGenTemplate"
value="Generate HTML" onclick="setWizardAction('genHTML.php')" />
</td>
<tr>
<td class="center">
<input type="button" name="btnPrev"
id="btnPrev" value="<--
Prev" disabled="true" />
<input type="button" name="btnNext"
id="btnNext" value="Next
-->" onclick="setWizardAction('mmwizard1.php')"/>
<input type="button" name="btnFinish"
id="btnFinish" value =" Finish" />
</td>
</tr>
</table>
</form>
However, when I submit and do a print_r($_POST), there is no value for
$_POST['txtKeyValue'].
Note: the setWizardAction() function sets the <form action="">
attribute so the Prev/Next buttons work correctly.
The application is very close to being complete, so I need help ASAP
don't quite follow that logic ;-)
.
Jason
--- End Message ---
--- Begin Message ---
Hello
> -----Original Message-----
> From: Jason Ferguson [mailto:[EMAIL PROTECTED]
> Sent: Sunday, October 09, 2005 5:55 PM
> To: [email protected]
> Subject: [PHP] Problem w/ Hidden Input Fields
>
> I have a <input type="hidden"> field with a value 86 characters long.
> Here is the entire form:
>
> <form name="frmWizard" id="frmWizard" method="post"
> action="">
> <table>
> <tr>
>
> <td><input
> type="radio" name="radioKey" value="2"
> checked="checked" />Rootsweb
> <input
> type="hidden" name="txtKeyValue" id="txtKeyValue"
> maxlength="90"
> value="ABQIAAAAh2cCTTmAE6T4OXjecIFe5BQMxb4e6BwgeSB7cBu9SbVQSak6ARTgAPoctbx
> 36BXXgbYZONZls0B1LQ"
> />
> </td>
> </tr>
> <tr>
> <td><input
> type="radio" name="radioKey" value="2" />Other Site:
> <input type="text" name="txtKeyValue" id="txtKeyOther" /></td>
> </tr>
> <tr>
> <td class="center">
>
> <input
> type="button" name="btnGenTemplate" id="btnGenTemplate"
> value="Generate HTML" onclick="setWizardAction('genHTML.php')" />
> </td>
> <tr>
> <td class="center">
> <input
> type="button" name="btnPrev" id="btnPrev" value="<--
> Prev" disabled="true" />
> <input
> type="button" name="btnNext" id="btnNext" value="Next
> -->" onclick="setWizardAction('mmwizard1.php')"/>
> <input
> type="button" name="btnFinish" id="btnFinish" value =" Finish" />
> </td>
> </tr>
>
> </table>
> </form>
>
> However, when I submit and do a print_r($_POST), there is no value for
> $_POST['txtKeyValue'].
Because You later in the form set:
<input type="text" name="txtKeyValue" id="txtKeyOther" />
It´s overwritten then.
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper
ComX Networks A/S
Naverland 31, 2
DK-2600 Glostrup
Denmark
Phone: +45 70 25 74 74
direct: +45 32 87 73 93
Fax: +45 70 25 73 74
Web: www.comx.dk
E-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Charles Stuart wrote:
A student run server on my old campus used to turn off PHP for security
reasons - ridiculous.
Would it be possible to use XSS to call curl from a remote site? I'm
just a beginner so that may or not make sense.
I'm not really a beginner but I don't know if that makes sense either :-S
I'm pretty sure the answer is no.
Indeed it does seem like JS is the solution - unfortunately - as it
workaround, not solution. a new host would be a solution,
one that means you don't have to waste time coding around completely
crazy setups.
seems like their 'trap' catches any string including CURL U before I
seems like a total bogus filter. exactly what makes 'CURL U' so evil when
passed to a php/cgi script anyway?
can str_replace the string after gathering the input with _POST. Anyone
disagree?
well you could check out something like:
<?
$putdata = fopen( "php://input" , "rb" );
while(!feof( $putdata ))
echo fread($putdata, 4096 );
fclose($putdata);
?>
or
<?
echo file_get_contents('php://input');
?>
or
<?
echo $HTTP_RAW_POST_DATA;
?>
best,
Charles
On Oct 10, 2005, at 3:12 PM, Rory Browne wrote:
I'm not completely sure, but I think they're talking shite. If curl is
I think I can smell it here too.
--- End Message ---
--- Begin Message ---
On 10/10/05, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> In addition to the Good column, let me add this:
>
> Once I made all my .html files go through PHP, I found myself adding a
> lot of cool little snippets to my files that I wouldn't have bothered
> with if I had to re-name the file, fix all the links, worry about
> search engines "losing" my page, etc.
>
> I would encourage anybody but the most hard-core million-hits-per-day
> super-stressed folks to just go ahead and use PHP on .htm and .html
Except its terrible form and not at all portable.
If 5% to 10% is putting you over the edge on performance, you're
> already in trouble anyway.
>
> NOTE:
> 5% to 10% was a lonnnnnnng time ago. I'd love to see more current
> benchmarks or, better, real-live stats from a moderately busy/complex
> server.
I highly doubt that many people use this configuration so there really
hasn't been any need for a new benchmark.
-Mike
--
________________________________
Michael E. Crute
Software Developer
SoftGroup Development Corporation
Linux, because reboots are for installing hardware.
"In a world without walls and fences, who needs windows and gates?"
--- End Message ---
--- Begin Message ---
Michael Crute wrote:
On 10/10/05, *Richard Lynch* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
wrote:
In addition to the Good column, let me add this:
Once I made all my .html files go through PHP, I found myself adding a
lot of cool little snippets to my files that I wouldn't have bothered
with if I had to re-name the file, fix all the links, worry about
search engines "losing" my page, etc.
I would encourage anybody but the most hard-core million-hits-per-day
super-stressed folks to just go ahead and use PHP on .htm and .html
Except its terrible form and not at all portable.
I don't do this myself (I leave extensions off PHP files instead, but
that's another story...), but it is reasonably portable -- every web
host I've ever dealt with supports .htaccess files; just put the
following line in an .htaccess file in the root of your application.
AddType application/x-httpd-php .html
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
--- End Message ---
--- Begin Message ---
Hello,
I've been toying around, lately, with using PHP's DOM API
(specifically, domxml because I'm still using PHP4) for doing some of my
server side dynamic pages, instead of the 'classic' method of outputting
a serial stream of html dynamically generated with, e.g. php print()
statements. The reason this is attractive to me is that,
programmatically, it makes it easier to seperate logic from
presentation. I realize that PHP has available, through PEAR and
otherwise, various templating systems that attempt to address that need,
but I've found some of the templating systems, at least, to be somewhat
confusing, whereas the DOM seems pretty straightforward to me.
But, I've wondered about the performance implications of my would-be
method. Namely, I would normally start by reading in an html 'template'
file with the function domxml_open_file, modify it to my hearts content
with DOM methods, and then use DomDocument->html_dump_mem() to
re-serialize the html and send it to the web-browser.
Is this horribly inefficient, or just a small, reasonable overhead?
--- End Message ---
--- Begin Message ---
Hi there,
I'm on the hunt for some Aegir users/developers in New Zealand. Please
email me offlist - [EMAIL PROTECTED] if you know of any.
Cheers,
Tim.
--- End Message ---
--- Begin Message ---
I'm finishing up my WASP framework 1.0 release (http://
wasp.sourceforge.net) and I'm trying to decide the best way to lay
out the template directories.
WASP uses HTML_Template_Flexy for its template system. The templates
are compiled using "Chunk" classes that each refer to a html template.
The way it works now, the directory structure of applications is
|_ /webroot/module/templates
where module is where the php classes are stored, and templates is
where the html templates are stored. The templates used to be stored
in a seperate directory outside of the web root, as such
|_ /templates/
|_ /webroot/ModuleDir
however it becomes cumbersome to keep track of which templates go to
which php classes, so for organization sake having the template
directory located beneath each module directory is easier to navigate.
My problem is, anyone who realizes a particular application uses WASP
can go to a url, say http://blah/module, and look at the html files
in the template directory (ex. http://blah/module/templates). Is it
too much of a security issue to justify this useful organization?
Theoretically the addition of an .htaccess file in the templates
directories could solve the problem, but is that compounding the
issue even more? I guess I'm asking for someone to tell me it's ok
to do it this way, but if nobody agrees I can change it back.
Thanks for the input.
-Brian
/**
* Brian Fioca
* Chief Scientist / Sr. Technical Consultant
* PangoMedia - http://pangomedia.com
* @work 907.868.8092x108
* @cell 907.440.6347
*/
smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
On Mon, October 10, 2005 3:24 pm, Dan McCullough wrote:
create a function to check if the rndnumber=couponcode row count = 0
if not then redo rndnumber if it does = 0 then insert rndnumber
Noooooooooooooooooooooooooooo!
You are creating a RACE CONDITION in which ONE user might generate a
'valid' code, and ANOTHER user might generate a 'valid' code AT THE
SAME TIME, and then they BOTH get the same coupon code.
The probability of this is very very very low, but still NOT zero.
And it's the kind of thing that won't show up in testing, but sure as
God made little green apples, it WILL happen at the worst possible
time after you "go live"
lol. Richard you should write a book :-) (or should that be 'another book'?)
The database engine has a *TON* of code in it to avoid this kind of
Bad Thing happening.
Use it.
create a UNIQUE INDEX on the column that needs to be unique.
Trap the INSERT error.
--- End Message ---
--- Begin Message ---
Thanks Richard,
I think I might start on a slightly simpler service, it seems MS has
done its best to complicate everything.
I have managed to get something working, but, god knows why the their
example web service is sending back schema data as well as the result
data, quite over the top. I'm guessing it helps their .NET stuff all
work together nicely.
Anyway, thanks again.
Chris.
Richard Lynch wrote:
On Mon, October 10, 2005 4:40 am, Chris Hemmings wrote:
Can anyone explain how this works, and, how to fix it. I'm can't find
any documentation on the problem I am having.
colon-separated name-spaces in XML are a relatively new development.
Your XML parser probably is not up to speed on them yet...
You'd have to upgrade your XML parser, or replace it with one that is
aware of this newer XML format.
I forget the precise terminology for colon-separated name-spaces in
XML, so your first task is to find out what the heck it's called. :-)
--- End Message ---
--- Begin Message ---
All,
Is there a way to do a sequential multiple file download? I have the scenario
where based on various factors/inputs a user ends up with a list of files to
download from the web server. This is an array of filenames from 1 to x total
number of files. I want the user to be able to select/click one time in the
browser to start the download of the first file in the list, then have the
standard browser download/save to dialog kick box in for where to save the first
file to. Once the first file has downloaded, I then want the second file in the
list to start downloading, kick in the std. dialog box again for the user to
save
the second file, and so on until all files in the list have been
sent/downloaded.
I know I could zip all the files together on the server first and then download
the one single file but for this application I need to do the sequential,
individual file download, one file at a time.
Iâm open to any solution whether it be PHP, PHP/Javascript, or any other
language. Obviously all PHP would be the preferred choice as the rest of the
site application is PHP but the functionality required overrides everything
else.
TIA,
Dave Merritt
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
[snip]
Is there a way to do a sequential multiple file download?
[/snip]
I think that the only way to do this in PHP is to zip 'em up and download
that file, but it is an interesting concept and I can see where it would
come in handy. I think that the problem lies in the fact that there would
have to be one request for each of the selected files for download. Each
subsequent request, in order to keep the sequential order of things, would
have to be made at the tail end of the previous request. You might could do
this with a set of JavaScript commands combined with PHP's sleep() and
header("Location:..."), but my guess is that it would not be pretty.
--- End Message ---
--- Begin Message ---
Richard Davey wrote:
Agreed totally, I am curious as to why this question seems to get
asked a LOT though. I wonder what it is that causes this? (other than
inexperience) I mean there must be some common end result these
developers are hoping to obtain, resulting in a password being stashed
away in a session var.
What about this scenario. A system developed using procedures /
functions to update data without direct table access. Bypassing the
single user account from the application to the database (which most web
based apps use), each procedure requires additional parameters
(username,password) which then verifies the user (from a user lookup
table) before executing the stored procedure. This makes the system more
secure in case the web app username and password is breached which
usually has full access to the db.
Of course storing it in a session is a no-no, so what I am trying to get
at is,perhaps a reason for storing the password "somewhere".
Your thoughts Richard?
Thanks!
Warm Regards
Terence
--- End Message ---
--- Begin Message ---
Hi,
My dev machine has PHP 5.1RC installed (no problems so far, apart from
this), its on Win XP. My server is running PHP 5.0.4 on Win NT.
I'm building some MS Word docs and it works fine except when I need to add
something that uses more than one parameter - eg.:
$word->Selection->ParagraphFormat->TabStops->Add->Position(418,0,0);
Whenever I use something that needs more than one parameter, I get my Word
document generated up to that point and an error message on the web page:
"PHP Fatal error: Uncaught exception 'com_exception' with message 'Error
[0x8002000e] Invalid number of parameters.'".
Does anyone know of a solution?
No smart-Alec replies please.
cheers
George in Oxford
--- End Message ---
--- Begin Message ---
George Pitcher wrote:
Hi,
My dev machine has PHP 5.1RC installed (no problems so far, apart from
this), its on Win XP. My server is running PHP 5.0.4 on Win NT.
I'm building some MS Word docs and it works fine except when I need to add
something that uses more than one parameter - eg.:
$word->Selection->ParagraphFormat->TabStops->Add->Position(418,0,0);
Whenever I use something that needs more than one parameter, I get my Word
document generated up to that point and an error message on the web page:
"PHP Fatal error: Uncaught exception 'com_exception' with message 'Error
[0x8002000e] Invalid number of parameters.'".
you should be using a try/catch block (lets assume for now that the error
msg is correct and COM is not broken as such):
try {
/* do stuff ... e.g. */
$word->Selection->ParagraphFormat->TabStops->Add->Position(418,0,0);
} catch (com_exception $e) {
print_r($e); // or do some better error handling
}
catching the exception will give you the opportunity to continue the
script (rather than having to swallow a fatal error) - the fact that your
getting an exception is either because you really are using the wrong
number of parameters or the COM extension is broken in 5.1 (I guess -
maybe check bugs.php.net to see if someone has filed anything regarding this)
btw there is also the keyword 'throw' that complements try/catch - the manual
explains the basics of exception throwing and catching much better than I
can (be bothered to ;-)
Does anyone know of a solution?
No smart-Alec replies please.
thats kinda asking for it ;-)
"stop your fatal error; don't run the script; garanteed to work
on all platforms"
cheers
George in Oxford
--- End Message ---
--- Begin Message ---
I did mention this is an INTRANET server so all clients are be local,
there are no router between the clients and the server.
how would i go about accessing arp from php, (the server runs Linux)?
Ben
On 10/10/05, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
> That will give you the *local* mac address, not that of the user
> visiting your page. The problem is the fact that the mac address is not
> sent as part of the REQUEST. As such it's not possible for PHP to find
> out what it is. So, unfortunately, no. (Though it's a very common
> question on this list)
>
> - tul
>
> Rory Browne wrote:
> > On unix
> > man arp
> >
> > on windows
> > arp/h
> > arp/help
> > arp/?
> >
> > sorry for short and sweet resp, but I'm falling asleep.
> >
> > On 10/9/05, Ben Sagal <[EMAIL PROTECTED]> wrote:
> >
> >>I have a local intranet server, running apache1.3+php4. Is it
> >>possible to get the mac address of computes which access on of my php
> >>pages?
> >>
> >>Ben
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >>
>
>
--- End Message ---
--- Begin Message ---
Hi,
Anyone knows how to start a php script as a separate thread/process from
another php script?
example.php:
<?php
some logic
execute('separate_script.php');
more logic
?>
The reason why I want to do this is because separate_script.php has to be
fully executed even if the request for example.php is stopped in the middle
of "more logic".
I am using PHP Version 4.3.11.
Thank you very much for your help..
Cheers,
Tommy
--- End Message ---
--- Begin Message ---
Hi,
Anyone knows how to start a php script as a separate thread/process from
another php script?
example.php:
<?php
some logic
..
..
execute('separate_script.php');
more logic
..
..
?>
The reason why I want to do this is because separate_script.php has to be
fully executed even if the request for example.php is stopped in the middle
of "more logic".
I am using PHP Version 4.3.11.
Thank you very much for your help..
Cheers,
Tommy
--- End Message ---