Re: [PHP] FreeBSD fsockopen problem

2002-04-18 Thread Charles Williams

fixed,

chuck

- Original Message -
From: "Charles Williams" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, April 17, 2002 2:34 PM
Subject: [PHP] FreeBSD fsockopen problem


> Hey all,
>
> I am in need of opening a UDP socket on a FreeBSD box.  The following code
> works in Linux but not in FreeBSD.  In FreeBSD $fp returns a valid
resource
> number and $error equals 0 (no error), but there is NO service on that
port
> when testing it.
>
> $fp = fsockopen ("udp://" . $tmpserver, $tmpport, $errno, $errstr,
25);
> echo "$fp , $errno , $errstr";
>   if(!$fp)
>   {
> $tpl->parse("CONTENT", "notconnected", false);
> $tpl->parse("OUT", "main", false);
> $tpl->p("OUT");
> exit;
>   }
>
> In other words the block in the "if" statement doesn't execute.
>
> Anyone have any ideas what this is?
>
> thanks,
> chuck
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Web Hosting control panel ported to freebsd

2002-03-23 Thread Charles Williams

yep,

finally got it working.  original linux based web hosting control panel,
written in PHP, now works under freebsd 4.3 (tested), and should work on 4.4
as well.

If interested in testing on a FreeBSD system just let me know, off list, at
[EMAIL PROTECTED]  I would like to get this compatible with just
about any other FreeBSD release.

thanks,
chuck


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Net status and free memory on freebsd

2002-03-22 Thread Charles Williams

Hey all,

I'm working on porting a php app to freebsd.  However, there is a problem.
;)

in linux you can parse /proc/net/dev for all network statistics and make a
call to free for available memory.  How could you do the same thing in
freebsd?

I have looked at "netstat -b -p ip -I ed0" but that outputs a huge page and
you have to grep for a line just to get close.  This means for each bit of
info you have to make multiple calls or store the entire return which is a
pain in the but.

I can't believe that freebsd wouldn't offer a better solution to this.  what
were they thinking?

any help greatly appreciated,

chuck



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Working with IP addresses

2002-03-18 Thread Charles Williams


- Original Message -
From: <[EMAIL PROTECTED]>
To: "Charles Williams" <[EMAIL PROTECTED]>
Cc: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, March 18, 2002 10:12 PM
Subject: Re: [PHP] Working with IP addresses


> On Mon, 18 Mar 2002, Charles Williams wrote:
> > There will be a form with a text box to allow IP address entries as
follows:
> >
> > 192.168.5.195
> > or
> > 123.23.35.4 123.23.35.45 123.23.35.74
> > or
> > 123.4.34.1/123.4.34.255
> > or
> > 13.234.5.41/13.234.5.75 12.34.34.150/12.34.34.225
> >
> > The above a just a few examples.  I need to be able to grab either the
IP
> > addresses or the ranges and verify that when an IP is entered at a later
> > date and compared to the above types of previously saved data that the
IP is
> > within the range(s).
> >
> > I hope I explained that ok. ;)
> >
> > So basically I guess I just need a way of, after retrieving the info
from
> > the DB, splitting the IP (range(s)) apart and then comparing the IP
entered
> > to those in the array(?) to verify that it was a good entry.
>
> It's not exactly clear to me what your question is.
>
> But, as to the general question of representing and comparing IP addresses
> internally, I guess first you'd want to pick a representation that
> efficiently and flexibly captures the values you expect to work with.
>
> Ordinarily I would suggest CIDR subnets but the sample IP addresses you
> provided do not comply - they seem to be random numbers. Is this because
> you need to deal with arbitrary sets of IP addresses rather than valid
> subnets, or because you were just in a hurry while typing your message to
> the list?
>
> Also, I wouldn't recommend using the slash to identify ranges of IP
> addresses, because the slash already has a specific meaning in this
> context: the number after it specifies the size of the subnet mask. For
> instance, to refer to the range 192.168.34.128-192.168.34.135, you'd write
> 192.168.34.128/29.
>

