Path to web development [duplicate] - php

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Where can I learn web programming from start to mastery?
I want to be able to make websites like facebook, youtube and google (and even stack overflow!), can someone suggest a step by step guide (as best as you can, if even for part of the way) and not just "Do tutorials and make websites".
I can't go to a we design company and tell them "I'll learn while making sites", or make a website for a client and it ends up being full of holes and security issues.
I'm interested in PHP as opposed to other types, but i'm open minded.
Your help is very appreciated.

Someone here offering a "step by step guide" is essentially the same as offering a tutorial, but with way more work involved.
The reason everyone on here says "here's a starting guide, go try it" is that that's how most of us learned, especially php.
So, this is exactly the answer you asked to not receive, but the absolute best method for learning is to have a goal in mind, and then build it.
Can you comment on this answer with a small project in mind? I'd be more than happy (or maybe other people too) to help get you started. But, I cannot tell you how to rewrite StackOverflow. I doubt the answer would fit in this text box.
Come back with "I want to rewrite Digg" or "I want to share recipes with friends" or something like that, and we can help you.
Edits based on comments below.
If you want to make a site like Craigslist, let's focus on one area for now.
Plan it out. What does your final product look like? Remember, you don't want replication of data, so think about what groupings of data you'll need. Things like categories, users, and posts, if we're keeping it simple.
You'll need to create a CRUD (Create, Read, Update, Delete) for each data group. This is a place to create categories, users, posts, view them, edit them as needed, and remove them.
You'll also want to connect these things together. So, for example, in a table of posts, you'll want a field called category_id or something, with the row id of said category. Then you can easily link posts to categories, view all posts in a category, etc.
What is your understanding of connecting to a database, retrieving results, etc? If this is completely over your head, I would definitely advise getting a book like the other answer suggests.

I think one of the best tools for learning PHP is the actual documentation. It is probably the best documentation for any language out there.
You can also go for books.

Related

