[PHP] Replace a string in array then re-write line.

2001-03-08 Thread enthalpy


ok so im using fopen to read a file split each line in to an array. Check
those variables against the same situation with a different file. Replace
a string in the second file with a string in the first file. Then rewrite
the line with the new variable.

here is a small example of how im opening and exploding the lines

$fpoint1 = fopen ($newfile,"r") or die("couldnt open working file");
while ($data = fgetcsv ($fpoint1, $newfilesize, " ")) {
  $num = count ($data);
  echo "$num fields in line $row: \n";
  for ($c=0; $c<$num; $c++) {

  }

im opening the second file the same way and if data[0] and data2[0] are =
then it will replace the strings.

anyway if i made any sense at all i think you will know what im talking
about.

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] Replace a string in array then re-write line.

2001-03-08 Thread enthalpy


im just using 2 flat files. is there any kind of freplace? or can i use str_replace to 
re-write the line?

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Thu, 8 Mar 2001, Jaxon wrote:

> Jon,
> 
> I've done something similar with strtr(), pulling the array from a database
> and swapping the result set into a file.
> 
> $fd = fopen ($file, "r");
> $string = fread ($fd, filesize ($template));
> fclose ($fd);
> 
> $array = mysql_fetch_array($result, MYSQL_ASSOC);
> echo (strtr($string, $array));
> 
> just my .02:
> 
> regards,
> jaxon
> 
> 
> 
> 
> On 3/8/01 10:53 PM, "enthalpy" <[EMAIL PROTECTED]> wrote:
> 
> > 
> > ok so im using fopen to read a file split each line in to an array. Check
> > those variables against the same situation with a different file. Replace
> > a string in the second file with a string in the first file. Then rewrite
> > the line with the new variable.
> > 
> > here is a small example of how im opening and exploding the lines
> > 
> > $fpoint1 = fopen ($newfile,"r") or die("couldnt open working file");
> > while ($data = fgetcsv ($fpoint1, $newfilesize, " ")) {
> > $num = count ($data);
> > echo "$num fields in line $row: \n";
> > for ($c=0; $c<$num; $c++) {
> > 
> > }
> > 
> > im opening the second file the same way and if data[0] and data2[0] are =
> > then it will replace the strings.
> > 
> > anyway if i made any sense at all i think you will know what im talking
> > about.
> > 
> > <-CoreComm-Internet-Services---http://core.com->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.org-http://enthalpy.org->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> 
> 


-- 
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] Replace a string in array then re-write line.

2001-03-08 Thread enthalpy


ok that will work for swaping the elements in the array.

however rewriting the old line

blah:blah:blah

to blah:foo:blah

its 2 flat files that im opening with fopen obviously.

perhaps im talking in circles

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Thu, 8 Mar 2001, andrew wrote:

> You should look at strtr -
> http://www.php.net/manual/en/function.strtr.php
> 
> either swap string into 'nother string according to target, or swap array
> into string, using array fields as target.
> 
> Also, check preg_replace:
> http://www.php.net/manual/en/function.preg-replace.php
> 
> regards,
> jaxon
> 
> On 3/8/01 11:32 PM, "enthalpy" <[EMAIL PROTECTED]> wrote:
> 
> > 
> > im just using 2 flat files. is there any kind of freplace? or can i use
> > str_replace to re-write the line?
> > 
> > <-CoreComm-Internet-Services---http://core.com->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.org-http://enthalpy.org->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> > On Thu, 8 Mar 2001, Jaxon wrote:
> > 
> >> Jon,
> >> 
> >> I've done something similar with strtr(), pulling the array from a database
> >> and swapping the result set into a file.
> >> 
> >> $fd = fopen ($file, "r");
> >> $string = fread ($fd, filesize ($template));
> >> fclose ($fd);
> >> 
> >> $array = mysql_fetch_array($result, MYSQL_ASSOC);
> >> echo (strtr($string, $array));
> >> 
> >> just my .02:
> >> 
> >> regards,
> >> jaxon
> >> 
> >> 
> >> 
> >> 
> >> On 3/8/01 10:53 PM, "enthalpy" <[EMAIL PROTECTED]> wrote:
> >> 
> >>> 
> >>> ok so im using fopen to read a file split each line in to an array. Check
> >>> those variables against the same situation with a different file. Replace
> >>> a string in the second file with a string in the first file. Then rewrite
> >>> the line with the new variable.
> >>> 
> >>> here is a small example of how im opening and exploding the lines
> >>> 
> >>> $fpoint1 = fopen ($newfile,"r") or die("couldnt open working file");
> >>> while ($data = fgetcsv ($fpoint1, $newfilesize, " ")) {
> >>> $num = count ($data);
> >>> echo "$num fields in line $row: \n";
> >>> for ($c=0; $c<$num; $c++) {
> >>> 
> >>> }
> >>> 
> >>> im opening the second file the same way and if data[0] and data2[0] are =
> >>> then it will replace the strings.
> >>> 
> >>> anyway if i made any sense at all i think you will know what im talking
> >>> about.
> >>> 
> >>> <-CoreComm-Internet-Services---http://core.com->
> >>> (Jon Marshall CoreComm Services Chicago)
> >>> ([EMAIL PROTECTED] Systems Engineer II)
> >>> ([EMAIL PROTECTED]   Network Operations)
> >>> <-Enthalpy.org-http://enthalpy.org->
> >>> ([EMAIL PROTECTED] The World of Nothing)
> >>> <-->
> >>> 
> >> 
> >> 
> > 
> > 
> 
> 


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

2001-03-13 Thread enthalpy


can you use str_replace or ereg_replace in an fputs statement?

something like this

fputs("$fpoint2", "str_replace($oldcrypt, $newcrypt, $shadow[2])");

i need to replace a string in a file. the string is in an array tho.. is that why this 
isnt working?

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->


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

2001-03-13 Thread enthalpy


figured it out

just had to use fread first.

$fpoint3 = fopen ($testshadow, "r+") or die("couldnt open shadow file again");
$contents = fread ($fpoint3, $shadowfilesize);
fputs ($fpoint3, ereg_replace("$data[0]:$shadow[1]", "$data[0]:$data[1]", $contents));

tho i will say it was a pain in the ass to get it to work.. 

now i can delete all my echo lines so i could follow the script with stdout :}

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<------>

