HomeTutorialsForumsResourcesHelpContact
 TechTuts Forum » Forum Tutorials » PHP Tutorials

User Controls

  • Welcome Guest
  • Log In
  • Register

Partner Links

  • Zaggle Limited
  • Web Hosting Reviews
  • Buy Website Traffic
  • Linux Training
  • Mac Pro Memory
  • Dating
  • Education

Tutorial Categories

  • » PHP
  • » PHP User System
  • » Web Development
  • » Javascript
  • » Cascading Style Sheets
  • » HTML
  • » Adobe Photoshop
  • » Adobe Dreamweaver
  • » Adobe Fireworks
  • » Microsoft Windows
  • » Microsoft Office
  • » Apple
  • » Linux
 
Reply to this topicStart new topic
> Simple Shoutbox - Gerard, works with naresh's usersystem
Rating 2 V
Options V
xiaozhu
Rating: 0
View Member Profile
post Oct 23 2006, 09:34 AM
Post #1


Newbie
Group Icon

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>";
}
?>
Go to the top of the page
 
+Quote Post
jamvince5k
Rating: 0
View Member Profile
post Oct 23 2006, 10:14 AM
Post #2


Newbie
Group Icon

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
Go to the top of the page
 
+Quote Post
xiaozhu
Rating: 0
View Member Profile
post Oct 23 2006, 10:20 AM
Post #3


Newbie
Group Icon

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
Go to the top of the page
 
+Quote Post
jamvince5k
Rating: 0
View Member Profile
post Oct 23 2006, 10:30 AM
Post #4


Newbie
Group Icon

Group: Members
Posts: 36
Joined: 16-October 06
Member No.: 311



QUOTE (xiaozhu @ Oct 23 2006, 04:20 PM) *
Do you have the URL? Btw, I wasn't the one who created this tutorial.

You must login to view shout.php


Hey, it works now thanks, Can you get the admin panel for this so that admins can remove shoutouts?
Go to the top of the page
 
+Quote Post
jamvince5k
Rating: 0
View Member Profile
post Oct 23 2006, 01:01 PM
Post #5


Newbie
Group Icon

Group: Members
Posts: 36
Joined: 16-October 06
Member No.: 311



QUOTE (jamvince5k @ Oct 23 2006, 04:30 PM) *
Hey, it works now thanks, Can you get the admin panel for this so that admins can remove shoutouts?


I made my own admin panel, nevermind tongue.gif
I can delete or edit shouts peace.gif
Thanks!
Simple tut but does the job!
Go to the top of the page
 
+Quote Post
lewisthemusician
Rating: 2
View Member Profile
post Oct 29 2006, 07:02 AM
Post #6


<?= $membertitle; ?>
Group Icon

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?


--------------------
Dual Core E5200 @ 3.85Ghz | Corsair 4GB DDR2 @ 1117Mhz Dominator Memory & Fan | 160GB Seagate HD | nVidia 9600GSO Overclock 384MB GDDR3 | Windows XP Pro SP3 Performance Edition
Go to the top of the page
 
+Quote Post
Narcotic
Rating: 1
View Member Profile
post Oct 29 2006, 08:11 PM
Post #7


Newbie
Group Icon

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
Go to the top of the page
 
+Quote Post
Matt
Rating: 3
View Member Profile
post Oct 29 2006, 08:16 PM
Post #8


Retired TT Moderator
Group Icon

Group: Advanced Member
Posts: 991
Joined: 30-September 06
From: UK
Member No.: 37



QUOTE (Narcotic @ Oct 30 2006, 03:11 AM) *
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 smile.gif
Go to the top of the page
 
+Quote Post
Narcotic
Rating: 1
View Member Profile
post Oct 29 2006, 08:18 PM
Post #9


Newbie
Group Icon

Group: Members
Posts: 29
Joined: 29-October 06
From: Netherlands Antilles
Member No.: 418



lol yeah but someone should warn them tho lol
Go to the top of the page
 
+Quote Post
Matt
Rating: 3
View Member Profile
post Oct 29 2006, 08:24 PM
Post #10


Retired TT Moderator
Group Icon

Group: Advanced Member
Posts: 991
Joined: 30-September 06
From: UK
Member No.: 37



True true smile.gif

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 peace.gif

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. peace.gif
Go to the top of the page
 
+Quote Post
Narcotic
Rating: 1
View Member Profile
post Oct 29 2006, 08:33 PM
Post #11


Newbie
Group Icon

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
Go to the top of the page
 
+Quote Post
Matt
Rating: 3
View Member Profile
post Oct 29 2006, 08:37 PM
Post #12


Retired TT Moderator
Group Icon

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 smile.gif All ready to be inserted now peace.gif
Go to the top of the page
 
+Quote Post
Connor
Rating: 0
View Member Profile
post Apr 1 2007, 02:22 PM
Post #13


Newbie
Group Icon

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.
Go to the top of the page
 
+Quote Post
Mon
Rating: 0
View Member Profile
post Apr 2 2007, 07:44 PM
Post #14


Newbie
Group Icon

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!
Go to the top of the page
 
+Quote Post
eaubailey
Rating: 0
View Member Profile
post Apr 3 2007, 10:49 AM
Post #15


Newbie
Group Icon

Group: Members
Posts: 4
Joined: 3-April 07
Member No.: 1,049



Could someone create me a mail system for the user panel tongue.gif Like so they can make their own address like theirname@myhost.com

PM me if you can!
Go to the top of the page
 
+Quote Post
agw2012
Rating: 0
View Member Profile
post May 26 2007, 06:19 AM
Post #16


Newbie
Group Icon

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???
Go to the top of the page
 
+Quote Post
cyruswu_old
Rating: 2
View Member Profile
post May 26 2007, 06:55 AM
Post #17


Advanced Member
Group Icon

Group: Members
Posts: 739
Joined: 25-January 07
From: Henry's bottom
Member No.: 859



QUOTE (agw2012 @ May 26 2007, 07:19 AM) *
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.


--------------------
I LOVE HENRY
Go to the top of the page
 
+Quote Post
agw2012
Rating: 0
View Member Profile
post May 26 2007, 11:40 AM
Post #18


Newbie
Group Icon

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 glare.gif
Go to the top of the page
 
+Quote Post
Wildo
Rating: 4
View Member Profile
post May 26 2007, 11:54 AM
Post #19


Retired Staff
Group Icon

Group: Advanced Member
Posts: 1,458
Joined: 14-December 06
From: The Netherlands
Member No.: 787



lol that must have sucked tities tongue.gif

Wildo


--------------------
I'm not an Indian!
Asking for help by PM, MSN or email will get no response unless I tell you you can contact me by one of the named methods.

Go to the top of the page
 
+Quote Post
agw2012
Rating: 0
View Member Profile
post May 26 2007, 01:20 PM
Post #20


Newbie
Group Icon

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
Go to the top of the page
 
+Quote Post
« Next Oldest · PHP Tutorials · Next Newest »
 

Reply to this topicStart new topic

 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

RSS Lo-Fi Version Time is now: 8th February 2010 - 07:05 PM
Copyright TechTuts.com © All Rights Reserved
Powered By IP.Board © 2010  IPS, Inc.
Licensed to: Adam Bray