jim6763nva
11-13-2005, 10:07 PM
Ok - This is for everyone that has been having problems creating and adding a custom PHP Page. If you don't understand something here, please reply or email me and I'll come back and update this thread.
STEP 1: Create your PHP page as you normally would.
Example:
Test.php
<?php
// Query your database and get a result set
// Loop through your records and either echo your html and php code,
// or just emdbed your html such as:
$var = "Hello World";
?>
<!-- This will print out hello world
This line is html and should print out <?= $var; ?>
<?php
// PHP code here if needed.
?>
Place your PHP code whereever you store your custom php files. I tested with them in my web root folder.
STEP 2: Add Your PHP File as a PHP Page.
ACP => vba CMPS => Add Page => PHP Page
Page Title: Test Page
Page Identifier: testpage
Parent Name: change if needed
Custom Style for this page: change as needed
Active: Yes
Path To File: Enter the path to your php file to be included
Clean File Output: I've gotten it to work with this set to Yes and No.
Use Module Shell Template: Yes
KEY ITEM: Modules Enabled Section
Make Sure You Have The Custom Page Content Module Active for this PHP Page. If you don't your PHP Code will not be displayed. I think this is a major area that Admins don't realize.
Templates are not needed or used to display output from a PHP Page..
I hope this will help save others many hours of time and frustration. Again, let me know if I have not been clear on something and I will try to help.
Regards,
Jim
STEP 1: Create your PHP page as you normally would.
Example:
Test.php
<?php
// Query your database and get a result set
// Loop through your records and either echo your html and php code,
// or just emdbed your html such as:
$var = "Hello World";
?>
<!-- This will print out hello world
This line is html and should print out <?= $var; ?>
<?php
// PHP code here if needed.
?>
Place your PHP code whereever you store your custom php files. I tested with them in my web root folder.
STEP 2: Add Your PHP File as a PHP Page.
ACP => vba CMPS => Add Page => PHP Page
Page Title: Test Page
Page Identifier: testpage
Parent Name: change if needed
Custom Style for this page: change as needed
Active: Yes
Path To File: Enter the path to your php file to be included
Clean File Output: I've gotten it to work with this set to Yes and No.
Use Module Shell Template: Yes
KEY ITEM: Modules Enabled Section
Make Sure You Have The Custom Page Content Module Active for this PHP Page. If you don't your PHP Code will not be displayed. I think this is a major area that Admins don't realize.
Templates are not needed or used to display output from a PHP Page..
I hope this will help save others many hours of time and frustration. Again, let me know if I have not been clear on something and I will try to help.
Regards,
Jim