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: 92
Joined: Sun Feb 04, 2018 8:19 pm

PHP Includes - how to

Post by LJLachance » Sun Feb 04, 2018 9:10 pm

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: 14502
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Includes - how to

Post by Pablo » Sun Feb 04, 2018 9:17 pm

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: 92
Joined: Sun Feb 04, 2018 8:19 pm

Re: PHP Includes - how to

Post by LJLachance » Mon Feb 05, 2018 1:38 am

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: 92
Joined: Sun Feb 04, 2018 8:19 pm

Re: PHP Includes - how to

Post by LJLachance » Mon Feb 05, 2018 3:43 am

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: 14502
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: PHP Includes - how to

Post by Pablo » Mon Feb 05, 2018 7:16 am

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: 92
Joined: Sun Feb 04, 2018 8:19 pm

Re: PHP Includes - how to

Post by LJLachance » Mon Feb 05, 2018 12:11 pm

Thanks, I'll see what I can figure out.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests