Jump to content

making 2 pages in one?


mybluehair

Recommended Posts

do you know myphpadmin? well ya know how theres a thing on the left side of the page that shows you your tables? and then beside that, theres everything else? well i kinda see that thows are 2 different pages both being viewed at the same time. the left panel never refreshes (unless needed to) to make things look a bit cooler. well, as some of you know, im making a chat room. and here is a pic of it:

http://gotdrake.com/screen.bmp

 

 

but anyway, it would be great if i could spit that in 2. right above were it sayes "chats:" would be a nice place to split. but thats not the only problem. when you click submit on that form, its told to go to the same exact page. (in that page it includes a bit were if anything was previously entered in the message box, it will insert it into the DB). so that might mess it up or something? idk, i dont really care how its done, just as long as it works. here is the code to the file:

<?

$database = "*************";

$username = "**********";

$password = "*********";

 

$message=$_POST['message'];

 

 

echo '

<center><a href="logintoap.html">Admin panel</a></center><br>

 

<form action="allinone.php" method="post"> <br>

chat message:<br> <textarea rows="12" cols="65" name="message" id="message"></textarea> <br><br>

<input type="submit"><br>';

 

 

mysql_connect(localhost,$username,$password);

@mysql_select_db($database) or die ( "unable to connect");

if ($message == '') {

$message = false;

} else {

$query = "INSERT INTO contacts VALUES ('', '$message', NOW())";

}

 

 

mysql_query($query);

 

 

mysql_close();

 

echo '<hr>';

 

 

mysql_connect(localhost,$username,$password);

@mysql_select_db($database) or die ( "unable to connect");

$query="SELECT * FROM `contacts` ORDER by 'datetime' DESC ";

$result=mysql_query($query);

 

 

$num=mysql_numrows($result);

 

mysql_close();

 

echo "<b><center>chats:</center></b><br><br><br>";

 

$i=0;

while ($i < $num) {

 

$message=mysql_result($result,$i,"message");

 

 

echo "<b>$message</b><br><hr><br>";

 

$i++;

}

 

 

?>

 

so how would i make this work? please help

Link to comment
Share on other sites

phpMyAdmin uses html frames.

ok, so how would i do that with this and keep it working?

Start by finding a simple tutorial on frames.  This is nothing to do with php and everything to do with simple html.

 

Free advice: don't post 3Mb images as examples of things. People on dial-up don't like it.

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.