Yeah well basically. Theres a load of Dj Panels flying about but what if you just want something to display a message from a DJ..
Also, this method doesnt use Cutenews. Cutenews sucks. Period.
Since i havent used this forum in months i saw this uitable as something nice to post for people to use. I wrote the script with reference to a few tutorials (Im new to PHP)
This uses a basic function where the current text in the box is added into a text document, but when the text in the box is changed, it also changes in the Text document.
Play about with it a bit, just so long as you give me credit for it. A live verison on it can be seen at:
Dj Says - Write and update the text to be displayed.
Dj Says - The current text in the .txt file. To be displayed where you wish the Dj Says to be
And last but not least. The source code.
Create a file named djsays.php and djsays.txt.
In the djsays.php, paste this code:
Save the .php file.Code:<?php if($_POST['update']) { $newmsg = stripslashes($_POST['message']); $file = fopen("djsays.txt","r+"); ftruncate($file,0); $writedate = fwrite($file,$newmsg); fclose($file); } $messages = fopen("djsays.txt","r+"); $message = fread($messages,100000); fclose($messages); ?> <html> <head> <title>Dj Says Ver 1.07 - By Sam (HxF)</title> <style type="text/css"> body { Font-family: Tahoma; Font-size: 9px; color: #FFFFFF; Background-color: #000000; } </style> </head> <body> <div align="center"><br> <b>Dj Says Ver 1.07<b><br> <p> Enter in the text you wish to be displayed below and hit Update! Simple as!<br> <p> Oh, but dont forget, You must use a PHP include function on the 'Djsays.txt' file if you want it displayed on a page. Also, if you are using iframes, just set the iframe src to Djsays.txt.<br> <p> You may remove this text and edit the CSS<br> <p> - Sam <form action="<? $php_self ?>" method="post"> <textarea name="message" rows="8" cols="50"><?=$message?> </textarea> <br><p> <input type="submit" name="update" value="Update" /> </form> <br> <p> Suggested Addons:<br> <p> Turn DJsays.txt into a html file, add a refresh.<br> Password protect this file<br>
Instrucions are in the actual file. Once you've ran it, open djsays.php and read the text.
Have Fun
- Sam







Reply With Quote







