Headhunter
|
| Posted: 05/07/2003, 2:53 PM |
|
Hello,
My project: CCS2 + MySQL + PHP
What I want to do is make a custom include page that is meant to have some custom variables (settings). For example, I want to specify the nr of records returned per page and that sort of stuff.
For example, I want specify the nr of records returned per page for my newspage in a custom settings include file. What is the best way to do this? At the moment the nr of records returned is hard coded in the php file of that grid.
So I want the value of "20" in the following code specify in a settings file:
I also want to add other settings to that include file so I have only to edit 1 file to reflect the changes in my project.
$this->PageSize = 20;
Thanks
|
|
|
 |
Headhunter
|
| Posted: 05/09/2003, 11:33 AM |
|
Anyone?
|
|
|
 |
rrodgers
|
| Posted: 05/09/2003, 6:31 PM |
|
I do this in ASP. I don't use PHP much but it looks like if you just create your custom php file.
The include file needs to have
<?php
//
// All you script vars and functions go here.
//
?>
Then in the common.php file, near the top where the other includes are, add your own include call to your new page
include(RelativePath . "/my_custom_inc.php");
Maybe someone with more php experience will jump in and correct the syntax but that is the general idea.
|
|
|
 |
rclayh
|
| Posted: 05/09/2003, 8:54 PM |
|
You might find it easier to just persist the custom variables in a MySQL table and call them from the page. Set up a mysettings table with your variables and just call that table. You can use PHPMyAdmin or any tool to edit the database and it's almost the same as editing a single page.
|
|
|
 |
Headhunter
|
| Posted: 05/11/2003, 3:15 PM |
|
I've put my settings in the db like rclayh suggested.
It works fine.
You can have a look at:
http://www.dbweaver.com/weavernews_demo/viewnews.php
http://www.dbweaver.com
|
|
|
 |