php-general Digest 24 Nov 2005 19:45:08 -0000 Issue 3813
Topics (messages 226398 through 226416):
understanding session vars ?
226398 by: Gregory Machin
226401 by: David Grant
226403 by: Gregory Machin
226404 by: David Grant
226405 by: Gregory Machin
226406 by: David Grant
226408 by: Ford, Mike
Re: Can't execute external program
226399 by: n.g.
R: [PHP] Re: Can't execute external program
226400 by: Sebastian \"En3pY\" Zdrojewski
Re: readfile and get_file_contents don't work
226402 by: David Grant
Re: preg_match_all for dummies
226407 by: n.g.
226413 by: Jochem Maas
Regexp trouble
226409 by: Andy Pieters
226410 by: David Grant
226411 by: Frank Armitage
226412 by: Jochem Maas
226416 by: Andy Pieters
great examples of using PHP to dynamically generate ASX files
226414 by: Graham Anderson
Where is utypes.h ?
226415 by: ÕÅ˳
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:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hi
I'm a bit stuck on session var, and thier implamentation, or my perseption
thier of.
I have a page and need certian vars to be persistat each time the page is
called.
This is done to detmin the content of the page through logic that calls
different includes.
But I cant get the vars to be persistant.
note the page call it's self.
./index.php
<?php
session_start();
$_SESSION['menu']
?>
<html><A href=./index.php?menu=1>option 1</A></html> // this works
<html><A href=./index.php?other=do>differnt action</A></html> // this brakes
it . when the user links here the 'menu' var is cleared
<?php $_SESSION['menu'] = $_GET['menu'];
echo $_SESSION['menu'];
?>
I would like the menu var (and others) to be persistant until it is reset or
updated. how do I acheave this .
Thanks
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)
+27 72 524 8096
--- End Message ---
--- Begin Message ---
Gregory,
Are you always setting $_SESSION['menu'] to the contents of
$_GET['menu']? If so, the second link will set $_SESSION['menu'] to
null. You need to check the contents of $_GET['menu'] first before
setting, i.e.
if (isset($_GET['menu']))
$_SESSION['menu'] = $_GET['menu'];
Cheers,
David Grant
Gregory Machin wrote:
> Hi
> I'm a bit stuck on session var, and thier implamentation, or my perseption
> thier of.
> I have a page and need certian vars to be persistat each time the page is
> called.
> This is done to detmin the content of the page through logic that calls
> different includes.
>
> But I cant get the vars to be persistant.
> note the page call it's self.
>
> ./index.php
> <?php
> session_start();
> $_SESSION['menu']
>
> ?>
> <html><A href=./index.php?menu=1>option 1</A></html> // this works
> <html><A href=./index.php?other=do>differnt action</A></html> // this brakes
> it . when the user links here the 'menu' var is cleared
> <?php $_SESSION['menu'] = $_GET['menu'];
> echo $_SESSION['menu'];
>
> ?>
>
> I would like the menu var (and others) to be persistant until it is reset or
> updated. how do I acheave this .
>
> Thanks
>
>
>
>
>
>
> --
> Gregory Machin
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> www.linuxpro.co.za
> www.exponent.co.za
> Web Hosting Solutions
> Scalable Linux Solutions
> www.iberry.info (support and admin)
>
> +27 72 524 8096
--- End Message ---
--- Begin Message ---
I have a test script..
What i'm trying to achieve is once the user has clicked on link1 the value
of item must equal x and if the user clicks on link2 the value of items must
stay equal to x while setting action equal to y ..
<?php
session_start();
echo 'Welcome to testpg';
$_SESSION['time'] = time();
if (isset($_GET['item'])){
$_SESSION['item'] = $_GET['item'];
echo $_SESSION['item'];
}
if (isset($_GET['action'])){
$_SESSION['action'] = $_GET['action'];
echo $_SESSION['action'];
}
?>
<html><br /><a href="test.php?item=x&<?php echo strip_tags(SID);
?>">link1</a></html>
<html><br /><a href="test.php?action=y&<?php echo strip_tags(SID);
?>">link2</a></html>
thanks
On 11/24/05, David Grant <[EMAIL PROTECTED]> wrote:
>
> Gregory,
>
> Are you always setting $_SESSION['menu'] to the contents of
> $_GET['menu']? If so, the second link will set $_SESSION['menu'] to
> null. You need to check the contents of $_GET['menu'] first before
> setting, i.e.
>
> if (isset($_GET['menu']))
> $_SESSION['menu'] = $_GET['menu'];
>
> Cheers,
>
> David Grant
>
> Gregory Machin wrote:
> > Hi
> > I'm a bit stuck on session var, and thier implamentation, or my
> perseption
> > thier of.
> > I have a page and need certian vars to be persistat each time the page
> is
> > called.
> > This is done to detmin the content of the page through logic that calls
> > different includes.
> >
> > But I cant get the vars to be persistant.
> > note the page call it's self.
> >
> > ./index.php
> > <?php
> > session_start();
> > $_SESSION['menu']
> >
> > ?>
> > <html><A href=./index.php?menu=1>option 1</A></html> // this works
> > <html><A href=./index.php?other=do>differnt action</A></html> // this
> brakes
> > it . when the user links here the 'menu' var is cleared
> > <?php $_SESSION['menu'] = $_GET['menu'];
> > echo $_SESSION['menu'];
> >
> > ?>
> >
> > I would like the menu var (and others) to be persistant until it is
> reset or
> > updated. how do I acheave this .
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> > --
> > Gregory Machin
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > www.linuxpro.co.za
> > www.exponent.co.za
> > Web Hosting Solutions
> > Scalable Linux Solutions
> > www.iberry.info (support and admin)
> >
> > +27 72 524 8096
>
>
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)
+27 72 524 8096
--- End Message ---
--- Begin Message ---
Gregory,
Values in the $_SESSION superglobal will persist over pages so long as
session_start() is called on each page.
Cheers,
David Grant
Gregory Machin wrote:
> I have a test script..
> What i'm trying to achieve is once the user has clicked on link1 the
> value of item must equal x and if the user clicks on link2 the value of
> items must stay equal to x while setting action equal to y ..
>
> <?php
> session_start();
> echo 'Welcome to testpg';
> $_SESSION['time'] = time();
>
>
> if (isset($_GET['item'])){
> $_SESSION['item'] = $_GET['item'];
> echo $_SESSION['item'];
> }
>
> if (isset($_GET['action'])){
> $_SESSION['action'] = $_GET['action'];
> echo $_SESSION['action'];
> }
>
>
> ?>
> <html><br /><a href="test.php?item=x&<?php echo strip_tags(SID);
> ?>">link1</a></html>
> <html><br /><a href="test.php?action=y&<?php echo strip_tags(SID);
> ?>">link2</a></html>
>
> thanks
>
> On 11/24/05, * David Grant* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Gregory,
>
> Are you always setting $_SESSION['menu'] to the contents of
> $_GET['menu']? If so, the second link will set $_SESSION['menu'] to
> null. You need to check the contents of $_GET['menu'] first before
> setting, i.e.
>
> if (isset($_GET['menu']))
> $_SESSION['menu'] = $_GET['menu'];
>
> Cheers,
>
> David Grant
>
> Gregory Machin wrote:
> > Hi
> > I'm a bit stuck on session var, and thier implamentation, or my
> perseption
> > thier of.
> > I have a page and need certian vars to be persistat each time the
> page is
> > called.
> > This is done to detmin the content of the page through logic that
> calls
> > different includes.
> >
> > But I cant get the vars to be persistant.
> > note the page call it's self.
> >
> > ./index.php
> > <?php
> > session_start();
> > $_SESSION['menu']
> >
> > ?>
> > <html><A href=./index.php?menu=1>option 1</A></html> // this works
> > <html><A href=./index.php?other=do>differnt action</A></html> //
> this brakes
> > it . when the user links here the 'menu' var is cleared
> > <?php $_SESSION['menu'] = $_GET['menu'];
> > echo $_SESSION['menu'];
> >
> > ?>
> >
> > I would like the menu var (and others) to be persistant until it
> is reset or
> > updated. how do I acheave this .
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> > --
> > Gregory Machin
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > www.linuxpro.co.za <http://www.linuxpro.co.za>
> > www.exponent.co.za <http://www.exponent.co.za>
> > Web Hosting Solutions
> > Scalable Linux Solutions
> > www.iberry.info <http://www.iberry.info> (support and admin)
> >
> > +27 72 524 8096
>
>
>
>
> --
> Gregory Machin
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> www.linuxpro.co.za <http://www.linuxpro.co.za>
> www.exponent.co.za <http://www.exponent.co.za>
> Web Hosting Solutions
> Scalable Linux Solutions
> www.iberry.info <http://www.iberry.info> (support and admin)
>
> +27 72 524 8096
--- End Message ---
--- Begin Message ---
My test code is for test.php which is intended to call it's self, and starts
with sesstion_start().
buy does not disply x after link2 is clicked on, but only y..
what am I missing ?
Thanks
On 11/24/05, David Grant <[EMAIL PROTECTED]> wrote:
>
> Gregory,
>
> Values in the $_SESSION superglobal will persist over pages so long as
> session_start() is called on each page.
>
> Cheers,
>
> David Grant
>
> Gregory Machin wrote:
> > I have a test script..
> > What i'm trying to achieve is once the user has clicked on link1 the
> > value of item must equal x and if the user clicks on link2 the value of
> > items must stay equal to x while setting action equal to y ..
> >
> > <?php
> > session_start();
> > echo 'Welcome to testpg';
> > $_SESSION['time'] = time();
> >
> >
> > if (isset($_GET['item'])){
> > $_SESSION['item'] = $_GET['item'];
> > echo $_SESSION['item'];
> > }
> >
> > if (isset($_GET['action'])){
> > $_SESSION['action'] = $_GET['action'];
> > echo $_SESSION['action'];
> > }
> >
> >
> > ?>
> > <html><br /><a href="test.php?item=x&<?php echo strip_tags(SID);
> > ?>">link1</a></html>
> > <html><br /><a href="test.php?action=y&<?php echo strip_tags(SID);
> > ?>">link2</a></html>
> >
> > thanks
> >
> > On 11/24/05, * David Grant* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > Gregory,
> >
> > Are you always setting $_SESSION['menu'] to the contents of
> > $_GET['menu']? If so, the second link will set $_SESSION['menu'] to
> > null. You need to check the contents of $_GET['menu'] first before
> > setting, i.e.
> >
> > if (isset($_GET['menu']))
> > $_SESSION['menu'] = $_GET['menu'];
> >
> > Cheers,
> >
> > David Grant
> >
> > Gregory Machin wrote:
> > > Hi
> > > I'm a bit stuck on session var, and thier implamentation, or my
> > perseption
> > > thier of.
> > > I have a page and need certian vars to be persistat each time the
> > page is
> > > called.
> > > This is done to detmin the content of the page through logic that
> > calls
> > > different includes.
> > >
> > > But I cant get the vars to be persistant.
> > > note the page call it's self.
> > >
> > > ./index.php
> > > <?php
> > > session_start();
> > > $_SESSION['menu']
> > >
> > > ?>
> > > <html><A href=./index.php?menu=1>option 1</A></html> // this works
> > > <html><A href=./index.php?other=do>differnt action</A></html> //
> > this brakes
> > > it . when the user links here the 'menu' var is cleared
> > > <?php $_SESSION['menu'] = $_GET['menu'];
> > > echo $_SESSION['menu'];
> > >
> > > ?>
> > >
> > > I would like the menu var (and others) to be persistant until it
> > is reset or
> > > updated. how do I acheave this .
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Gregory Machin
> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > > www.linuxpro.co.za <http://www.linuxpro.co.za>
> > > www.exponent.co.za <http://www.exponent.co.za>
> > > Web Hosting Solutions
> > > Scalable Linux Solutions
> > > www.iberry.info <http://www.iberry.info> (support and admin)
> > >
> > > +27 72 524 8096
> >
> >
> >
> >
> > --
> > Gregory Machin
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > www.linuxpro.co.za <http://www.linuxpro.co.za>
> > www.exponent.co.za <http://www.exponent.co.za>
> > Web Hosting Solutions
> > Scalable Linux Solutions
> > www.iberry.info <http://www.iberry.info> (support and admin)
> >
> > +27 72 524 8096
>
>
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)
+27 72 524 8096
--- End Message ---
--- Begin Message ---
Gregory
Gregory Machin wrote:
> My test code is for test.php which is intended to call it's self, and
> starts with sesstion_start().
> buy does not disply x after link2 is clicked on, but only y..
>
> what am I missing ?
"x" wouldn't display because it depends on $_GET['item'] being set,
which isn't. Try var_dump($_SESSION) instead of the conditional echoing
of the variables.
Cheers,
David Grant
> Thanks
>
> On 11/24/05, *David Grant* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Gregory,
>
> Values in the $_SESSION superglobal will persist over pages so long as
> session_start() is called on each page.
>
> Cheers,
>
> David Grant
>
> Gregory Machin wrote:
> > I have a test script..
> > What i'm trying to achieve is once the user has clicked on link1 the
> > value of item must equal x and if the user clicks on link2 the
> value of
> > items must stay equal to x while setting action equal to y ..
> >
> > <?php
> > session_start();
> > echo 'Welcome to testpg';
> > $_SESSION['time'] = time();
> >
> >
> > if (isset($_GET['item'])){
> > $_SESSION['item'] = $_GET['item'];
> > echo $_SESSION['item'];
> > }
> >
> > if (isset($_GET['action'])){
> > $_SESSION['action'] = $_GET['action'];
> > echo $_SESSION['action'];
> > }
> >
> >
> > ?>
> > <html><br /><a href="test.php?item=x&<?php echo strip_tags(SID);
> > ?>">link1</a></html>
> > <html><br /><a href="test.php?action=y&<?php echo strip_tags(SID);
> > ?>">link2</a></html>
> >
> > thanks
> >
> > On 11/24/05, * David Grant* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> > <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
> >
> > Gregory,
> >
> > Are you always setting $_SESSION['menu'] to the contents of
> > $_GET['menu']? If so, the second link will set
> $_SESSION['menu'] to
> > null. You need to check the contents of $_GET['menu'] first
> before
> > setting, i.e.
> >
> > if (isset($_GET['menu']))
> > $_SESSION['menu'] = $_GET['menu'];
> >
> > Cheers,
> >
> > David Grant
> >
> > Gregory Machin wrote:
> > > Hi
> > > I'm a bit stuck on session var, and thier implamentation, or my
> > perseption
> > > thier of.
> > > I have a page and need certian vars to be persistat each
> time the
> > page is
> > > called.
> > > This is done to detmin the content of the page through logic
> that
> > calls
> > > different includes.
> > >
> > > But I cant get the vars to be persistant.
> > > note the page call it's self.
> > >
> > > ./index.php
> > > <?php
> > > session_start();
> > > $_SESSION['menu']
> > >
> > > ?>
> > > <html><A href=./index.php?menu=1>option 1</A></html> // this
> works
> > > <html><A href=./index.php?other=do>differnt action</A></html> //
> > this brakes
> > > it . when the user links here the 'menu' var is cleared
> > > <?php $_SESSION['menu'] = $_GET['menu'];
> > > echo $_SESSION['menu'];
> > >
> > > ?>
> > >
> > > I would like the menu var (and others) to be persistant until it
> > is reset or
> > > updated. how do I acheave this .
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Gregory Machin
> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > > www.linuxpro.co.za <http://www.linuxpro.co.za>
> <http://www.linuxpro.co.za>
> > > www.exponent.co.za <http://www.exponent.co.za>
> <http://www.exponent.co.za>
> > > Web Hosting Solutions
> > > Scalable Linux Solutions
> > > www.iberry.info <http://www.iberry.info>
> <http://www.iberry.info> (support and admin)
> > >
> > > +27 72 524 8096
> >
> >
> >
> >
> > --
> > Gregory Machin
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
> > www.linuxpro.co.za <http://www.linuxpro.co.za>
> <http://www.linuxpro.co.za >
> > www.exponent.co.za <http://www.exponent.co.za>
> <http://www.exponent.co.za>
> > Web Hosting Solutions
> > Scalable Linux Solutions
> > www.iberry.info <http://www.iberry.info> <http://www.iberry.info>
> (support and admin)
> >
> > +27 72 524 8096
>
>
>
>
> --
> Gregory Machin
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> www.linuxpro.co.za <http://www.linuxpro.co.za>
> www.exponent.co.za <http://www.exponent.co.za>
> Web Hosting Solutions
> Scalable Linux Solutions
> www.iberry.info <http://www.iberry.info> (support and admin)
>
> +27 72 524 8096
--- End Message ---
--- Begin Message ---
On 24 November 2005 10:24, Gregory Machin wrote:
> I have a test script..
> What i'm trying to achieve is once the user has clicked on
> link1 the value
> of item must equal x and if the user clicks on link2 the
> value of items must
> stay equal to x while setting action equal to y ..
>
> <?php
> session_start();
> echo 'Welcome to testpg';
> $_SESSION['time'] = time();
>
>
> if (isset($_GET['item'])){
> $_SESSION['item'] = $_GET['item'];
> echo $_SESSION['item'];
> }
>
> if (isset($_GET['action'])){
> $_SESSION['action'] = $_GET['action'];
> echo $_SESSION['action'];
> }
>
>
> >
> <html><br /><a href="test.php?item=x&<?php echo strip_tags(SID);
> > ">link1</a></html>
> <html><br /><a href="test.php?action=y&<?php echo strip_tags(SID);
> > ">link2</a></html>
This is not how you use <html> tags -- you need one <html> tag at the beginning
of your output page, and one </html> tag at the end.
Additionally, you shouldn't need to strip_tags(SID) -- if the constant SID
exists, it will be well-formed.
What are the value of your session.use_trans_sid, session.use_cookies and
session.use_only_cookies settings?
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
put the executable into another directory rather than DOC_ROOT,
maybe you have reached apache security settings.
or try add `option +exec' to your apache conf, but be aware this maybe
a security problem to your site to do so.
On 11/24/05, Henry Castillo <[EMAIL PROTECTED]> wrote:
> Hi
> Still desperate
> DOCUMENT_ROOT is /var/www/html
> Check all settings at http://provi.voicenetworx.net:8080/t.php
> From the command line it runs perfectly:
> [EMAIL PROTECTED] html]# /var/www/html/myprog -E 123456789098.dat sample1.txt
> sample1.new
> (no output, it just creates the file .new)
>
> Here is the php I've created, fairly simple:
> <?php
> exec("/var/www/html/myprog -E 123456789098.dat sample1.txt
> sample1.new");
> phpinfo();
> ?>
>
>
>
> On 11/22/05, n.g. <[EMAIL PROTECTED]> wrote:
> >
> > is /var/www/html your web root dir ?
> > maybe its the plobrem.
> >
> > On 11/23/05, Henry Castillo <[EMAIL PROTECTED]> wrote:
> > > That was on of the first things I checked:
> > > safe mode is set to off
> > > Any ideas...
> > > Henry
> > > Voip tech said the following on 11/20/2005 10:31 PM:
> > > > Hello,
> > > > I cannot get exec(), system() or passthru() to run an extenal
> program.
> > > > From the command line it runs perfectly:
> > >
> > > <snip>
> > >
> > > > I'm getting frustrated, Any help will be deeply appreciated
> > > > Henry
> > >
> > > The answer is probably in your php.ini. Look into whether you are
> > > running in safe mode or not, and if you are whether you have your
> > > program in the safe_mode_exec_dir or not. Also check disable_functions
> > > to see if any of the ones you are having trouble with are listed.
> > >
> > > - Ben
> > >
> > >
> >
> >
> > --
> > Tomorrow will be a good day :-)
> >
>
>
--
Tomorrow will be a good day :-)
--- End Message ---
--- Begin Message ---
Try verifying the following:
- does the web server user (apache/nobody) have a shell?
- can the web server user/group execute the file? (x permission)
I believe this is your problem, the exec option for the apache would be
useful if you need to run an executable from the apache service, not from
the command line.
Check out the earlier and I think you're gonna solve your issue.
Regards,
En3pY
Sebastian Konstanty Zdrojewski
________________________________
URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]
________________________________
Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE).
-----Messaggio originale-----
Da: n.g. [mailto:[EMAIL PROTECTED]
Inviato: giovedì 24 novembre 2005 10.16
A: Henry Castillo
Cc: php-general@lists.php.net
Oggetto: [PHP] Re: Can't execute external program
put the executable into another directory rather than DOC_ROOT, maybe you
have reached apache security settings.
or try add `option +exec' to your apache conf, but be aware this maybe a
security problem to your site to do so.
On 11/24/05, Henry Castillo <[EMAIL PROTECTED]> wrote:
> Hi
> Still desperate
> DOCUMENT_ROOT is /var/www/html
> Check all settings at http://provi.voicenetworx.net:8080/t.php
> From the command line it runs perfectly:
> [EMAIL PROTECTED] html]# /var/www/html/myprog -E 123456789098.dat
> sample1.txt sample1.new (no output, it just creates the file .new)
>
> Here is the php I've created, fairly simple:
> <?php
> exec("/var/www/html/myprog -E 123456789098.dat sample1.txt
> sample1.new"); phpinfo(); ?>
>
>
>
> On 11/22/05, n.g. <[EMAIL PROTECTED]> wrote:
> >
> > is /var/www/html your web root dir ?
> > maybe its the plobrem.
> >
> > On 11/23/05, Henry Castillo <[EMAIL PROTECTED]> wrote:
> > > That was on of the first things I checked:
> > > safe mode is set to off
> > > Any ideas...
> > > Henry
> > > Voip tech said the following on 11/20/2005 10:31 PM:
> > > > Hello,
> > > > I cannot get exec(), system() or passthru() to run an extenal
> program.
> > > > From the command line it runs perfectly:
> > >
> > > <snip>
> > >
> > > > I'm getting frustrated, Any help will be deeply appreciated
> > > > Henry
> > >
> > > The answer is probably in your php.ini. Look into whether you are
> > > running in safe mode or not, and if you are whether you have your
> > > program in the safe_mode_exec_dir or not. Also check
> > > disable_functions to see if any of the ones you are having trouble
with are listed.
> > >
> > > - Ben
> > >
> > >
> >
> >
> > --
> > Tomorrow will be a good day :-)
> >
>
>
--
Tomorrow will be a good day :-)
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 23/11/2005
smime.p7s
Description: S/MIME cryptographic signature
--- End Message ---
--- Begin Message ---
Hi Richard,
Please ensure that the "allow_url_fopen" directive is set to "On" in
your php.ini file.
Cheers,
David Grant
Richard K. Miller wrote:
> I compiled PHP from source on Fedora Core 4, but I must have left
> something out because readfile and get_file_contents aren't working. If
> I try to connect to a "http://" address I get the error "failed to open
> stream: HTTP request failed". Any ideas why?
>
> Richard
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
lookbehind assertion require fixed length string as its parameter.
but you intend to put arbitary length string between `<!--' and `[!'
so the solution can be
1, remove html comments first before do bbcode expansion.
2, change bbcode tags to something like `[!-- .* --!]', that is define
a new tag of bbcode comments, which is independent to html comments.
On 11/24/05, Kristen G. Thorson <[EMAIL PROTECTED]> wrote:
> I am a regex retard.
>
> I am trying to pull keywords out of this crazy bbcode-like file, but
> only for bbcode-like code NOT enclosed in HTML comments. I currently
> have managed to create this regex:
>
> '/(?<!<!--)\[!(\w+)::.*!\](?!-->)/U'
>
> Which matches
>
> [!keyword::crazy bbcode!]
>
> and not
>
> <!--[!keyword::crazy bbcode!]-->
>
> That's a step in the right direction. But it includes in the match
> keywords within phrases like this:
>
> <!-- A sentence including some [!keyword::crazy bbcode!]. -->
>
> I want to ignore all bbcode within HTML quotes. How do I do this?
>
>
> thanks
>
> kgt
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Tomorrow will be a good day :-)
--- End Message ---
--- Begin Message ---
Kristen G. Thorson wrote:
I am a regex retard.
good for you ;-)
why not take the easy route and simply strip out all HTML comments
(and whatever maybe inside them) from the string(s) before you do the
search for the 'bbcode'?
I am trying to pull keywords out of this crazy bbcode-like file, but
only for bbcode-like code NOT enclosed in HTML comments. I currently
have managed to create this regex:
'/(?<!<!--)\[!(\w+)::.*!\](?!-->)/U'
Which matches
[!keyword::crazy bbcode!]
and not
<!--[!keyword::crazy bbcode!]-->
That's a step in the right direction. But it includes in the match
keywords within phrases like this:
<!-- A sentence including some [!keyword::crazy bbcode!]. -->
I want to ignore all bbcode within HTML quotes. How do I do this?
thanks
kgt
--- End Message ---
--- Begin Message ---
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
but when I put it in the php script it fails.
ereg('^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})'
Does not match my query string.
Which is
Nov 22 06:51:36
Any ideas why? I mean Line start, followed by 3 word chars, followed by a
space, followed by 2 digits, followed by a space, followed by two digits,
folowed by a colon followed by 2 digits and followed by a colon, should match
that date?
With kind regards
Andy
--
Currently not listening to amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
pgpDJ07uGR43X.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Andy,
Try preg_match instead of ereg.
Cheers,
David Grant
Andy Pieters wrote:
> Hi list
>
> I still fail to understand why regular expressions are causing me such a hard
> time.
>
> I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
> but when I put it in the php script it fails.
>
> ereg('^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})'
>
> Does not match my query string.
>
> Which is
>
> Nov 22 06:51:36
>
> Any ideas why? I mean Line start, followed by 3 word chars, followed by a
> space, followed by 2 digits, followed by a space, followed by two digits,
> folowed by a colon followed by 2 digits and followed by a colon, should match
> that date?
>
> With kind regards
>
>
> Andy
>
--- End Message ---
--- Begin Message ---
Andy Pieters wrote:
> Hi list
>
> I still fail to understand why regular expressions are causing me such a hard
> time.
>
> <snip />
Hi!
Why don't you use 'preg_match'? And why do you use all those character
classes?
This:
<code>
$subject = 'Nov 22 06:51:36';
$pattern = '/^(\w{3})\s(\d{2})\s(\d{2}):(\d{2}):(\d{2})/';
if (preg_match($pattern, $subject, $matches)) {
print_r($matches);
}
</code>
nicely prints:
Array
(
[0] => Nov 22 06:51:36
[1] => Nov
[2] => 22
[3] => 06
[4] => 51
[5] => 36
)
Bye
Frank
--
tradeOver | http://www.tradeover.net
...ready to become the King of the World?
--- End Message ---
--- Begin Message ---
Andy Pieters wrote:
Hi list
I still fail to understand why regular expressions are causing me such a hard
time.
er, because they are hard? hey you failed! we have a club :-)
I used and tested my regexp in kregexpeditor (comes with Quanta [kdewebdev])
but when I put it in the php script it fails.
ereg('^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})'
I always use the preg_*() functions myself.
and I always have to specify regexp delimiters ...
$re =
"#^([\w]{3,3})[\s]([\d]{2,2})[\s]([\d]{2,2})[:]([\d]{2,2})[:]([\d]{2,2})#";
$st = "Nov 22 06:51:36";
echo (preg_match($re, $st) ? "Yes":"No"),"\n";
I ran the above and it returned 'Yes' for me.
Does not match my query string.
Which is
Nov 22 06:51:36
Any ideas why? I mean Line start, followed by 3 word chars, followed by a
space, followed by 2 digits, followed by a space, followed by two digits,
folowed by a colon followed by 2 digits and followed by a colon, should match
that date?
With kind regards
Andy
--- End Message ---
--- Begin Message ---
Thanks all for your contributions. Seems like the missing link was the
delimiter.
On Thursday 24 November 2005 18:23, Frank Armitage wrote:
>
> And why do you use all those character
> classes?
>
Err.. why NOT use character classes? What is easier [0-9] or \d or maybe
[a-zA-Z] or [\w], ... ?
With kind regards
Andy
--
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--
pgpO3jmVvZxvl.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Are there any great examples/tutorials of building advanced ASX
files with PHP ?
I have built a lot of playlists with Quicktime/ PHP/MYSQL...but I am
a windows media noob
any resources and/or examples are appreciated :)
g
--- End Message ---
--- Begin Message ---
Hi List
When I what to build PHP5 in Win32:
Where is the "utypes.h" .
===========================================================
C:\work\php5\win32>msdev php4ts.dsp /MAKE "php4ts - Win32 Debug_TS"
php4ts.dsp
File not found.
Please verify that the path and file name are correct.
Error: no project loaded.
C:\work\php5\win32>
C:\work\php5\win32>msdev php5ts.dsp /MAKE "php5ts - Win32 Debug_TS"
--------------------Configuration: EngineSelect - Win32 Debug-------------------
-
--------------------Configuration: ZendTS - Win32 Debug_TS--------------------
Compiling...
zend.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_alloc.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_API.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_builtin_functions.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_compile.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_constants.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_default_classes.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_dynamic_array.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_exceptions.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_execute.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_execute_API.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_extensions.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_hash.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_highlight.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_indent.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_ini.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_ini_parser.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_ini_scanner.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_interfaces.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_iterators.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_language_parser.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_language_scanner.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_list.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_llist.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_mm.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_object_handlers.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_objects.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_objects_API.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_opcode.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_operators.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_ptr_stack.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_qsort.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_reflection_api.c
fatal error C1083: Cannot open source file: 'C:\work\php5\Zend\zend_reflection_a
pi.c': No such file or directory
zend_sprintf.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_stack.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_stream.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_strtod.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_ts_hash.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
zend_variables.c
c:\work\php5\zend\zend_alloc.h(31) : fatal error C1083: Cannot open include file
: 'unicode/utypes.h': No such file or directory
Error executing cl.exe.
php.exe - 39 error(s), 0 warning(s)
--- End Message ---