Page 1 of 1
Dynamic Website - help
Posted: Thu Dec 08, 2011 11:30 am
by Fonis
Okay, so i just started reading about php, javascript and mysql, and even though i've read every single guide at the w3schools.com about these 3 subjects, i just can't seem to get the hang of it. Now, what i want to do on my website is to make it possible for the users to login and write an article, and to make it possible for other users to comment on this (yes, it's like a forum but build up differently!). I also want to make it possible for an admin to change the front page, without letting the common users do it.
I know it's a lot of things, but does anyone of you know a guide/tutorial to do this. I've searched the web for 1-2 hours, but it's really hard for me to come up with the right keywords.
- thanks in advance

Re: Dynamic Website - help
Posted: Thu Dec 08, 2011 11:33 am
by Celauran
Re: Dynamic Website - help
Posted: Fri Dec 09, 2011 2:08 pm
by Fonis
Okay, so i learned some about login/register. But what if i want to make the website like anyone can see all the content, but only people who's logged in can write some new? Should i just for example make a button named "write content" that links to a part of the website that only people that are logged in can visit? And how can i then make a textfield that will post to a certain part of the site?
Re: Dynamic Website - help
Posted: Thu Jan 26, 2012 4:11 pm
by Slason
I suggest you try dreamweaver. It generates all the code for you, and makes learning making dynamic websites more fun. When you are done with the functions of dreamweaver, read the code, try to tweak it arround etc : )
Re: Dynamic Website - help
Posted: Thu Jan 26, 2012 5:41 pm
by flying_circus
Fonis wrote:Okay, so i learned some about login/register. But what if i want to make the website like anyone can see all the content, but only people who's logged in can write some new? Should i just for example make a button named "write content" that links to a part of the website that only people that are logged in can visit? And how can i then make a textfield that will post to a certain part of the site?
What you are describing is absolutely doable in PHP. I will admit, it is quite an ambitious project for a beginner, but there is only 1 way to learn.
Rather that making a button that links to a restricted area of the website, simply dont make a button at all, if the user is not logged in:
Code: Select all
<?php
# Psuedo-Code
if($user->logged_in()) {
print $button;
}
?>
You will need to use a database to manage things like locations of a post, who the poster is, and who the post belongs to. You can use a database to set permissions of an article, as in, is the article public or for paying customers only?
Security it a tough topic in PHP when you are new. Ilia wrote a good book with some general security guidelines, here is a link:
http://www.phparch.com/books/phparchite ... -security/
Be patient and think everything through. Building a secure website in PHP is hard.
I would also tend to disregard the suggestion to use dreamweaver. It is a fancy tool that does nothing well. I used it extensively when I began writing php until I discovered alternatives. PhpED is now my editor of choice.