PDA

View Full Version : How to do DJ Says. WITHOUT CUTENEWS!



DJ=Ice
02-11-2005, 06:23 PM
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:



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

Lysine
02-11-2005, 06:32 PM
That looks good but i have not tried it. + Rep.

DJ=Ice
02-11-2005, 06:53 PM
thnx, jus here to help people! lol. Anymore people like?

splintercell!
02-11-2005, 06:55 PM
Is this tried and tested because imo it wouldnt work..

GommeInc
02-11-2005, 06:57 PM
Wouldn't all DJs need to have access to that page which then makes it a security risk...

DJ=Ice
02-11-2005, 06:59 PM
ain't that the whole point, DJ's have access to a DJ message page so they can leave a message? and lemme check wether it works.

just found out, think you need to create the testFile.txt in the same directory then let it create it itself. and chmod it to 666. tht should work, if it don't say. plus I made it and it's fine on www.habbocentre.co.uk so dno what ya on bout

splintercell!
02-11-2005, 07:01 PM
I doubt it does because 1 it would just show all the messages.. you would need to put it in an array etc not just use include();

nelly
02-11-2005, 07:04 PM
Lol i tried it and it doesn't show the message anywhere

Dan Williamson
02-11-2005, 07:05 PM
I agree with Splintor on this one.

It doesn't look as if it's going to work.

I tested it on my tryout site and nothing happened except some weird error "/

- Dan

DJ=Ice
02-11-2005, 07:07 PM
OK, one, I'm not stupid I have thought this over. IT OVERWRITES THE MESSAGE. THATS WHAT FOPEN WITH THE W FUNCTION DOES! Jeez, splintercell all u do is complain about everything and everyone except ya self.

Dan Williamson
02-11-2005, 07:09 PM
I disagree, Splintor gives what any good and cool webdesigner does.

He gives constructive criticism and also tell people if something won't work, and as you can see he has fluent knowledge of webdesign MySQL/PHP as he has a really good site and deffo knows what he's talking about so don't have a cry if he just says that it's wrong "/

- Dan

nelly
02-11-2005, 07:10 PM
now your just ****ing up to him :/
I disagree, Splintor gives what any good and cool webdesigner does.

He gives constructive criticism and also tell people if something won't work, and as you can see he has fluent knowledge of webdesign MySQL/PHP as he has a really good site and deffo knows what he's talking about so don't have a cry if he just says that it's wrong "/

- Dan

DJ=Ice
02-11-2005, 07:10 PM
I've just write a new DJ Message and it overwrite it fine. Plus them codes are copied form my files so it must work and Dan, what error message u getting?

Oh and I just gone through ti ma self and it works like a dream. The djform.php is where they put the message and the formatted djmessage.php is where the message is displayed.

It overwrites the message everytime which is what the fopen function does when suing the w function it provdes.

Notice?

<?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); ?>


the 'w' means it will overwrite it and the fopen actually writes it. trust me it works.

Dan Williamson
02-11-2005, 07:12 PM
I've just write a new DJ Message and it overwrite it fine. Plus them codes are copied form my files so it must work and Dan, what error message u getting?

Some weird one, do you have to CHMOD them?

And Nelly i'm not Súcking up. I'm merely agreeing, i don't súck up as i don't really care what people think or do i just agree with what i think is write "/

- Dan

nelly
02-11-2005, 07:13 PM
you have to CHMOD textFile to 666
Some weird one, do you have to CHMOD them?

And Nelly i'm not Súcking up. I'm merely agreeing, i don't súck up as i don't really care what people think or do i just agree with what i think is write "/

- Dan

Dan Williamson
02-11-2005, 07:14 PM
I've just write a new DJ Message and it overwrite it fine. Plus them codes are copied form my files so it must work and Dan, what error message u getting?

Ok DJ put on the DJ screen, something like this.

Members of Habbox, this DJ system works.

Just so we can prove, as i have no FTP on my test host so i can't CHMOD "/

