Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

Please for the love of god someone look my question this time!

(Click here to view the original thread with full colors/images)


Posted by: Scav

CGI/PERL:

open(FILE, "data/newsdata.cgi");
@newsdata = <FILE>;
close(FILE);

($postnum, $trash, $trash, $trash, $trash, $trash, $trash) = split(/|/, $newsdata[0]);
$postnum = "$postnum" + "1";

unshift(@newsdata, "$postnum|$title|$fullname|$email|$time|$date|$news");

open(FILE, ">data/newsdata.cgi");
flock(FILE, 2);
foreach $message (@newsdata) {

chomp $message;
print FILE "$message\n";

}
close(FILE);


the file i am having it open looks like this:

10|122222|Kevin Ulin|6944@home.com|1:50:39 am|04/10/01|2222
9|asdaaa|Kevin Ulin|6944@home.com|1:50:10 am|04/10/01|aaaaa
8|hmmm|Kevin Ulin|6944@home.com|1:47:59 am|04/10/01|adsf ohhhh ysa
7|test|Kevin Ulin|6944@home.com|1:46:20 am|04/10/01|test
6|123|Kevin Ulin|6944@home.com|1:46:03 am|04/10/01|123
5|asdf|Kevin Ulin|6944@home.com|1:42:51 am|04/10/01|asdf
4|asdf|fullname|email|1:41:36 am|04/10/01|asdf
3|a mere test|fullname|email|1:39:30 am|04/10/01|woohoo<br>
2|Just A Test|Kevin Ulin|6944@home.com|5:46 pm|4/8/01|This is a news post using cgi.
1|Second Test|Kevin Ulin|6944@home.com|5:46 pm|4/8/01|This is a news post using cgi.


the problem is the next line it makes is not 11, it is 2, help me!



Posted by: Chako

Scav, sorry to disappoint but I did see it the firs time, however I have 0 programming skills and hence can't help you...I post this so that you don't think your being ignored. Hopes someone helps you if they can



Posted by: TotalRecall

Sorry, I don't have the skillz either, Scav.

I did look over the code though, and you may try changing this :

$postnum = "$postnum" + "1";

to this:

$postnum = "$postnum" + "01";

This is only and uneducated guess.



Posted by: TheeMon

yeah 0 programing skills here to (ill learn very very soon though) cyaz



 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.