# How to make a shout out box with no mysql



## bob57 (Sep 5, 2008)

Hi iam going to show u how to make a shoutout box with out useing mysql only php.:grin:

1. First thing you need to do is to make a file named.

addtag.php

then add this code below then save it.


```
<?

// This gets the information from the form
 $name = $_POST['name'];
 $name = $_POST['website'];
 $name = $_POST['message'];

// This takes the smiley code in the message and turns it into a smiley
 $code = array(
   '/:\)/;
   '/:P/;
   '/:]/'
);

$image = array(
  '<img src="smileys/smile.gif">;
  '<img src="smileys/razz.gif">;
  '<img src="smileys/biggrin.gif">'
);
$formatted = preg_replace($code,$image,$message);

// Set up how it's going to be displayed.
 $tag = ("<font size=\"2\" face=\"Arial\">
 <a href=\"$website\" target=\"_blank\">$name</a>:$formatted
 </font><br>");

// Gather the data currently in the file
 $read = fopen("content.txt","r");
 $contents = fread($read,filesize('content.txt'));
 fclose($read);

// Open the file and write the tag to it
 $write = fopen("content.txt","w");
 fwrite($write,"$tag $contents");
 fclose($write);

// Refresh!
 print "<meta http-equiv=\"refresh\" content=\"0;shoutout.php\">";

?>
```
2.
Ok next step make file named

content.php

Then copy and paste code below.


```
<html>
<head>
<link href="style.css" rel="STYLESHEET" type="TEXT/CSS" />
</head>
<body>
<?php include('content.txt');?>
</body>
</html>
```
3.
This is step 3,create another file named

shoutbox.php

Copy and paste code in this file.


```
<html>
<head>
<title>Shout box</title>
<link href="style.css" rel="STYLESHEET" type="TEXT/CSS"/>
</head>
<body>


[MEDIA=youtube]marginwidth[/MEDIA]
<FORM name="shout" action="addtag.php" method="POST">
Name:<br>
<INPUT TYPE="TEXT" name="name" size"20"><br>
Website:<br>
<INPUT TYPE="text" name="website" size="20" value="http//"><br>
Message:<br>
<TEXTAREA NAME+"message" COLS+16 ROWS=2></TEXTAREA><br>
<br>
<INPUT TYPE="Submit" name="submit" value="Post IT" soze="20">
</FORM>

</body>
</html>
```
4.
Make a file named

content.txt

no code need it for this file.
4.
This is last step,now you can put this code anywere you want,it will only work in php files.

Copy and paste this code any were u want but only work in php files.


```
[MEDIA=youtube]marginwidth[/MEDIA]
```
Thats all its that simple if theres any promblems please let me know Thanks.:grin:


----------



## Slapshot (Feb 3, 2008)

Super unsafe


----------