- Dan

splintercell!
02-11-2005, 07:16 PM
THe only problem really if how you displayed it.. instead of including it you need to do it the proper way and it will probably work then "/

DJ=Ice
02-11-2005, 07:18 PM
what u mean the proper way. theres nothing wrong with the include bit is there, it overwrites fine. what other way is there to display it, plain text? lmao

Dan Williamson
02-11-2005, 07:18 PM
I don't know if this is anything but on test.php all i can see is this "/



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana;
font-size: 9px;
color: #0000FF;
}
body {
background-color: #ffe7ad;
}
-->
</style></head>

<body>
DJ Ice Says: There is No DJ Online

</body>
</html>

DJ=Ice
02-11-2005, 07:22 PM
Yes because thats the message it's written to it. And then thats how it will display.

Dan Williamson
02-11-2005, 07:23 PM
Ahhh Ok, i'm not a PHP master so i don't fully understand it.

- Dan

DJ=Ice
02-11-2005, 07:26 PM
no prb lol. In PHP it's different to html, I mean if u look at the source code for the site stats on my site it comes up as if I've typed in all different numbers. PHP translates into normal, so u don't see it, lol.

Dan Williamson
02-11-2005, 07:27 PM
Yeah i know that, but i'd have though like with cutenews you would have been able to see some of the PHP format "/

- Dan

Seacat
02-11-2005, 07:28 PM
Wow.. Wouldn't it be so much easier just to stick with CuteNews..? :s

Dan Williamson
02-11-2005, 07:29 PM
Lol Ash, i'd have thought so, not like i'll ever use this script or DJ says "/

- Dan

Rebecca
02-11-2005, 07:31 PM
LIES!!!!! Dan (l) Stace <3

Edit by Seacat - Please do not make pointless posts

DJ=Ice
02-11-2005, 07:32 PM
Well no not really, because cutenews one is harder to setup and theres a massive security risk, u can press tab and it takes you down to the Form! so cutenews is tubbish lol. CuteNEWS, recognise the news, coz it's what it's mean't for not CuteDJSAYS, lol

Seacat
02-11-2005, 07:36 PM
Well you kind of proved yourself in this thread that it's easier just to use CuteNews. Also I don't see what the 'NEWS' bit has to do with it, it's like saying you shouldnt use 'cuteNEWS' to write articles, even though plenty of people do it - People just use it for the purpose it serves.


Well no not really, because cutenews one is harder to setup and theres a massive security risk, u can press tab and it takes you down to the Form! so cutenews is tubbish lol. CuteNEWS, recognise the news, coz it's what it's mean't for not CuteDJSAYS, lol

Dan Williamson
02-11-2005, 07:39 PM
Lol Cutenews is used for a variety of different purposes, and also even if it is a security risk, yours is a security risk i presume, as they'd probably have to have access to part of your main cPanel which is really dangerous as they could hack it "/

- Dan

DJ=Ice
02-11-2005, 07:39 PM
no but, if people do it correctly then it works, as I have done it. Or if people search the net and bother to learn they can get a proper tutorial to then teach others how to do it, bit in a slightly less professional way.

How would they have to access cpanel, they type the message into the form on the web. What includes cPanel in that......

Dan Williamson
02-11-2005, 07:48 PM
no but, if people do it correctly then it works, as I have done it. Or if people search the net and bother to learn they can get a proper tutorial to then teach others how to do it, bit in a slightly less professional way.

How would they have to access cpanel, they type the message into the form on the web. What includes cPanel in that......

Ahh, i didn't read it properly, i just skimmed the bit about the form "/

Sowwie :)

- Dan

nelly
02-11-2005, 07:58 PM
:D i got it working well Ice did cheers ice :) (nick)

DJ=Ice
02-11-2005, 08:05 PM
If it's such a bad tutorial (btw I'm not so good with tutorials) then PM me and I'll PM you back with all the needed files, plus I'll customize it to your needs and it will be free.

