Hello, I've learned some php, and finally started getting handy with it, but learned there was certain things that shouldn't be done with it, because every request needs to be sent to a page. After skimming some javascript books I came to the conclusion I can't figure out a legitimate use for Javascript. My mental hurdles include not being able to communicate with a database, and the inability to use Jscript with PHP. Since the two languages can't communicate and java can't get into the database I'm not sure where to start with developing a web application in javascript language. I have a basic idea that I'd like to create something that works a bit like twitter, and maybe learn to create programs that run like other social networks... the problem is I can't seem to figure out how to do it without PHP, which is what I would want to do for efficiency, and what not.. I really can't get past storing friend information, and comments, and stuff like that in a database... Would it actually be better to use xml for stuff like this? any help would be great, thanks.
Javascript is for browser/client side stuff. PHP is for back end stuff. I write a lot of php to flat files - then include the file and get the variables out of the saved file. How to write a file I write a lot of simple stuff with absolutely no need for a MySQL database. I use cookies and sessions to store stuff. I get away with writing some realy cool websites using nothing buy php and flat files (and some sessions and cookies) -- and aweber. As amatter of fact, I am currently writing a website in php wich allows people to subscribe to 5 (stored) twitter people (*referrers), and then they get their twtter name added to the site with some referrers stored as variables, and so on and so forth - so hundreds of thousands of people can build a follower downline. I am passing all users through an aweber form, so I am getting their email address at aweber while I'm at it. I'm gonna make a kiling. All using php and flat files
So, you're building a Twitter-subscriber pyramid scheme. With flat files. And people wonder why the web is going to the dogs. To OP: you can perfectly fine use javascript to communicate with a database - but you have to go via some sort of server side scripting - like PHP. User fills out form (say login) -> javascript gathers the information from the form and sends it to a PHP-file -> the PHP file processes the received data, and uses the data to check for a user/password combo and logs the user in if found. (Very simplified, but you should get the point). Besides, do NOT use "java" to refer to javascript. JAVA is a programming language, and have nothing to do with javascript at all. Refer to javascript as "js" if you need to do shorthand.
Hey, thanks PoPSiCLe. After posting this I dug into some books and learned some JavaScript and Ajax, so I have a pretty good handle on what I need... Just have to learn to use it better. Thanks again.
Thank you for the post clarifying javascript vs. PHP. It helped me to see the overall picture of what I need to learn.