Viewing Does Everweb support PHP Script?
Does Everweb support PHP Script?
|
User: Rob W. 11 years ago
|
|
|
I have a store on my website from a company called Ecwid, they provide the ability to intergrate your store anywhere with the code they provide (on Everweb you just paste it into a HTML snippet). The Ecwid store supports AJAX Indexing, this requires pasting code into the HTML snippet with the store code, uploading a PHP file (i was told to drag it into external assets as that will uppload the file) and add some PHP script to the PHP page. They told me that my website is a HTML site not a PHP site therefore the place i pasted the code would not work. Is there any way i can add PHP script? I'm not that knowledgable on this sort of thing so any help would be much appreciated. |
|
|
User: Jumbo T. 11 years ago
|
|
|
Everweb pages end with the .html extension. Webpages with php code should end in .php, otherwise the server won't execute the code. http://www.google.com/search?q=execute+php+in+html Try it. Paste php code and see what happens. To force the webserver to execute php code in a file with the .html extension, you have to add a htaccess file with this directive : AddType application/x-httpd-php .htmlhttp://www.google.com/search?q=how+to+make+a+htaccess+file I use it. This file : http://trotter.is-best.net/target/tar.html is included in this page : http://trotter.is-best.net/target/ with this code : <?phpEW is ignorant about it. It publishes the page and that's it. Last edit 11 years ago |
|
|
✔ Best Answer
|
|
|
User: Rob W. 11 years ago
|
|
| Ok i'll have a proper look at this tomorrow as i'm about to leave, it looks promising though had a quick read about forcing it to excute php code, might need some help with what to put where with the htaccess file etc. i'll post tomorrow once i've had a look, thanks for your help. | |
|
User: Rob W. 11 years ago
|
|
| also i didnt actually mean to click answered yet.. not sure how to un-answer a thread? | |
|
User: Rob W. 11 years ago
|
|
[quote name=Jumbo T. time=23/07/2014 10:41:04]To force the webserver to execute php code in a file with the .html extension, you have to add a htaccess file with this directive :AddType application/x-httpd-php .htmlhow do i make this .htaccess file with that ^ this is what the tutorial says: 2. In the PHP file, which is responsible for displaying your product browser page, add the following code in the head section (between the <head> and </head> tags) before title and description tags: Note: The code can be placed to PHP page only. It is not possible to add it to HTML page type <?php $ecwid_store_id = YOUR_ACTUAL_STORE_ID; include_once "%PATH%/ecwid_ajax_indexing.php"; if (!isset($_GET['_escaped_fragment_'])) { echo '<meta name="fragment" content="!" />'; } ?> The above code will work though if i add the htaccess you mention? Last edit 11 years ago |
|
|
User: Jumbo T. 11 years ago
|
|
|
Save this file. http://trotter.is-best.net/includes/htaccess.txt Then put it in the root of the webserver, or if your site is a folder, inside that folder. Rename the file to : .htaccess A dot before the name and without .txt. The file becomes invisible. Put the PHP code in the Head Code box of the page (Inspector, scroll down) : ![]() Based on what I see in the PHP code, I guess there are other php files used. Before you put all files on the server, test if it really works. Put this file on the server and change the extension to .html http://trotter.is-best.net/includes/helloworld.txt You should see this : http://trotter.is-best.net/includes/helloworld.html |
|
|
User: Rob W. 11 years ago
|
|
|
[quote name=Jumbo T. time=24/07/2014 5:36:19]Save this file. http://trotter.is-best.net/includes/htaccess.txt how do i save that file? do you mean save link as? Quote: Then put it in the root of the webserver, or if your site is a folder, inside that folder. i use Everweb hosting so i add it to external files right? Quote: Based on what I see in the PHP code, I guess there are other php files used. yeah i've downloaded the php file they provided and added it to external files Quote: Before you put all files on the server, test if it really works. Put this file on the server and change the extension to .html http://trotter.is-best.net/includes/helloworld.txt You should see this : http://trotter.is-best.net/includes/helloworld.html i'm getting confused with how i get this file? where do i put it? Sorry i'm bit of a noob with this side of things! appreciate your help. |
|
|
User: Rob W. 11 years ago
|
|
|
*double posted
Last edit 11 years ago |
|
|
User: Jumbo T. 11 years ago
|
|
|
Command S Put file on server. |
|
|
User: Rob W. 11 years ago
|
|
|
added those files and published the website but get page not found when i search for them http://www.peacock-records.com/helloworld.html is there a way to check files are uploaded? as we cant access the server |
|
Screen Shot 2014-07-24 at 14.10.25.png |
|
|
User: Jumbo T. 11 years ago
|
|
|
The only file I could find is the ecwid_ajax_indexing.php file : http://peacock-records.com/ewExternalFiles/ecwid_ajax_indexing.php Found two page with the php code : http://peacock-records.com/online-music-store.html#!/~/category/id=9674367&offset=0&sort=addedTimeDesc and http://peacock-records.com/shop.html The shopping cart works and checking out also works. But that is because it's JavaScript driven. How to get files in the proper location on the EW server, I don't know. |
|
| Post Reply |
| You must login or signup to post. |