splintercell!
03-11-2005, 07:53 AM
For anyone it really use it though you would need to protect the submission form etc which isnt too hard..

---MAD---
03-11-2005, 08:12 AM
you could password protect the page?

Or even use mysql database for logins ..

splintercell!
03-11-2005, 04:33 PM
it would be quite easy really.

Silent
04-11-2005, 02:49 AM
Couldn't it be exploited in some way as people will be able to type html/js etc.. ?

splintercell!
04-11-2005, 08:02 AM
Quite easily he hasnt bothered to stop any of that although you can use html and js in cutenews... "/

SamMaddock
27-11-2005, 02:10 PM
Jeez, DJ=Ice has written everything for the DJ message to help people, and you know what, its helped me. Just because he forgot to say "Remember to Password Protect The Area', everyone makes mistakes. And anyway, its better what any of you could do.

:Lively
16-01-2006, 08:21 PM
what would i change if i just wanted it to add to the testFile.txt and then not remove the previous one when a new post is made

DanWilliamson
16-01-2006, 08:33 PM
Hey,

Why did you bump an ancient thread?

- Dan

:Lively
16-01-2006, 08:42 PM
dunno lol, jus thought this wud b da place 2 find out how 2 get mi problem solved

dani342us
16-01-2006, 08:51 PM
=O im talking to ice

timROGERS
16-01-2006, 09:02 PM
That would never work lmao! It calls the variable "$message" which was never defined!

dani342us
17-01-2006, 02:52 AM
yeah, it works. I just got it working so yall dont be going on this guy but saying something bad lol. It works perfeclt.y AWESOME

Splinter
17-01-2006, 08:01 AM
well his method is a load of ******** "/ dont use it..

:Lively
17-01-2006, 04:00 PM
dats nice, but i still dunno how to actually do it lolz

:Blob
17-01-2006, 06:21 PM
now your just ****ing up to him :/

Bit like you

Nick.
17-01-2006, 07:13 PM
1. That was when I was first started learning PHP. 2. I've built a 500000000000000000000000000 times better one using MySQL databases. Plus it's fully protected by Sessions

:Lively
17-01-2006, 08:24 PM
can you give it to me plz, or if not offer any tutorials i could use to develop my php/mysql knowlege and make what i want

dani342us
17-01-2006, 10:12 PM
ill help yall out it worked for me for habpagefm.net, its right under the main iframe. Anyways if you want it just f/r me and ill make it for ya or tell you how for a certain amount of furni, not alot. Just norms ;]

dani342us
05-02-2006, 02:50 AM
Oh yeah it works. Want proof? Want me to get it working for you? CONTACT ME

Mentor
05-02-2006, 03:11 AM
I cant see any techical issues in the script, other than it not be secured no way of logging who does what etc, plus would need a input into direct veraibles confgured in the php ini file.

Althogh dosnt seem practial, cant see what use it would be realy, rather than randomly refreshing, Just a securty risk, little else

:Edzy
05-02-2006, 08:01 AM
well done, i like it but it would be better as a mysql login 1 ( not being rude )

Nick.
05-02-2006, 10:26 AM
1. That was when I was first started learning PHP. 2. I've built a 500000000000000000000000000 times better one using MySQL databases. Plus it's fully protected by Sessions

Yeah, I'll do a tut on a MySQL database one today.

By the way, Ive been thinking, are cookies better then sessions?

dani342us
05-02-2006, 03:25 PM
Good thing for this is that no mysql is needed plus if you yall want ill make you guys a PHP password security :].

Flisker
05-02-2006, 08:16 PM
Why has he been Deleted for :S

dani342us
05-02-2006, 09:19 PM
Huh? what you mean.

Dakara
05-02-2006, 09:24 PM
I can't remember the time when you had to do Dj-Says *WITH* CuteNews?

dani342us
06-02-2006, 12:59 AM
Its The Future Man. Times has changed so much.

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