Page 1 of 1

PHP Includes - how to

Posted: Sun Feb 04, 2018 9:10 pm
by LJLachance
New to WYSIWYG. I've searched the forum and read "Adding HTML or Javascript to a web page" and admit, I'm still confused. I want to insert a placeholder/text box/something (on a page) that retrieves the .php page also uploaded to the server. The server side page is a simple (not necessarily accurate) php visitor counter.

For lack of a better way to explain - I want a text area that says "To Date" <!--?php include("count.php"); ?--> "people have visited". The "count.php" generates the actual text number.

Where, specifically, do I place this code? I've tried placing it in the text Object HTML, Inside Tag but then it shows up before the text. If I place it After Tag, it's outside the div. Will i need two text objects?

Can i just use some other object, such as a shape, and place the code inside the shape somehow then surround the shape with text?

Thanks

Re: PHP Includes - how to

Posted: Sun Feb 04, 2018 9:17 pm
by Pablo
You can insert custom code in an HTML object.
http://wysiwygwebbuilder.com/add_html.html

If you want to insert PHP code inside a text object then you can enable 'Do not encode HTML characters' in the properties of the text object.

Re: PHP Includes - how to

Posted: Mon Feb 05, 2018 1:38 am
by LJLachance
Pablo, I did read the add_html but just couldn't make that work for some reason. I'll use your second option - thanks very much for the quick reply, much appreciated.

Re: PHP Includes - how to

Posted: Mon Feb 05, 2018 3:43 am
by LJLachance
I enabled "Do not encode..." in the text object. All works as the "count.php" is included as desired. The problem now is that I can't center the object. I've tried adding padding to the left of the object and confirmed the grid is centered. The page is currently located here - http://206.214.218.15. I'm using the New York template as a basis. Everything else in this grid is perfect. Where am I failing?

Re: PHP Includes - how to

Posted: Mon Feb 05, 2018 7:16 am
by Pablo
If you add you own code then you will need to provide your own styling for that code.
Based on the code of the page the alignment of the text is set to 'left'

Note that I cannot help with custom programming related issues.

Re: PHP Includes - how to

Posted: Mon Feb 05, 2018 12:11 pm
by LJLachance
Thanks, I'll see what I can figure out.

Re: PHP Includes - how to

Posted: Wed Mar 04, 2020 9:14 pm
by satbho458@gmail.com
Please give me some example to use php script using Insert -> HTML option.

When I used the php script it is not showing result on server. But the html code is generated I can check through the browser element tools

please help me for the same.

Re: PHP Includes - how to

Posted: Wed Mar 04, 2020 9:26 pm
by Pablo
Did you set the page extension to php?