CAiNSTUHhh Posted August 7, 2009 Share Posted August 7, 2009 <? function tg($action, $nick, $stuffsaid){ $talkdatafile = "Riders.txt"; $showtalks = "100"; if ($action == "talk") { if(strlen($nick) >= 3){ if(strlen($stuffsaid) >= 3){ $t_fp = fopen ($talkdatafile, "a+"); $talkdate = date("d/m/y"); $ip = getenv(REMOTE_ADDR); $nicktwo = ereg_replace('<', ' ', $nick); $nickthree = ereg_replace('>', ' ', $nicktwo); $one_stuffsaid = ereg_replace('<', ' ', $stuffsaid); $two_stuffsaid = ereg_replace('>', ' ', $one_stuffsaid); $f_stuffsaid = stripslashes("$two_stuffsaid"); $f_nick = stripslashes("$nickthree"); if (is_alphachar($f_nick) == 1) { $error .= "Invalid User ID. Go Back!"; echo $error; exit; } $writedata = $talkdate."|".$f_nick."|".$f_stuffsaid."|".$ip."|"."\n"; $test_last = file($talkdatafile); $test_lastr = array_reverse($test_last); $last_e = $test_lastr[0]; if($writedata != $last_e){ fwrite ($t_fp, $writedata); fclose ($t_fp); } } } } //EDIT THESE VARS $bgcolor = "white"; $bordercolor = "black"; $height = "400"; $width = "200"; $font = "verdana"; $fontcolor = "blue"; $linkcolor = "blue"; $linkhover = "blue"; $inputtext = "blue"; $inputbackground = "#FFFFFF"; $inputborder= "#FF0000"; //DONT EDIT echo "<html><head>\n" ."<style type=text/css><!-- input{background-color:$bgcolor;font-color:$fontcolor;font-family:$font;font-size:10px;} --></style></head>\n" ."<style type=text/css>\n" ."<!--\n" ."a:link.taglink{color:$linkcolor;font-family:$font;}\n" ."a:visited.taglink{color:$linkcolor;font-family:$font;}\n" ."a:hover.taglink{color:$linkhover;font-family:$font;}\n" ."input.tagput{color:$inputtext;font-family:$font;background-color:$inputbackground;border-color:$input-border;border-style:solid;border-width:1}\n" ."-->\n" ."</style>\n" ."<body bgcolor=$bgcolor>\n" ."<center>\n" ."<table border=0 cellpadding=0 cellspacing=0 bgcolor=$bgcolor>\n" ."<tr><td colspan=2>";echo "<table border=0 cellpadding=0 cellspacing=0 bgcolor=$bgcolor>\n" ."<tr><td>\n";echo "<table border=0 cellpadding=0 cellspacing=0 bordercolor=$bordercolor><tr><td bordercolor=$bgcolor>\n" ."<font face=$font color=$fontcolor size=1>\n"; $talks_temp = file($talkdatafile); $talks = array_reverse($talks_temp); //$showtalks = "20"; //http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendID=40269157 for ($t = 0; $t < $showtalks; $t++) { $talk_array = explode("|", $talks[$t]); echo "<b>".$talk_array[2]."</b> (<a href=\"http://collect.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&friendID=".$talk_array[1]."\" target=\"_blank\">Add</a> | <a href=\"http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendID=".$talk_array[1]."\" target=\"_blank\">View</a> )<BR> "; } echo "</tr></td></table>\n" ."</textarea>\n" ."</div>\n" ."</font>\n" ."</td></tr>\n" ."</table>\n" ."</table><BR>\n" ."<table cellpadding=3 cellspacing=3 border=0><tr><td>\n" ."<form action=\"".$PHP_SELF."\" method=\"post\"><font face=$font color=$fontcolor size=1>MySpace ID(0-9):\n" ."<td><input type=\"text\" name=\"nick\" class=tagput>\n" ."<tr><td><font face=$font color=$fontcolor size=1>Name(A-Z, 0-9):<td><input type=\"text\" name=\"stuffsaid\" class=tagput><br>" ."</table><input type=\"submit\" name=\"tagit\" value=\"Submit\" class=tagput>\n" ."<input type=\"hidden\" name=\"action\" value=\"talk\">\n" ."</form><BR>"; include("post.php"); echo "<font face=$font color=$fontcolor size=1><BR><BR>\n" ."<BR><BR><BR><BR>\n" ."</font>\n" ."</body>\n" ."</html>"; } tg($action, $nick, $stuffsaid, $personsite); function is_alphachar($text) { for ($i = 0; $i < strlen($text); $i++) { if (!ereg("[0-9]", $text[$i])) { return 1; } } } ?> for ($i = 0; $i < strlen($text); $i++) { if (!ereg("[0-9]", $text[$i])) { return 1; } } } ?> it wont post to text file whenever i push Submit at the bottom. cain.justfree.com/T/train.php <--View the file Link to comment https://forums.phpfreaks.com/topic/169287-php-wont-post-to-txt-file/ Share on other sites More sharing options...
Mardoxx Posted August 7, 2009 Share Posted August 7, 2009 $test_last = file($talkdatafile); $test_lastr = array_reverse($test_last); $last_e = $test_lastr[0]; why not use $last_e = end($test_last); Link to comment https://forums.phpfreaks.com/topic/169287-php-wont-post-to-txt-file/#findComment-893334 Share on other sites More sharing options...
CAiNSTUHhh Posted August 7, 2009 Author Share Posted August 7, 2009 Is this supposed to fix the whole script. I just need a train people can jump on and jump off for the 3rd page of my website.. Theres no free ones out there so this is all i qott Link to comment https://forums.phpfreaks.com/topic/169287-php-wont-post-to-txt-file/#findComment-893339 Share on other sites More sharing options...
Mardoxx Posted August 7, 2009 Share Posted August 7, 2009 instead of $test_last = file($talkdatafile); $test_lastr = array_reverse($test_last); $last_e = $test_lastr[0]; use $last_e = end($test_last); and instead of if($writedata != $last_e){ use if($writedata != $last_e."\n"){ Link to comment https://forums.phpfreaks.com/topic/169287-php-wont-post-to-txt-file/#findComment-893341 Share on other sites More sharing options...
CAiNSTUHhh Posted August 8, 2009 Author Share Posted August 8, 2009 Can you just edit the script and post it. i did that and nothing changed. you still dont get showed up on the site. Please PLEASE thanks Link to comment https://forums.phpfreaks.com/topic/169287-php-wont-post-to-txt-file/#findComment-893356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.