PDA

View Full Version : Need Dj Says Php



DUB
15-07-2006, 08:19 PM
need the php code for DJ says,

also how ichange background of the dj says aswel?

Skimmy?
15-07-2006, 08:49 PM
I have a php code for a Dj says for this dj says i have.

ADAM:
15-07-2006, 09:08 PM
Hey

Very basic DJ Says.

Make a page called djform.php and put in the following code:


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

OK, now make a page called phpcode.php and insert the following:


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!--------!>

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.

Formatting:

Create a page called djmessage.php and put in the following in the body part of the page:


PHP Code:

<?php include("testFile.txt) ?>

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.


That tutorial was created by DJ=ICE

Want to hide these adverts? Register an account for free!