A2xA Posted January 27, 2008 Share Posted January 27, 2008 Let's see if I can explain this. The chat I have writes to a txt file. So, I gave the users the option to make their own "hub" Which makes their own text file. I need to make it where they type in their text file's name/or number and it takes them to "their hub". The only problem is the php file where I'm trying to define it are the settings for a swf file, which is the actual file I'm running.. the php settings file for the chat: <?php extract($HTTP_GET_VARS); extract($HTTP_POST_VARS); header("Expires: ".gmdate("D, d M Y H:i:s")."GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); ?> <?php $nickname = str_replace ("\n"," ", $nickname); $nickname = str_replace ("<", " ", $nickname); $nickname = str_replace (">", " ", $nickname); $nickname = str_replace ("fuck", "-", $nickname); $nickname = str_replace ("suck", "-", $nickname); $nickname = str_replace ("ass", "-", $nickname); $nickname = str_replace ("&", "and", $nickname); $nickname = stripslashes ($nickname); $message = str_replace ("\n"," ", $message); $message = str_replace ("<", " ", $message); $message = str_replace ("&","and", $message); $message = str_replace ("fuck", "-", $message); $message = str_replace ("suck", "-", $message); $message = str_replace ("ass", "-", $message); $message = stripslashes ($message); $p=gmdate("d M H:i"); ?> &output= <?php $chat_file = "shout.txt <-- What I'm trying to define as a variable"; $chat_lenght = 40; $max_single_msg_lenght = 100000; $max_file_size = $chat_lenght * $max_single_msg_lenght; $file_size= filesize($chat_file); if ($file_size > $max_file_size) { $lines = file($chat_file); $a = count($lines); $u = $a - $chat_lenght; for($i = $a; $i >= $u ;$i--){ $msg_old = $lines[$i] . $msg_old; } $deleted = unlink($chat_file); $fp = fopen($chat_file, "a+"); $fw = fwrite($fp, $msg_old); fclose($fp); } $msg = str_replace ("\n"," ", $message); $msg = stripslashes ($msg); if ($msg != ""){ $fp = fopen($chat_file, "a+"); $fw = fwrite($fp, "<font color=\"blue\"><b>$nickname:($p)<br></b></font> $msg\n"); fclose($fp);} $lines = file($chat_file); $a = count($lines); $u = $a - $chat_lenght; for($i = $a; $i >= $u ;$i--){ echo $lines[$i]; } ?> ^ignore the cuss words they are filters ^ on the 28th line there is $chat_file = "shout.txt"; Instead of shout.txt I want it to be the users custom indentifier ie: hub232.txt Then, somehow re-direct to the flash file? I know this is very...very confusing. If anyone it getting what I'm saying and can help I'd appreciate it. I sure can't wrap my mind around it :-X Link to comment https://forums.phpfreaks.com/topic/87996-using-a-form-to-define-a-variable-not-so-simple/ Share on other sites More sharing options...
A2xA Posted January 27, 2008 Author Share Posted January 27, 2008 where this can be viewed is at http://wiicharged.com/index.php?action=hubs I'm trying to fix the join hub option. Do the make a hub option for better understanding. Thanks all for helping you don't know how much I appreciate it Link to comment https://forums.phpfreaks.com/topic/87996-using-a-form-to-define-a-variable-not-so-simple/#findComment-450226 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.