Sorry.  forgot about the cisco standard thing there when I typed it all up.
hehe.  been a long day.

Anyway.  the IP addresses provided were just arbitrary addresses to show the
format to be used.

of course the /xx (cisco method) will be used and the IP-IP format will be
used for a range as well.

thanks for any help.

> Anyway, I have a few ideas in mind but with an answer to the above
> question I'd be able to give you what may be an optimal representation and
> methodology.
>
> miguel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Working with IP addresses

2002-03-18 Thread Charles Williams

Hey all,

I find myself in need of working with IP addresses.  However, the situation
is a bit strange.

There will be a form with a text box to allow IP address entries as follows:

192.168.5.195
or
123.23.35.4 123.23.35.45 123.23.35.74
or
123.4.34.1/123.4.34.255
or
13.234.5.41/13.234.5.75 12.34.34.150/12.34.34.225

The above a just a few examples.  I need to be able to grab either the IP
addresses or the ranges and verify that when an IP is entered at a later
date and compared to the above types of previously saved data that the IP is
within the range(s).

I hope I explained that ok. ;)

So basically I guess I just need a way of, after retrieving the info from
the DB, splitting the IP (range(s)) apart and then comparing the IP entered
to those in the array(?) to verify that it was a good entry.

Thanks for any help.  I'm gonna to rest my brain a bit now.
chuck



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP module for modem???

2001-12-18 Thread Charles Williams

This would require that your httpd user (nobody? depends on your setup) has
read/write access to said device (which is normally not the case).  In such
a case you would need to filter it through sudo or some such.

chuck

- Original Message -
From: "Nathan Cassano" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 18, 2001 5:47 PM
Subject: RE: [PHP] PHP module for modem???


>
> There aren't any modem modules that I am aware of but if you are using
> UNIX you can just open the modem device and talk to it directly. What is
> your application that would need to use a modem?
>
>   /* Something like this */
>  $fp = fopen("/dev/modem", "rw");
>  fwrite($fp, "ATA");
>  echo fgets($fp, 128)
>  fclose($fp);
> ?>
>
> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 8:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP module for modem???
>
>
> Hi!
>
> Is there any module or software that I can use and compile it with
> PHP for working with hte modem???
> For example, I have cURL but it is a seperate software and can be
> compile with PHP for certain things like FTP, Internet socket, etc.  So,
> is there ever one for the modem?
>
> Thanks,
>  Scott
>
>
> --
> 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]




Re: [PHP] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Charles Williams

Jack

$_GET is automatically global to all scopes.  No need to globalize.

chuck

- Original Message -
From: "Jack Dempsey" <[EMAIL PROTECTED]>
To: "Michael Jurgens" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 10:49 PM
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


> a quick and inelegant hack
> 4.1 includes an array that has all of the data sent to the script...(or
use
> the different ones like $_GET etc if need be) then write a globalize
function
> that extracts the vars and declares them global...then use this snippet in
an
> auto_prepend file to magically register the vars
> there's probably a much easier way, including asking your hosting provider
to
> change one little config var...
>
> jack
>
> Michael Jurgens wrote:
>
> > Hi,
> > Now that register_globals is (or will be) OFF by default (just like
> > error_reporting) I'm facing a huge rewrite of existing code if my
hosting
> > provider decides that he wants to upgrade his php (and believe me, he
will
> > use default settings)
> >
> > Is there any way to override register_globals and error_reporing runtime
in
> > your PHP script?
> > (there is no way that I can use .htaccess to override :-((
> >
> > Any help would be much appreciated!
> >
> > --
> > 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]
>


-- 
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]




Re: [PHP] How deep can I go with embedded if s.

2001-12-17 Thread Charles Williams

Mehmet,

If you can keep the scope ({and}) correct then you will have no problems.
However, it will get kinda slow after going deep enough.

chuck

- Original Message -
From: "Mehmet Kamil ERISEN" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 10:07 PM
Subject: [PHP] How deep can I go with embedded if s.


> Hello All,
> Is anybody aware of any limitations of php on embedded if
> ..else statements?
> For example:
>
>   if ($a>$b) {
> if ($c>$d) {
> this();
>} else {
>  if ($gg==$dd) {
>  echo 'ladooo';
>} else {
>  echo 'bab';
>}
> that();
>}
> if ($e<$f) {
>tthis();
>   } else {
>tthat();
>}
>else {
> echo "Oooops";
>
> }
>
> would this work,
>
>
> =
> Mehmet Erisen
> http://www.erisen.com
>
> __
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com
>
> --
> 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]




Re: [PHP] 'Select All'

2001-12-17 Thread Charles Williams

Shane,

is this meant for initial settings of the form only or as a button, or some
such, to allow someone to select all the boxs?

chuck

- Original Message -
From: "Shane Wright" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 6:54 PM
Subject: [PHP] 'Select All'


> Hi
>
> I'm having somewhat of a problem :(
>
> I have my banks of checkboxes, all named 'mycheckbox[]' with the values as
> different IDs.  The user happily checks a few of them and my scripts
happily
> process the resulting arrays.
>
> But...  how do I get Javascript to do a 'select all' on them??  I cant
access
> them by name because of the square brackets, and I cant access them by
going
> through all form elements in case there are other checkboxes that dont
want
> to be included.
>
> Is there a tidy way around this, does any of the above make sense?
>
> Thanks
>
> --
> Shane
>
> --
> 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]




