Pass PHP code to page from record

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 29, 2014   (RSS)

By nmsinc - May 26, 2014

I want to store some PHP code within a record then pass it through to a page. How can this be done without it parsing as HTML?

Thanks - nmsinc

nmsinc

By Damon - May 26, 2014

Hi,

You may be able to include the code already in the target page and then pass in variables and a trigger for the code through the URL.

Can you give me some more details of what you are trying to do and code you want to pass?

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By nmsinc - May 26, 2014

Hi Damon,

I want to allow users to customize their listing grid. The code below will be triggered to replace the current static code when the user has set the record to do so!

Thanks - nmsinc


<td align="center" bgcolor="<?php echo $bgColor ?>">
<?php if ($record['acknowledgment'] == "Accepted"): ?>
<img border="0" alt="" height="25" src="../images/yes.png" width="25" /></a>
<?php elseif ($record['acknowledgment'] == "Rejected"): ?>
<img border="0" alt="" height="25" src="../images/no.png" width="25" /></a>
<?php else: ?>
<img border="0" alt="" height="25" src="../images/warning.png" width="25" /></a>    
<?php endif; ?>
</td>

nmsinc

By Damon - May 27, 2014

Hi nmsinc,

Sorry but I'm missing something here.

You have a page that is displaying different images (yes, no, warning) depending on what the user has set for that record.

What are you then passing into another page?

Maybe can you include both pages and provide so more details?

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Damon - May 29, 2014

Hi,

So it looks like the users will be able to change the sort order of the Categories?

Would passing a URL like this for a set of prefined sort options work?
http://example.com/page.php?sort=numeric
http://example.com/page.php?sort=numeric_reverse
http://example.com/page.php?sort=other

Then in the page.php file you could have code that matches the sort variable (from the URL) and then passes that into the sort order for that page.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/