Jump to content

[SOLVED] More Chat Help


twilitegxa

Recommended Posts

I also have some other files that are generating errors:

 

<?php

include "connect.php";

if(isset($_POST['submit']))

{

  $searchterm=$_POST['searchterm'];

  $getmsg="Select * from chatmessages where message like '%$searchterm%' order by postime desc";

  $getmsg2=mysql_query($getmsg) or die("Could not get messages");

  print "<table border='1'><tr><td>Name of poster</td><td>IP</td><td>Message</td><td>Edit</td><td>Delete</td></tr>";

  while($getmsg3=mysql_fetch_array($getmsg2))

  {

     print "<tr><td valign='top'>$getmsg3[name]</td><td valign='top'>$getmsg3[iP]</td><td valign='top'>$getmsg3[message]</td><td valign='top'><A href='editm.php?ID=$getmsg3[iD]'>Edit</a></td><td valign='top'><A href='delete.php?ID=$getmsg3[iD]'>Delete</a></td></tr>";

  } 

  print "</table>";



}

else

{

  print "<form action='editdelete.php' method='post'>";

  print "Search for messages (leaving blank will return all messages:<br>";

  print "<input type='text' name='searchterm' size='20'><br>";

  print "<input type='submit' name='submit' value='submit'></form>";



}

?>

 

This one is not returning the ip addresses for some reason. Can anyone tell me why?

Link to comment
https://forums.phpfreaks.com/topic/123880-solved-more-chat-help/
Share on other sites

uhhh, you haven't concocted the array data correctly on this line....

 

<?php
print "<tr><td valign='top'>" . $getmsg3['name'] . "</td>

the really long Print....

 

you need to put " . $getmsg3['name'] . " inside the print like that. And put single quotes around the name.

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.