Re: [PHP] Checking a frames url..

2001-12-17 Thread Charles Williams

Necro,

inline below

- Original Message -
From: "Necro" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 9:58 AM
Subject: [PHP] Checking a frames url..


> Lo all,
>
> I am trying to write a script that will output to a frame the current
> location within a site..
> like Home :: Contact
> I need PHP to be able to check the url of the frame "main" and then parse
> out anything after the domain to decide what to output as the location.
> e.g. http://domain.com/contact/index.html
> (http://domain.com) <<-- forgotten
> (contact/index.html)
> If URL = contact/index.html {
> echo('Home :: Contact'); }
> If URL = business/index.html {
> echo('Home :: Business'); }
>
> Am I on the correct track with most of it?? I just cant work out how to
grab
> the URL of a single frame.
>
> Thanx
>
> Andrew

you basically have it right there.  You can do it easier by passing the $loc
(location) per the url (&loc=contact) or per session.  either way you have
the page that is being called and can then use the following to output the
location

echo strtoupper($loc);

all done.

chuck



-- 
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]




Re: [PHP] Is PHP up to task?

2001-12-15 Thread Charles Williams


- Original Message -
From: "René Fournier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 15, 2001 1:27 AM
Subject: [PHP] Is PHP up to task?


> (Now that I have your attention... :-)
>
> Here's the situation: All the navigational buttons in the site I'm
> working on have three different states (for mousovers--normal,
> mouseover, onClick). What I don't like: When I mouse over one button, it
> takes a second or two for the page to fetch the mouseover state of the
> button from the server. Now, normally, I would just write a
> preloadimages() function in JavaScript and preload all the button states
> when the pages load. BUT, this is a little harder, since this is a
> fairly big site (or will be) and it's not always the same buttons that
> need to be loaded; they can change from page to page (say, between
> sections, with subnav bars). That being said, I've kept one thing
> simple: All the buttons (and their states) are stored in the same
> directory, and in fact only button images are in that directory ("/nav").
>
> So here's what I would like to know: Is it possible for PHP to read the
> contents of a directory--all the files--and then take that array and
> generate some javascript preload() statements? (Of course, I'm sure it
> IS possible, but I would appreciate any pointers you might have before I
> undertake it. Maybe there's even a better way than what I can see!) What
> I was thinking was to preload all the nav buttons and their states in
> the header.inc.
>
> Thanks.
>
> ...Rene

Rene,

Of course this is possible.  However, I doubt if it is desirable.  The more
visitors to your site the larger the load if you load all the graphics,
because each session would have it's own copy of all the graphics.  It would
be better if you checked the page being loaded and passed a list of the
needed graphics needed to a function that would load ONLY those graphics
needed for said page.  This is not too very difficult and if run on a PHP
caching server then the overhead is not so bad.  The hard part is getting
the JS to work correctly (at least for me. hehe. I suck at JS).

For example. http://clans.acnsnet.com is a package I'm working on that uses
templates to control the layout.  Each menu item is stored in an SQL backend
as well as the Template info (location, menu type, state, etc).  I
already have a function to determine what page is active.  So finding out
what menu items are visible is simply a matter of comparing the active page
to the array of menu items.  I can then determin which images I would need
to load (depending on the template in use).  This way I only load the images
that are needed, which saves on load time and memory.

Anyway, have fun.

chuck


-- 
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] PHP Safe Mode control

