OK, A lot of people have been asking how to do DJ Says, NOT the cutenews way. I personally hated the cutenews way. Follow the simple instructions below to make a DJ Says. This DJ Says system will be like this:
DJ Ice Says: Hey! Search ...... for the party!
Make a page called djform.php and put in the following code:
Then Customize that page to how you wish, different background color etc. Also when the DJ puts in there name they must only type the second part such as Ice not DJ Ice.HTML Code:<form action="phpcode.php" method="post" name="form1" target="_self"> <p> <label>DJ Name: <input name="djname" type="text" id="djname"> </label> <br> <label><br> DJ Message: <br> <textarea name="message" cols="35" id="message"></textarea> </label> </p> <p> <label> <input type="submit" name="Submit" value="Submit Message"> </label> </p> </form>
OK, now make a page called phpcode.php and insert the following:
OK, now once you have used djform.php, it will lead to phpcode.php which will then create a file called testFile.txt on the same directory as all the other files above are in. You must then CHMOD testFile.txt to 666 if it isn't already done. So the DJ Says is located in testFile.txt. If your not bothered about formatting then just set testFile.txt to the DJ Message page.PHP Code:<?php $myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "DJ $djname Says: $message\n";
fwrite($fh, $stringData);
fclose($fh); ?>
<!-------Now make the rest of the page here, make sure that the code above stays at the top!--------!>
Formatting:
Create a page called djmessage.php and put in the following in the body part of the page:
Then customize the page as you would normally. Then set the DJ Page to djmessage.php. Please note all the above files would work exactly how they are if in the same directory. If you want them in different directorys you will have to fiddle with the code. you MUST CHMOD the testFile.txt to 666 or it will not be writeable.PHP Code:<?php include("testFile.txt) ?>




Reply With Quote






