PHP or Javascript (+HTML)

19 posts

Flag Post

Hi, i don´t know if i can ask this question here. But i am going to do it anyway and see if it´s wrong topic or forum. (?) Anyway, my question is, I am going to learn a new programming language and i´ve been thinking if i should use Javascript or PHP to make a website, But i´ve think you can make games on PHP or Javascript not really sure. But on some of those you can make a game, i´m pretty sure of it. Anyway my question is that should i start with PHP or Javascript? I´ll already know HTML so that doesn´t need anything.

Also i have another question, can you put PHP and javascript codes in HTML? If so, i might try to learn both. But i guess i shouldn´t force my memory so much. That´s why i´m asking you.

The two questions.

Should i use Javascript or PHP?
Can you put PHP and Javascript codes in HTML?

 
Flag Post

yes u can in your html body code add <?php ?> and u should learn php.

 
Flag Post

Okey thanks, on PHP you can make register and login forms. So i guess that´s kinda cool.

 
Flag Post

PHP + MySQL makes games. PHP has limited cross-session data storage (i.e. none) and limited cross page data storage (i.e. Session Variables).

You might want to check out The MySQL Game

 
Flag Post

Thanks, PHP seems like a little hard language. Btw those it also works with usuall Text editors like HTML? Yes, i know about dreamweaver but i´m curious about just using text editors if it works.

Ps. More people can answer to if they want.

 
Flag Post

yes u can use notepad or whatever to make a webpage/website. just code it right and dreamweaver i think shows you the errors in your code so u need to make shore u got ur code right

 
Flag Post

Okey, dreamweaver i have in school. So that´s why i´m thinkin about using it. But at home i can use a text editor. (Well i have dreamweaver trial version). Anyway, does anyone knows some things you can do with PHP? If so post them here, want to see my options if you know what i mean.

 
Flag Post

u can send emails in a form
make a hit counter on ur site
make a forum
add a poll.

 
Flag Post

PHP’s primary purpose is to output HTML formatted containing content delivered for a specific user. That is, PHP looks up in the MySQL database what the data is, who the user is, and whether or not that user wants/needs that data (aka a forum or blog).

But you can do all kinds of things with it, but it’s still data manipulation and display.

 
Flag Post

btw neither of them are programming languages.

PHP is just for server stuff. If you don’t have a server or your webhost doesn’t allow php then it’s kinda pointless. Also, I suggest you start from the easy stuff first, and work with javascript. Yes you can put it in html easily (I’m not sure but w3schools.com might have something about that) and there are a lot of things you can do with it. And I don’t know of a single webhost who doesn’t let you use javascript.

 
Flag Post

And I don’t know of a single webhost who doesn’t let you use javascript.

If your webhost lets you serve HTML pages, then they can’t stop you using javascript.

Javascript doesn’t execute on the server – it’s downloaded as plaintext and executed on the client’s machine.

 
Flag Post

If you want to make a browser based game such as ogame, cybernations, tribal wars, the list goes on… The I would advise using mainly php and mysql as it allows you to have data stored over more than one page. However javascript receiving data from php can be very usefull, for timers and quick previews to tell you how much something can cost. For instance :

<-->; var total_cost = cost * document.getElementById("number").value;

so in this way you can tell someone the cost of however many troops they are buying without reloading the page, which php would have to do.

 
Flag Post

this may be a bit late, but i’m pro-javascript. there are quite a few games using javascript, such as the recently-famous cookie clicker , as well as cycle blob and others.

 
Flag Post

Why not use both together, so you can exploit their strengths? PHP for its server-side security and access to databases, and javascript for its ability to create dynamic page elements without needing to refresh the page. That aside, developing applications via javascript and php is trickier than developing the typical stand-alone java, flash, c#, etc application, so start easy: Do javascript first. Then try php. Then try them both together to make the magic happen.

 
Flag Post

so you can exploit their strengths

Haha. You mean weaknesses. Cough. Both super insecure if done wrong. Cough. Just be careful

 
Flag Post

^ Strengths/weakness, relatively speaking of course.

 
Flag Post
Originally posted by wobalisk:
Apr 27, 2009 6:04pm
Originally posted by jrm115:
Oct 7, 2013 9:27pm

this may be a bit late

I think you’re right.

 
Flag Post
Originally posted by jonathanasdf:

btw neither of them are programming languages.

PHP is just for server stuff. If you don’t have a server or your webhost doesn’t allow php then it’s kinda pointless. Also, I suggest you start from the easy stuff first, and work with javascript. Yes you can put it in html easily (I’m not sure but w3schools.com might have something about that) and there are a lot of things you can do with it. And I don’t know of a single webhost who doesn’t let you use javascript.

PHP and Javascript aren’t programming languages? I beg to differ, there’s many game engines that use Javascript, and even a few that use PHP. Not to mention they all have data types, and you can compute data. Thus, it’s a programming language. Saying that Javascript isn’t a programming language is like saying ActionScript3 isn’t either. However, the rest I can somewhat agree on, w3schools.com is slightly terrible.

 
Flag Post

Javascript is the basic of programing language which is use for apply validation and with the use of html, php and javascript we can make a complete dynamic website. Html is the basic language which is use for making layout and php is use for make the dynamic web page.