On Tue, 13 Mar 2001, enthalpy wrote:

> 
> can you use str_replace or ereg_replace in an fputs statement?
> 
> something like this
> 
> fputs("$fpoint2", "str_replace($oldcrypt, $newcrypt, $shadow[2])");
> 
> i need to replace a string in a file. the string is in an array tho.. is that why 
>this isnt working?
> 
> <-CoreComm-Internet-Services---http://core.com->
> (Jon Marshall CoreComm Services Chicago)
> ([EMAIL PROTECTED] Systems Engineer II)
> ([EMAIL PROTECTED]   Network Operations)
> <-Enthalpy.org-http://enthalpy.org->
> ([EMAIL PROTECTED] The World of Nothing)
> <-->
> 
> 
> -- 
> 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] replacing a line in a file

2001-03-13 Thread enthalpy


having problems replacing a line in a file.

need to search the whole document for a string and then replace that line with a 
string.

any ideas?

this is causing lots of problems now.

$fpoint3 = fopen ($testshadow, "r+") or die("couldnt open shadow file again");
$contents = fread ($fpoint3, $shadowfilesize);
fputs ($fpoint3, ereg_replace("$data[0]:$shadow[1]", "$data[0]:$data[1]", $contents));
fclose ($fpoint3);

any ideas?

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] replacing a line in a file

2001-03-13 Thread enthalpy


that could work but i dont want to append the new line a the bottom which it looks 
like thats what your doing.
i need to replace the line where it is

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Wed, 14 Mar 2001, Henrik Hansen wrote:

> maybe this?
> 
> while($line = fgets($fp, 1024)) {
> $line = str_replace("replace_this", "with_this", $line);
> $content .= $line;
> }
> 
> fwrite($fp, $content);
> 
> --
> Henrik Hansen
> - Original Message -
> From: "enthalpy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 14, 2001 12:29 AM
> Subject: [PHP] replacing a line in a file
> 
> 
> >
> > having problems replacing a line in a file.
> >
> > need to search the whole document for a string and then replace that line
> with a string.
> >
> > any ideas?
> >
> > this is causing lots of problems now.
> >
> > $fpoint3 = fopen ($testshadow, "r+") or die("couldnt open shadow file
> again");
> > $contents = fread ($fpoint3, $shadowfilesize);
> > fputs ($fpoint3, ereg_replace("$data[0]:$shadow[1]", "$data[0]:$data[1]",
> $contents));
> > fclose ($fpoint3);
> >
> > any ideas?
> >
> > <-CoreComm-Internet-Services---http://core.com->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.org-http://enthalpy.org->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> >
> >
> > --
> > 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]




[PHP] Asking for input from shell?

2001-04-08 Thread enthalpy


anyone have sample code of how you can have a php script (cgi)
ask for input from the shell?

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] Asking for input from shell?

