Jump to content

using a form to define a variable? (not so simple?)


A2xA

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.