8 Replies - 925 Views - Last Post: 16 July 2014 - 03:10 AM

#1 Midi_  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 109
  • Joined: 22-May 12

I need some advice (server side programming)

Posted 14 July 2014 - 06:36 PM

I am currently working on a website that will eventually (when I'm done with html/css) need to make use of and manipulate data from the server and display that information in the browser. Think something along the lines of ratemyprofessors.com. Anyway here is the deal, although I've done my share of html/css design, I've never worked with the server before. I was thinking about doing this in javascript. The reason why I was thinking javascript is because for my next project I want to start learning how to program Oculus Rift which makes use of the Unity engine which is in javascript and figured this webpage would be a good warm up to familiarize myself with the language before diving into the hard stuff. I brought this up with a friend and he said I should do it in PHP and that it'd be easier, then learn javascript later.

All that being said, Im a server side/web "programming" noob and know nothing about it. Im a little confused on how the html meets the programming language and work together, so if anyone has any suggestions as to how to go about accomplishing these goal id really appreciate it. Also if you could provide a book or online resource that could help with this that'd be awesome too. Thanks everyone!

Is This A Good Question/Topic? 0
  • +

Replies To: I need some advice (server side programming)

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: I need some advice (server side programming)

Posted 14 July 2014 - 08:16 PM

A few things.. first - the lounge isn't the best place for this. Probably the web dev area.

Second - javascript is a client side language, and is not the server side.

Third.. server side would be your php, asp.net, ruby, perl, python, cgi, etc.

I'll move this to web dev for the time being.
Was This Post Helpful? 1
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: I need some advice (server side programming)

Posted 15 July 2014 - 06:52 AM

Quote

Second - javascript is a client side language, and is not the server side.


You're forgetting Node.JS ;)
Was This Post Helpful? 1
  • +
  • -

#4 ge∅  Icon User is offline

  • D.I.C Addict

Reputation: 80
  • View blog
  • Posts: 564
  • Joined: 21-November 13

Re: I need some advice (server side programming)

Posted 15 July 2014 - 07:17 AM

Midi, if you know nothing about server-side programming, it will be a lot harder to make your site in Javascript, partly because you will need to set up a private server (or a virtual private server) in order to install it. Node.js is not everywhere like Apache2+PHP5+MySQL.

Concerning the relation between HTML and a server-side language, basically, the server-side language will output HTML to the user and the HTML will request other documents via HTTP requests thanks to links or forms. It's as simple as that. HTML is a sort of interface between the user and the server.

It's exactly the same thing in a client-side app : your client-side Javascript will modify the DOM (an object representation of the HTML parsed by the browser) and your users will trigger Javascript events when they interact with the DOM.

To my mind, it's a lot easier to learn Javascript on the client side. You will probably need it, don't worry.
Was This Post Helpful? 1
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: I need some advice (server side programming)

Posted 15 July 2014 - 07:21 AM

Pffsst.. node-schmode.
Was This Post Helpful? 1
  • +
  • -

#6 Midi_  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 109
  • Joined: 22-May 12

Re: I need some advice (server side programming)

Posted 15 July 2014 - 03:53 PM

So if I understand this correctly, Javascript is more for stuff that people are going to see. Like moving items or like a button that you click to "go to top of page" stuff like that, its not usually for handling the retrieval of items on the server?
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: I need some advice (server side programming)

Posted 15 July 2014 - 05:04 PM

That is, generally, correct.
Was This Post Helpful? 1
  • +
  • -

#8 Midi_  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 109
  • Joined: 22-May 12

Re: I need some advice (server side programming)

Posted 15 July 2014 - 06:13 PM

Ok awesome, so now to the next question. Should I be taking my friends advice and learning PHP for this task? I am already familiar with C, C++, Obj-C, and Java (jack of all trades but master of none).

Do you guys know of any materials for learning PHP if thats the language I should use? Thanks again

And one other thing. If you go on ratemyprofessors.com, you type in the professors name and click "search" which takes you to a second page with a list of possible answers. Would that be considered "client-side" as in javascript is what displays them like that? Or is that "server side" as in PHP accesses that data and uses html to display it?

I also need to be able to get data from the server, manipulate it (e.g. cell 1 = 8, cell 2 = 2, add them together and divide, display average "average is 5"), then display this information.

This post has been edited by Midi_: 15 July 2014 - 06:15 PM

Was This Post Helpful? 0
  • +
  • -

#9 ge∅  Icon User is offline

  • D.I.C Addict

Reputation: 80
  • View blog
  • Posts: 564
  • Joined: 21-November 13

Re: I need some advice (server side programming)

Posted 16 July 2014 - 03:10 AM

When you type the professor's name in the form, you see a drop-down list of names matching your input. This involves both client-side and server-side scripts:

- the data is in a database on the server side, so there is a HTTP request to query this content.
- the server has to look in the database, fetch the data, write standard HTML and send it back to the client.
- You can tell the page isn't reloading when you type, you're still in the same document: Javascript is actually listening to the key press event, does the HTTP request in background, retrieves the server response and adds it to DOM dynamically. That's the client-side part.

When you click on an element in the drop-down list or when you submit the form, you change page, it's a standard functionality of HTML, you don't need a client-side script, but you do send a HTTP request to the server who will query its database and so on...

Both Javascript and PHP are programming languages, you can do whatever you want with the data. The simplest way is to generate and format the content on the server side and send ready to be parsed as HTML content to the browser. Search engines do not understand Javascript well and don't trigger events, so it's better to do little on the client side : enhance the user experience (add a user-friendly drop-down list for example) without overriding the browser's default behaviour too much.

This post has been edited by ge∅: 16 July 2014 - 03:12 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1