Journal #7765

Posted 11 years ago2012-04-30 10:47:28 UTC
Striker StrikerI forgot to check the oil pressure
My first PHP page! I am so happy I succeeded in making a simple, but functional comment system using php and mysql :).

Here's the page

Leave a comment! :D (also, try telling me here too that you left a comment, somebody is playing with it...)

[EDIT] As my website uses the co.cc domain, some stupid antivirus software might tag it as a potentially dangerous website. Yeah sure, like some basic php code can do any harm. You can safely ignore your antivirus warning.

[EDIT2] Added time and date!

[EDIT3] Thank you Daubster for the <div style="clear: both;"></div> tip!

28 Comments

Commented 11 years ago2012-04-30 11:16:12 UTC Comment #57968
Left 3 comments. My first one didn't get displayed though because of the way I navigated away from the "Congraturations" page. :|
Commented 11 years ago2012-04-30 11:20:12 UTC Comment #57977
And how did you navigate away? :|
Also, it seems that writing a single apostrophe returns an error. Writing two apostrophes returns one apostrophe. Similar situation with "\" on TWHL ...
Commented 11 years ago2012-04-30 11:30:16 UTC Comment #57978
<table border="1">
<tr><td>Do</td><td>Tables</td></tr>
<tr><td>Actually</td><td>Work?</td></tr>
</table>

I can''t believe this. They work! :o


Nah, this doesn't work on TWHL :D.
Commented 11 years ago2012-04-30 12:01:57 UTC Comment #57989
Umm you might want to check for empty fields and display an error if that occurs.
Commented 11 years ago2012-04-30 12:01:59 UTC Comment #57974
Start by stripping malicious script tags from the comments. ;)
Someone could have plugged something a lot more dangerous (like stealing user session data).

Other than that - good job!
Commented 11 years ago2012-04-30 12:06:35 UTC Comment #57972
Weird, my antivirus blocked your site :P

It says:
"The web page is on the list of websites with potentially dangerous content."
Commented 11 years ago2012-04-30 12:06:36 UTC Comment #57990
Use mysql_real_escape_string(); and preg_match(); to check for "bad letters"
Commented 11 years ago2012-04-30 12:08:17 UTC Comment #57979
"On the list"- what? I only just put the page online. Your antivirus lies to you :P.
Commented 11 years ago2012-04-30 12:48:59 UTC Comment #57980
Ok, I added mysql_real_escape_string() and htmlentities() :).
Commented 11 years ago2012-04-30 13:11:13 UTC Comment #57973
That's why it's weird. It's blocking the entire co.cc domain. Odd.
Commented 11 years ago2012-04-30 13:15:45 UTC Comment #57969
Oh shit son. You on the list. D:
Commented 11 years ago2012-04-30 13:32:35 UTC Comment #57981
I was thinking about switching to the .free domain, but I don't want to over complicate myself now. I use Avast! and it doesn't say anything about the co.cc domain( btw co.cc is very popular, I don't understand why would your antivirus block it... what antivirus are you using?)

[EDIT] Made the div blocks colored differently.
Commented 11 years ago2012-04-30 14:08:04 UTC Comment #57971
Huh, my AV blocked it as well.
Commented 11 years ago2012-04-30 15:14:03 UTC Comment #57982
Added captcha. No spamming anymore :).
Commented 11 years ago2012-04-30 15:25:53 UTC Comment #57991
Captcha's are obsolete against bot-spammers believe it or not, better add a random math question :D
Commented 11 years ago2012-04-30 15:59:10 UTC Comment #57983
Against amateur spammers it's super efficient.

[EDIT] I accidentally the whole comment system. I don't understand this, I tried making the comment boxes square and float them all to the left. Now they all get out from the initial div block, why does this happen?
Commented 11 years ago2012-04-30 16:02:31 UTC Comment #57975
clear: both;
is your friend. Use it for the div containers.
Commented 11 years ago2012-04-30 16:11:16 UTC Comment #57984
No, I'm not trying to stack them vertically. The way they're arranged is the expected result. What is unexpected is that the same div block where it's written "comments" is the parent of these boxes, but it doesn't extend in the background!
Commented 11 years ago2012-04-30 16:14:19 UTC Comment #57976
Add a <div style="clear: both;"></div> under all the comment containers before the main wrapper ends.
Commented 11 years ago2012-04-30 16:40:11 UTC Comment #57985
Yes, that stacks them vertically. I don't want that.

[EDIT] Meh, reverted to normal vertical stacking, without float. I bet if I'd use tables though it would work the way I want.
Commented 11 years ago2012-04-30 17:21:23 UTC Comment #57970
Another fun project is to make an active web chat with an ajax script. You basically make the script send a request for messages newer than your last update time every ~second, and if the request comes back with something in it the message is appended onto the end of the chat window. It's a pretty cool project to see work, and a good extension to your project if you're interested. :P
Commented 11 years ago2012-04-30 19:53:59 UTC Comment #57994
Nice, grats. But line breaks don't work. They're not hard to look for.
Commented 11 years ago2012-04-30 20:24:47 UTC Comment #57993
Even has captcha. Colour me impressed.
Also, I put my captcha results in my comment.
Commented 11 years ago2012-04-30 21:50:07 UTC Comment #57986
For whoever requested I add time and date: mission accomplished!
Commented 11 years ago2012-05-01 18:39:01 UTC Comment #57995
OH so you also moderate the spam? Too bad. I thought it was a perfect addition for this sort of page.

Also, I'm looking at a captcha that is a photo of something rather than scanned text.
Commented 11 years ago2012-05-01 20:27:02 UTC Comment #57987
Yeah, but if you don't understand the current one you can just hit refresh to get a new one...
Commented 11 years ago2012-05-02 03:26:44 UTC Comment #57992
You could try and create your own captcha by using sessions and gd :)
Commented 11 years ago2012-05-02 18:01:32 UTC Comment #57988
Hmm, actually that's a good idea. A simplified system of approving an easy math calculation can be a great replacement for reCaptcha I guess...

You must log in to post a comment. You can login or register a new account.