2001-12-10 Thread Charles Williams

Hey all,

I just finished an article on Safe Mode control for PHP but it is based on
non-Win32 systems.  Can somebody with a bit more experience in Win32 servers
take a look at it and let me know what can be done to achieve, if not the
same level of control then close to it, on a Win32 platform?

The article is at:
http://www.acnsnet.com/~slydder/stories/op/storiesView/sid/53/

thanks,
chuck

Chuck's Top 10 Things to Remember and Think about!
===
10. Please return stewardess to original upright position.
9. Fighting for peace is like fucking for virginity.
8. Never date someone because you're too lazy to commit suicide.
7. It is not the fall that kills you.  it's the sudden stop at the end.
6. You can't have everything.  Where would you put it all?
5. " Real Windows Performance", on the next "In Search Of".
4. 2 rules to success in life. 1. Don't tell people everything you know.
3. 24 hours in a day, 24 beers in a case.  Coincidence?
2. 9 out of 10 men who try Camels prefer women.
1. Always borrow money from a pesimist.  They never expect it back anyway.

That's it!  NO MORE! JEEZ! GET BACK TO WORK!



-- 
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]




Re: [PHP] PHP based authentification -----------

2001-08-20 Thread Charles Williams

Alex,

If your using sessions then just use session_destroy(); in your logout.

chuck

- Original Message -
From: "Alex Sofronie" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 4:25 PM
Subject: [PHP] PHP based authentification ---


> Hi all!
>
> How can I "logout" from a PHP based auth (with PHP_AUTH_USER and
PHP_AUTH_PW
> and appropriate headers sent at the beginning)?
> It seems like unset($PHP_AUTH_USER) does not wotk in this case...
>
> Any help would be appreciated!
>
> Alex Sofronie
> [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]
>


-- 
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] MySQL Multi-Table Select Query Problem

2001-08-15 Thread Charles Williams

Hey folks,

if you go to http://www.acnsnet.com/czc/show.php?state=Bayern  You can see
my problem with this query.  This thing is killin me so if you have any
ideas just shout.

thanks,
chuck

Chuck's Top 10 Things to Remember and Think about!
===
10. Please return stewardess to original upright position.
9. Fighting for peace is like fucking for virginity.
8. Never date someone because you're too lazy to commit suicide.
7. It is not the fall that kills you.  it's the sudden stop at the end.
6. You can't have everything.  Where would you put it all?
5. " Real Windows Performance", on the next "In Search Of".
4. 2 rules to success in life. 1. Don't tell people everything you know.
3. 24 hours in a day, 24 beers in a case.  Coincidence?
2. 9 out of 10 men who try Camels prefer women.
1. Always borrow money from a pesimist.  They never expect it back anyway.

That's it!  NO MORE! JEEZ! GET BACK TO WORK!



-- 
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]




Re: [PHP] Capturing output of shell script.

2001-07-02 Thread Charles Williams

correction below

chuck

