Jump to content


Photo

Evaluate my blog


  • Please log in to reply
12 replies to this topic

#1 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 04:25 PM

I would like to receive some feedback from you guys, but unlike other people i don't have a DNS and would like keep my address hidden + I haven't implemented a javascript function yet to restrict the comment size and some other vulnerabilities

My source code is also published on SourceForge and I've included a README.pdf file for people to see the infrastructure of my page. Btw i forgot to give a legend on how to interpret the pdf: Blue circles and Black lines - Visible to anyone, Red Circles and gray lines - only to admin, Circles with no outline: frontend, Circles with outline: backend.

I would like to receive feedback from these points of view:

- web-site organization
- my PHP scripts organization
- scalability of the system
- security
- functionality
- some feedback on my design is not necessary but feel free to comment...I'm not a web designer, i actually ###### at designing web pages.

The website hasn't got much content. This is a small web-site... it only has 19KBs of code in 10 files (images not included)

If you are really bored (or kind or both), PM me and I will send you my sourceforge project link and my website link.

I'm mentioning that I just started learning PHP and javascript and css in the middle of September (2 months ago), so I'm not actually very experienced.

Edited by KingA, 20 November 2010 - 04:26 PM.


#2 thescientist

thescientist

    Likes gettin' it on!

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,363 posts
  • Gender:Male
  • Location:Rhode Island, USA
  • Interests:Music, programming, computers, web design, business, books, and politics.
  • Languages:HTML/CSS, JS, PHP/MySQL, XML, bash, SVN/Git, Java, Python

Posted 20 November 2010 - 04:33 PM

maybe just a live link when its done would be appropriate?
myTunes: www.analogstudios.net

my {...} code {...} works in all the decent browsers. This of course means that it does not work in IE.


#3 boen_robot

boen_robot

    XSLT senior

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,486 posts
  • Gender:Male
  • Location:europe://Bulgaria/Plovdiv
  • Interests:Everything having to do with computers... and science.
  • Languages:(X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based...

Posted 20 November 2010 - 04:38 PM

Why the secrecy? Either give an actual link along with the "spec", or give the source code pieces you're having doubhts about, and we'll see how we can improve them.

That or... hmm... you know what... I think for a (hopefully small) fee, vchris will review everything you have, giving you detailed diagnostics on it... well... he once had this idea at least.

I once read something in an installment of BOFH: Security is a journey, not a destination.

So... help us get on the journey, don't try to teleport us to your destination.
The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a4) - reliable sockets.
PEAR2_Cache_SHM(0.1.2) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.

#4 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 04:49 PM

Well ok...If you don't feel comfortable like this :).

http://89.115.144.183/blogger/

https://sourceforge....ects/kingablog/







BTW: RICK ROLL'D

Edited by KingA, 20 November 2010 - 04:50 PM.


#5 boen_robot

boen_robot

    XSLT senior

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,486 posts
  • Gender:Male
  • Location:europe://Bulgaria/Plovdiv
  • Interests:Everything having to do with computers... and science.
  • Languages:(X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based...

Posted 20 November 2010 - 05:21 PM

Few things...

1. On SourceForge's "files" section, you're supposed to put different releases or modules for your applications in downloadable forms. In other words - you should put the whole thing into an archive file. You should not make your users (us included) download all required files separately.
2. To make the source codes viewable on site, as well as enable yourself to jump between different states of the code, use the SVN services. This may be a lot to handle now, so don't feel obligated to do it for now. Just keep it in mind.
3. Your comments posting script is waaay too restrictive. There's no way for me to write an angle bracket. What if I wanted to say "<3"? See? I can't show you love even. Escaping HTML special characters is a good idea, but not eliminating them.
4. Not only are you not letting me post a second comment (I guess that's acceptable to avoid double posting, as long as there's a way to post again when someone else has posted after me), but you're not letting me modify my name AND you're still outputting the new post form. I wouldn't want to bother (re?)typing something only to find out I can't post it. Directing my attention directly to the "You can't post, modify instead" message is probably a better idea.
The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a4) - reliable sockets.
PEAR2_Cache_SHM(0.1.2) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.

#6 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 05:57 PM

what's the function that converts escape characters into their codes (like in your case > to &lt; )

I tried using SVN and GIT but they are too much for me (i don't really get it on how to use them, although i'm very familiar to Git)

Edited by KingA, 20 November 2010 - 06:02 PM.


#7 boen_robot

boen_robot

    XSLT senior

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,486 posts
  • Gender:Male
  • Location:europe://Bulgaria/Plovdiv
  • Interests:Everything having to do with computers... and science.
  • Languages:(X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based...

Posted 20 November 2010 - 06:00 PM

htmlspecialchars()
The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a4) - reliable sockets.
PEAR2_Cache_SHM(0.1.2) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.

