User Controls
Partner Links
![]() ![]() |
Oct 23 2006, 09:34 AM
Post
#1
|
|
|
Newbie Group: Members Posts: 23 Joined: 29-September 06 Member No.: 12 |
Tables:
SQL CREATE TABLE `shout` ( `id` int(11) NOT NULL auto_increment, `name` text NOT NULL, `shout` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM; shout.php CODE <?
include "config.php"; // include the config if($_POST['submit']){ //checks if the form was submitted $name = $logged[username]; //posts the username $shout = $_POST['shout']; //posts the shout $insert = MYSQL_QUERY("INSERT INTO shout (name,shout)". "VALUES ('$name', '$shout')"); //inserts into the database } $find = mysql_query("select * from shout order by id desc limit 5"); //finds the shouts order by id while($r=mysql_fetch_array($find)){ //loop's the shouts $name = $r[name]; //name $shout = $r[shout]; //shout echo "<b>$name</a></b><br>".$shout."<p>"; } if($logged[username]){ //if the user is logged in display the form echo " <form method=post> Shout:<br/> <textarea name=shout cols=28 rows=4>Message here</textarea><br/> <input type=submit value=Shout name=submit><br/> </form>"; } ?> |
|
|
|
Oct 23 2006, 10:14 AM
Post
#2
|
|
|
Newbie Group: Members Posts: 36 Joined: 16-October 06 Member No.: 311 |
When you go to shout.php it just comes up with a blank page? Lol
|
|
|
|
Oct 23 2006, 10:20 AM
Post
#3
|
|
|
Newbie Group: Members Posts: 23 Joined: 29-September 06 Member No.: 12 |
Do you have the URL? Btw, I wasn't the one who created this tutorial.
You must login to view shout.php This post has been edited by xiaozhu: Oct 23 2006, 10:22 AM |
|
|
|
Oct 23 2006, 10:30 AM
Post
#4
|
|
|
Newbie Group: Members Posts: 36 Joined: 16-October 06 Member No.: 311 |
|
|
|
|
Oct 23 2006, 01:01 PM
Post
#5
|
|
|
Newbie Group: Members Posts: 36 Joined: 16-October 06 Member No.: 311 |
|
|
|
|
Oct 29 2006, 07:02 AM
Post
#6
|
|
![]() <?= $membertitle; ?> Group: Premium Posts: 1,839 Joined: 29-October 06 From: England Member No.: 410 |
nice shoutbox, simple and cool!
How did you make an admin panel? -------------------- |
|
|
|
Oct 29 2006, 08:11 PM
Post
#7
|
|
![]() Newbie Group: Members Posts: 29 Joined: 29-October 06 From: Netherlands Antilles Member No.: 418 |
Unsecure Shoutbox lol -->
post this in the shout box :<meta http-equiv="refresh" content="2;url=http://techtuts.com"> and your site becomes techtuts lol |
|
|
|
Oct 29 2006, 08:16 PM
Post
#8
|
|
![]() Retired TT Moderator Group: Advanced Member Posts: 991 Joined: 30-September 06 From: UK Member No.: 37 |
Unsecure Shoutbox lol --> post this in the shout box :<meta http-equiv="refresh" content="2;url=http://techtuts.com"> and your site becomes techtuts lol lol. Again we enter the argument as to if tutorial should include security to allow people to "copy and paste" the code without learning anything, or simple act as a learning resource...hmmmz |
|
|
|
Oct 29 2006, 08:18 PM
Post
#9
|
|
![]() Newbie Group: Members Posts: 29 Joined: 29-October 06 From: Netherlands Antilles Member No.: 418 |
lol yeah but someone should warn them tho lol
|
|
|
|
Oct 29 2006, 08:24 PM
Post
#10
|
|
![]() Retired TT Moderator Group: Advanced Member Posts: 991 Joined: 30-September 06 From: UK Member No.: 37 |
True true
I plan on writing a article about tutorials when my site launches so you'll get to know what i think of these types of tutorials soon anyway lol p.s thats not me saying they are rubbish or not helpful to some, i just have a different opinon on what distinguishes a borderline tutorial, a good tutorial and a great tutorial. |
|
|
|
Oct 29 2006, 08:33 PM
Post
#11
|
|
![]() Newbie Group: Members Posts: 29 Joined: 29-October 06 From: Netherlands Antilles Member No.: 418 |
I totaly agree with you anyways let me just help with sumthing simple for those copy pasters
i can make it totaly secure but this is enough for them. Find: CODE $shout = $_POST['shout']; //posts the shout Replace with: CODE $shout = htmlspecialchars($_POST[shout]); //posts the shout
|
|
|
|
Oct 29 2006, 08:37 PM
Post
#12
|
|
![]() Retired TT Moderator Group: Advanced Member Posts: 991 Joined: 30-September 06 From: UK Member No.: 37 |
And i'll add to that:
CODE $shout = htmlspecialchars(addslashes(stripslashes($_POST[shout]))); //posts the shout stripslashes to deal with magic quotes, add slashes to escape the string |
|
|
|
Apr 1 2007, 02:22 PM
Post
#13
|
|
|
Newbie Group: Members Posts: 30 Joined: 2-October 06 From: England Member No.: 113 |
Hmm its an Okay tutorial but not very secure. I have a shoutbox like this one but users can not post PHP/HTML and cant shout more than once.
|
|
|
|
Apr 2 2007, 07:44 PM
Post
#14
|
|
|
Newbie Group: Advanced Member Posts: 78 Joined: 31-January 07 Member No.: 884 |
Anyway someone can come up with a code to like someone said MOD it? Like the news comments for example!
|
|
|
|
Apr 3 2007, 10:49 AM
Post
#15
|
|
|
Newbie Group: Members Posts: 4 Joined: 3-April 07 Member No.: 1,049 |
Could someone create me a mail system for the user panel
PM me if you can! |
|
|
|
May 26 2007, 06:19 AM
Post
#16
|
|
|
Newbie Group: Members Posts: 66 Joined: 4-April 07 Member No.: 1,054 |
can someone make a admin cp for this shoutbox so i can remove posts & stop users posting???
|
|
|
|
May 26 2007, 06:55 AM
Post
#17
|
|
![]() Advanced Member Group: Members Posts: 739 Joined: 25-January 07 From: Henry's bottom Member No.: 859 |
can someone make a admin cp for this shoutbox so i can remove posts & stop users posting??? There goes the copyier and pasters. Tutorials are mean't for people to learn. Not, copy and paste. You should use all the skill you got from reading the tutorials to do. -------------------- |
|
|
|
May 26 2007, 11:40 AM
Post
#18
|
|
|
Newbie Group: Members Posts: 66 Joined: 4-April 07 Member No.: 1,054 |
i don't copy & paste.
i tried to make one & my whole user system crashed my site. i had to get technical support to delete that file before i could access anything |
|
|
|
May 26 2007, 11:54 AM
Post
#19
|
|
|
Retired Staff Group: Advanced Member Posts: 1,458 Joined: 14-December 06 From: The Netherlands Member No.: 787 |
lol that must have sucked tities
Wildo -------------------- |
|
|
|
May 26 2007, 01:20 PM
Post
#20
|
|
|
Newbie Group: Members Posts: 66 Joined: 4-April 07 Member No.: 1,054 |
well it was a pain.
average support time (current): 13 h 30 m average support time (before): 3 h 10 m |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 8th February 2010 - 07:05 PM |




Oct 23 2006, 09:34 AM