How would you do in order to have buttons on wordpress page/post that permit to add it to one user profil [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am bulding a website for a project and I want to implement a fonction but I can't seems to find a way to do it.
The principe would be to have on each page one button that, when one particular user click on it, it then add it to his profil page ( that I will build) with the title of this page and an hyperlink to it.
The goal here is to have some sort of activities and the user click on the ones he want to do and then it show a "to-do" list to its profile page.
If you have any clue where to start, through a plugin or coding, I will really be thankful.
Have an awesome night and thanks in advance for the help
Edit :
Hi guys, I am really thankful for your answers and I just want to add some details as I as indeed not so explicit in my description ( the fact that english is not my language played a role too, sorry about that)
I already looked up on internet for hours and didn't find anything. Like Fergus said, I am not familliar with wordpress dev this deep. I basicly know how to add plugin, edit some easy php to make them work with my website if required. I am more business oriented but I have bases in dev in php, jquery/js, and litle bit in ajax.
My goal here was more to build an Minimum viable Product in order to make an "exemple" in order to look in the futur for a technical co-funder so I don't really mind if this is not very clean code.
I started reading the wordpress documentation, about the loop, the hooks, php file, template etc... So here is my technical level ;)
I really appreciate your answers and will try to work with what you wrote Fergus. This is a good start and I actually have a place to start learning know. thanks a lot
Full disclosure: I wouldn't generally answer this type of question as it's incredibly broad and seems to possess very little information; where more is required to truly answer it. However, it got me pondering something I've been wondering about and I've answered it anyway.
In future try and put some more information in your questions, tell us what you've researched and what you've tried and so on. Nobody wants to spend time writing out an answer to someone who wont even do a a quick Google search themselves!
Breaking it down
You need to provide some clear requirements - if you have any that is. If you don't have any, then you need to think of some. For example, from breaking down your post the obvious requirements are:
You need to... display a button on each page
You need to... store data about a users selected pages
You need to... retrieve pages associated with a specific user
You need to... display those pages on the users profile
Displaying a button
Have a button in the template; with an associated jQuery event handler for it? This isn't an elegant solution as it mixes logic with the view - making future maintainability and design changes a pain.
In which case, I'd begin looking at Wordpress Plugin Development - with the first requirement of the plugin to simply display a button - as well as output the required jQuery event handlers.
For implementing this you could look at existing plugins; easy things like source code viewers would show you how to inject scripts and mark-up into a page. Hell, any plugin should be able to show you how to do this!
Storing user data
This will have to be done in the wordpress database. So once again you could look at other plugins that conduct database operations and build a solution from there; or you could check out the wordpress plugin 'Function Reference' and set about 'hacking something together'; it's probably best to see how others achieve it first though.
This part of your plugin literally just needs to take the page and the user, that's all that really needs to be done.
Retrieving pages associated with a user
Ditto the above. You need to be able to take a username or user ID and return the specific pages that this user has clicked on. This could almost be described as just the above in reverse; similarly - bare this in mind when implementing it!
Displaying the data to a user
Think back to the first requirement: displaying a button. You need to be able to output specific data to the screen. The lessons learnt from here will come in very useful again.
So... With this in mind
You now have to consider what tools you're working with and how confident you really are. I get the impression you haven't worked with Wordpress before at this level - but have you worked with PHP? jQuery/Javascript? Do you have an understanding of MySQL and the way Wordpress stores data in databases?
Then condense what I've said above and find out:
How a plugin displays data in a Wordpress Page.
How a plugin can interact with the database.
In the Plugin API you may want to examine Actions as these appear to provide a wrapper for the core functionality of your plugin. Similarly, examine the available Hooks and determine when which part of your plugin is required to run.
As for database interaction? The Wordpress Documentation has pretty extensive information on this too.
There are plenty of documents online about plugin development; and this one details how to modify HTML output using filters. A quick google will probably provide you with 95% of what you need to know, the other 5% could probably be gained with a pen and pencil and a 10minute brainstorm.
In conclusion; break down your requirements in to easier chunks and do some research to see how these bits can be achieved. Then plan on how to integrate it all together as one package. It's too big a question to provide a whole answer to.
I will confess to never having developed a plugin myself, but I'll link you to the seemingly brilliant documentation for it. Similarly, if you haven't worked with jQuery before - here's the $.ajax() method documentation.

how to add comments to website

In an effort to give a website im working on more functionality, im wanting the ability for readers to post comments/thoughts to the stories they read.
any ideas the best way to go about this?
ive tried Google but the minute i add the word "comments " + html or php etc (assuming i can do it in these languages) then google just gives me methods to commenting on code....
Any ideas, tips, tutorials etc ill gladly jump on.
Thanks in advance
-somdow
Well the most popular embeddable comment system is probably Disqus. Besides that you will have to look if there are plugins for your framework of choice - or just roll your own (a comment system is basically just like any other database backed PHP application - and there are many ways to implement these).
Why not just look at how popular content management systems have implemented comments? (For instance, take a look at how Drupal and Wordpress do it.) The manner in which you build a comment system will depend on your needs and the limitations imposed by the structure of the system you're trying to integrate it with.
You should work out your database schema first. I'm assuming you're writing all of this from from scratch. You haven't given a lot of details.
It will be easier if you put your comments in a separate table. Make sure you have some basic protections against bots(captcha, etc.)
Sort the results by the timestamp.
comments_table
Id
UserId
UserDisplayName
ArticleId
Comment
PostTime
Disqus is nice, I must say. If you want code that you want to copy/paste, Google Friend Connect is a different route you can take... Almost everyone has a google account and it only takes a few minutes to set up. They also have some sweet other widgets you might want to try out like rating, etc.
http://google.com/friendconnect
If you really want to customize it just how you want it, I would create your own commenting system with a MYSQL database to store all your data. You could even use some nice jQuery animations when they write / delete a comment. (I just did something simular to that and it's really nice).
Whatever works best for you -- roll with it!
Good luck,
Coulton

How to Build Basic "To-Do" list style Website

I am trying to create a website that will allow me to list all of the different types of beers I have tried including name, type, location, and brief tasting notes. I have a basic login created and believe that I will have to store the information about the beer in a database as well (with a cell for each of the elements). I was wondering a) if this is how people would suggest going about doing this and b) if anyone knows of good tutorials on how to set this up. I plan on using mySQL and PHP for the database and jQuery for the visual side of things. I am relatively new at this, so I am having trouble figuring out what exactly to Google to find what I am looking for.
I plan on going about it similar to a to-do list (only each element would have multiple attributes — name, type, etc.). Any help/suggestions/direction would be awesome! Thanks!
First off you need to decide on the features you want to implement, and then work out which to do first.
For example,
you need a database, which has a table for your beer info. (but do you need another one for people to have a user account too?)
you need to create a set of functions that you can access from the web site.
list beers
add beer
etc.
How do you want the front end to work?
How do you want the front end to look?
Once you know exactly what you want to do, it's much easier to break down the tasks into jobs you need the application to do.
I'd also suggest you look at Ruby on Rails (especially + the Hobo addon) to get you up and running faster (instead of PHP) - if you are set on PHP, have a look at CakePHP or another similar framework, so that you don't end up re-inventing the wheel.
Update:
Once you get started, further more detailed problems will be faced, many you can get a quick answer from google or the documentation for the language / database etc. If something is extra tricky, post another question on StackOverflow.
As it is your question is too general for a more specific answer, but if you need any additional info, just yell.

