Jump to content

PHP Problem


Monk3h

Recommended Posts

This is a mini chat system im using, its displayed in the top right corner of my site, it works fine apart from when i click Chat to post a message it takes me to chat.php.

 

How would i change this script so that it dosnt take me to chat.php but still does the action. =/

 

<?php

Print"<center>
<form method=post action=chat.php?action=minichat>
<tr><td colspan=2 align=center>
<input type=text name=msg size=15> <input type=submit value=Chat>
</form></center>";

} if ($action == minichat) {
if ($msg){

		if ($stat[rank] == Admin) {
		$starter = "<span style=color:#0066cc>$stat[user]</span>"; 
		} elseif ($stat[sub] > 0) {
		$starter = "<span style=color:#FF0000>$stat[user]</span>"; 
		} elseif ($stat[rank] == Staff) { 
		$starter = "<span style=color:#629632>$stat[user]</span>"; 



} else {
		$starter = "$stat[user]";
	}
	mysql_query("insert into chat (user, chat) values('$starter', '$msg')");
mysql_query("update players set chatline=chatline+1 where id=$stat[id]");
}
}
?>

		<iframe src=minichat.php width='100%' height=306 id=ifr name=ifr frameborder=0></iframe>




	</td></tr>
	</table><br>

 

 

BTW, Chat .php is the main chat script.

Link to comment
https://forums.phpfreaks.com/topic/106065-php-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.