PDA

View Full Version : Use an actual php document for a "Page"?


dbassett74
07-02-2004, 02:59 PM
Is it possible that rather than using a template, to use a php document for a "page"? For example, when you go to add a page to CMPS, you only have the option of specifying a template to populate the content. However, I would like to select a php page, much like you do when you add a module. Why can you specify a page for a module, but not for a page? Any help on how to do this would be appreciated.

Brian
07-02-2004, 03:06 PM
http://www.vbadvanced.com/membersarea.php?do=viewmanual&productid=4&pageid=6 ;)

Our Sponsors
 

mholtum
07-02-2004, 03:07 PM
You could use a template to display the .php page and then include that as the new page content.

dbassett74
07-02-2004, 03:41 PM
http://www.vbadvanced.com/membersarea.php?do=viewmanual&productid=4&pageid=6 ;)

But this seems to add content to my forums, not my home page based on CMPS. What I was looking for was to be able to include a PHP page at my home page via CMPS rather than having to use a template.

Our Sponsors
 

Brian
07-02-2004, 03:43 PM
Ahhh, got ya... Why not just add the php page as a module, and then have it active only on that particular page?

dbassett74
07-02-2004, 03:43 PM
You could use a template to display the .php page and then include that as the new page content.

Can you give me an example of how to do this? For example, I have a CMPS page called "test". Within there, I want to display a file called "test.php". In this test.php file, I have the following command:

echo $HTTP_GET_VARS['id']

dbassett74
07-02-2004, 03:55 PM
Ahhh, got ya... Why not just add the php page as a module, and then have it active only on that particular page?

DOH!! I don't know why I didn't even think about that approach. I guess I was just spacing out or something. But let me ask you, is the $HTTP_GET_VARS['id'] available doing this? For example, say I have a page called "test". That page shows the module named "test". The module displays a php page called "test.php". If I call it as cmps_index.php?page=test?id=1, will 'id' be available?

Brian
07-02-2004, 04:06 PM
Should be...

mholtum
07-02-2004, 04:16 PM
Can you give me an example of how to do this? For example, I have a CMPS page called "test". Within there, I want to display a file called "test.php". In this test.php file, I have the following command:

echo $HTTP_GET_VARS['id']
You would have to use IFrames to accomplish this.




<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">

<tr>
<td class="$getbgrow"><span class="smallfont">
<center>
<iframe src="http://www.yoursite.com/yourfile.php" width="155" height="250"></iframe>
</center>
</span>
</td>
</tr>
</table>
<br />


I used something similar to pull a php file into a module on my site. I would think it would work for a custom page as well. I havent tried it.

dbassett74
07-02-2004, 04:43 PM
Ahhh, got ya... Why not just add the php page as a module, and then have it active only on that particular page?

This doesn't seem to work at all as it makes the screen go blank. The php file I'm including only has the following lines:

<?php
echo 'Hello World!'
?>

I have created a module called test. That module includes a file called test.php which has only the above lines.

Do you know what I'm doing wrong here??

dbassett74
07-02-2004, 04:44 PM
You would have to use IFrames to accomplish this.




<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">

<tr>
<td class="$getbgrow"><span class="smallfont">
<center>
<iframe src="http://www.yoursite.com/yourfile.php" width="155" height="250"></iframe>
</center>
</span>
</td>
</tr>
</table>
<br />


I used something similar to pull a php file into a module on my site. I would think it would work for a custom page as well. I havent tried it.

Sorry but frames are not an option for me. Any other way?

dbassett74
07-02-2004, 05:08 PM
Should be...

Okay, I finally got this thing to work, however, $HTTP_GET_VARS['id'] does not seem to work. I just returns blank all the time. Is it not possible to have this in the php file and then have it display via the module? This is critical as this module will show different things based on the id passed in to it. Any help would be appreciated.