database design: best practice for designing a forum table [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I wonder if there is any practice when designing a forum. I want to design a couple of forums. yes there are two different types of forum at least. one is for a selective members and another is open for any public members.
In the forum, the member can initiate a thread, then other members can respond to it.
So I have this rough idea for the structure of this type of forums.
I'd name the forum table as 'strings' table. this is the structure I can think of,
str_id for the auto increment id
str_tilte for title of the thread
str_content for content/ text of the thread
str_follow for you to choose whether you want to follow this thread or not
str_approved for the admin to approve or reject the thread
parent_id*1
mem_id member id who initiates the thread or who responds to the op
cat_id*2
str_created
str_updated
*1 eg. if the data injection is an op thread then the parent id is itself, if the injection is a response to the op, its parent id is the str_id of the op.
*2 this column is to store the category id of the current data injection. if the injection is a selective forum then it is 1, if the injection is public forum then it is 2.
not sure if I am on the best track, but please let me know if you have any better ideas.
thanks.
edit:
thanks for some reply and suggestions that using phpbb.
just had a look and downloaded phpbb. it is 101% sure that I won't go for it. it is a whole programme like Wordpress or any other PHP frameworks (like Zend). I have an independent framework running this website, so I don't want to run another programme/ framework to mess up the site's backend structure, etc.
if I the site is only a pure forum website, then maybe I would be considering phpbb. but the forum is just a sub feature of a holistic website in my current project.
Don't start with a table, start with a conceptual ER Diagram of your base entities, forums, threads, replies,members, keywords, categories etc. and express the relationships first.Then get into logical design mode and define the tables needed to implement the functionality. As suggested have a peek at the way phpBB tables are organized.
I like to do my first diagram on a printing whiteboard or on paper then move to a diagramming tool for logical design.
I think there's still some room for a 'better' forum, so good luck.
Greetings.
As i previously recommended in comments to your question.
I strongly recommend you to set up local installations of other open source database driven forums in your machine, in order for you to have a strong idea and base of what other developers did when they develop such forum applications, not just looking at the database tables but also to the code, organization and design of the forum. I think it proof it self very useful to open your eyes to possibilities for your own forum application
A few examples of database driven forums:
phpBB
Simple Machines Forum
XMB Forum
I usually say the best way to learn is trial and error but let me also point out. Even this forum application your creating, its just for small and private use for your websites.
You should consider that your forum application one day may become popular and you might desire to turn it public like these previous ones mentioned, or you just want to add some new features.
In this case i suggest you plan your Code and Database Architecture very well, planning ahead for future upgrades.
Also you should take MikeAinOz advice very seriously in his answer and start by
Conceptual ER Diagram of your base
entities, forums, threads,
replies,members, keywords, categories
etc. and express the relationships
first.Then get into logical design
mode and define the tables needed to
implement the functionality
Thats the best answer to this kind of question i ever seen.
Regards & Good Luck.
My thoughts...
str_follow shouldn't be in this table. It should have its own table that links members to subscribed threads.
I'd recommend having parent_id null if its a top level thread, it makes more sense.

What script should I attempt first?

I've just got started with the basics (as well as a few intermediate aspects) of HTML, CSS and PHP. What is a good starting point to practice these 3 languages?
I was thinking of writing a URL shortening script but I was wondering if anyone here might have a better idea.
I am looking to develop something that would help me broaden my knowledge of the above 3 languages, but it shouldn't be too advanced that I wouldn't even know how to start it.
Any suggestions would be appreciated.
Whatever you write, if you allow users to input anything, prepared for it to get spammed and hacked mercilessly as soon as it goes live.
Therefore I'd suggest starting with something where you don't give end users any input ability. Something like an image gallery, or a CMS where you as the site admin can create the content, but end users only get to see the finished pages.
If you're feeling more adventurous, you could write a guestbook app, or something like that, but be warned that you'll have to learn quickly all the security aspects of allowing end user input. You'll need to learn how to block spam, avoid SQL injection attacks, prevent cross-site scripting attacks, and a whole bunch of other stuff.
That's all important stuff to know about, but perhaps best left to your second project rather than your first.
Some common beginner tasks are:
- image gallery
- message board
- phone book
- simple forum
These simple projects will allow you to get accustomed to the languages and prepare you for the next steps: security, optimization, user experience, and maybe other.
I recommend trying something very simple at first and finishing it. Only after that you should start something bigger, or better still improve on your first project.
A simple blog platform would be a potentially good second or side project, with the opportunity for enhancement as your skills improve and incorporating things you'll learn from other smaller systems. Start from a single-user blog without comments, and build things up as you go along. Gives you some more free reign to play around on the design (HTML and CSS) side of things as well, and you can always throw in some simple JavaScript as well.
I'll say that #Alin's answers are some good potential starter projects as well, and #Spudley's answer is a good one.
And above all else - have fun!
I support a few of these. I would also suggest you look into doing something for someone else, say a small project. One think I find with myself and those I've taught is that it's a lot harder to commit to something when it's your own project. You also get caught up in the details. When you're doing it for someone else, though, it minimizes the chance.
Also look into using a MVC framework as a way to learn. Good MVC frameworks will allow you to play around while learning how classes work in PHP. I'm sure there are plenty of questions regarding them on SO.
Finally, if none of that leads you anywhere, think of something fun you'd like to try, not matter the difficulty, and go with that. Even if you don't complete a project, there's a high chance you learned something on the way, and that's worth your time.
You can start by reading and do some examples from here http://www.w3schools.com, they have good explanations for everything you want to use in html, php and css.m
Here are a couple suggestions:
Guest book
Simple client / project management
No PHP script could help you with html and css.
You have to master these things separately.
if you want to practice with html and css - just create an HTML page that represents one of your site/script pages and use it to train your html,css skills.
And it will have absolutely nothing to do with PHP part.
Just once you have finished with HTML, you will need to produce the same text dynamically.
Make blog. One step at a time:
On the main page articles one after another. Store them in files.
On the main page only 3 newest. Access the rest of them by menu.
Add option to create new articles.
Add option to edit or delete them.
Restrict access to these actions by using logins and passwords stored in file.
Add option to comment articles.
Add option to remove comments only by administrators (those logged with login and password).

Categories