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 11 years ago.
Are there any prerequisites I need to know before I build a website/web application in php?
Anything like ajax, jquery, jsp etc?
PHP is a server side technology, it means the server execute your PHP script and then send the result to the user's browser.
JSP is a concurrent technology based on Java. Your site will be in PHP or JSP, not both.
AJAX stands for "Asynchronous Javascript And XML", it is a way to obtains data from a server with reloading the whole page.
jQuery is a Javascript framework which greatly simplify a lot of common tasks in Javascript.
Javascript is a language which is usually used client side to modify the page or respond to user's action without reloading the page.
You can do a complete site using only PHP without problem. Javascript and everything related (jQuery, AJAX) will help you building a site with better user experience if you do it right.
You can add MySQL to the list, or any other database technology, to store data on the server.
It completely depends on what you want to do, if you want to create a simple blog php is the only thing required, however if you would like to add more features then I would recomend starting the blog and learning more functions as you go along.
There are hundreads of tutorials out there which you can read or watch (on youtube) that will get you started. Most of the other languages such as javascript are touched on as they can make the site easier to use or just look better.
If you want to create a blog or a forum then php is all you need but you may like to start learning other languages once you have a good understanding of php. I would also recomend, if you are new to creating websites, that you should begin by creating a simple site first following a tutorial and then either adapt it or create an entirely different site after you understand the concept of php5.
Like others have said, it depends on what website you're trying to build. You'll be able to get quite far with just PHP/MySQL but for advanced interactivity and dynamics I'd suggest looking into other technologies and combining these into your website along with the PHP.
However, just starting a project and then adding things as you learn is probably the best way. You'll surely get to a point where you want to add something you don't really know how to do, and a quick search will point you towards.. for example, jQuery. That's the point where you can start learning about another jQuery and try to implement whatever it was that you wanted to add to the website.
However, for basic dynamic websites, PHP will do a great job. It all depends on what you want to achieve.
I recommend you to learn PHP hand in hand with MySQL, because it's a common combination for database based web applications.
For MySQL, the most important operations are CRUD
What do you want to create? Just throw in some signal words like guestbook, etc., so we can tell you more about the needed tools.
Related
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.
Does anyone know of any good tutorials to build a database driven website?
I am trying to build a site, that will do the following:
I upload data into different tables (categories) into a MYSQL Database
The user on the front end selects a category
The database then prints out all of the data in that category
Seems simple right? But where do I start!
In my opinion, take up php basics from the ground up, learn your variables and what they do, if/else statements, loops n functions etc etc..and leanr how/why they operate.
once you have a handle on the basics, then do something like was suggested above like lynda.com(ive used em theyre great) and other tuts online/books etc.
To do what you want to do, not only will you need this (the basic concepts i put up above), but youll need to learn SQL/MySql as well which is another simple but easy to messup language especially at first depending on what/how/how much you want to extract from the DB, mixing it with php and printing on the page, seting up databases/tables etc etc...
ALSO, in order to organize and display your content, youll need to understand how to extract said data hence, learning the basic basics.
as far as W3Schools - for basics theyre fine.just my .02
If you do your homework, And can tackle what you need in an orderly fashion, in a few days you should be up n running.
Good luck.
You could always get started with the PHP Tutorials on W3Schools - http://www.w3schools.com/php/default.asp
Before I get slated for suggesting them, they are a good start, especially if youre quite new to PHP or PHP with MySQL.
As for the printing it out, I guess you mean display it on a web page, the tutorials would cover this as well.
Once familiar with what you are doing, I highly recommend the tutorials put together on Lynda.com - http://www.lynda.com/
They are really well put together, and come with a video walk-through, so you get covered whatever your learning style.
You could start off by looking at the example code here:
http://www.willfitch.com/mysqli-tutorial.html
Then look at the php documentation:
http://php.net/manual/en/book.mysqli.php
Be careful not to get confused with the mysql_ and mysqli_ functions. mysqli_ is the one you want!
If you are using PHP to build your website,then maintain database on PHPMYADMIN of your server.Connect from your php code to mysql using mysql_connect function..follow this link...php_on_server
I used a couple of the For Dummies series to learn PHP/MySQL/phpMyAdmin. I'm sure the purists will disapprove :)
However, one of my acquaintances works for Google, and he got in my ear that AJAX sites are a much better way to approach things than PHP-driven sites.
So I pretty much rewrote everything I'd done to minimise the need for page reloads. So I now use PHP on the server side, but the client side is never built with PHP. It starts as pure HTML, and then makes calls using Javascript.
I share this not because I have great expertise, but because it might save you some heartache later if you head down the AJAX road from the start :)
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 been having this idea spooking around in my head for 2 weeks now. I’ve finally created some cases and plans on where I want to go with this project. I will have to create both a web application (ASP.NET) and a desktop application (Java). Both these applications will need to have sync’d databases.
I’ve been thinking about creating a public API over my database so my front-end and 3rd parties could communicate to the database. But I’ve never really attempted something like this before. I’ve spend my weekend so far on reading up on how I could approach this and I’ve gotten a pretty good idea. I’m having some questions/doubts currently and was hoping perhaps someone could help me.
1) I’m currently still in university and I don’t have a job so my pockets don’t go very deep. I’ve been thinking of writing the API in PHP, I already have possession of an unmetered hosting account and else I would be forced to buy .NET hosting which can turn out to be quite expensive. However my PHP knowledge is quite limited towards parsing user input/security. Would it be wise to search for an (e)book around this topic or would I be fine with online tutorials, do you have any suggestions on where to look? Should I put my time in writing a possible vulnerable PHP API or should I look at other options?
2) So far I’ve never really had the need to look into PHP libraries. I was wondering if I should look into some of these (for example cakePHP) to help me develop the API.
3) I’ve experience with implementing Twitter/Linkedin their API’s so I’ve been thinking to use OAuth (v2) to allow people to use my API. Is implementing OAuth to your API a lot of work? Is it well documented enough for someone with only basic PHP knowledge? If you ever used it on your API, what was your experience with it?
4) If this project would ever kick off, it would be wise to look into hosting It in the cloud. Do I currently need to think about something so future cloud integration is possible?
5) For the web application, would there be a (big) performance difference between using the API or directly connecting to the database?
6) Any recommended lecture or tips are welcome. It’s the first time I will be attempting something this big (both in functionalities & required knowledge).
1) Developing a simple API is not that hard with PHP if you have some experience in other languages. Ofcourse, every language has its own way, and when it comes to optimization and stuff like that, you may need some more PHP knowledge.
2) Using a PHP framework would definitely help with the lots of aspects. I use symfony 2 for all my PHP projects. I really suggest checking it. It's a decoupled framework, and you can use individual components from the framework. It's lightweight and fast, and offers great tools to build what you want. What is symfony? explains the benefits. Also, using ORM (I prefer Doctrine) is an option, but this is a whole another topic.
3) If you decide to use symfony2, there are bundles (libraries) for it that you can use. It shouldn't be too hard to implement even without a framework, but I don't have any experience in that area.
4) I don't have any experience in cloud, so can't comment on that.
5) There will be a performance difference as you are adding another layer to your project, but whether it will be a big or small depends on the API, database etc. But, using an API will mean a standard way to communicate with the database, so even with the performance difference, it might be beneficial in terms of consistency and development time(you won't have to deal with different platforms to do database stuff.).
6) The usefulness of the API greatly depends on the application and I can't really say if it outweighs the costs without specific information about the project. But having a standardized way to communicate with the data storage is generally a good idea when dealing with multiple platforms and languages IMO. As I don't know how much do you know about PHP, I can't comment on if it will be worth your time. I would go for it if there is enough time, as learning about PHP would add some more tools in your arsenal and this will be a good opportunity to improve yourself as a developer.
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 11 years ago.
I'm new to cakephp and still learning my way through php in general. To learn I'm trying to build an app which allows the following:
- A user can sign up (using the basic Auth component)
- A signed up user can create a 'campaign', ie fill in a form which will end-up as a page on my website containing details of things the user is trying to achieve. As well as that there will be a 'story' field in the form for the user to explain the reason they are trying to achieve whatever it is they are doing.
Users will have different reasons for creating their campaign, ie new years resolution/wife nagged you into doing it/need to make more money etc etc...
To help users along what I'd like is to have some default stories written and via a radio button users can select their default template to edit. In other words, if they select the 'new years resolution' template a pre-written story will appear in the text box for the story field which they can edit to their preference before submitting.
As I said, Im new to cakephp but have bought all the books and read the manual a couple of times, but since I'm also a bit green with php too I'm struggling a bit. But whats the best way to go about doing the above?
If someone could give me a bit of a break down so I can go off and google the correct things then it would sure make this learning curve a whole lot less daunting.
thanks in advance
pete
ireland
[Sorry to be so blunt but] It's pretty tough to answer this since you don't really have a specific problem but a general problem: you don't know the tools you want to work with.
Again, I don't mean you no harm.
For PHP in general, I would probably suggest to keep http://docs.php.net open in your browser at any time. PHP has one of the best (or maybe the best) language reference and manual. It probably also doesn't hurt to buy a book - IMHO, one from O'Reilly is usually a good fit.
As for CakePHP, I'd recommend starting here: http://cakephp.org/#learn
What you need to do is learn the framework and then go from there. Learn and adapt. There's no other way. What you described is of course not specifically part of any of the tutorials or screencast, but they teach you the skills necessary to achieve your own goals.
It seems like I am "wearing the same exact shoes" as yourself. I have a huge project to work with and no CakePHP knowledge. I tried to start with a plugin like many have suggested, but quickly got lost. Now a couple of months into learning CakePHP, this is what I would suggest you do:
Read the manual entirely (I downloaded this COPY and ordered it only as a manual)
Place sticky markers on the pages and sections you feel you need to reference back
Use a notebook to create your database structure as detailed as possible and use CAKEAPP to make them all come together. Use as much time as you need since the Database is the most important section of your app. CakeAPP allows you to set your app relantionships as well. Pretty neat!
Download the SQL code from CAKEAPP and dump it into your MySQL Database
Use Cake Bake to generate all your Models and Controllers (Change them later if necessary)
Create your main site layout (default.ctp)
Manually create all your other Views.
At this stage, DO NOT look at plugins. Plugins will make you lazy and prevent you from learning CakePHP. After you got your main application structure going, you can then look at plugins to beef it up. Looking at plugins this early in your game will only slow you down. Also, look at tutorials online and Q&A like STACKOVERFLOW's. Most importantly, read the Manual
BTW, I am still working on my Database to make sure, from the get go everything is as close to what I need as possible.
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 12 years ago.
as web developer using PHP/JS/CSS for years , i suffer from repeat myself over and over and over and over , even if i use a PHP framework , i feel the same thing every time, i start to build new feature , so every time i started new thing i feel the 'Déjà vu' ( i write it before ) , and i rewrite many things from scratch despite i write something same before , if i use previous written code , i may take more time to reuse it , i love programming and web development , but by this way i will lose this :( ...
Where the problem ? in language , my way to built software or what ?
if i use previous written code , i may take more time to reuse it
This, I believe, is your real problem: you're writing way too much quick-and-dirty code and are suffering from the resulting techincal debt. The problem is, what is quick in the short term can lead to being very slow in the long term.
If I may offer a non-technical comparison, consider a Ferrari and a cargo ship. When delivering just one letter, it seems obvious that the Ferrari would be much faster not to mention much more convenient compared to using a cargo ship. Just loading the ship before leaving the docks can take hours. By which time the Ferrari would have already completed the delivery. But when you have to deliver a hundred tons of mail, the cargo ship would complete the delivery while the Ferrari would still be busy speeding back and forth delivering each letter.
It's the same in your case. When developing just a single web site, it will always seem obvious that you should write the least amount of the simplest possible code to get the job done quickly. And if your whole career is devoted to just one web site I would even say that that's the right way to do it. It is, after all, the essential spirit of Agile methods. But if your job is to develop websites (plural) then this approach will start to become slower with each new site. Just like how the Ferrari is not ideal for delivering a hundred tons of anything.
One real world example is 37signals. When their business model requires that they should be able to quickly develop and deploy sites as necessary, instead of just diving in and develop their first site in a quick-and-dirty way, they took a step back and developed Ruby on Rails instead.
I'm not saying that you should go ahead and start your own framework, re-inventing the wheel is exactly what you want to avoid at this point. What I'm suggesting is to separate the functionality you're developing from the web related code. In other words, when writing new code write it as a library. Yes, it's a bit more involved writing code in two or more files compared to inlining the functionality directly in the PHP page. But in the end your next web site would be easier/quicker to implement.
I always, as a matter of habbit, create a lib directory in a project's base directory whenever I start a new project. I then force myself to write all code even remotely reusable as separate modules in this directory. These days I find that, more often than not, I'd simply copy (or more commonly make a symlink) of files I need to the lib directory instead of writing the needed code.
The problem is that when PHP started, every tutorial, every demo and all code was made in a very structured way, because PHP descended from the C/C++ family. Many developers took this problem and have carried it, and it was visible that we couldn't keep this.
Now, we have PHP 5.3.3 available, we have namespaces, objects, classes, interfaces and all of this. Many of the things that helpt making bad code like magic quotes and register globals are now deprecated. PHP is evolving into the OO world, it took long enough, but is happening. So if you want to start again to "relearn" PHP I would suggest getting your hands on some frameworks like:
symfony, joomla, propel, doctrine
learn about mvc and design patterns applied to PHP and you will see how you'll start making good OO code, and the deja-vus might stop before you knwo it.!
Hope I can help
David
This is exactly why a framework is the best way to go. It takes out the mundane parts of code (the stuff you always have to write over and over like DB connections).
I would suggest picking a good framework (I use CakePHP, but there are others like Symphony, Codeignitor, Zend, etc.), and as you build various components, you can reuse them in other projects. It will reduce the time it takes to write all future projects.
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 12 years ago.
When a Web framework ( like django, ruby on rails, zend, etc ) isn't convenient to use ?
And so... When a Web programming language ( like PHP, Asp, Python, etc ) is better than a Web Framework ?
I like the wikipedia description:
The framework aims to alleviate the
overhead associated with common
activities performed in Web
development. For example, many
frameworks provide libraries for
database access, templating frameworks
and session management...
Basically if you don't need all of the above, you don't need a framework.
You don't need frameworks when you don't plan to use their features.
The difference is, in my opinion, the simpleness of what you are trying to build.
Are you trying to make a difficult, complicated web app, or are you making a simple script that performs a trivial task? In the first case you absolutely need a framework, in the second case.. don't even bother.
The rule that I have is that if whatever I'm building is only going to be a single page, I'll usually do it in just PHP. Whenever I need more than one page, I go with a framework (Symfony), because that usually means that I'm going to want things like routing and proper dispatching of requests.
This does however depend a lot on the language. In languages like PHP, the time needed to set up a project to use an MVC framework may be a lot more than just solving the problem. Other languages may very well be designed around using an MVC framework, and has a very low setup cost for that.
A web framework is supposed to provide means to handle certain kind of interaction. If you have site with no interaction or no "adaptation", you don't need either framework or programming language, you simply write HTML files and publish your files.
As you start to add features for the back-end (like publishing more plain pages) or in the front end (like sorting a list when the user clicks "order by") you start getting into frameworks/programming languages.
Basic interaction was handled with CGI - you write an script which responds with a string to a few parameters passed via a form. Then you have database access.
In my experience, if you need simple features AND want your website to be suitable for growth without resorting to rewriting it from scratch, you should start from a web framework like Django. You can do simple things quite easily in Django (granted - it is not trivial) and add very complex behavior with small, incremental steps.
When you have to build a very complex site, and the functionality is already exists in a CMS (eg Drupal, it has amazingly lot contrib for everything).
I'm at that stage where, because I spent so much time learning a framework recently, even if I do a one page "website", I will still use one, need to get my ROI up :p