PHP or Javascript

phazzedout

New Member
Messages
230
Reaction score
3
Points
0
I was asked by my father to build him a website with a contact form, image galleries, sending images of his products through emails, other things like that. Which language would it be best to build that kind of website with. Would it be easier and better with PHP or Javascript. Ruby would also be fine.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
PHP and Ruby are server side. JS is (mostly) client side (there is such a thing as server-side JS, but it's uncommon). They're used for different things. If you're thinking of using X10, the X10 servers (at least, the free ones) don't appear have a Ruby interpreter installed. Even if Ruby on Rails were installed, it's more for web apps than web sites in general (though you could approach the site as an app). They have Python, but no web framework to go with it, such as Django. Similar situation for Perl. Basically, Perl and Python on X10 are used for CGI scripts.
 

phazzedout

New Member
Messages
230
Reaction score
3
Points
0
Thank you both of you. You are right, Ruby on Rails is not on the free servers, do not know why since it is free. Oh well.

I guess I will have to refresh my memory on Javascript and learn much more PHP.

Thank you. I tried building him a website 2 years ago when all I knew was HTML, CSS, and some Javascript. It was an epic fail. Now I know more so we will have to see.
 

cybrax

Community Advocate
Community Support
Messages
764
Reaction score
27
Points
0
Don't fret.. you should see some of my portfolio that was done circa 1995. I cringe just looking at the designs.

Just keep it clean and simple, remember that visitors want informative and useful content and they want it fast. They do not care how many hours you spent photoshopping the background image or logo to get it looking nice. Get it working then make it pretty, not the other way around.


Incidently now that Google has revealed it tweaks web site ranking using the page loading times as well the whole design/ build community is having kittens. Those heavily relient on graphics, Msql backends or FLASH particulary so, even overdoing it with the client side javascript could have consequences for the SEO.
 

dbantner

New Member
Messages
34
Reaction score
1
Points
0
I just read an article on slashdot.org that was saying that Java was losing ground and losing favorability because of, some people think, Microsoft. But who knows. I personally like php because I believe it's faster and easier to use. Plus gained ground very quickly in the beginning and has done nothing but grow by leaps and bounds.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
To be honest, you'll need to use both PHP and Javascript.

PHP for the form to email side of things and javascript for menu and galleries.

The real answer to the question is both, of course -- but don't ever require your users to use JavaScript. In this case (on x10Hosting), you would build a PHP site that does everything you need the site to do, including the image galleries. If you really want to do things right, the site should be completely usable (if ugly) without any CSS or JavaScript at all. You can then modify the pages you have created with (first) CSS, to make the site more attractive and define "activity areas" clearly to make the site more usable, then JavaScript to make the application more responsive in the browser (by preloading images, doing the gallery paging on a single page, validating form data in the browser, and so on). Not only does that make Google (and other web crawlers) happy, it means that more users can access and make use of the site on more devices.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
You should build it in PHP. Every browser supports PHP, and not all browsers support javascript.

~Callum
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Every browser supports PHP, and not all browsers support javascript.
No browser supports PHP because it's a server side scripting language. You could, I suppose, create a browser extension to support client-side PHP (like the old Tcl plugin).
 

Tariqul Islam

New Member
Messages
182
Reaction score
0
Points
0
In your issue I think PHP, MySQL is the best. For form validation you can use JavaScript. Also for beautification you will need CSS.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
No browser supports PHP because it's a server side scripting language. You could, I suppose, create a browser extension to support client-side PHP (like the old Tcl plugin).

Exactly what I meant, I just thought it was obvious.

~Callum
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Exactly what I meant, I just thought it was obvious.
I'm reminded of a certain conversation between an English girl and an egg.

And another conversation at a tea party.
 
Last edited:

cl58logs

New Member
Messages
28
Reaction score
0
Points
0
PHP and JavaScript are two totally different types of languages. You can use JS with your PHP.
 
Top