WebSite X5Help Center

 
Juergen S.
Juergen S.
User

I wanna include php code on page  en

Author: Juergen S.
Visited 4190, Followers 2, Shared 0  

I've been trying to get some php-code running in my pages.

I made a test-page and chose in the properties that it should be .php instead of .html.

When loading the page it still is .html. Why?

Second problem is, that it seems that the internal website X5 Prof 11 server does not provide php: When I use IE for preview and have a link to a php page, it will not open, saying there's no programm installed to handle .php files.

Two ways to solve this:

1. Where (patjh) is that internal server your prog is using (127.0.0.1 8080)?
Could I add a php engine there?

2. How can I use my installed xampp Server (apache) for preview istead of the internal server? This Server has everything it takes. 
I did edit httpd.conf and added the directory (like an alias) where Website X5 locates the sites I'm building (outsite the normal htdocs path of my server):

ScriptAlias /ks/ "C:\Users\TSD\Documents\Incomedia\WebSite X5 v11 - Professional"
<Directory "C:\Users\TSD\Documents\Incomedia\WebSite X5 v11 - Professional">
    AllowOverride All
    Options Indexes FollowSymLinks ExecCGI
    Order deny,allow
    Allow from all
</Directory>

I  get Error 403 (I'm not allowed to reach there). What should I do?  8:o(

Just remember: I want to add something like &lt;?php echo "Hello world"; ?&gt; in my code, either if its a textbox object (html activated) or a html-box object.

Posted on the
10 ANSWERS - 1 CORRECT
Jamie B.
Jamie B.
User

Could you upload the demo test page so I can see where the problem is.

regards

jamie

Read more
Posted on the from Jamie B.
Juergen S.
Juergen S.
User
Author

Nothing special about that page. Just a page with a html-box containing somewhat like

<?php

echo "Hallo Welt";

?>

I wonder why not many more have this question. Can't they code php?

What for ? I want a dropdown to load options (date) for courses to select from and I don't want to edit this in the e-comerce section by hand for ewvery article but load the date values dynamicly from a file. I'll only have to replace the file to update the options.

Read more
Posted on the from Juergen S.
Juergen S.
Juergen S.
User
Author

So what I've done by now is:

I added some lines on the httpd.conf of my xampp:

Alias /ks "C:\Users\TSD\Documents\Incomedia\WebSite X5 v11 - Professional/"
<Directory "C:\Users\TSD\Documents\Incomedia\WebSite X5 v11 - Professional/">
    AllowOverride All
    Options Indexes FollowSymLinks Includes ExecCGI
    Order deny,allow
    Allow from all
</Directory>

and I did create a .htaccess file in the projects root directory:

Satisfy Any
Order Deny,Allow
Allow from all

Now I can access the preview folder of my project with my xampp-Apache Server with any browser like http://localhost/ks/ /preview.

I still have the problem, that the Website X5 still saves my file as .html, even though I switched it to .php within the property Dialog window (see picture).

Can you help? Maybe add a button in the next update not to keep it files as .html?

If I edit the file-extension by hand in the preview-folder it does work, but that is a mess, if there are lots of files to edit... 8:o(

Read more
Posted on the from Juergen S.
Juergen S.
Juergen S.
User
Author

New Idea:

The preview uses a server. It's not loading from the local file system (like C:\Users\TSD\Documents\Incomedia\WebSite X5 v11 - Professional/...

The preview does load from 127.0.0.1... So there is a local server included. Why doesn't it have a php-engine? Add one, so you (me) can save php-files as php-files, and not just change the extension on export (Iguess that's how it works by now ?!). I cannot (= I don't want to) export the page (or even site if there are links) for every programming mistake I make when coding just to test the page....again and again ...

8:o(

Read more
Posted on the from Juergen S.
Juergen S.
Juergen S.
User
Author

...maybe WebsiteX5 should save both versions for the preview, html and php?

Still there would be a problem with links to those pages (html), but one could quite easily test php code included by previewing those pages directly...

...but the best thing is to add php support to the internal server (127.0.0.1). 8:o|

Read more
Posted on the from Juergen S.
Incomedia
Claudio D.
Incomedia

Hello Juergen,

The preview loads only html code since it cannot execute PHP code. Once exported online or on the hard disk it saves it as PHP code and then you can test it on a server which supports PHP.

You need to export it on the hard disk to be able to test your PHP code since the preview uses only HTML as extension and if you set on XAMPP to use the preview folder the code will not work.

Many thanks!

Read more
Posted on the from Claudio D.
Juergen S.
Juergen S.
User
Author

You're right, but you should change that soon. Coding needs trial & error method to generate valid code, and to export for every test takes much to lonf and is to complicated.

Can't you save both (html & php) in the preview folder?

or can't you add php-capatibility to your internal server?

That's not much work to add that to the next service update?!?  8:o|

Read more
Posted on the from Juergen S.
Juergen S.
Juergen S.
User
Author

Can you tell me where to look for the internal server on you use for preview on my harddisk? 8:o/

Read more
Posted on the from Juergen S.
Incomedia
Claudio D.
Incomedia

Hello Juergen,

The Preview folder saves only as .html since it is meant to be used only inside the programs preview. You can open an "Idea" Topic to suggest it for the future releases of the program.

There's no way to edit the internal server of the preview since it is in the program file and has no settings you can edit.

The best way is to create and test your PHP code externally and once it is complete then you add it in the program and then you export it online.

Many thanks!

Read more
Posted on the from Claudio D.
Juergen S.
Juergen S.
User
Author

The idea is to include an xampp or to use the 1 you already have.

Thanks 8:o/

Read more
Posted on the from Juergen S.