- Original Message -
From: "Charles Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Php-General (E-mail)"
<[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 10:54 PM
Subject: Re: [PHP] Capturing output of shell script.


>
> - Original Message -
> From: "Brad Hubbard" <[EMAIL PROTECTED]>
> To: "Charles Williams" <[EMAIL PROTECTED]>;
> "Php-General (E-mail)" <[EMAIL PROTECTED]>
> Sent: Saturday, June 30, 2001 1:12 PM
> Subject: Re: [PHP] Capturing output of shell script.
>
>
> > On Sat, 30 Jun 2001 06:36, Charles Williams wrote:
> > > Hello all,
> > >
> > > I have an .sh shell script being executed from a php4 call.  I need to
> > > capture the string return and work with that in the php script.  The
> only
> > > problem is that the call works but I cannot get the returned string.
> I've
> > > tried using exec, passthru, ``, system, and escapeshellcommand.
Nothing
> > > seems to work.  any ideas?
> >
> > $capture = `script.sh 2>&1`; // redirect standard error to standard
output
> >
> >
> > Cheers,
> > Brad
>
> Brad,
>
> Here is what I am trying to execute:
>
> $pass_string = "super cadduser -f \"".$full_name."\" -u
> \"".$Username."\" -p \"".$Password."\" -q \"".$Quota."\" -x -d
> ".$top_domain;

The above should be one line.


> exec($pass_string, $ary_result);
> echo "Result: ";
> #var_dump($ary_result);
> return $ary_result;
>
> For some reason it will only continue execution past the 'exec' call
rarely.
> Most of the time the script just stops after the exec call (the echo and
> below is not executed).  When it does go beyond the 'exec' call the
var_dump
> (that I use for testing only. will be gone when working) does show as an
> array.
>
> I have the max_execution_time set to 180 so I know the script isn't
timeing
> out.  Any ideas?  I have never run into this problem before.
>
> thanks
> chuck
>
>
>
> --
> 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]




Re: [PHP] Capturing output of shell script.

2001-07-02 Thread Charles Williams


- Original Message -
From: "Brad Hubbard" <[EMAIL PROTECTED]>
To: "Charles Williams" <[EMAIL PROTECTED]>;
"Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Saturday, June 30, 2001 1:12 PM
Subject: Re: [PHP] Capturing output of shell script.


> On Sat, 30 Jun 2001 06:36, Charles Williams wrote:
> > Hello all,
> >
> > I have an .sh shell script being executed from a php4 call.  I need to
> > capture the string return and work with that in the php script.  The
only
> > problem is that the call works but I cannot get the returned string.
I've
> > tried using exec, passthru, ``, system, and escapeshellcommand.  Nothing
> > seems to work.  any ideas?
>
> $capture = `script.sh 2>&1`; // redirect standard error to standard output
>
>
> Cheers,
> Brad

Brad,

Here is what I am trying to execute:

$pass_string = "super cadduser -f \"".$full_name."\" -u
\"".$Username."\" -p \"".$Password."\" -q \"".$Quota."\" -x -d
".$top_domain;
exec($pass_string, $ary_result);
echo "Result: ";
#var_dump($ary_result);
return $ary_result;

For some reason it will only continue execution past the 'exec' call rarely.
Most of the time the script just stops after the exec call (the echo and
below is not executed).  When it does go beyond the 'exec' call the var_dump
(that I use for testing only. will be gone when working) does show as an
array.

I have the max_execution_time set to 180 so I know the script isn't timeing
out.  Any ideas?  I have never run into this problem before.

thanks
chuck



-- 
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]




Re: [PHP] ADD a user in linux using PHP

2001-06-30 Thread Charles Williams

ADD a user in linux using PHPsure, I use a small C program I wrote and set to setuid 
root.  that way I can hide it and it all works good with an exec call from php.  I 
wouldn't advise setting setuid adduser to root.  It's way too dangerous.

chuck

  - Original Message - 
  From: Bruno Freire 
  To: '[EMAIL PROTECTED]' 
  Cc: '[EMAIL PROTECTED]' 
  Sent: Thursday, June 28, 2001 4:30 PM
  Subject: [PHP] ADD a user in linux using PHP


  Hi! I'm Bruno, from brazil 

  Somebody knows how to create a new user in LINUX (not http server) using PHP? 

  Something like useradd and passwd 

  Thanks, 

  Bruno. 




[PHP] Capturing output of shell script.

2001-06-30 Thread Charles Williams

Hello all,

