Jump to content


Refreshing


2 replies to this topic

#1 derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 343 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 21 July 2007 - 05:00 PM

For some reason, I can't switch frames when I enter the chat room. Here is my code:
<?php
session_start();
require_once("connect.php");
$ip = $_SERVER['REMOTE_ADDR'];
$t = time();
if (isset($_POST['username'])) {
if (isset($_POST['enter'])) {
echo "<meta http-equiv='refresh' content='1' url='messages.php' target='frame2'>";
}
$ip_ck = mysql_query("SELECT * FROM `bans` WHERE `usr_ip` = '$ip'") or die("<b><u>MySql Error:</u></b> ".mysql_error());
$get = mysql_fetch_array($ip_ck);
if (mysql_num_rows($ip_ck)>0) {
die("<h1>You have been kicked from the chat room.</h1><br><h2>Reason: ".$get['reason']."</h2>");
}else{
if ($_POST['username'] == NULL) {
die("<h1>You need a username in order too chat.</h1>");
}else{
mysql_query("INSERT INTO `occupants` (`id`, `username`, `usr_ip`) VALUES('', '".$_POST['username']."', '$ip')") or die("<b><u>MySql Error:</u></b> ".mysql_error());
mysql_query("INSERT INTO `public` (`id`, `username`, `message`) VALUES('', '".$_POST['username']."', '".$_POST['message']."')") or die("<b><u>MySql Error:</u></b> ".mysql_error());
echo "<meta http-equiv='refresh' content='0;url=chat.php?username='".$_POST['username']."'>";
$_SESSION['s_username'] = $_POST['username'];
}
}
}else{
echo "
<body bgcolor='#3366CC'>
<center>
<form action='".$_SERVER['PHP_SELF']."' method='post'>
<input type='hidden' name='message'>
<input type='hidden' name='enter'>
<input type='hidden' name='to' value='Room'>
Username: <input type='text' name='username'>
<input type='submit' value='Login'>
</form>
</center>
</body>
";
}
?>

I have the frame labled as frame2, I've made sure of that. Can someone help me? ex: http://dsullivan.sil...chat/index.html

#2 Ali Imran

    Young Padawan

  • Members
  • Pip
  • 7 posts

Posted 22 July 2007 - 05:44 PM

The supplied link is dead, please provide alternate.
Secondly what you mena by "I can't switch frames" ? please give some more details.

regards

#3 derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 343 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 22 July 2007 - 07:07 PM

View PostAli Imran, on Jul 22 2007, 05:44 PM, said:

The supplied link is dead, please provide alternate.
Secondly what you mena by "I can't switch frames" ? please give some more details.

regards


Sorry about the dead link. What I mean by switching frames is, in the middle frame you start off with the help page, when the user is logged into the chat room, it will redirect the middle frame to the file that stores the messages so he'll be able to see them...


as far as the link goes, http://dsullivanonli...chat/index.html





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users