2001-04-08 Thread enthalpy

Thank you.

<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Mon, 9 Apr 2001, Jason Brooke wrote:

> $fp = fopen("php://stdin", "r");
> echo fgets($fp, 64); 
> fclose($fp);
> 
> - Original Message - 
> From: "enthalpy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 09, 2001 1:10 PM
> Subject: [PHP] Asking for input from shell?
> 
> 
> > 
> > anyone have sample code of how you can have a php script (cgi)
> > ask for input from the shell?
> > 
> > <-CoreComm-Internet-Services---http://core.com->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.org-http://enthalpy.org->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> > 
> > -- 
> > 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] Asking for input from shell?

2001-04-09 Thread enthalpy

when using this more then once in a script i get errors
even though the file pointers are different.

echo "Artist: ";
$artist = fopen("php://stdin", "r");
echo fgets($artist, 64);
fclose($artist);
echo "\n";

echo "Album: ";
$album = fopen("php://stdin", "r");
echo fgets($album, 64);
fclose($album);
echo "\n";

---
Errors:

Warning:  fopen("php://stdin","r") - Bad file descriptor in 
./addvinyl.php on line 11

Warning:  Supplied argument is not a valid File-Handle resource in 
./addvinyl.php on line 12

Warning:  Supplied argument is not a valid File-Handle resource in 
./addvinyl.php on line 13




<-CoreComm-Internet-Services---http://core.com->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.org-http://enthalpy.org->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Mon, 9 Apr 2001, Jason Brooke wrote:

> $fp = fopen("php://stdin", "r");
> echo fgets($fp, 64); 
> fclose($fp);
> 
> - Original Message - 
> From: "enthalpy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 09, 2001 1:10 PM
> Subject: [PHP] Asking for input from shell?
> 
> 
> > 
> > anyone have sample code of how you can have a php script (cgi)
> > ask for input from the shell?
> > 
> > <-CoreComm-Internet-Services---http://core.com->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.org-http://enthalpy.org->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> > 
> > -- 
> > 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]




[PHP] Change Password script

2001-02-02 Thread enthalpy


anyone have example code of a change password script in php?

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] Change Password script

2001-02-02 Thread enthalpy


sorry for the generalization. im looking to change a unix password.

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Fri, 2 Feb 2001, Joe Stump wrote:

> DB password or unix password?
> 
> --Joe
> 
> On Fri, Feb 02, 2001 at 03:38:15PM -0600, enthalpy wrote:
> > 
> > anyone have example code of a change password script in php?
> > 
> > <-CoreComm-Internet-Services--http://core.com/->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.orghttp://enthalpy.org/->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> > 
> > -- 
> > 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]
> 
> -- 
> 
> ---
> Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
> http://www.miester.org http://www.care2.com /\\
> "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
> ---
> 
> 
> -- 
> 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] Change Password script

2001-02-02 Thread enthalpy


yea thats what i was thiking is there anyway to use soemting like suexec?

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Fri, 2 Feb 2001, Mark Maggelet wrote:

> On Fri, 2 Feb 2001 14:13:50 -0800, Joe Stump 
> ([EMAIL PROTECTED]) wrote:
> >Not unless passwd takes stdin (which i don't think it does)
> 
> It does, but php would have to be running as root, which is a bad 
> idea.
> 
> >--Joe
> >
> >On Fri, Feb 02, 2001 at 04:07:47PM -0600, enthalpy wrote:
> >> 
> >> sorry for the generalization. im looking to change a unix 
> password.
> >> 
> >> <-CoreComm-Internet-Services--http://core.com/->
> >> (Jon Marshall CoreComm Services Chicago)
> >> ([EMAIL PROTECTED] Systems Engineer II)
> >> ([EMAIL PROTECTED]   Network Operations)
> >> <-Enthalpy.orghttp://enthalpy.org/->
> >> ([EMAIL PROTECTED] The World of Nothing)
> >> <-->
> >> 
> >> On Fri, 2 Feb 2001, Joe Stump wrote:
> >> 
> >> > DB password or unix password?
> >> > 
> >> > --Joe
> >> > 
> >> > On Fri, Feb 02, 2001 at 03:38:15PM -0600, enthalpy wrote:
> >> > > 
> >> > > anyone have example code of a change password script in php?
> >> > > 
> >> > > <-CoreComm-Internet-Services--http://core.com/->
> >> > > (Jon Marshall CoreComm Services Chicago)
> >> > > ([EMAIL PROTECTED] Systems Engineer II)
> >> > > ([EMAIL PROTECTED]   Network Operations)
> >> > > <-Enthalpy.orghttp://enthalpy.org/->
> >> > > ([EMAIL PROTECTED] The World of Nothing)
> >> > > <-->
> >> > > 
> >> > > 
> >> > > -- 
> >> > > 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: php-list-
> >>[EMAIL PROTECTED]
> >> > 
> >> > -- 
> >> > 
> >> > 
> -
> >>--
> >> > Joe Stump, PHP Hacker, [EMAIL PROTECTED] 
> >>   -o)
> >> > http://www.miester.org http://www.care2.com 
> >>   /\\
> >> > "It's not enough to succeed. Everyone else must fail" -- Larry 
> >>Ellison _\_V
> >> > 
> -
> >>--
> >> > 
> >> > 
> >> > -- 
> >> > 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: php-list-
> >>[EMAIL PROTECTED]
> >> > 
> >> > 
> >> 
> >
> >-- 
> >
> >-
> 
> >--
> >Joe Stump, PHP Hacker, [EMAIL PROTECTED] 
> >   -o)
> >http://www.miester.org http://www.care2.com 
> >   /\\
> >"It's not enough to succeed. Everyone else must fail" -- Larry 
> >Ellison _\_V
> >-
> 
> >--
> >
> >
> >-- 
> >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: php-list-
> >[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] Change Password script