I have an .sh shell script being executed from a php4 call.  I need to
capture the string return and work with that in the php script.  The only
problem is that the call works but I cannot get the returned string.  I've
tried using exec, passthru, ``, system, and escapeshellcommand.  Nothing
seems to work.  any ideas?

thanks.
chuck


-- 
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] Determining page load time?

2001-06-20 Thread Charles Williams \(CEO\)

Hey all,

If you take a look at the link
http://www.acnshosting.com/server_test/index.php you will notice that I am
running a php script that calculates the time it takes to read the file from
the drive and parse it through apache.

However,  that is all it does.  What I would like to be able to do is to
time the call to actual display and also the call to actual parse of all
components.

Does anyone have any ideas?

thanks
chuck



-- 
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]




Re: [PHP] File upload form

2001-05-22 Thread Charles Williams \(CEO\)



Chris,

Have you asked what browsers they are using?  Also, what are you using to
serve this page?

chuck



-- 
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]




Re: [PHP] Is this a typo or what?

2001-05-22 Thread Charles Williams \(CEO\)


- Original Message -
From: "Floyd Baker" <[EMAIL PROTECTED]>
To: "Henrik Hansen" <[EMAIL PROTECTED]>
Cc: "Henrik Hansen" <[EMAIL PROTECTED]>; "PHP General List"
<[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 8:16 PM
Subject: Re: [PHP] Is this a typo or what?


> On 22 May 2001 19:32:00 +0200, you wrote:
>
> >Floyd Baker <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > I removed one of the two above the bottom 'return rettext'.
> > >
> >
> >There are sure something with that script, at least I found out there
> >is a } too much, maybe you removed one too many, can i see the
> >original script? I would also advise you to try and ident the script
> >correctly which makes it like 100% easier to read.
> >
> >--
> >Henrik Hansen
>
>
> http://www.php.net/manual/en/ref.strings.php
>
> The top example of user contributed notes.  I didn't take anything
> out..  It comes that way...  with 15 brackets.   The extra one I
> think is the second (or third) one up from the bottom.
>
> Yes I have the whole thing indented to make sense.  I am still working
> on it to make it work.
>
> Floyd
>

Floyd,

This works fine for me (if this is the correct example you were looking at):
function wraptext($text, $wrapmargin){
$rettext = "";
$linebuf = "";
$linelen = 0;
$tok = split("[ \t]", $text);
$numtok = count($tok);
for ($i = 0; $i < $numtok; $i++){
$elem = $tok[$i];
$elemlength = strlen($elem) + 1;
if (($linelen + $elemlength) > $wrapmargin){
$rettext = $rettext . $linebuf . "";
$linebuf = "";
$linelen = 0;
}
// Do we have a newline in this element?
  $pos = strrpos($elem, "\\n");
  if ($pos){
 $before = substr($elem, 0, $pos);
 $after = substr($elem, $pos);
 $rettext = $rettext . $linebuf . " " . $before . "";
 $linebuf = $after;
 $linelen = strlen($after);
  }else{
 $linebuf = $linebuf . " " . $elem;
 $linelen = $linelen + $elemlength;
  }
}
return $rettext;
}

$test = wraptext("this is just a test to see if this thing works if not the
fuck it.", "10");
echo"$test";


-- 
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] Max execution time for exec()?

2001-05-22 Thread Charles Williams \(CEO\)

Haven't seen anything to support this but it seems to me that exec() and
such has maximum execution times.  Can anyone verify this?

chuck



-- 
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]




Re: [PHP] Problem with exec, shell_exec

2001-05-18 Thread Charles Williams \(CEO\)

Have located ( I think ) the problem.

I have been calling 'super' from the php script and when I call 'cadduser'
it works perfect but when I call 'caddvsite' I get an 'Unable to setgid=0'
error.  Any idea why this would happen?  Both executables are owned by
root.root and permission of both are set to 4700. the exec() call uses the
'sh' shell on both script calls.

The only differance is that one works and the other doesn't.   Any ideas?

Thanks,

Chuck

