random numbers vs sequential numbers
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
the entire section of code that uses $ID needs to be moved to after $num is set up with the file.. way down the script.
I don't have the energy to walk you through all the changes that may be necessary, mostly because of the volume of code in that script.. which contains zero functions.. I haven't seen code like that in years..
I don't have the energy to walk you through all the changes that may be necessary, mostly because of the volume of code in that script.. which contains zero functions.. I haven't seen code like that in years..
-
skydivelouie
- Forum Newbie
- Posts: 23
- Joined: Tue Jan 18, 2005 7:07 pm
I thought I already submitted this...but didn't see it after I rebooted...
This script is designed for newbies like me...I understand you are used to more complicated scripts...although I am not...This script was written into subsections in order for idiots like me to attempt to make simple modifications...You have offered substantial help and I do appreciate it...
I believe there are only 2 sections in this code that are preventing my from accomplishing my sequential numbering code...one of which you have helped SUBSTANTIALLY...Thank You...
This portion seems to tell the $ID where to begin counting...
And this is the portion where you helped out substantially...
I believe the answer to what I'm trying to acomplish is within these 2 portions of code...you seem to be the one who has the most consistent and successful answers...
I appreciate your help thusfar...this is so close to being accomplished I can't give up now...If you choose to help me I would truly be grateful...
This script is designed for newbies like me...I understand you are used to more complicated scripts...although I am not...This script was written into subsections in order for idiots like me to attempt to make simple modifications...You have offered substantial help and I do appreciate it...
I believe there are only 2 sections in this code that are preventing my from accomplishing my sequential numbering code...one of which you have helped SUBSTANTIALLY...Thank You...
This portion seems to tell the $ID where to begin counting...
Code: Select all
#===========================================================
# ADJUST A FEW VARIABLES
#===========================================================
$ID = $num;
for ($x=0;$x<count($EMAIL);$x++){
if ($EMAILї$x]) $SendFrom = $EMAILї$x];}
if (!$SendFrom)
$SendFrom = $Recipient;
$_EMAIL = $_POST;
$_HTML = $_POST;
$_SQL = $_POST;
$_CSV = $_POST;
$_FILE = $_POST;
$_AUTO = $_POST;
$AttachmentField = explode(",",$AttachmentFields);
$x=0;
foreach ($AttachmentField as $ThisAttachment)
{
$ATTACHї$x]ї0] = $_FILESї$ThisAttachment]ї'name'];
$ATTACHї$x]ї1] = $_FILESї$ThisAttachment]ї'tmp_name'];
$x++;
}
if ($SMTPServer)
{
ini_set('SMTP',$SMTPServer);
ini_set('sendfrom_mail',$Recipient);
}Code: Select all
#########################################################################
# FLAT-FILE FUNCTIONS #
#########################################################################
if ($Action == "F" or $Action == "EF" or $Action == "DF"){
$seqfile = 'ID.txt';
if(!file_exists($seqfile))
$num = 100;
else
$num = intval(file_get_contents($seqfile)) + 1;
$fp = fopen($seqfile, 'w');
fwrite($fp, $num);
fclose($fp);
// send the form's data
$handle = @fopen($FlatFile,'a');
@flock($handle,LOCK_EX);
@fwrite($handle,$FileData);
@flock($handle,LOCK_UN);
@fclose($handle);
} // END OF ACTIONI appreciate your help thusfar...this is so close to being accomplished I can't give up now...If you choose to help me I would truly be grateful...
-
skydivelouie
- Forum Newbie
- Posts: 23
- Joined: Tue Jan 18, 2005 7:07 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
k... delete thisand put thisafter the code from "choose action", and before "email functions" section.
I seriously hope that takes care of it..

Code: Select all
$seqfile = 'ID.txt';
if(!file_exists($seqfile))
$num = 100;
else
$num = intval(file_get_contents($seqfile)) + 1;
$fp = fopen($seqfile, 'w');
fwrite($fp, $num);
fclose($fp);Code: Select all
$seqfile = 'ID.txt';
if(!file_exists($seqfile))
$ID = 100;
else
$ID = intval(file_get_contents($seqfile)) + 1;
$fp = fopen($seqfile, 'w');
fwrite($fp, $ID);
fclose($fp);I seriously hope that takes care of it..
-
skydivelouie
- Forum Newbie
- Posts: 23
- Joined: Tue Jan 18, 2005 7:07 pm
Dude...you...are...a...freakin'...GENIUS!!!...
I can't thank you enough...
Your genius far exceeds what I feel I could offer in gratitude...Thank you...Exponentially...!!!...
I am still curious as to why the number continues to grow from 10000...to which is currently at 10022...even though I've changed the beginning number from what I see as a point of reference to 100 and then 1000...it seems to increase in the same increments...
http://www.skydivelouie.com/mmex/ID.txt
I don't know if this is something I did or what...
Ya know...whatever...you have set me leaps and bounds beyond where I was earlier in the day...
I continue to value your advice...
Thank You...
I can't thank you enough...
Your genius far exceeds what I feel I could offer in gratitude...Thank you...Exponentially...!!!...
I am still curious as to why the number continues to grow from 10000...to which is currently at 10022...even though I've changed the beginning number from what I see as a point of reference to 100 and then 1000...it seems to increase in the same increments...
http://www.skydivelouie.com/mmex/ID.txt
I don't know if this is something I did or what...
Ya know...whatever...you have set me leaps and bounds beyond where I was earlier in the day...
I continue to value your advice...
Thank You...
-
skydivelouie
- Forum Newbie
- Posts: 23
- Joined: Tue Jan 18, 2005 7:07 pm
-
skydivelouie
- Forum Newbie
- Posts: 23
- Joined: Tue Jan 18, 2005 7:07 pm