dynamicgfx
Members-
Posts
14 -
Joined
-
Last visited
Never
Everything posted by dynamicgfx
-
Shoutbox autorefresh everytime a new entry is added.
dynamicgfx replied to dynamicgfx's topic in Javascript Help
I've been googling since you said google, and still i found nothing. Alot of people asked the same question but non got an answer. -
Shoutbox autorefresh everytime a new entry is added.
dynamicgfx replied to dynamicgfx's topic in Javascript Help
could you give me an example of the ajax tight loop thingy? -
What i want too do is make the page refresh every time there's a new entry, at the moment its using a meta refresh which isn't really quit reliable since it refreshes after a certain time. Could anyone tell me who this can be done.
-
Shoutbox code cant understand why it gives an error.
dynamicgfx replied to dynamicgfx's topic in PHP Coding Help
oh lol thanks -
Hi there ive got this php code for a shoutbox im working on but i keep getting the error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a7865530_shout'@'localhost' (using password: YES) in /home/a7865530/public_html/index.php on line 66 The while loop works its just when im inserting something it give an error <style> table { border:thin solid #000; width:600px; font-family:arial; } th { color:#fff; background:#000; } </style> <? $username="a7865530_shout"; $password="passwordishere"; $database="a7865530_shout"; $host="mysql16.000webhost.com"; if(!isset($_GET['insert'])){ ?> <meta http-equiv="REFRESH" content="20;url=/"> <table style="max-height:600px;overflow:scroll;" border="0"> <tr> <th>Name:</th> <th>Message:</th> </tr> <?php $con = mysql_connect($host, $username, $password); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database , $con); $result = mysql_query("SELECT * FROM shout"); while($row = mysql_fetch_array($result)) { echo "<tr><td>"; echo stripslashes($row['name']) . "</td><td/> " . stripslashes($row['message']); echo "</td></tr>"; } mysql_close($con); ?> </table> <table border="0" cellspacing="0" cellpadding="0"> <form name="addform" method="post" action="?insert"> <tr> <td align="center"> Name: <input type="text" id="name" name="name"> Message: <input type="text" id="message" name="message"> <input type="submit" name="shout" title="shout" value="shout"> </td> </tr> </table> </form> <?php } else { $table="shout"; $name = $_POST['name']; $message = $_POST['message']; $name = stripslashes($name); $message = stripslashes($message); $ip = $_SERVER['REMOTE_ADDR']; mysql_connect($$host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="INSERT INTO $table (ip,name, message) values ('$ip','$name','$message')"; $result=mysql_query($query); echo "Succsesfully Shouted. <a href=\"/\">Return</a>"; header("location: .../index.php"); } ?>
-
thanks it works now
-
Fatal error: Cannot redeclare replace() (previously declared in /home/a7749307/public_html/forum/topic.php:169) in /home/a7749307/public_html/forum/topic.php on line 169 thats the error to see it http://k-rs.co.uk/forum/topic.php?id=9
-
Need help with the code below it gives a fatal error <? $result = mysql_query("SELECT * FROM topics WHERE id='$id'"); while($row = mysql_fetch_array($result)) { $des = $row['desc']; ?> <? function replacesmiley($des) { $des = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $des); $des = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $des); $des = str_replace('', '<img src="set1/sad.gif" alt="" />', $des); $des = str_replace('', '<img src="set1/001_smile.gif" alt="" />', $des); $des = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $des); $des = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $des); return $des; } ?> <table width="100%" border="1" cellpadding="0" cellspacing="0" style="border:thin; border-top:none;"> <tr style="color:#FFF;"> <th width="30%" bgcolor="#000000" scope="col"></th> <th width="70%" bgcolor="#000000" scope="col"><? echo $row['name']; ?></th> </tr> <tr height="50px" style="text-align:center; background:url(http://k-rs.co.uk/images/background.png);"> <td><? echo $row['user']; ?><br /><? echo $row['post']; ?></td> <td><? echo replacesmiley($des) ?></td> </tr> <? $server = mysql_query("SELECT * FROM reply WHERE topic='$id'"); while($rows = mysql_fetch_array($server)) { $user = $rows['user']; $desc = $rows['desc']; ?> <? function replace($desc) { $desc = str_replace('', '<img src="set1/biggrin.gif" alt="" />', $desc); $desc = str_replace('', '<img src="set1/sad.gif" alt="" />', $desc); $desc = str_replace('', '<img src="set1/001_smile.gif" alt="" />', $desc); $desc = str_replace('', '<img src="set1/tongue_smilie.gif" alt="" />', $desc); return $desc; } ?> </tr> <tr height="50px" style="text-align:center; background:url(http://k-rs.co.uk/images/background.png);"> <td><? echo $rows['user']; ?><br /><? echo $rows['rank']; ?><br />Posted at: <? echo $rows['post']; ?></td> <td><? echo replace($desc) ?></td> </tr> <? }} ?>
-
i have a include.php which connects 2 database its so i dnt have 2 redo evry time...
-
Hi there i was wondering is anyone could help me in creating a page for each site like info.php?site=sitename I've Currently got this but its not really working... <?php include ("config.php"); $ServerName = $_GET['title']; $server = "SELECT * FROM sites WHERE title='$ServerName'"; $desc = $_GET['content']; $content = "SELECT * FROM sites WHERE content='$desc'"; $url = $_GET['link']; $link = "SELECT * FROM sites WHERE link='$url'"; if ($info== "$server") { echo "<h1>$server</h1>"; echo "<p>$content</p>"; echo "<a href='$link'>Visit Site</a> OR <a href='play.php?server=$server'>Play Now</a>"; } ?> Please relpy ASAP & Thank You in Advance...
-
tyvm and i removed the @ dnt why i had it in
-
sos didnt understand wat u said at first. btw how do i select a certain column could u perhaps give me an example code. and again im sorry...
-
thts not wat im asking learn to read
-
i have this code but it shows the password of the user to... <?php $database="dynamicg_sites"; mysql_connect ("localhost","dynamicg_sites","boom123"); @mysql_select_db($database) or die( "Unable to select database"); $result = mysql_query( "SELECT * FROM sites order by votes DESC" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "<br>\n"; print "There are $num_rows News Articles"; print "<br>\n"; print "<table width=457 border=0>\n"; print "<tr>\n"; print "<td>\n"; echo "Title:"; print "</td>\n"; print "<td>\n"; echo "Description:"; print "</td>\n"; print "<td>\n"; echo "Votes:"; print "</td>\n"; print "</tr>\n"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; print "<br />\n"; print "<br />\n"; ?> i was wondering how do i make this only show certain columns... thanks in advance...