-
Posts
783 -
Joined
-
Last visited
Everything posted by ZulfadlyAshBurn
-
LOL
-
well, it works for me. you can try this. <?php $db = mysql_connect("localhost", "root") or die("Could not connect."); //username and password mysql_select_db("cute") or die(mysql_error()); $getnummessages="SELECT COUNT(*) as messagecount from chatmessages"; $getnummessages2=mysql_query($getnummessages) or die("blah"); $getnummessages3= mysql_result($getnummessages2, 0); if($getnummessages3>40) { $startrow=$getnummessages3-20; } else { $startrow=0; } $getmsg="SELECT name, message from chatmessages order by postime ASC limit $startrow,$getnummessages3"; $getmsg2=mysql_query($getmsg) or die(mysql_error()); function replacesmiley($msg) { $msg = str_replace('', '<img src="smile.gif" alt="" />', $msg); $msg = str_replace('', '<img src="sad.gif" alt="" />', $msg); $msg = str_replace('', '<img src="tongue.gif" alt="" />', $msg); return $msg; } echo replacesmiley($text); function filterBadWords($str) { $result = mysql_query("SELECT badwords FROM clean") or die(mysql_error()); $replacements = "*"; while($row = mysql_fetch_assoc($result)) { $str = eregi_replace($row['badwords'], str_repeat('*', strlen($row['badwords'])), $str); } return $str; } while($getmsg3=mysql_fetch_array($getmsg2)) { $getmsg3['message'] = replacesmiley($getmsg3['message']); $getmsg3['message'] = filterBadWords($getmsg3['message']); //Smiley faces print "<font color='blue'><b>$getmsg3[name]:</b></font> $getmsg3[message]<br>"; } ?> <script> setTimeout("window.location.replace('chatlog.html')",2000); var objDiv = document.body; objDiv.scrollTop = objDiv.scrollHeight; </script>
-
../******.php
-
try this. hope it works. <?php $db = mysql_connect("localhost", "root") or die("Could not connect."); //username and password mysql_select_db("cute") or die(mysql_error()); $getnummessages="SELECT COUNT(*) as messagecount from chatmessages"; $getnummessages2=mysql_query($getnummessages) or die("blah"); $getnummessages3= mysql_result($getnummessages2, 0); if($getnummessages3>40) { $startrow=$getnummessages3-20; } else { $startrow=0; } $getmsg="SELECT name, message from chatmessages order by postime ASC limit $startrow,$getnummessages3"; $getmsg2=mysql_query($getmsg) or die(mysql_error()); function replacesmiley($msg) { $msg = str_replace('', '<img src="smile.gif" alt="" />', $msg); $msg = str_replace('', '<img src="sad.gif" alt="" />', $msg); $msg = str_replace('', '<img src="tongue.gif" alt="" />', $msg); return $msg; } echo replacesmiley($text); function filterBadWords($str) { $result = mysql_query("SELECT badwords FROM clean") or die(mysql_error()); $replacements = "*"; while($row = mysql_fetch_assoc($result)) { $str = eregi_replace($row['badwords'], str_repeat('*', strlen($row['badwords'])), $str); } return $str; } echo "<div id='chatlog'>"; while($getmsg3=mysql_fetch_array($getmsg2)) { $getmsg3['message'] = replacesmiley($getmsg3['message']); $getmsg3['message'] = filterBadWords($getmsg3['message']); //Smiley faces print "<font color='blue'><b>$getmsg3[name]:</b></font> $getmsg3[message]<br>"; } echo "</div>"; ?> <script> setTimeout("window.location.replace('chatlog.php')",2000); var objDiv = document.getElementById("chatlog"); objDiv.scrollTop = objDiv.scrollHeight; </script>
-
From the images, i see that you are using a div for the chat log. give the chatlog div an id for example <div id="chatlog"><?php your stuffs here ?></div> then add this script to the bottom of the script. <script> var objDiv = document.getElementById("chatlog"); objDiv.scrollTop = objDiv.scrollHeight; </script>
-
do you have a live site where we can see the code running? So, my understanding of what you want is to have to have a chat log on the page and have it refreshed every 2 seconds. If you were handling more than 100 clients, I wouldn't encourage that. What you should actually do is to check if there is any updates on the chat log. If there is then you should update the chat log. What imperium2335 had done was using jQuery's $.post() function. Learn some jQuery here From what I see, you don't speak English fluently, but hopes that site helps you. If you want people to help you code your script, you can find them or post a new topic for help. Usually there are some charges from $0++
-
I did all the codings in two hours. What do you think? here is the link http://infocommcrew.net/beta
-
I use notepad++ its free and useful for me xD
-
Leaving PHPFreaks
ZulfadlyAshBurn replied to RaythMistwalker's topic in PHPFreaks.com Website Feedback
RaythMistwalker, seriously, we don't care ?!! PHPFreaks have helped me in most of my websites I've created. Its a coding forum not a get free coding forums. If you want pure help, pay other people to do it for you. Like seriously! Didn't know emotions/smileys were fun to play with xD -
any had the misfortune of debugging iWeb html?
ZulfadlyAshBurn replied to freelance84's topic in Miscellaneous
HAHA. No Problem. Glad I was able to help you out xD -
any had the misfortune of debugging iWeb html?
ZulfadlyAshBurn replied to freelance84's topic in Miscellaneous
try finding this in the code <textarea id="input_4" class="form-textarea" name="q4_message" cols="40" rows="6"></textarea> EDIT: The contact form is from another page and they used an iframe at the contact_form.html. The file you should be finding is at: /alphacreative//contact_form_files/widget0_markup.html -
Will install it soon, asap
-
not bad? you've got any idea on starting with it?
-
<?php session_destroy(); ?>
-
I spare vps when which I bought a year a go and its still running. I have moved all the files to a dedicated server. What should I do with the VPS? Currently, I'm using it as a testing server. any ideas? its a linux VPS...
-
HAHA. no problem
-
Modified login post but after modified its is blank page
ZulfadlyAshBurn replied to shebbycs's topic in PHP Coding Help
please remember that you have to clear your sessions everytime you changes the code if no the session wouldn't be empty and is set. hope below might help if (!isset($_SESSION['is_logged_in']) || empty($_SESSION['is_logged_in'])) { -
no problem here you go : <?php $dir = "tt/"; if(!empty($_GET['delete'])) { $filename = $dir . $_GET['delete']; $name = $_GET['delete']; if (file_exists($filename)) { if (unlink($filename)) { echo "File '" .$name."' deleted!<br/>"; } } } foreach (glob($dir . "*.*") as $filename) { $filename = str_replace($dir, "", $filename); echo $filename . " | <a href='?delete=".$filename."'>delete</a> <br/>"; } ?>