convert PHP to javascript?

Reply

Join Date: Sep 2008
Posts: 14
Reputation: kozkay is an unknown quantity at this point 
Solved Threads: 0
kozkay kozkay is offline Offline
Newbie Poster

convert PHP to javascript?

 
0
  #1
Sep 4th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 84
Reputation: MVied is an unknown quantity at this point 
Solved Threads: 5
MVied's Avatar
MVied MVied is offline Offline
Junior Poster in Training

Re: convert PHP to javascript?

 
0
  #2
Sep 4th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: kozkay is an unknown quantity at this point 
Solved Threads: 0
kozkay kozkay is offline Offline
Newbie Poster

Re: convert PHP to javascript?

 
0
  #3
Sep 4th, 2008
unfortunately it's too late for that at this point. Any suggestions on good amazon style review script that is javascript?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: convert PHP to javascript?

 
0
  #4
Sep 5th, 2008
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
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: kozkay is an unknown quantity at this point 
Solved Threads: 0
kozkay kozkay is offline Offline
Newbie Poster

Re: convert PHP to javascript?

 
0
  #5
Sep 5th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,432
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 132
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: convert PHP to javascript?

 
0
  #6
Sep 5th, 2008
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.
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: convert PHP to javascript?

 
0
  #7
Sep 5th, 2008
Originally Posted by cwarn23 View Post
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.
OMG, I hate java with a live passion, but I think cwarn might be right here ... it makes sense really.

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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: kozkay is an unknown quantity at this point 
Solved Threads: 0
kozkay kozkay is offline Offline
Newbie Poster

Re: convert PHP to javascript?

 
0
  #8
Sep 5th, 2008
I understand neither.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: convert PHP to javascript?

 
0
  #9
Sep 5th, 2008
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
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,073
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: convert PHP to javascript?

 
0
  #10
Sep 5th, 2008
  1. 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.
It would likely be less work creating a JavaScript review system, that saves the reviews to a custom PHP script.
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC