PHP Includes - how to

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
LJLachance
 
 
Posts: 117
Joined: Sun Feb 04, 2018 8:19 pm
Location: Jacksonville, FL
Contact:

PHP Includes - how to

Post 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
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Includes - how to

Post 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.
LJLachance
 
 
Posts: 117
Joined: Sun Feb 04, 2018 8:19 pm
Location: Jacksonville, FL
Contact:

Re: PHP Includes - how to

Post 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.
LJLachance
 
 
Posts: 117
Joined: Sun Feb 04, 2018 8:19 pm
Location: Jacksonville, FL
Contact:

Re: PHP Includes - how to

Post 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?
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Includes - how to

Post 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.
LJLachance
 
 
Posts: 117
Joined: Sun Feb 04, 2018 8:19 pm
Location: Jacksonville, FL
Contact:

Re: PHP Includes - how to

Post by LJLachance »

Thanks, I'll see what I can figure out.
satbho458@gmail.com
 
 
Posts: 1
Joined: Sun Mar 01, 2020 6:26 am

Re: PHP Includes - how to

Post 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.
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: PHP Includes - how to

Post by Pablo »

Did you set the page extension to php?
Post Reply