Jump to content

Recommended Posts

Posted

Hey everyone,

Just wondering if the pages you can create through the admin panel will accept PHP and show it in the site. If not how could I display a php page?

cheers,

roboa

  • Administrators
Posted

You can create your own php pages and place them in the "Pages" folder and then call them through  <your site>/index.php/Pages/yourpage, or that is what has worked for me. I have not tried the pages module in the admin center although I think that is designed for static pages versus pages that are calling functions and such. It is easy to create your own module as well and create new dynamic pages through that method. The great way Nabeel has designed this app makes it easy to add your own content.

  • Administrators
Posted

If you're gonna use a lot of php, it's better to create a module, and you can call whatever you want in it.

If it's just a few lines, you can add them via the html pages in /core/pages/[yourpage].htm. I am not sure if you can add PHP directly using the source mode of the editor

  • 3 weeks later...
Posted

I've put 2 pages in the pages folder which contain this php:

<?php

echo "Hello, this is a test of the page test.php!!";

?>

One file is test2.php and the other is just test.htm and neither will show. I just get the page missing alert. Am I doing something wrong?

cheers,

roboa

Posted

Ok, so I now have a file called test.htm in the core/pages folder with this content in it:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>test</title>
</head>

<body>
<?php

echo "Hello, this is a test of the page test.php!!";

?>
</body>

</html>

So the address for the page would be http://fcava.co.uk/index.php/pages/test but it displays the no page error. When I try to add the page through the admin panel I get this error:

Warning: fopen(/home/fcava./public_html/core/pages/phptest.htm) [function.fopen]: failed to open stream: Permission denied in /home/fcava./public_html/core/common/SiteData.class.php on line 255

cheers,

roboa

  • Administrators
Posted

You have to add the page in the admin panel first, then edit the file.

Seems like permissions are not set to 777 in core/pages (for the folder and files it must be writable)

Posted

Cheers Nabeel, got that working all nicely now!

I'm trying to call the routemap to a page now and am using this:

<?php

MainController::Run("RouteMap", "ShowMap");

?>

Now, it sort of works and does bring up a google map but with no information and some joyful errors :D Is there anyway I can modify that to make it work?

Posted

These are the errors I get:

Warning: Missing argument 1 for RouteMap::ShowMap(), called in /home/fcava./public_html/core/classes/MainController.class.php on line 295 and defined in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 39

Warning: Invalid argument supplied for foreach() in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 50

Warning: Division by zero in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 74

Warning: Division by zero in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 75

  • 1 month later...
Posted

Tried to edit the htm file in core/pages and i'm getting the following after trying to save;

[a fatal error or timeout occurred while processing this directive]

Have tried editing the permissions but it won't allow me to.

-James

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...