SitePoint Sponsor |
|
User Tag List
Results 1 to 12 of 12
-
Dec 8, 2009, 14:37 #1
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is it possible to do this, without any javascript ?
Is it possible to set up some sort of automatic conversion of kilos to pounds for example, but without using any js at all ?
Any help appreciated.
Dez.
-
Dec 8, 2009, 14:44 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
The only way to do it without JavaScript is to use server side scripting and have the form where the figure to be converted is entered submit a request to load a new page containing the answer.
To do any sort of calculation without involving the server requires the use of JavaScript.Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Dec 8, 2009, 14:50 #3
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Stephen, I wouldn't want to chance any of the users not being able to see it.
What choices of server side scripting are there for this scenario please ?
Dez.
-
Dec 8, 2009, 16:39 #4
- Join Date
- Mar 2009
- Location
- Melbourne, AU
- Posts
- 24,338
- Mentioned
- 465 Post(s)
- Tagged
- 8 Thread(s)
There are lots, but PHP is probably the best to use. You'd best head over to the PHP forum to see if anyone has any suggestions/scripts that you could use.
-
Dec 10, 2009, 07:39 #5
- Join Date
- Feb 2009
- Location
- England, UK
- Posts
- 8,111
- Mentioned
- 0 Post(s)
- Tagged
- 1 Thread(s)
Dez, you can use whatever server-side language you like (as long as it's supported by the server), for something as simple as unit conversion I wouldn't go with Ruby or Python because they would be overkill, but PHP, ASP(.NET), JSP, Perl or ColdFusion would do the job (depending on your preference and what your host supports).
-
Dec 10, 2009, 08:04 #6
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Don't know about the rest of the script types, but my hosts definitely support php. But wouldn't site B hosts need to support it as well ?
-
Dec 10, 2009, 08:26 #7
- Join Date
- Feb 2009
- Location
- England, UK
- Posts
- 8,111
- Mentioned
- 0 Post(s)
- Tagged
- 1 Thread(s)
Nope, only the site executing and parsing the data would need the server-side language (as it's just taking the static results and doing something with it)
-
Dec 10, 2009, 08:39 #8
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
But wouldn't there be any security issues for site B, receiving stuff from another site ?
-
Dec 10, 2009, 14:46 #9
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
You haven't explained how site B fits into your having a calculator on your site.
All that is normally involved in setting up a calculator like that is the one site that the calculator is on. Any other site can then use the calculator simply by providing a link to the page that the calculator is on.Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Dec 10, 2009, 14:57 #10
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Many thanks Stephen and Alex - will put some more of this into the PHP forum.
BTW, what would be the pros and cons of using PHP for this, over the other script types mentioned above by Alex please ?
-
Dec 10, 2009, 15:00 #11
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
It all comes down to what server side languages your hosting provides for you to use and which of those if any that you already know. If your hosting provides several languages and you don't know any of them yet then it comes down to which one you decide to learn.
PHP has a slight advantage over some of the alternatives that you are likely to find on the same hosting as there are more people using it and therefore more people to get help from.Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Dec 10, 2009, 15:05 #12
- Join Date
- Jun 2005
- Posts
- 1,441
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Stephen, I'll look into php.
Bookmarks