- Original Message -
From: "Charles Williams (CEO)"
<[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, May 18, 2001 2:38 PM
Subject: [PHP] Problem with exec, shell_exec


> below you'll see a bit of code that is not working for me.  I have tried
> exec, shell_exec, passthru, system.  nothing works.  If I copy the echoed
> copy of the command and paste it in an SSH session it works 100%.  all of
> the exec, and such use the 'sh' shell.  So I changed to that shell to
verfy
> that it is working and it still works great in SSH but only halfway in the
> script.  The command will create the needed directories but then it quits.
> It doesn't finish the job.
>
> $pass_string = "caddvsite -i ".$IP." -n www -d ".$domain;
> if($email=="y")$pass_string .= " -e";
> if($web=="y")$pass_string .= " -w";
> $pass_string .= " -q ".$Quota." -u ".$Users;
> if($cgi=="y")$pass_string .= " -c";
> if($ssi=="y")$pass_string .= " -s";
> if($frontp=="y")$pass_string .= " -x";
> if($ssl=="y")$pass_string .= " -l";
> if($apop=="y")$pass_string .= " -o";
> if($ftp=="y")$pass_string .= " -f";
> if($telnet=="y")$pass_string .= " -t";
> #$pass_string .= " &";
> echo"$pass_string";
> # system("touch /forbidden 2>&1");
> #printf("%s",system($pass_string));
> exec( EscapeShellArg($pass_string) );
>
> Any ideas appreciated.
>
> chuck
>
>
>
> --
> 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]




[PHP] Problem with exec, shell_exec

2001-05-18 Thread Charles Williams \(CEO\)

below you'll see a bit of code that is not working for me.  I have tried
exec, shell_exec, passthru, system.  nothing works.  If I copy the echoed
copy of the command and paste it in an SSH session it works 100%.  all of
the exec, and such use the 'sh' shell.  So I changed to that shell to verfy
that it is working and it still works great in SSH but only halfway in the
script.  The command will create the needed directories but then it quits.
It doesn't finish the job.

$pass_string = "caddvsite -i ".$IP." -n www -d ".$domain;
if($email=="y")$pass_string .= " -e";
if($web=="y")$pass_string .= " -w";
$pass_string .= " -q ".$Quota." -u ".$Users;
if($cgi=="y")$pass_string .= " -c";
if($ssi=="y")$pass_string .= " -s";
if($frontp=="y")$pass_string .= " -x";
if($ssl=="y")$pass_string .= " -l";
if($apop=="y")$pass_string .= " -o";
if($ftp=="y")$pass_string .= " -f";
if($telnet=="y")$pass_string .= " -t";
#$pass_string .= " &";
echo"$pass_string";
# system("touch /forbidden 2>&1");
#printf("%s",system($pass_string));
exec( EscapeShellArg($pass_string) );

Any ideas appreciated.

chuck



-- 
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] PHP ICQ Channel

2001-05-17 Thread Charles Williams \(CEO\)

For those of you interested.  There is a ICQ channel for PHP at: 74684492




-- 
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] Pattern matching and replacement!

2001-05-08 Thread Charles Williams \(CEO\)

Hello all,

I have a slight problem.  I am storing an email template in a MySQL DB.
Portions of the email have text that need to be replaced with variable
values when run through the script.

ex:

Sehr geehrte(r) Frau/Herr {%Last_Name%} ,

Dies ist eine automatische Zusendung von ACNS Billing and Support Software.

Ihre Zahlung von  DM {%Prev_Total%} fuer ihr ACNS Domain und/oder ihr
Internet Flatrate
konto wurde von ihrer Bank uneingeloest zurueckgegeben.  Daher moechten wir
Sie bitten innerhalb der naechsten 4 werktage, dies zu begleichen.  Werktage
zaehlen ab dem  {%Today_Date%}.

Konto/Kunden #: {%Customer_ID%}
Vorheriger Betrag: DM {%Prev_Total%}
Mahngebuehr: DM 19,99



As you can see. I am using the {% and %} to delimit the parts that need to
be replaced.  I can't get the replacements to work right though.  Can
someone help?

Thanks in advance.

chuck


-- 
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]