php-general Digest 11 Jan 2002 17:21:42 -0000 Issue 1105
Topics (messages 80161 through 80213):
Re: Can PHP access BIOS information?
80161 by: Jason Bell
80211 by: Austin Gonyou
Re: Piping phpinfo();
80162 by: Rasmus Lerdorf
80166 by: Vaccius ITsec
80167 by: Vaccius ITsec
80168 by: Kraa de Simon
80169 by: Rasmus Lerdorf
Re: ereg
80163 by: Niklas Lampén
80171 by: Rasmus Lerdorf
Re: ask about cookies
80164 by: gendeng
New mailparse extensions
80165 by: Paul
Authenticating via http
80170 by: Paul
COM
80172 by: DrouetL.ldnegoce.com
Re: New to list
80173 by: hugh danaher
php executing system commands..
80174 by: louie miranda
80179 by: Martin Wickman
80200 by: mike cullerton
80205 by: Matt Friedman
Re: Redeclaring functions
80175 by: Martin Wickman
80208 by: Arve Bersvendsen
Re: Parsing SAR output with PHP.
80176 by: Martin Wickman
80187 by: DL Neil
Re: Specific References Incident
80177 by: Martin Wickman
eregi and alfa numeric characters.
80178 by: Sait Karalar
80182 by: Jimmy
How to get a function backtrace?
80180 by: Stefan Rusterholz
Re: Q: Array
80181 by: Ivo Stoykov
Re: HTTP_X_FORWARDED_FOR?
80183 by: TD - Sales International Holland B.V.
SUMMARY: Seg fault when using SNMP on Redhat 7.x
80184 by: Richard Ellerbrock
Re: quick question
80185 by: Ford, Mike [LSS]
Re: A variable with a variable
80186 by: Ford, Mike [LSS]
passing parameters from one page to another
80188 by: Simos Varelakis
80190 by: val petruchek
80192 by: Sait Karalar
xml dom support
80189 by: Sandeep Murphy
80197 by: Henning Sprang
Sizeof variable variable arrays
80191 by: Neil Freeman
80193 by: Jason Wong
80194 by: Neil Freeman
80195 by: Ford, Mike [LSS]
Php and PDF files...
80196 by: Sait Karalar
session related
80198 by: Mark Chin, Apoll Displays
80199 by: Andrey Hristov
RTFM code snippet
80201 by: mike cullerton
80202 by: Andrey Hristov
80203 by: Andrey Hristov
Re: [PHP-DEV] [PHP] Strange Java Extension Problem (fwd)
80204 by: Xavier Noguer
Compiled PHP
80206 by: charlesk
80207 by: Andrey Hristov
80209 by: Henning Sprang
80210 by: Andrey Hristov
Using PHP to post the contents of an email to MySql database
80212 by: Mullin, Reginald
removing an array element
80213 by: Erik Price
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 ---
as far as I know, PHP can't do that itself, however..... if you had a
commandline utility that did the BIOS read for you, you should be able to
have PHP exec() out to it....
----- Original Message -----
From: "Police Trainee" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2002 9:04 PM
Subject: [PHP] Can PHP access BIOS information?
> Hello. I was trying to determine if PHP has the
> ability to access BIOS information in a WIN
> environment. Specifically, I would like to have PHP
> access the cpu temperature as appears in the BIOS
> menu.
> I am running Apache 1.3.14. The board is a PC 100
> Super 7 M598.
>
> Any help/thoughts/ideas greatly appreciated!
>
> Thank you!
> -mark
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
--- End Message ---
--- Begin Message ---
It might be possible with php of you could write a function that access
lm_sensor type info. Just a thought.
On Fri, 2002-01-11 at 00:03, Jason Bell wrote:
> as far as I know, PHP can't do that itself, however..... if you had a
> commandline utility that did the BIOS read for you, you should be able
> to
> have PHP exec() out to it....
>
>
> ----- Original Message -----
> From: "Police Trainee" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Thursday, January 10, 2002 9:04 PM
> Subject: [PHP] Can PHP access BIOS information?
>
>
> > Hello. I was trying to determine if PHP has the
> > ability to access BIOS information in a WIN
> > environment. Specifically, I would like to have PHP
> > access the cpu temperature as appears in the BIOS
> > menu.
> > I am running Apache 1.3.14. The board is a PC 100
> > Super 7 M598.
> >
> > Any help/thoughts/ideas greatly appreciated!
> >
> > Thank you!
> > -mark
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send FREE video emails in Yahoo! Mail!
> > http://promo.yahoo.com/videomail/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-698-7250
email: [EMAIL PROTECTED]
"It is the part of a good shepherd to shear his flock, not to skin it."
Latin Proverb
signature.asc
Description: This is a digitally signed message part
--- End Message ---
--- Begin Message ---
php -i >logfile
On Fri, 11 Jan 2002, Vaccius ITsec wrote:
>
> Hi,
>
> How does one redirect phpinfo into some logfile?
>
> Rgds,
> -PY
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
On Thu, 10 Jan 2002, Rasmus Lerdorf wrote:
Thanks Rasmus, but I am not looking for a command line option.
I need to pipe phpinfo() from a php script, running under apache.
Normally, phpinfo() will just dump its output onto the browser;
I want to redirect those output to a logfile instead.
Is there a way out?
-PY
> php -i >logfile
>
> On Fri, 11 Jan 2002, Vaccius ITsec wrote:
>
> >
> > Hi,
> >
> > How does one redirect phpinfo into some logfile?
> >
> > Rgds,
> > -PY
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
--- End Message ---
--- Begin Message ---
On Fri, 11 Jan 2002, Paul A. Procacci wrote:
> how about
>
> <?
>
> ob_start();
>
> phpinfo();
>
> $contents = ob_get_contents();
> ob_end_clean();
>
> $fopen = fopen("my_file.log", "w+");
>
> fputs($fopen, $contents);
>
> ?>
What a beauty!
Thanks!
>
> Paul :>
> ----- Original Message -----
> From: "Vaccius Itsec" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 11, 2002 12:21 AM
> Subject: Piping phpinfo();
>
>
> >
> > Hi,
> >
> > How does one redirect phpinfo into some logfile?
> >
> > Rgds,
> > -PY
> >
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Maybe you could use:
$fp = fopen ("http://yoursite/phpinfo.php", "r");
See http://www.php.net/manual/en/function.fopen.php.
Simon.
> -----Original Message-----
> From: Vaccius ITsec [mailto:[EMAIL PROTECTED]]
> Sent: vrijdag 11 januari 2002 8:04
> To: Rasmus Lerdorf
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Piping phpinfo();
>
>
> On Thu, 10 Jan 2002, Rasmus Lerdorf wrote:
>
> Thanks Rasmus, but I am not looking for a command line option.
>
> I need to pipe phpinfo() from a php script, running under apache.
> Normally, phpinfo() will just dump its output onto the browser;
> I want to redirect those output to a logfile instead.
>
> Is there a way out?
>
> -PY
>
> > php -i >logfile
> >
> > On Fri, 11 Jan 2002, Vaccius ITsec wrote:
> >
> > >
> > > Hi,
> > >
> > > How does one redirect phpinfo into some logfile?
> > >
> > > Rgds,
> > > -PY
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
> On Thu, 10 Jan 2002, Rasmus Lerdorf wrote:
>
> Thanks Rasmus, but I am not looking for a command line option.
>
> I need to pipe phpinfo() from a php script, running under apache.
> Normally, phpinfo() will just dump its output onto the browser;
> I want to redirect those output to a logfile instead.
>
> Is there a way out?
Use output buffering.
-Rasmus
--- End Message ---
--- Begin Message ---
You should use preg_match_all() for this.
Something like this should do (didn't try it thou):
preg_match_all("|<!--start-->(.*)<!--stop-->\">|U", $lineofhtml,
$output, PREG_PATTERN_ORDER);
Niklas
-----Original Message-----
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
Sent: 11. tammikuuta 2002 5:56
To: php-list
Subject: [PHP] ereg
This is my code :
ereg("<!--start-->(.*)<!--stop-->", $lineofhtml, $output);
The problem is that, with <!--start-->(.*)<!--stop--> it matches
everthing from the first <!--start--> to the last <!--stop-->... hence
it appears its all in one array... what I need to do is tell it to stop
at the first <!--stop--> and I can't figure out how to do that... any
ideas?
Regards,
Kunal Jhunjhunwala
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
.*? is a Perl'ism and only supported by the preg* functions. Use
preg_match() instead of ereg() and it will work.
-Rasmus
On Fri, 11 Jan 2002, Martin Towell wrote:
> what about ?
> ereg("<!--start-->(.*?)<!--stop-->", $lineofhtml, $output);
>
> -----Original Message-----
> From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 11, 2002 3:05 PM
> To: Jimmy
> Cc: php-list
> Subject: Re: [PHP] ereg
>
>
> Nopes, dint work
> Regards,
> Kunal Jhunjhunwala
> ----- Original Message -----
> From: "Jimmy" <[EMAIL PROTECTED]>
> To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
> Cc: "php-list" <[EMAIL PROTECTED]>
> Sent: Friday, January 11, 2002 9:30 AM
> Subject: Re: [PHP] ereg
>
>
> > Hi Kunal,
> >
> > > ereg("<!--start-->(.*)<!--stop-->", $lineofhtml, $output);
> >
> > ereg("<!--start-->([^<!--stop-->]*)<!--stop-->", $lineofhtml, $output);
> >
> > --
> > Jimmy
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > It's not what you have in your life that counts, but who you have in your
> life
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
halo ..
i want to know, how setting cookies in php win98 with PWS, because my
guestbook with cookies is not working. all cookies , i set default in php
ini., please help what can i do now ?
Mpu Strees
--- End Message ---
--- Begin Message ---
Hey all,
Before I begin, I would like to acknowledge that I understand that the
mailparse functions are still in development. I, however, would like to
start programming a mailparse utility that will read from the stdin and
return, body, attachments, from, etc. Does anyone know, or has anyone
produced anything silimar? Also, does anyone have any idea as to when the
mailparse docs will be completed. I guess you can say I'm a little anxious.
Thanks in advance,
Paul
--- End Message ---
--- Begin Message ---
Here's a really quick question. I can't figure out how to try to get user
authentication more than once. For instance, supposed I get this log on
screen that asks for my username and password. If I type in something wrong
that variable gets stuck in $PHP_AUTH_USER, and there is no way to unset it,
so the user would be prompted again. Please help. Thanks
<?php
if (!isset($PHP_AUTH_USER)) {
header("WWW-Authenticate: Basic realm=\"My Realm\"");
header("HTTP/1.0 401 Unauthorized");
echo "Text to send if user hits Cancel button\n";
exit;
} else {
//Check the database for user/password combination. Oh, not right?
let's try again
unset($PHP_AUTH_USER); //Doesn't work
}
?>
--- End Message ---
--- Begin Message ---
Hi everybody,
When i run the following script in a dos box it works fine. If i run it in
a browser window i receive a Dr Watson.
Anybody has an idea ?
My config is
Apache 1.3.20
PHP 4.0.5
Windows NT4 SP5 French
The script is inspired of the following url
http://www.phpbuilder.net/columns/alain20001003.php3
<?
$workbook = "D:\CAC40.XLS";
$sheet = "Feuil1";
#Instantiate the spreadsheet component.
$ex = new COM("Excel.application") or Die ("Did not connect");
#Open the workbook that we want to use.
$wkb = $ex->application->Workbooks->Open($workbook,3) or Die ("Did not
open");
$sheets = $wkb->Worksheets($sheet); #Select the sheet
$sheets->Calculate;
$sheets->activate; #Activate it
$cell = $sheets->Cells(2,2) ; #Select the cell (Row Column number)
$cell->activate; #Activate the cell
$oldcell=$cell->value;
print "Cac40 = {$cell->value} <BR>"; #Print the value of the
cell:10000
$cell = $sheets->Cells(1,2) ; #Select the cell (Row Column number)
$cell->activate; #Activate the cell
$oldcell=$cell->value;
print "DowJones = {$cell->value} <BR>"; #Print the value of the
cell:10000
#Close all workbooks without questioning
$ex->application->ActiveWorkbook->Close(False);
unset ($ex);
?>
--- End Message ---
--- Begin Message ---
try
$total=((0.416 / $time) * 60) * 60);
$output=number_format($total,2,'.',','); / / uses comma separators between
thousands and a decimal point between the units and tenths.
or
$output=number_format(((0.416 / $time) * 60) * 60),2,'.',','); / / php is
usually forgiving on combined operations.
number_format() truncates the number so if you have 1.209 it will lop of the
last number resulting in 1.20. if you want a rounded number use round().
both commands are in the online manual.
hope this helps.
Hugh
----- Original Message -----
From: Andrew <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2002 4:05 PM
Subject: [PHP] New to list
> Hello to you all!
> I am new to this list and I have a question that maybe someone can help
with
>
> In a script I am working on I have a math's equation :
>
> ((0.416 / $time) * 60) * 60)
>
> this out but a figure at goes to a about 10 decimal places I only want 2
> decimal places and just can not figure out how to do this
>
> Any ideas would be great
>
>
> Thanks
>
> Andrew
> Web Harper Graphics
> www.webharpergraphics.com
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi, can php execute system commands
like df, and then print it to html ?
thanks,
louie
--- End Message ---
--- Begin Message ---
Louie Miranda wrote:
> Hi, can php execute system commands
> like df, and then print it to html ?
`df`;
shell ("df");
exec ("df");
etc
--- End Message ---
--- Begin Message ---
on 1/11/02 1:35 AM, louie miranda at [EMAIL PROTECTED] wrote:
> Hi, can php execute system commands
> like df, and then print it to html ?
http://www.php.net/manual/en/ref.exec.php
-- mike cullerton
--- End Message ---
--- Begin Message ---
Try the backtick too.
print "<pre>" . `ls -l` "</pre>";
Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
Email: [EMAIL PROTECTED]
-----Original Message-----
From: mike cullerton [mailto:[EMAIL PROTECTED]]
Sent: Friday January 11, 2002 8:46 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php executing system commands..
on 1/11/02 1:35 AM, louie miranda at [EMAIL PROTECTED] wrote:
> Hi, can php execute system commands
> like df, and then print it to html ?
http://www.php.net/manual/en/ref.exec.php
-- mike cullerton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Arve Bersvendsen wrote:
> As a small, personal, "enjoy-myself"-project I'd like to run a
> perpetual-running socket server. Problem is; I also want it to be
> self-modifying so I can insert, remove and change functions as the
> server is running.
>
> The problem is; under normal circumstances, PHP won't let the script
> redeclare functions. Is there any way to circumvent this.
I dont know what a perpetual-running socket server is, but to have a
main PHP script execute different functions with the same name I guess
you could play with "include/require" directives or create classes
with the same function-names you then pass to you main program (kind
like poor-mans polymorphism :-)
--- End Message ---
--- Begin Message ---
Martin Wickman wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:
> I dont know what a perpetual-running socket server is, but to have
> a main PHP script execute different functions with the same name I
> guess
I'm thinking about a server that can keep it's connection up &
running, even if I decide to change the internal functionality of
functions, or even adding functions on-the-fly.
--
Arve <URL:http://www.bersvendsen.com/>
Newsere mot X-No-Archive
<URL:http://www.ibiblio.org/Dave/Dr-Fun/df9601/df960124.jpg>
--- End Message ---
--- Begin Message ---
Austin Gonyou wrote:
> The real question I suppose is how could I parse this type
> of output into something I could use to make a graph.
>
> Example:
> 12:20:00 PM CPU %user %nice %system %idle
> 12:30:00 PM all 2.17 0.79 0.77 96.27
> Problem is I'm not sure how to go about breaking up the rows
> to allow them to be inserted into the db. Thanks in advance for
> any ideas.
I guess fields are separated with tabs? Then just use split, as in:
list($time,$cpu,$ser,$nice,$ststem, $idle)= split ("\t", $line);
Then build your INSERT sql clause. Graph building is then a simple
matter of passing the data as arrays to your php graph system.
--- End Message ---
--- Begin Message ---
Or checkout the sql import facilities offered by your choice of database to 'convert'
the data from log to
db-tbl, then set up your analysis in PHP+SQL separately.
=dn
----- Original Message -----
From: "Martin Wickman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 11 January 2002 09:08
Subject: [PHP] Re: Parsing SAR output with PHP.
> Austin Gonyou wrote:
>
> > The real question I suppose is how could I parse this type
> > of output into something I could use to make a graph.
> >
> > Example:
> > 12:20:00 PM CPU %user %nice %system %idle
> > 12:30:00 PM all 2.17 0.79 0.77 96.27
>
>
> > Problem is I'm not sure how to go about breaking up the rows
> > to allow them to be inserted into the db. Thanks in advance for
> > any ideas.
>
> I guess fields are separated with tabs? Then just use split, as in:
>
>
> list($time,$cpu,$ser,$nice,$ststem, $idle)= split ("\t", $line);
>
> Then build your INSERT sql clause. Graph building is then a simple
> matter of passing the data as arrays to your php graph system.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
Ken Kinder wrote:
> The $this->children attribute should be an array of (references to) objects.
> I think somehow in the foreach ($this->children as $child) the objects are
> being copied, as $child->validate(); seems not to effect the original objects.
Someone just said you can use
$a = &$b
to make $a a reference to $b instead of a copy. Dunno if that solves
you problem though, but it may be a step on the way.
--- End Message ---
--- Begin Message ---
Hi all,
I want a regular expression process such that,
no characters except for the followings will not be allowed.
0-9 a-z A-Z ~ @ # $ % ( ) _ - + =
[ ] { } < ? >
I create a web site with membership. I have a problem. Some body uses
a username GUEST and someother get's the same username (in fact not the
same, but displays as a same username, because,
second username is GUESTx where x replace with the
code ALT+231
so I want to give a sequence of characters to the user, such
that user cannot use except for this crahcters.
I wrote all the characters above...
best regards...
|
____________________________________________________
IncrediMail -
Email has finally evolved - Click
Here
|
--- End Message ---
--- Begin Message ---
Hi Sait,
> no characters except for the followings will not be allowed.
> 0-9 a-z A-Z ~ @ # $ % ( ) _ - + = [ ] { } < ? >
if ( ereg("[^0-9a-zA-Z\_\-]", $user_input) ) {
//invalid char detected
}
else {
//input contain only allowed char
}
just add all your valid char in the pattern, and dont forget
to escape the char which has special meaning in regex.
--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Money is what you make it - a servant or a master
--- End Message ---
--- Begin Message ---
Im not sure if "function-backtrace" is the correct word for what I need, so I'll
explain:
If I have for example
<?
a();
function a(){
b();
}
function b(){
c();
}
function c(){
$x = function_backtrace();
print_r($x);
}
?>
then I want to get
array(
[0] => 'a',
[1] => 'b',
[2] => 'c'
)
or something similar. So I want to know, what functions have been called. If you know
perl, then adequate function was "caller".
I already searched php.net for it but had no luck for it - so if you please could
point me to the right direction I was very happy.
TIA
Stefan Rusterholz
--- End Message ---
--- Begin Message ---
Thank you Michel
You;ve understand correct the question. Thank you for the removing new
keyword
Everything you've said is exact but using following snippet
$b = array('one' => 'bla', 'two' => 'blabla', 'three' => 'blablabla');
while(list($k, $v) = each($b)) {
print "$k - $v";
}
the result will be
0 - bla
one - bla
0 (the key) = 'bla' (the value)
one (the key of the *same* element) = 'bla' (the *same* value)
and so on ...
"Michael Sims" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote:
> >How could I determine whether I have in the array's key integers *and*
> >strings or integers only?
>
> I'm not sure exactly what you're asking but I'll give it a shot...
>
> >i.e.
> >$a = new array('one', 'two', 'three'); // this has only integers (am I
> >wrong?)
>
> First of all, the "new" keyword assumes that you are instantiating an
> object. For example if you created an object with the name foo you would
> instantiate it like so:
>
> $a = new foo;
>
> So when creating arrays the "new" keyword is undesirable.
>
> To address your question, yes your example above (after removing the "new"
> keyword) will create an array named $a that has only integers for
> keys. It's functionally the same as this:
>
> $a = array(0 => 'one', 1 => 'two', 2 => 'three');
>
> >$b = new array('one' => 'bla', 'two' => 'blabla', 'three' =>
'blablabla');
> >// integers & strings
>
> The above example (again once corrected to remove the "new" keyword) will
> create an array named $b that has ONLY strings for keys. There are no
keys
> that are integers because you didn't create any. You can test this by
> trying to echo the values out by key:
>
> echo $b['one']; //outputs "bla"
> echo $b[0]; //outputs nothing because this key does not have a value.
>
> This is perfectly legal:
>
> $b = array ('one' => 'bla', 'two' => 'blabla', 'three' => 'blablabla', 0
=>
> 'blablablabla',
> 1 => 'blablablablabla');
>
> In the above case you do have some keys that are strings and some that are
> integers but they are DIFFERENT keys, representing DIFFERENT values.
>
> Hope that answers your question...
>
--- End Message ---
--- Begin Message ---
On Thursday 10 January 2002 19:36, [EMAIL PROTECTED] stuffed this into my
mailbox:
Please note that not all proxies will fill in HTTP_X_FORWARDED_FOR. Some will
obscure it others will not fill it in at all, either due to privacy or to
conseal things.
> > > Okay, thanks. 'Cause I mean, the REMOTE_ADDR is still there. So you
> > > mean that the HTTP_X_FORWARDED_FOR isn't working while I'm working
> >
> > localhost?
> >
> > REMOTE_ADDR contains the IP of the computer that requested your page.
> >
> > If it was a proxy doing the request, you'll have the proxy's IP in this
> > variable, and the IP of the computer that requested the page from the
> > proxy will be in HTTP_X_FORWARDED_FOR.
>
> Thanks, never really knew that.
>
> > This means the best way to grab an IP is with a a function like this:
> >
> > <?php
> > function getIP () {
> > if (getenv(HTTP_X_FORWARDED_FOR)) {
> >
> > $ip = getenv(HTTP_X_FORWARDED_FOR);
> > } else {
> > $ip = getenv(REMOTE_ADDR);
> > }
> > return $ip;
> > }
> > ?>
>
> Yeah, that's what I do. ;)
>
> > I'm unsure what happens with multiple proxies, and I'd be interested to
> > know - do you get an array of HTTP_X_FORWARDED_FORs? Do you just get the
> > first or the last?
>
> Have no idea...
>
> > Cheers
> > Jon
>
> ....................................
> Get your own free email account from
> http://www.popmail.com
--- End Message ---
--- Begin Message ---
I have been having problems with Segmentation faults when using SNMP
with PHP. This used to work just fine on my Redhat 6.2 box. Appears that
the problem is related to the way the standard Redhat 7.x ucd-snmp RPM
is built. Rebuilding the RPM using the latest software obtained from
http://sourceforge.net/projects/net-snmp/ fixes the problem. Or if
you insist using the Redhat RPM, you will need to modify the SPEC file
to remove "disk" entry from the --with-mib-modules="host agentx smux
notification" line, and then rebuild.
Thanks also to Willem Brown.
Maintainer IPPlan (https://sourceforge.net/projects/iptrack/)
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: 10 January 2002 15:44
>
> I thought that $_GET[] and $_POST[] could be used in place of regular
> variables... that is,
>
> $sql = "SELECT * FROM tablename WHERE
> tablename.column=$_GET['criteria_integer']";
>
> but unfortunately, this isn't working.
No, of course not -- I repeat:
> On Thursday, January 10, 2002, at 08:18 AM, Ford, Mike [LSS] wrote:
>
> > But, if you insist on the quotes, it needs to be:
> >
> > case "{$_POST['insert']}"
> >
> > to ensure that the array index gets processed properly.
Please note the {}, which you *MUST* include to get the array index processed
properly. If you write:
"$_POST['insert']"
PHP will try to interpret this as the variable called $_POST followed by the string
"['insert']", which is clearly not what you want. including the {} forces it to use
the value of $_POST['insert'], which *is* what you want.
Incidentally, I've occasionally had problems including a variable name containing an
underscore in a double-quoted string (e.g. "$num_recs records retrieved"), where PHP
tries to insert the value of $num followed by the string "_recs", so I always {} those
as well, just to be on the safe side ("{$num_recs} ..." or "${num_recs} ..." both work.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Yoed [mailto:[EMAIL PROTECTED]]
> Sent: 10 January 2002 23:01
>
> I never really found the trick to this one yet, and wanted to
> see what you
> guys say is the best methods to call a variable that needs a variable.
>
> Say I have variables called $Var_1_Stat, $Var_2_Stat, and $Var_3_Stat
> and I have a variable called $Nums thats value is either 1, 2, or 3.
> How then would I go about calling $Var_Call=$Var_$Num_Stat ? Or
> $Var_Call="$Var_$Num_State".... hmm not hat wouldn't work?
> So what do you guys suggest?
I suggest arrays -- is there a good reason why they won't do the job in this case? If
it were at all possible, I'd reformulate the algorithm using these variables so they
could be $Var_Stat[$Nums] ($Var_Stat[1], $Var_Stat[2], etc.).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Hello everybody
I want from a Form page to pass a couple of values (fooa, foob, fooc)
which are not form fields
when submit button pressed to the submited page...
thanks in advance for your help
simos
--- End Message ---
--- Begin Message ---
> I want from a Form page to pass a couple of values (fooa, foob, fooc)
> which are not form fields
> when submit button pressed to the submited page...
Use hidden fields:
<input type=hidden name=fooa value='value_of_fooa'>
<input type=hidden name=foob value='value_of_foob'>
<input type=hidden name=fooc value='value_of_fooc'>
Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
If you want some parameters which will be pass in your site, you can
use "session"
.
for example, you have parameters, fooa, foob, fooc, ...
etc..
<?
session_start();
$fooa = 1;
$foob = "sait";
// you do,
session_register("fooa");
session_register("foob");
session_register("fooc");
?>
then you can use them everywhere in your site as "$fooa",
"$foob", "$fooc".
You can change it's value. you can unset with
session_unregister("fooa");
Be carefull that, your paramater is $fooa, you should register it
without $
session_register("fooa"); // No $ at the beginning
of the paramater...
And you should put session_start() at the top of the page, if
you will use these parameters in that PHP file...
Also, you can use COOKIES...! I dont prefer in general ... and do NOT
session_register a password or a credit card number, for security
reasons...
good works...
-------Original Message-------
Date: 11 Ocak 2002 Cuma
14:13:41
Subject: [PHP] passing
parameters from one page to another
Hello everybody
I want from a Form page to
pass a couple of values (fooa, foob, fooc) which are not form
fields when submit button pressed to the submited page...
thanks
in advance for your help
simos
|
____________________________________________________
IncrediMail -
Email has finally evolved - Click
Here
|
--- End Message ---
--- Begin Message ---
hi,
I am running PHPtriad on a win2k machine... when I run phpinfo() it
displays " XML ACTIVE" but I keep getting an error "Fatal error: Call to
undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24"
What needs to installed/configured ??
TIA,
sandeep
--- End Message ---
--- Begin Message ---
Sandeep Murphy wrote:
> hi,
>
> I am running PHPtriad on a win2k machine... when I run phpinfo() it
> displays " XML ACTIVE"
this means that the standart, expat based xml support ist active
>but I keep getting an error "Fatal error: Call to
> undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24"
>
> What needs to installed/configured ??
you need DOM XML support, i only don't know how to do this with win2k...
see http://www.php.net/manual/en/ref.xml.php
and
http://www.php.net/manual/en/ref.domxml.php
for more information about these two...
henning
--- End Message ---
--- Begin Message ---
Hi there guys,
Who's awake today then? :) What I'm trying to do is create variable
variable arrays and then fill these arrays with values. The problem I
have though is that the values don't appear to be getting stored - as
following the assignment I have outputted a 'sizeof' command which
always outputs 0.
Here's a snippet of the code. Any ideas guys???
...........
//store children page_IDs into array for each parent
$str_array = "menu_array_" . $current_parent_page_ID;
$$str_array = array();
for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
{
$db_help_structure->next_record();
//get page_ID value
$page_ID = $db_help_structure->return_single_result('page_ID');
//$page_ID is now set
echo "storing in $str_array position $child_cnt:" . $page_ID .
"<br>";
$$str_array[$child_cnt] = $page_ID;
echo "size:" . sizeof($$str_array) . "<br>";
}
...........
--------------------------------
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
--------------------------------
--- End Message ---
--- Begin Message ---
On Friday 11 January 2002 20:02, Neil Freeman wrote:
> Hi there guys,
>
> Who's awake today then? :)
Someone isn't :)
> Here's a snippet of the code. Any ideas guys???
>
> ...........
> //store children page_IDs into array for each parent
> $str_array = "menu_array_" . $current_parent_page_ID;
> $$str_array = array();
>
> for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
> {
> $db_help_structure->next_record();
>
> //get page_ID value
> $page_ID = $db_help_structure->return_single_result('page_ID');
>
> //$page_ID is now set
>
> echo "storing in $str_array position $child_cnt:" . $page_ID .
> "<br>";
> $$str_array[$child_cnt] = $page_ID;
> echo "size:" . sizeof($$str_array) . "<br>";
> }
You need to resolve the ambiguity in your code by placing braces around the
variable part of the variable variable (!)
ie: ${$str_array}[$child_cnt] = $page_ID;
See manual for details. See the annotated online manual for more examples.
hth
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Go out and tell a lie that will make the whole family proud of you.
-- Cadmus, to Pentheus, in "The Bacchae" by Euripides
*/
--- End Message ---
--- Begin Message ---
That's done the trick. More coffee for me I think :) Cheers Jason.
Jason Wong wrote:
> On Friday 11 January 2002 20:02, Neil Freeman wrote:
> > Hi there guys,
> >
> > Who's awake today then? :)
>
> Someone isn't :)
>
> > Here's a snippet of the code. Any ideas guys???
> >
> > ...........
> > //store children page_IDs into array for each parent
> > $str_array = "menu_array_" . $current_parent_page_ID;
> > $$str_array = array();
> >
> > for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
> > {
> > $db_help_structure->next_record();
> >
> > //get page_ID value
> > $page_ID = $db_help_structure->return_single_result('page_ID');
> >
> > //$page_ID is now set
> >
> > echo "storing in $str_array position $child_cnt:" . $page_ID .
> > "<br>";
> > $$str_array[$child_cnt] = $page_ID;
> > echo "size:" . sizeof($$str_array) . "<br>";
> > }
>
> You need to resolve the ambiguity in your code by placing braces around the
> variable part of the variable variable (!)
>
> ie: ${$str_array}[$child_cnt] = $page_ID;
>
> See manual for details. See the annotated online manual for more examples.
>
> hth
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> Go out and tell a lie that will make the whole family proud of you.
> -- Cadmus, to Pentheus, in "The Bacchae" by Euripides
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ***************************************************************
> This message was virus checked with: SAVI 3.52
> last updated 17th December 2001
> ***************************************************************
--
--------------------------------
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
--------------------------------
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Neil Freeman [mailto:[EMAIL PROTECTED]]
> Sent: 11 January 2002 12:03
>
> Who's awake today then? :) What I'm trying to do is create variable
> variable arrays and then fill these arrays with values. The problem I
> have though is that the values don't appear to be getting stored - as
> following the assignment I have outputted a 'sizeof' command which
> always outputs 0.
Once again, I can't help wondering why go all round the houses with $$ instead of
using arrays -- in this case, 2-dimensional ones (arrays of arrays!):
>
> Here's a snippet of the code. Any ideas guys???
>
> ...........
> //store children page_IDs into array for each parent
> $str_array = "menu_array_" . $current_parent_page_ID;
> $$str_array = array();
$str_array = array();
$str_array[$current_parent_page_ID] = array();
>
> for ($child_cnt = 0; $child_cnt < $number_children; $child_cnt++)
> {
> $db_help_structure->next_record();
>
> //get page_ID value
> $page_ID = $db_help_structure->return_single_result('page_ID');
>
> //$page_ID is now set
>
> echo "storing in $str_array position $child_cnt:" . $page_ID .
> "<br>";
> $$str_array[$child_cnt] = $page_ID;
$str_array[$current_parent_page_ID][$child_cnt] = $page_ID;
> echo "size:" . sizeof($$str_array) . "<br>";
> }
> ...........
Mind you, I've done no comparison of the relevant efficiencies of the $$ method and
the 2-dimensional array -- I just find the arrays easier to comprehend (and less prone
to syntactical problems!!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Hi,
I want to change a PDF file into the HTML, DOC, TXT...
All programs that I used is not enogh to create a good
document...
- HTML output is not clear enough like original PDF
OR
- Images inside the PDF document has been corrupted or bad (although
original ones are very very good)
does anybody have/know a utulity which best converts these
documents?
thanx...
note that, I search and tried some documents... like pdf2html
...
-------Original Message-------
Date: 11 Ocak 2002 Cuma
14:27:28
Subject: [PHP] Sizeof
variable variable arrays
Hi there guys,
Who's awake today then? :) What I'm
trying to do is create variable variable arrays and then fill these
arrays with values. The problem I have though is that the values don't
appear to be getting stored - as following the assignment I have
outputted a 'sizeof' command which always outputs 0.
Here's a
snippet of the code. Any ideas guys???
............ //store
children page_IDs into array for each parent $str_array = "menu_array_"
. $current_parent_page_ID; $$str_array = array();
for
($child_cnt = 0; $child_cnt < $number_children;
$child_cnt++) { $db_help_structure->next_record();
//get
page_ID value $page_ID =
$db_help_structure->return_single_result('page_ID');
//$page_ID
is now set
echo "storing in $str_array position $child_cnt:" .
$page_ID . "<br>"; $$str_array[$child_cnt] = $page_ID; echo
"size:" . sizeof($$str_array) .
"<br>"; } ............
-------------------------------- Email:
[EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------
|
____________________________________________________
IncrediMail -
Email has finally evolved - Click
Here
|
--- End Message ---
--- Begin Message ---
i can't use session, give me an error when use ie 6.
Warning: Cannot send session cookie - headers already sent by (output
started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in
/home/www.apollodisplays.com/public_html/mainpage.php on line 29
Warning: Cannot send session cache limiter - headers already sent
(output started t
/home/www.apollodisplays.com/public_html/mainpage.php:10) in
/home/www.apollodisplays.com/public_html/mainpage.php on line 29
my code is very simple. see below ---->
session_start();
session_register("userright");
$HTTP_SESSION_VARS["userright"]=$right;
anyone have any idea ? thankx
_____
Mark Chin <mailto:[EMAIL PROTECTED]>
Apollo Display Technologies, LLC
85 Remington Blvd. Ronkonkoma, NY 11779
Ph. (631) 580-4360 EXT 19
Fax (631) 580-4370
http://www.apollodisplays.com
--- End Message ---
--- Begin Message ---
Probably
1)You do echo before session_start()
2)You have white space before the opening <?php tag
The problem is in that that the server had sent some output to the browser and after
that you want to sent a header - the session
cookie.
No output must appear before all headers are sent. You can suppres echo's to be sent
to the browser with ob_start() as the furst
instructuion in the Php, and ob_end() after the last header is sent.
Regards,
Andrey Hristov
----- Original Message -----
From: "Mark Chin, Apoll Displays" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2002 11:00 PM
Subject: [PHP] session related
> i can't use session, give me an error when use ie 6.
>
> Warning: Cannot send session cookie - headers already sent by (output
> started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in
> /home/www.apollodisplays.com/public_html/mainpage.php on line 29
>
> Warning: Cannot send session cache limiter - headers already sent
> (output started t
> /home/www.apollodisplays.com/public_html/mainpage.php:10) in
> /home/www.apollodisplays.com/public_html/mainpage.php on line 29
>
>
> my code is very simple. see below ---->
>
> session_start();
> session_register("userright");
> $HTTP_SESSION_VARS["userright"]=$right;
>
> anyone have any idea ? thankx
>
>
>
>
> _____
>
> Mark Chin <mailto:[EMAIL PROTECTED]>
> Apollo Display Technologies, LLC
> 85 Remington Blvd. Ronkonkoma, NY 11779
> Ph. (631) 580-4360 EXT 19
> Fax (631) 580-4370
> http://www.apollodisplays.com
>
>
--- End Message ---
--- Begin Message ---
hey folks, hope the new year is treating everyone well.
i was RTFMing yesterday and ran across this piece of code
while (false !== ($file = readdir($handle))) {
which is similar to stuff i've done
while ($file = readdir($dir)) {
so, what am i not catching with my code, and what is really going on in the
RTFM code with the "false !==" part?
thanks y'all,
mike
-- mike cullerton
--- End Message ---
--- Begin Message ---
I'm not sure if a resource casted to numeric to be 0 - var_dump() to say :(0) resource
of type ....
!==flase assures that it is FALSE, not 0.
!== is like != but makes type checking. Frequently used with strpos(). See the memos
there.
There is also available === operator. It is like == but also makes type comparison.
Regards,
Andrey Hristov
----- Original Message -----
From: "mike cullerton" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 5:01 PM
Subject: [PHP] RTFM code snippet
> hey folks, hope the new year is treating everyone well.
>
> i was RTFMing yesterday and ran across this piece of code
>
> while (false !== ($file = readdir($handle))) {
>
> which is similar to stuff i've done
>
> while ($file = readdir($dir)) {
>
> so, what am i not catching with my code, and what is really going on in the
> RTFM code with the "false !==" part?
>
> thanks y'all,
> mike
>
> -- mike cullerton
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
If you have file with name "0" , with
while ($file = readdir($dir)) {
it will be casted to false, but this is regular file. Thus !== is used.
Regards,
Andrey Hristov
----- Original Message -----
From: "mike cullerton" <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 5:01 PM
Subject: [PHP] RTFM code snippet
> hey folks, hope the new year is treating everyone well.
>
> i was RTFMing yesterday and ran across this piece of code
>
> while (false !== ($file = readdir($handle))) {
>
> which is similar to stuff i've done
>
> while ($file = readdir($dir)) {
>
> so, what am i not catching with my code, and what is really going on in the
> RTFM code with the "false !==" part?
>
> thanks y'all,
> mike
>
> -- mike cullerton
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
>Also, the value I set in the ini file for java.library is changed from
>libjvm.so to libjava.so. Is this suppose to happen? I was guessing as to
>what library I should use here, but the error I am getting indicates that it
>can't start the jvm, so this has me worried to. Which library is the correct
>one?
I had the same problem and in my php.ini java.library is set to libjvm.so,
since it's already working now, I think that's the correct value...
about the "Unable to create Java Virtual Machine" error, in my case I solved
it by setting the LD_LIBRARY_PATH environment variable to the apropiate
values. In your case I suppose that would be /usr/java1.2/jre/lib/sparc/ and
/usr/java1.2/jre/lib/sparc/classic or /usr/java1.2/jre/lib/sparc/client
depending on which JVM you have (java -version).
If this is usefull at all, please let me know.
Xavier
--- End Message ---
--- Begin Message ---
Are there any php compilers available for win32?
Can they compile to byte code that the processor like C uses, instead of an
interpreter?
Charles Killmer
IIS 5.0, Windows 2000 Server, PHP 4.1.0
--- End Message ---
--- Begin Message ---
Several months ago there were notes on few websites about "phpcompiler".
AFAIK it is not so good but it is something.
Last week a man on php-dev said that he starts working on new php compiler but with
different approach - to connect in one thing -
php4ts.dll, php.exe, and the source code untouched(no compiling on it).
It is interesting if one can make compiler for php to Java bytecode. I saw that there
is a such compiler for Ada.
Regards,
Andrey Hristov
----- Original Message -----
From: "charlesk " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 5:57 PM
Subject: [PHP] Compiled PHP
> Are there any php compilers available for win32?
> Can they compile to byte code that the processor like C uses, instead of an
>interpreter?
>
> Charles Killmer
> IIS 5.0, Windows 2000 Server, PHP 4.1.0
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
Andrey Hristov wrote:
> Several months ago there were notes on few websites about "phpcompiler".
> AFAIK it is not so good but it is something.
> Last week a man on php-dev said that he starts working on new php
compiler but with different approach - to connect in one thing -
> php4ts.dll, php.exe, and the source code untouched(no compiling on it).
> It is interesting if one can make compiler for php to Java bytecode.
I saw that there is a such compiler for Ada.
But, as i understood the question, he ist looking for something that
generates code which makes the php interpreter obsolete.
I think something like this doesn't exist. There are several ways to
generate bytecode, but this is still to be run with a special interpreter.
There are several approaches, whereof some have the goal to make
execution of code quicker and some others have the goal to give you
possibility to distribute your software without giving away the code in
readable form. I think there is an encoder from zend, too, to be found
at www.zend.com
my 2 cents
henning
--- End Message ---
--- Begin Message ---
I think that he uses "bytecode" wrongly.
C is not generating a bytecode but asm instead, then translated to machine code.
Bytecode is another thing. Java is bytecoded.
IMO that the question is : "Is there any tool which generates machine code as the C
compiler does? "
AFAIK the encoder first optimizes somehow the code and then encode it to make a
bruteforce attack harder to do.
Regards,
Andrey Hristov
----- Original Message -----
From: "Henning Sprang" <[EMAIL PROTECTED]>
To: "Andrey Hristov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 6:31 PM
Subject: Re: [PHP] Compiled PHP
> Andrey Hristov wrote:
>
> > Several months ago there were notes on few websites about "phpcompiler".
> > AFAIK it is not so good but it is something.
> > Last week a man on php-dev said that he starts working on new php
> compiler but with different approach - to connect in one thing -
> > php4ts.dll, php.exe, and the source code untouched(no compiling on it).
> > It is interesting if one can make compiler for php to Java bytecode.
> I saw that there is a such compiler for Ada.
>
>
> But, as i understood the question, he ist looking for something that
> generates code which makes the php interpreter obsolete.
>
> I think something like this doesn't exist. There are several ways to
> generate bytecode, but this is still to be run with a special interpreter.
>
> There are several approaches, whereof some have the goal to make
> execution of code quicker and some others have the goal to give you
> possibility to distribute your software without giving away the code in
> readable form. I think there is an encoder from zend, too, to be found
> at www.zend.com
>
>
> my 2 cents
>
> henning
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
Hi Guys,
I recently read an email entitled "Can a PHP program receive an e-mail and
write it to a file???" in the PHP archives (see
http://marc.theaimsgroup.com/?l=php-general&m=97986044121868&w=2) and wanted
to ask a follow up question. I'm a novice programmer, new to PHP, and
unfamiliar with the ways in which to access the Standard Input for a PHP
program. Can anyone provide me with some examples or online reference
material as to how I can go about doing this. For example, is there a
particular variable or function that I should call? Or, is there something
that needs to be initialized?
P.S. Thanks, in advance, for all of your help and assistance.
O From Now 'Till Then,
\-> Reginald Alex Mullin
/\ More Questions than Answers
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the postmaster at [EMAIL PROTECTED]
www.sothebys.com
**********************************************************************
--- End Message ---
--- Begin Message ---
A quick question:
what function is used to remove an array element from an array? Like
array_pop(), except one by which I can refer to the element by its
associative index rather than just the last element of the array.
For more detail with what I'm doing, I have two versions of a <select>
listbox -- one that includes an <option> with selected="yes" (if the
user is calling this page from submitting a form). The other version is
for users who are NOT calling this page from submitting a form, i.e. for
the first time.
I would like, in the first version (if ($formfilled)), to REMOVE the
element $temprow['div_name'] from the array $temprow so that it doesn't
appear a second time (in the WHILE loop), since it has already been
echoed above the WHILE loop.
Is this even possible?
$home_div_id = $myrow['home_div_id']; // (from another SQL query
$div_name = $myrow['div_name']; // earlier in the script)
$tempsql = "SELECT divisions.div_name, divisions.div_id
FROM divisions";
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);
if ($formfilled) { // if this page is called with
// the form fields filled, grab
// $home_div_id and make it
// selected="yes"
echo "<select name=\"home_div_id\">\n";
echo "<option value=\"$home_div_id\"
selected=\"yes\">$div_name</option>\n";
while ($temprow = mysql_fetch_array($tempresult)) {
echo "<option value=\"" . $temprow['div_id']
. "\">" . $temprow['div_name'] . "</option>\n";
}
echo "</select>\n";
} else { // if this page is called with
// blank form fields, same thing
// except no "selected" attribute
echo "<select name=\"home_div_id\">\n";
while ($temprow = mysql_fetch_array($tempresult)) {
echo "<option value=\"" . $temprow['div_id']
. "\">" . $temprow['div_name'] . "</option>\n";
}
echo "</select>\n";
}
--- End Message ---