Help - Search - Members - Calendar
Full Version: Best way to learn PHP and Javascript.
Forums > Resource Center > Webmasters' Corner
Maccabee
Would you still suggest http://www.w3schools.com/?
Or should I go buy some books? I need to really master php but I just need to learn the basics of java script first. And someone explain to me, the idea behind java script.
mipadi
The Idea Behind JavaScript

JavaScript provides a way to enable client-side interaction with a web page. Web pages are marked up using HTML, and served over HTTP. To get a web page, your computer requests a page from a web server, which fetches the page (stored on the server) and returns the HTML markup to your computer via HTTP. Your computer then renders the page. This means that every page interaction requires communication with the server, which is relatively slow compared to communication with the local machine. JavaScript removes this limitation by enabling some interaction with web pages without requiring communication with the server.

Learning PHP

Don't. It's a horrible language and not much fun for doing web development anyway. Learn something more useful, like Python or Ruby, which are both (a) better for web development anyway, and (b) also useful outside of web development.
Maccabee
Thank you.
I started browsing through the w3schools javascript section. Im not sure if it is in depth enough but I am getting the idea.
http://www.w3schools.com/JS/js_comparisons.asp
And my "boss" at my internship suggested that I learn it. It is what all his programmers use. Sorry. haha.
mipadi
That's a shame. Your boss probably just uses it because everyone else does.
Maccabee
Whatever he is doing, he is doing it right. What is used to write iphone apps?
mipadi
QUOTE(jcp @ Aug 11 2009, 11:49 AM) *
Whatever he is doing, he is doing it right. What is used to write iphone apps?

Not PHP!

Objective-C is typically used to write an iPhone app. (Incidentally, Objective-C is typically used to write Mac apps, too.) Unlike PHP, Objective-C is totally awesome, but they're starkly different and comparing them is like comparing apples and oranges anyway.
Maccabee
Oic! Well im still gona learn php. But w3schools suggested I learn, Javascript first.
mipadi
QUOTE(jcp @ Aug 11 2009, 11:57 AM) *
Oic! Well im still gona learn php. But w3schools suggested I learn, Javascript first.

You really should try Python or Ruby. It's a lot better. So much better that my own website is written in Python.
Maccabee
I was gonna buy a python book the other day. Till i realized it was 50 bucks. And besides php seems a lot more versatile and easier to learn.
mipadi
QUOTE(jcp @ Aug 11 2009, 12:30 PM) *
I was gonna buy a python book the other day. Till i realized it was 50 bucks. And besides php seems a lot more versatile and easier to learn.

Easier to learn, probably. Not "easy" isn't always the "best" way.

Versatile? Like I said, PHP is hardly used outside of web development; Python is widely used to write desktop applications as well as web apps. Python has better library support, too. (Those last two things also go for Ruby.) I think both Python and Ruby win on the versatility front, hands-down.
synatribe
if you want iphone apps tutorial visit
http://www.smashingmagazine.com/2009/08/11...ne-application/
Maccabee
Ok, im having an odd problem. In all the php tutorials I have read they dont teach the basic useful Stuff, what is this called and how do i do it...

I have like a variable and then I want it to show up on another page.
Im using it so I can have separate keywords and stuff on each page.

CODE
<php
$title = "Page title here";
$description = "description here";
$keywords = "keywords go here each seperated by commas";
?>


this is on the index of a page.

And then in my header include I have,

CODE
<title><?php echo '$title' ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<meta name="description" content="<?php echo $description ?>" />

<meta name="keywords" content="<?php echo $keywords ?>" />


Am I doing it right? Cause it doesnt seem to be working.
fixtatik
Are you including the variables in the same page as where you want them to show up, and before the HTML?
Maccabee
No.
I have an include called header.php that is in a folder called includes that I put on all my pages. Instead of having the keywords in header.php I want to give each page its own keywords. So I put the second code in header.php and in index.php I put

CODE
<php
$keywords = "keywords go here each seperated by commas";
?>


hoping that it would put the text keywords go here each seperated by commas in the keywords section.

I probably worded that really badly. But it isnt working.
And im doing the same thing with the title and the description meta tag.
fixtatik
Ahh...if you're printing a variable, that variable's definition needs to occur before the spot where you print it.

So it would be something like this:
CODE
<?php
include('seo.php');
include('header.php');
?>

You'd just have to specify which definition you want to show up for which page.
Maccabee
huh/ I have my includes working already. I need to get my variables working.
fixtatik
Right...but the variables need to be defined before you print them. Btw, the <?php echo '$title' ?> won't work at all. I just noticed that. It'll show up as <title>$title</title>. It should be <?php echo $title; ?>
Maccabee
Ok i figured out the problem. I put the <?php $title = "Page title here"; ?> after the include. I guess I wasnt thinking.
Maccabee
you know best way to learn enrish? read books! good PROFFESSIONAl books! becauseing learning from the sources on the internet is liker learning zoo farm treat farm swine!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.