| | |
convert PHP to javascript?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 14
Reputation:
Solved Threads: 0
I'm new to the forum and new to web development, I have an ecommerce store on prostores and I recently purchased a PHP based 5 star review script for my website. I then gave it to my web developer to implement it and he came back to me saying that prostores doesnt support php, only javascript. Is there a way around this? or can I conver this php script to javascript?
Conversion from PHP to Javascript is impossible. That's kind of like converting a spaceship into spaghetti. They're different things entirely.
PHP is a server-side programming language meaning that the code is parsed by the server. The end-user will never see PHP. Javascript on the other hand (in most cases) is a client-side programming language meaning that the server does not parse the code, but the end-user's browser does. Each language is used for different things and usually work hand-in-hand. I'm certain that the software you purchased has bits of Javascript in it, but is PHP based.
The only suggestion I would have is to find a regular web host that offers support for PHP.
PHP is a server-side programming language meaning that the code is parsed by the server. The end-user will never see PHP. Javascript on the other hand (in most cases) is a client-side programming language meaning that the server does not parse the code, but the end-user's browser does. Each language is used for different things and usually work hand-in-hand. I'm certain that the software you purchased has bits of Javascript in it, but is PHP based.
The only suggestion I would have is to find a regular web host that offers support for PHP.
•
•
Join Date: Aug 2008
Posts: 380
Reputation:
Solved Threads: 33
You might find it difficult locating a script if you have no server-side technologies you can use for it. I noticed ProStores does not support any server-side technologies, including MySQL -- where might you expect to store these reviews you want on your site???
I can suggest that you seriously consider not getting yourself locked into a service that you might find very difficult to get out of if you need to expand or grow your business, and from the looks of it, offers very minimal features outside of their specialization. No matter what it looks like now, it will likely be easier to change course now than down the road after you've invested even more time and money into this.
If you have invested a ton of money having someone customize one of the templates or design themes and insist on sticking with this service, you could always consider getting a second hosting service that would host the other scripts you need -- it doesn't sound appealing but is a thought.
I wish you luck
I can suggest that you seriously consider not getting yourself locked into a service that you might find very difficult to get out of if you need to expand or grow your business, and from the looks of it, offers very minimal features outside of their specialization. No matter what it looks like now, it will likely be easier to change course now than down the road after you've invested even more time and money into this.
If you have invested a ton of money having someone customize one of the templates or design themes and insist on sticking with this service, you could always consider getting a second hosting service that would host the other scripts you need -- it doesn't sound appealing but is a thought.
I wish you luck
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
•
•
Join Date: Sep 2008
Posts: 14
Reputation:
Solved Threads: 0
So I could have another hosting service host the scripts? How does that work? I dont know if its okay to post links here but if you go to my site www.mavidot.com and check out a product page, you can see that I have an area ready to go for the review script. You're saying it's possible to host this script on another server and still have the added benefits of seo for my domain?
Although I don't know about converting the script but you may find downloading a review script written in Java would be your best option. You should try and ask if a particular script is compatible with your server before buying one though. So try looking for a Java applet review script at http://www.hotscripts.com/Java/Applications/index.html
Note it is Java, Not Javascript.
Note it is Java, Not Javascript.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
•
•
Join Date: Aug 2008
Posts: 380
Reputation:
Solved Threads: 33
•
•
•
•
Although I don't know about converting the script but you may find downloading a review script written in Java would be your best option. You should try and ask if a particular script is compatible with your server before buying one though. So try looking for a Java applet review script at http://www.hotscripts.com/Java/Applications/index.html
Note it is Java, Not Javascript.
To answer your question above, I know I could use JavaScript to talk to PHP on a different server. In fact I just tested my idea to make sure I'm not talking out of my ear here.
It would very likely require some, if not a lot of, custom code though. You might be able to find a javascript interface that handles the rating system front-end. That goes with a PHP back-end that talks to the database and returns results based on a simple product-id methodology. In this case you could run the javascript on your main site, the php on the remote-secondary site and use a little javascript/php hand-rolled module to make the two talk.
That hand-built module would be cake to anybody who knows both languages and if the product you bought was written well in both javascript and php so the middle-ware person didn't have to deal with a ton of spaghetti code.
Mind you, this can NOT be done with Ajax (at this time in Ajax's history) since Ajax still does not support cross-site queries (last time I checked).
Let me know if you need more details -- do you understand both javascript and php?
Cheers
Last edited by langsor; Sep 5th, 2008 at 4:14 am.
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
•
•
Join Date: Aug 2008
Posts: 380
Reputation:
Solved Threads: 33
Hi again,
I would be happy to try and help, but I should probably be talking to your web developer so he/she will have a head start on knowing what I'm talking about ...
Let me know if I can help on this
Cheers
I would be happy to try and help, but I should probably be talking to your web developer so he/she will have a head start on knowing what I'm talking about ...
Let me know if I can help on this
Cheers
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
PHP Syntax (Toggle Plain Text)
You're saying it's possible to host this script on another server and still have the added benefits of seo for my domain?
A side effect of using JavaScript is that it is that it is invisible to Search Engines. So the reviews would not be indexed by search engines.
If PHP was used, it would be visible to search engines, since PHP renders the reviews as HTML.
•
•
•
•
To answer your question above, I know I could use JavaScript to talk to PHP on a different server. In fact I just tested my idea to make sure I'm not talking out of my ear here.
It would very likely require some, if not a lot of, custom code though. You might be able to find a javascript interface that handles the rating system front-end. That goes with a PHP back-end that talks to the database and returns results based on a simple product-id methodology. In this case you could run the javascript on your main site, the php on the remote-secondary site and use a little javascript/php hand-rolled module to make the two talk.
Creating a javascript interface for the review script you have may be more work depending on how well they separate the logic from the rendering of HTML.
---
A non-standard solution you could use it to have a PHP server save your reviews, but then have that PHP server save those reviews to your site as HTML.
Under the reviews tab on your product pages, you have HTML. If this is custom HTML that you added through a form (maybe in the administration panel of your store), then you can have PHP do this automatically for you.
It could post the HTML for reviews through that form, to be saved for the product.
This would be search engine friendly.
It would require that the PHP server know your administration panel password however, or at least the minimum required access to post HTML under the reviews tab.
It is non-standard, and if your PHP server had a vulnerability it would allow someone to log into your online store also. So I'd be very careful in choosing such a solution - but this is probably the only option you have of getting search engine friendly reviews.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- convert php function to ajax? (JavaScript / DHTML / AJAX)
- Coldfusion image upload w. javascript thumbnail preview (ColdFusion)
- link c++ with javascript/html (C++)
- <script language=\"javascript\"> Display problem with PHP & MYSQL (PHP)
- converting from javascript to HTML? (Java)
Other Threads in the PHP Forum
- Previous Thread: Problem with Radio Button error "[object HTMLInputElement]"
- Next Thread: check if email address is correct without sending email?
| Thread Tools | Search this Thread |
apache api array basic beginner binary body broken cakephp class cms code computing confirm cron curl customizableitems database date date/time delete display dynamic echo email error file files filter folder form forms forum function functions gc_maxlifetime global google headmethod href htaccess html iframe image include ip javascript joomla limit link list login malfunction memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php phpmysql query question random recourse recursion regex script search select seo server sessions snippet source space sql static system table thesishelp trouble tutorial update upload url variable video web webdesign xml youtube