2001-02-06 Thread enthalpy


i figured a better way to do it.. ill just have to run a cron that check
a flat file thats encrypted.

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Sat, 3 Feb 2001 [EMAIL PROTECTED] wrote:

> enthalpy wrote:
> > 
> > anyone have example code of a change password script in php?
> > 
> > <-CoreComm-Internet-Services--http://core.com/->
> > (Jon Marshall CoreComm Services Chicago)
> > ([EMAIL PROTECTED] Systems Engineer II)
> > ([EMAIL PROTECTED]   Network Operations)
> > <-Enthalpy.orghttp://enthalpy.org/->
> > ([EMAIL PROTECTED] The World of Nothing)
> > <-->
> > 
> > --
> this is for freebsd - use at your own risk -
> best used as a php shell script run by root
> 
> 
> $newpassword = "veryinsecure";
> $fp = popen("/usr/sbin/pw usermod -n username -h passwd", "w");
> 
> fputs($fp, "$newpassword");
> pclose($fp)
> 
> -- 
> 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] Retrieve item from table at random

2001-02-06 Thread enthalpy


anyone have example code for randomly grabing an item from a mysql table?

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] breaking up images to sets of 5

2001-02-06 Thread enthalpy


i use mysql to store urls for all my images and have php query that for
the images. is there an easy way to set it up so it does 5 at a time and
has a lil next 5 link at the bottom.. the entriees in the table are not
numbered.

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->


-- 
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] breaking up images to sets of 5

2001-02-06 Thread enthalpy


well that should do it for me i already have all the code i was unaware
that there was a limit command.. 

i should be able to do something like 
url.php?limit=0,5

or something like that 

<-CoreComm-Internet-Services--http://core.com/->
(Jon Marshall CoreComm Services Chicago)
([EMAIL PROTECTED] Systems Engineer II)
([EMAIL PROTECTED]   Network Operations)
<-Enthalpy.orghttp://enthalpy.org/->
([EMAIL PROTECTED] The World of Nothing)
<-->

On Wed, 7 Feb 2001, Mark Green wrote:

> enthalpy wrote:
> > 
> > i use mysql to store urls for all my images and have php query that for
> > the images. is there an easy way to set it up so it does 5 at a time and
> > has a lil next 5 link at the bottom.. the entriees in the table are not
> > numbered.
> 
> 
> 
> Append your SQL query with  LIMIT $edge, $limit";
> 
> ie "SELECT blah from stuff LIMIT 0,5";
> 
> select the first ten images.
> The next ten would be as such
> 
> "SELECT blah from stuff LIMIT 5,5";
> 
> For a link to the next 5, or previous 5 for example..do something like this:
> 
> # Prints the previous 5 (if they exist!)
> if($edge >= $limit) { 
>   $edge = $edge - $limit;
>   echo "http://blah/script.php?limit=$limit&edge=$edge">
> Previous Ten";
> }
> 
> # Prints the next 5..
> $edge = $edge + $limit; 
> if($count > $edge) { 
>   echo "http://blah/script.php?limit=$limit&edge=$edge">
> next Ten";
> }
> 
> Sorry its a bit rough :)
> Hope you get the general idea :)
> 
> ^^@rk
> << If I was a signature file, where would I be?? >>
> 


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