#8 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 06:12 PM

Ok... in what order should i use strip_tags and htmlspecialchars so no1 can use html tags but still be able to input < or >.

I have a feeling if I use htmlspecialchars, an input like "<img src=... >" would be converted to "&lt;img src=..." in the plain text that i have stored in db. I want all < > html tags to be stripped but the < > characters to stay, like this "<strong>text</strong>" would be "text" and "<3 3 is > 5" should be "&lt;3 3 is &gt; 5" in my database.

I uploaded the whole .rar archive

Edited by KingA, 20 November 2010 - 06:14 PM.


#9 boen_robot

boen_robot

    XSLT senior

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,486 posts
  • Gender:Male
  • Location:europe://Bulgaria/Plovdiv
  • Interests:Everything having to do with computers... and science.
  • Languages:(X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based...

Posted 20 November 2010 - 06:18 PM

Why?

There's no problem in displaying full HTML as plain text. Look at your very post as an example. If the forum wasn't secure, it would've made your text strong. Instead, it just displays the "<" and ">" as plain texts.

Just scrap the strip_tags() function, and use htmlspecialchars() instead.

I've downloaded the archive, and on first sight, I noticed one very important detail - you're constantly reconnecting to the database and selecting it, writing it in every file... consider placing the DB data in a separate file, which you then include everywhere else. Also, you're casting several queries when displaying posts - one for each column. Consider conbining all of those in one query call.
The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a4) - reliable sockets.
PEAR2_Cache_SHM(0.1.2) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.

#10 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 06:35 PM

Why?

There's no problem in displaying full HTML as plain text. Look at your very post as an example. If the forum wasn't secure, it would've made your text strong. Instead, it just displays the "<" and ">" as plain texts.

Just scrap the strip_tags() function, and use htmlspecialchars() instead.

I've downloaded the archive, and on first sight, I noticed one very important detail - you're constantly reconnecting to the database and selecting it, writing it in every file... consider placing the DB data in a separate file, which you then include everywhere else. Also, you're casting several queries when displaying posts - one for each column. Consider conbining all of those in one query call.


I would've considered using mysql_fetch_assoc if i would know how to jump on the next row (using mysql_result is easy)

#11 boen_robot

boen_robot

    XSLT senior

  • Moderator
  • PipPipPipPipPipPipPip
  • 8,486 posts
  • Gender:Male
  • Location:europe://Bulgaria/Plovdiv
  • Interests:Everything having to do with computers... and science.
  • Languages:(X)HTML, CSS, XML, XSLT, Schema, PHP, JavaScript (a little), other XML based...

Posted 20 November 2010 - 06:37 PM

Every next mysql_fetch_assoc() moves to the next row. See the manual:

Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead.


The greatest difficulty in programming is not in finding answers, but in asking yourself the right questions. -- If nobody has said it before, then I'd like to take credit of thinking this up (during summer of 2010).
"Complex problems often have the simplest solutions" -- Not sure who said that first.
=== My projects (all feedback welcomed) ===
XML_XSLT2Processor(0.5.3) - perform XSLT 2.0 transformations in PHP.
PEAR2_Net_Transmitter(1.0.0a4) - reliable sockets.
PEAR2_Cache_SHM(0.1.2) - persistent data storage wrapper.
=== Useful tools ===
NetBeans - full featured PHP IDE, as well as a decent code editor for other things.
Fiddler2 - The best free HTTP debugger. Performance tuning, security check, integrity check, custom requests and more, all made easy.
Gobby - That's NOT my Nickname! Look at the topic.

#12 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 20 November 2010 - 06:45 PM

internal data pointer.... I KNEW it.... i just never tested it... all my code is written with mysql_result omg -.- there's so much stuff to change/update... idk if i have the patience to do it right now.

But every project i make will go to my portfolio and I have to change this if I want to get in front of others at a job position.

#13 KingA

KingA

    Member

  • Members
  • PipPip
  • 107 posts
  • Gender:Male
  • Location:Romania
  • Languages:XHTML, CSS, JavaScipt with AJAX, PHP, MySql

Posted 22 November 2010 - 08:55 PM

So can any1 inspect my code? is it good? I know it works, but i wan't to know if its efficient and well organized. That's what I want to hear :)

Ok, i know it's not exactly well organized, so I could use some advice.

I've updated the archive. I've replaced all mysql_result functions with mysql_fetch_assoc (well not every function) and i've added a 2000 post size limit.

Edited by KingA, 22 November 2010 - 11:33 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users