943,884 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 11523
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Sep 4th, 2008
0

convert PHP to javascript?

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kozkay is offline Offline
14 posts
since Sep 2008
Sep 4th, 2008
0

Re: convert PHP 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.
Reputation Points: 21
Solved Threads: 11
Junior Poster
MVied is offline Offline
111 posts
since Aug 2008
Sep 4th, 2008
0

Re: convert PHP to javascript?

unfortunately it's too late for that at this point. Any suggestions on good amazon style review script that is javascript?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kozkay is offline Offline
14 posts
since Sep 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

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
Reputation Points: 30
Solved Threads: 36
Posting Whiz
langsor is offline Offline
389 posts
since Aug 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kozkay is offline Offline
14 posts
since Sep 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

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.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Sep 5th, 2008
0

Re: convert PHP to javascript?

Click to Expand / Collapse  Quote originally posted by cwarn23 ...
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.
Reputation Points: 30
Solved Threads: 36
Posting Whiz
langsor is offline Offline
389 posts
since Aug 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

I understand neither.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kozkay is offline Offline
14 posts
since Sep 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

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
Reputation Points: 30
Solved Threads: 36
Posting Whiz
langsor is offline Offline
389 posts
since Aug 2008
Sep 5th, 2008
0

Re: convert PHP to javascript?

PHP Syntax (Toggle Plain Text)
  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.

Quote ...
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.
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Problem with Radio Button error "[object HTMLInputElement]"
Next Thread in PHP Forum Timeline: check if email address is correct without sending email?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC