php-general Digest 14 Aug 2006 20:33:05 -0000 Issue 4293
Topics (messages 240619 through 240651):
Re: non-text data
240619 by: Chris
240627 by: tedd
Re: break up variable and put each element in an array
240620 by: Ivo F.A.C. Fokkema
Re: Codigo de Captcha en PHP
240621 by: Julio B.
Re: New Large Scale Project.
240622 by: Colin Guthrie
240623 by: James Nunnerley
240624 by: Paul Scott
Need PHP developer in Thailand
240625 by: Peter Lauri
240626 by: Paul Scott
auto_globals_jit breaks $_SERVER var
240628 by: Artzi, Yoav \(Yoav\)
240638 by: Rasmus Lerdorf
header lost session variables.
240629 by: João Cândido de Souza Neto
240651 by: BBC
Re: A way to stop spam on this list
240630 by: Austin Denyer
Re: Compiling and iconv
240631 by: Ray Hauge
Creating custom superglobals
240632 by: Ville Mattila
240633 by: Jay Blanchard
240634 by: Stut
240635 by: KermodeBear
240636 by: Robert Cummings
240639 by: Adam Zey
system, exec, shell_exec, passthru
240637 by: p.willis.telus.net
240640 by: Adam Zey
240643 by: Michael Jonsson
240645 by: Adam Zey
240646 by: Michael Jonsson
240647 by: p.willis.telus.net
240648 by: p.willis.telus.net
Re: requests from 2nd window breaks my program
240641 by: afan.afan.net
Why does count() make copies of arrays?
240642 by: Adam Zey
PHP Job Opening (Chicago-downtown)
240644 by: Richard Lynch
Re: INPUT
240649 by: Chris Shiflett
Re: IMAGE LOADED...
240650 by: Richard Lynch
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 ---
Dave Shariff Yadallee - System Administrator a.k.a. The Root of the
Problem wrote:
On Mon, Aug 14, 2006 at 02:40:53PM +1000, Chris wrote:
John Meyer wrote:
Gd,
BTW, came into this late, have we gotten the old "store your images in the
filesystem and save the file name in the database" argument yet?
Nope, haven't done that one yet, do you want to start it off or shall I? ;)
--
Postgresql & php tutorials
http://www.designmagick.com/
Careful where you light your match.
You may blow up if you are not careful.
Probably very good advice ;)
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
At 10:35 PM -0600 8/13/06, John Meyer wrote:
Gd,
BTW, came into this late, have we gotten the old "store your images in the
filesystem and save the file name in the database" argument yet?
You can do that? ;-)
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Sat, 12 Aug 2006 16:36:36 -0500, Richard Lynch wrote:
> On Fri, August 11, 2006 3:11 am, Ivo F.A.C. Fokkema wrote:
>> Well, if it's true that some browsers on some platforms ignore the W3C
>> standard, I guess we could use:
>
> Or perhaps these browsers pre-date W3C standards. :-)
Sure, but in newer versions, they might update their code to follow
the standards after all... wouldn't they?
>> $datelist =
>> str_replace(array("\r\n","\n","\r"),'<BR>',$_POST['datelist']);
>
> Two problems here.
>
> This assumes a specific undocumented ordering to the replacement in
> processing the array argument. If, for some insane reason, the PHP
> implementation of str_replace chooses to process that input array in
> reverse order, you would end up with double <BR> for "\r\n" input. This
> is incredibly unlikely, but it's NOT (yet) documented that the arrays
> are processed in order.
True; and I haven't tested the code either, to be honest. I found the
basic implementation on a forum somewhere and adapted it to the
threadstarter's need.
I might try and see if I could submit a documentation bug on this. I think
it's a useful feature and you're right to claim that since it's not
documented, one should not rely on it.
> The next problem is that replacing newline (in any form) with <BR> on
> the INPUT phase of your program is just a Bad Idea. :-)
>
> (...)
>
> Because someday you may want to output that same data to RSS, XML, or
> XYZ, in which case <BR> is NOT what you want for your newlines.
Hey, totally agree here, BUT, the threadstarter doesn't mention it being
put in a database. Actually, he just requests it to be written on a new
line in the output. I just provided him a way of doing this.
I always store the input directly in the database (quoted, then, of
course) and replace \r\n with <BR> when needed (display on screen). I've
had no problems by strictly using \r\n yet. But as I have an open source
project, I assume someone will (be telling me||submit a bug) if they have
problems. In that case, I will implement a non-W3C compliant hack ;)
--- End Message ---
--- Begin Message ---
Hay muchos y muy variados en Internet. En alguna ocasión he usado el que
viene en sBlog. Es muy sencillo de implementar y para la mayoría de los
casos suficiente para evitarnos problemas de spam.
En código es:
<?php
$key = (array_key_exists('k', $_GET) && strlen($_GET['k']) == 4) ?
$_GET['k'] : strtolower(substr(md5(rand()), 0, 4));
$im = imagecreatetruecolor(40, 20);
$bg = imagecolorallocate($im, 0, 0, 0);
$col_text = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 4, 4, 1, $key, $col_text);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
Luego llamas a este archivo desde el que lo necesites.
Te generas el código (en este caso de 4 numeros y letras):
<?php $k = strtolower(substr(md5(mt_rand()), 0, 4)); ?>
En el formulario donde lo uses poner un campo oculto como éste:
<input type="hidden" name="h" id="h" value="<?php echo $k; ?>" />
Y llamas a la imagen como:
<img src="as_img.php?k=<?php echo $k; ?>" />
Por último, una vez se a enviado el formulario, compruebas que el valor del
campo oculto "h" es igual que el escrito por el usuario en el formulario.
Para más seguridad se podrían haber usado variables de sesión para guardar y
pasar los valores de "h", pero eso ya te lo dejo a ti.
Saludos,
Julio Barroso
""Ricardo Ríos"" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
| Hola amigos listeros alguien conoce algun codigo libre de un captcha en
php
| , gracias por sus comentarios.
|
--- End Message ---
--- Begin Message ---
Wesley Acheson wrote:
Basically the different areas I would need are authentication,
galleries (for images), permission levels. Internal messaging (not
real time), forums (hopefully I can just plugin an existing one but
intregrated with my new so that registering users for the site
registers for the forum and vice versa, also I would like each new
gallery entry to create a new forum entry for that image). Comments,
ratings and such like. Sales (This would have to be a script written
elsewhere, I am in no way confident when it comes to dealing with
sensitve info like credit card details.) etc. etc.
My other problem is even though I'm confident coding I find design
very difficult I've a good idea of how the website would work but only
in general terms.
Out of the box mambo or drupal doesn't seem to do what I want really
I use Joomla quite a bit (Mambo by an other name).
I've used the bridge components and Menalto Gallery and it works pretty
well. THere are various core hacks you can apply too to setup varying
permission levels and other stuff. Simple Machine Forums also has a good
bridge component (it's what the Joomla forums themselves use).
So with a little fiddling you can probably make Joomla do what you need.
If you are not confident dealing with CC payments and the like, then I
strongly suggest you use a third party service for this.
Col.
--- End Message ---
--- Begin Message ---
I can strongly recommend Joomla - I have it working with Menalto's Gallery2,
and just got a phpBB bridge working as well.
Can I also recommend you use Joomla over Mambo? About a year ago the core
developers (now at Joomla) fell out with the so called owners of Mambo,
about ownership and future developments.... so they created Joomla.
They're in the process of developing v1.5 which is going to have some really
cool features, mainly for 3rd party developers, so although you may not
experience the features with it's direct release, other components and
modules are already being developed that will improve the CMS no end...
Hope that helps
Nunners
-----Original Message-----
From: Colin Guthrie [mailto:[EMAIL PROTECTED]
Sent: 14 August 2006 10:06
To: [email protected]
Subject: [PHP] Re: New Large Scale Project.
Wesley Acheson wrote:
> Basically the different areas I would need are authentication,
> galleries (for images), permission levels. Internal messaging (not
> real time), forums (hopefully I can just plugin an existing one but
> intregrated with my new so that registering users for the site
> registers for the forum and vice versa, also I would like each new
> gallery entry to create a new forum entry for that image). Comments,
> ratings and such like. Sales (This would have to be a script written
> elsewhere, I am in no way confident when it comes to dealing with
> sensitve info like credit card details.) etc. etc.
>
> My other problem is even though I'm confident coding I find design
> very difficult I've a good idea of how the website would work but only
> in general terms.
>
> Out of the box mambo or drupal doesn't seem to do what I want really
I use Joomla quite a bit (Mambo by an other name).
I've used the bridge components and Menalto Gallery and it works pretty
well. THere are various core hacks you can apply too to setup varying
permission levels and other stuff. Simple Machine Forums also has a good
bridge component (it's what the Joomla forums themselves use).
So with a little fiddling you can probably make Joomla do what you need.
If you are not confident dealing with CC payments and the like, then I
strongly suggest you use a third party service for this.
Col.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> I use Joomla quite a bit (Mambo by an other name).
>
How about trying KINKY? http://avoir.uwc.ac.za/ It is customizable and
we have a few code generation modules that will write your basic code
for you, you just need to fill in the blanks. The new Chisimba framework
does the same, and has a more advanced code generation module, but is
still in alpha stage. It is a better framework though...
http://5ive.uwc.ac.za/ mail me off list for a download or do an
anonymous CVS checkout of the code and join our list! :)
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
--- End Message ---
--- Begin Message ---
Hi,
I am sorry to have to post this on this list. I do not enjoy reading the
"personals" that are posted here on the list. Before this I have been trying
to find Thai PHP programmers via some Thai job brokers, but no success. So
my hope is that there will be someone from Thailand reading this.
I am looking for a PHP developer in Bangkok area. English language is NOT a
requirement. However, if you are a member of this list, you probably know
some English. If you have a friend that knows PHP and does not speak
English, let him know that I am searching for a PHP developer.
Or there is maybe a PHP developer from another country that is interested to
come to Bangkok for a year, not that great pay, but living standard are
great.
Best regards,
Peter Lauri
--- End Message ---
--- Begin Message ---
On Mon, 2006-08-14 at 16:38 +0700, Peter Lauri wrote:
> Or there is maybe a PHP developer from another country that is interested to
> come to Bangkok for a year, not that great pay, but living standard are
> great.
>
As part of our project, we have a strong internship programme. Would you
consider that? Our interns are trained at the highest level of work, and
are very good at what they do...
--Paul
All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
--- End Message ---
--- Begin Message ---
I have the following in my php.ini:
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
The following PHP code prints nothing:
<?php
$webroot = $_SERVER['DOCUMENT_ROOT'];
$server = $_SERVER["HOST"];
$file = $_SERVER["SCRIPT_FILENAME"];
$transport = $_SERVER["REQUEST_TRANSPORT"];
$port = $_SERVER["SERVER_PORT"];
print "$webroot";
print "$server";
print "$transport";
?>
The rest of the php.ini is like php.ini-recommended that comes with the
source. Any idea what might be the problem?
Thanks,
Yoav.
--- End Message ---
--- Begin Message ---
Artzi, Yoav (Yoav) wrote:
I have the following in my php.ini:
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
The following PHP code prints nothing:
<?php
$webroot = $_SERVER['DOCUMENT_ROOT'];
$server = $_SERVER["HOST"];
$file = $_SERVER["SCRIPT_FILENAME"];
$transport = $_SERVER["REQUEST_TRANSPORT"];
$port = $_SERVER["SERVER_PORT"];
print "$webroot";
print "$server";
print "$transport";
?>
The rest of the php.ini is like php.ini-recommended that comes with the
source. Any idea what might be the problem?
Do you have APC enabled? If so, upgrade to a more recent version.
Preferably the CVS one.
-Rasmus
--- End Message ---
--- Begin Message ---
Hi guys.
Anyone here know why in some cases when i use (header("Location: ???"); the
system lost the session variables?
Any tips will be apreciated.
Thanks in advantge.
--
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br
--- End Message ---
--- Begin Message ---
> Hi guys.
>
> Anyone here know why in some cases when i use (header("Location: ???"); the
> system lost the session variables?
>
> Any tips will be apreciated.
> Thanks in advantge.
Please tell me the cases you mean..!
--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:
> Late answer,
>
> but I was coming back yesterday from Palestine, after the Israelien
> Terror Authority had arrest me for making tonns of photos and Videos
> about Israeli military crime... (shooting children and pregnant women)
<Plonk>
Regards,
Austin.
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
On Sunday 13 August 2006 22:00, Chris wrote:
> Ray Hauge wrote:
> > I use Slackware linux, and XMLRPC is not compiled in by default with my
> > distro, so I'm compiling PHP myself. It's always been a simple enough
> > task. First I get and install the required xmlrpc-epi libraries, and then
> > I compile PHP telling it where I just installed them. Now I get this
> > error message:
> >
> > undefined reference to `libiconv'
> >
> > when compiling PHP. I did some searching, and the only thing I've found
> > in reference to this error was a bug in version 4.3.10. Has anyone run
> > into this issue, or have some suggestions?
> >
> > I have checked that /usr/include/iconv.h is there, and it defines all the
> > iconv_* and iconv compiler flags etc. I can also vouch that using iconv
> > on the command line works just fine.
>
> Try explicitly telling php where iconv is by adding this option to your
> configure command:
>
> --with-iconv-dir=/usr
Thanks for the reply. I enentually got it to comipile by adding "-liconv" to
the LDFLAGS environment variable to tell it to actually link in the iconv
code.
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099
--- End Message ---
--- Begin Message ---
Hello,
Does the PHP environment (5.1.4) provide a way to define some custom
variables as a superglobal? It would be useful for saving certain site
preferences and settings that must be referred in many variables and
classes, without every time writing global keyword at the beginning of a
function definition.
Thanks,
Ville
--- End Message ---
--- Begin Message ---
[snip]
Does the PHP environment (5.1.4) provide a way to define some custom
variables as a superglobal? It would be useful for saving certain site
preferences and settings that must be referred in many variables and
classes, without every time writing global keyword at the beginning of a
function definition.
[/snip]
An include file?
--- End Message ---
--- Begin Message ---
Ville Mattila wrote:
Does the PHP environment (5.1.4) provide a way to define some custom
variables as a superglobal? It would be useful for saving certain site
preferences and settings that must be referred in many variables and
classes, without every time writing global keyword at the beginning of
a function definition.
No, PHP does not allow userland to create superglobals. However, all
global variables can be accessed through the $GLOBALS superglobal.
-Stut
--- End Message ---
--- Begin Message ---
Hello,
You CAN create custom superglobals, but it requires that you have RunKit
enabled: http://us3.php.net/runkit
HTH,
K. Bear
> -----Original Message-----
> From: Stut [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 14, 2006 10:04 AM
> To: Ville Mattila
> Cc: [email protected]
> Subject: Re: [PHP] Creating custom superglobals
>
> Ville Mattila wrote:
> > Does the PHP environment (5.1.4) provide a way to define
> some custom
> > variables as a superglobal? It would be useful for saving
> certain site
> > preferences and settings that must be referred in many
> variables and
> > classes, without every time writing global keyword at the
> beginning of
> > a function definition.
>
> No, PHP does not allow userland to create superglobals.
> However, all global variables can be accessed through the
> $GLOBALS superglobal.
>
> -Stut
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
On Mon, 2006-08-14 at 10:45 -0400, KermodeBear wrote:
> Hello,
>
> You CAN create custom superglobals, but it requires that you have RunKit
> enabled: http://us3.php.net/runkit
Which will make your application incompatible with any distribution
where runkit is not enabled :/ Which kinda sucks, I wish more stuff was
part of the core.
Cheers,
Rob.
>
> HTH,
> K. Bear
>
> > -----Original Message-----
> > From: Stut [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 14, 2006 10:04 AM
> > To: Ville Mattila
> > Cc: [email protected]
> > Subject: Re: [PHP] Creating custom superglobals
> >
> > Ville Mattila wrote:
> > > Does the PHP environment (5.1.4) provide a way to define
> > some custom
> > > variables as a superglobal? It would be useful for saving
> > certain site
> > > preferences and settings that must be referred in many
> > variables and
> > > classes, without every time writing global keyword at the
> > beginning of
> > > a function definition.
> >
> > No, PHP does not allow userland to create superglobals.
> > However, all global variables can be accessed through the
> > $GLOBALS superglobal.
> >
> > -Stut
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> > unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
Which will make your application incompatible with any distribution
where runkit is not enabled :/ Which kinda sucks, I wish more stuff was
part of the core.
Cheers,
Rob.
I agree, this module looks very powerful. The ability to write wrappers
around internal functions by renaming the existing functions could come
in very handy, and defining new superglobals would help make code more
readable (IE, $settings['foo'] rather than $GLOBALS['settings']['foo']).
Heck, even runkit_lint_file would be somewhat helpful, since it's save
us from having to make a shell call for syntax checking.
Regards, Adam.
--- End Message ---
--- Begin Message ---
Hello,
I am trying the run an external application with
command line arguments using PHP under linux.
ie:
$command="myprog $arg1 $arg2 > textfile.txt";
system("echo \"$command\" > test.txt");
system($command);
$handle=fopen("textfile.txt","r");
if($handle!=NULL)
{
while(!feof($handle))
{
...
}
fclose($handle);
}
I test my input arguments for the 'system' call by dumping
the command into a text file. I can then test the command in
the console. The commands work fine when run from the console.
The commands don't work when run through the system command.
I have tried system, exec, passthru, and shell_exec to no avail.
Am I missing some permissions thing in my php.ini file?
Thanks for any insight,
Peter
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Hello,
I am trying the run an external application with
command line arguments using PHP under linux.
ie:
$command="myprog $arg1 $arg2 > textfile.txt";
system("echo \"$command\" > test.txt");
system($command);
$handle=fopen("textfile.txt","r");
if($handle!=NULL)
{
while(!feof($handle))
{
...
}
fclose($handle);
}
I test my input arguments for the 'system' call by dumping
the command into a text file. I can then test the command in
the console. The commands work fine when run from the console.
The commands don't work when run through the system command.
I have tried system, exec, passthru, and shell_exec to no avail.
Am I missing some permissions thing in my php.ini file?
Thanks for any insight,
Peter
Looking at your $command, there is no path in front of it. It's likely
that PHP's shell doesn't have the program in its PATH. Try manually
specifying the full path to the command:
$command="/home/peter/myprog $arg1 $arg2 > textfile.txt";
(or whatever the path is)
Keep in mind that under linux, (unlike DOS), you CANNOT execute
applications in the same directory without a path. Even if the program
is in the same directory as your present working directory (which is
usually where the PHP script is located), you'd have to do "./myprog" as
a relative path.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
Hi,
I can run any external program like ls, cp, uptime...
But if a try to run my shell script a get error.
$passwdexe = "sudo /usr/bin/webpasswd";
$user=$_POST[name];
$passwd="$passwdexe $user 123456";
echo $passwd;
$result = system($passwd);
Resultat from the web, "sudo /usr/sbin/webpasswd billy 12345678"
and from the error_log, "couldn't read file "./usr/sbin/webpasswd.": no
such file or directory".
.Mike
Adam Zey wrote:
[EMAIL PROTECTED] wrote:
Hello,
I am trying the run an external application with
command line arguments using PHP under linux.
ie:
$command="myprog $arg1 $arg2 > textfile.txt";
system("echo \"$command\" > test.txt");
system($command);
$handle=fopen("textfile.txt","r");
if($handle!=NULL)
{
while(!feof($handle))
{
...
}
fclose($handle);
}
I test my input arguments for the 'system' call by dumping
the command into a text file. I can then test the command in the
console. The commands work fine when run from the console.
The commands don't work when run through the system command.
I have tried system, exec, passthru, and shell_exec to no avail.
Am I missing some permissions thing in my php.ini file?
Thanks for any insight,
Peter
Looking at your $command, there is no path in front of it. It's likely
that PHP's shell doesn't have the program in its PATH. Try manually
specifying the full path to the command:
$command="/home/peter/myprog $arg1 $arg2 > textfile.txt";
(or whatever the path is)
Keep in mind that under linux, (unlike DOS), you CANNOT execute
applications in the same directory without a path. Even if the program
is in the same directory as your present working directory (which is
usually where the PHP script is located), you'd have to do "./myprog" as
a relative path.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
Michael Jonsson wrote:
Hi,
I can run any external program like ls, cp, uptime...
But if a try to run my shell script a get error.
$passwdexe = "sudo /usr/bin/webpasswd";
$user=$_POST[name];
$passwd="$passwdexe $user 123456";
echo $passwd;
$result = system($passwd);
Resultat from the web, "sudo /usr/sbin/webpasswd billy 12345678"
and from the error_log, "couldn't read file "./usr/sbin/webpasswd.": no
such file or directory".
.Mike
Notice that "." is being appended before the path, which turns it into a
relative path. It looks like safe mode might be on.
Create a new PHP script with nothing but the command "phpinfo();" in it,
and view it in a browser. To see if safe mode is on, look for the
setting "safe_mode". The line below it is "safe_mode_exec_dir". If safe
mode is on, you'll need to put your program ("webpasswd") into that
directory to execute it.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
No, it not on...
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
.M
Adam Zey wrote:
Michael Jonsson wrote:
Hi,
I can run any external program like ls, cp, uptime...
But if a try to run my shell script a get error.
$passwdexe = "sudo /usr/bin/webpasswd";
$user=$_POST[name];
$passwd="$passwdexe $user 123456";
echo $passwd;
$result = system($passwd);
Resultat from the web, "sudo /usr/sbin/webpasswd billy 12345678"
and from the error_log, "couldn't read file "./usr/sbin/webpasswd.":
no such file or directory".
.Mike
Notice that "." is being appended before the path, which turns it into a
relative path. It looks like safe mode might be on.
Create a new PHP script with nothing but the command "phpinfo();" in it,
and view it in a browser. To see if safe mode is on, look for the
setting "safe_mode". The line below it is "safe_mode_exec_dir". If safe
mode is on, you'll need to put your program ("webpasswd") into that
directory to execute it.
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
Yes, that is a similar problem and sounds very much like
what I am experiencing.
Peter
Quoting Michael Jonsson <[EMAIL PROTECTED]>:
> Hi,
>
> I can run any external program like ls, cp, uptime...
> But if a try to run my shell script a get error.
>
> $passwdexe = "sudo /usr/bin/webpasswd";
> $user=$_POST[name];
> $passwd="$passwdexe $user 123456";
> echo $passwd;
> $result = system($passwd);
>
> Resultat from the web, "sudo /usr/sbin/webpasswd billy 12345678"
> and from the error_log, "couldn't read file "./usr/sbin/webpasswd.": no
> such file or directory".
>
> .Mike
--- End Message ---
--- Begin Message ---
Quoting Adam Zey <[EMAIL PROTECTED]>:
>
> Looking at your $command, there is no path in front of it. It's likely
> that PHP's shell doesn't have the program in its PATH. Try manually
> specifying the full path to the command:
>
> $command="/home/peter/myprog $arg1 $arg2 > textfile.txt";
>
> (or whatever the path is)
>
> Keep in mind that under linux, (unlike DOS), you CANNOT execute
> applications in the same directory without a path. Even if the program
> is in the same directory as your present working directory (which is
> usually where the PHP script is located), you'd have to do "./myprog" as
> a relative path.
>
> Regards, Adam Zey.
I have actually tried that and it didn't make any difference.
In the actual code I have full paths applied to all input and
output files.
One of the system calls is in the system path. (ie: /usr/bin)
Peter
--- End Message ---
--- Begin Message ---
>
> on rereading your post - your storing session data in a db, why bother;
> secondly
> it sounds like you just overwriting the session record with a new
> transaction
> id rather than adding a new transaction id [record] and leaving any
> already existing
> transactions available.
>
> basically pass the transaction id around when you need to keep referring
> to
> an existing transactions and maintain a 'stack' of active transactions.
>
Reason I store session info in 'sessions' table
CREATE TABLE `sessions` (
`sessID` varchar(45) NOT NULL default '',
`last_update` timestamp(14) NOT NULL,
`session_values` text NOT NULL,
PRIMARY KEY (`sessID`)
) TYPE=MyISAM;
instead in $_SESSIONS (something like $_SESSION['session_info']['User'],
$_SESSION['session_info']['UserNo'], $_SESSION['session_info']['OrderID,
'], $_SESSION['session_info']['PageID'], etc.) is to be able to see who is
"online", eventually by redoing sessions table, when they started session,
how much time they spend on application, what they mostly use from
application, etc. (requests from "the office").
-afan
--- End Message ---
--- Begin Message ---
I was writing a shell script in PHP (4.4.2) that dealt with a rather
large array. To figure out what I needed the new memory limit to be, I
did a memory_get_usage() at the end of my script, and came up with about
5.5MB. I then set the memory limit to 8MB.
When I tried to run it, the script ran out of memory on the line:
$numwords = count($words);
However, when I switched to simply incrementing $numwords every time I
added an element to $words, the memory limit of 8MB was fine.
So my question is, if PHP does copy-on-write, why does PHP make a copy
of an array when you use count() on it, which should NOT be modifying
the array?
Regards, Adam Zey.
--- End Message ---
--- Begin Message ---
[If you're not in Chicago, or relocating to Chicago within days, hit
delete now.]
PHP Job Opening
I'm leaving a very nice cushy job for an even nicer cushier job. :-)
My final task is to find my replacement.
The work mostly entails setting up new pages of search results from APIs
based around XML feeds for:
http://info.com/
There are occasionally some in-house PHP pages to be built/maintained.
The Tech environment consists of, and your skill set should include:
PHP 4 OOP
PEAR XML
High-Volume High-Availability stable coding
Reading vendor API documentation of XML feeds for RPC, HTTP, REST etc
Occasional PHP/HTML Intranet back-end work
The work environment is very casual and relaxed, with a stunning view
from your desk of Lake Michigan over-looking Millenium Park.
This is in Chicago, downtown near the Art Institute, Chicago Cultural
Center, etc.
There is no shortage of work to do, so it's a solid 40 hours per week,
but the hours are very flexible.
Pay rate is $23-$28 per hour, based on experience.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
Warren Vail wrote:
> I would be interested to know what might get past the
> addslashes function that the mysql_escape_string function
> catches.
I wrote an example to demonstrate this:
http://shiflett.org/archive/184
The theory behind this type of problem is pretty easy to understand - if
your escaping function interprets characters differently than the
database, it's possible that it will fail to escape something that needs
to be escaped, just because it misinterprets the character.
The problem I demonstrate doesn't exist with UTF-8 or ISO-8859-1, but it
does with any character encoding where there is a valid multi-byte
character that ends in 0x5c. Regardless, it's best to use the right tool
for the job, even if you think you won't be punished for using the wrong
one. (You might be wrong.)
The original question is related to XSS, not SQL injection, and
character encoding consistency is even more important in that context:
http://shiflett.org/archive/178
Hope that helps.
Chris
--
Chris Shiflett
Principal, OmniTI
http://omniti.com/
--- End Message ---
--- Begin Message ---
On Sun, August 13, 2006 8:03 am, tedd wrote:
>> This leads
>>to the opposite problem of IE caching DYNAMIC images when it should
>>not, which is a whole different rant. :-)
>
> In that case, I just added a random string to end of the image url
> like so:
>
> images/myimage.jpg?a=adj12k4mfdi
>
> If I remember correctly, it seemed to work.
Works okay for images on MOST browsers, but not some ancient IE versions.
Will also fail as a generalized technique for a PDF if the user has
configured Adobe Reader to open in a Adobe rather than as a plug-in.
Also fails as a generalized technique for the PDF embedded in an FDF.
Basically, IE simply does not deal well with Rich Media (non-HTML)
dynamic content. It's quite narrow-minded on what can be "dynamic" on
the Internet.
I personally would recommend that folks solve this problem in a
generalized way using URL re-writing with $_SERVER['PATH_INFO'] as I
have posted in the past (several times, actually) because that
solution works well across the board, and means you can re-use the
code for Images, PDFs, FDFs, Ming (PHP-generated Flash), MP3s, etc
instead of having different code-bases for each.
The basic technique for this is posted in a rant here:
http://richardlynch.blogspot.com
in case anybody cares.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---