using {php}{/php}, user defined tags, and global contents
Posted: Sat Sep 09, 2006 8:32 pm
Hi,
I have been away for a while. I am working on a new project and I am having problems incorporating php with cmsmadesimple. To use php I usually set a user defined tags and than add it as {my_userdefinedname} to my pages. However, I am having a problem when what I needed call is a mixture of php and html. It defeats the purpose of cms when I have to setup over 100 userdefined tags for each instance of php in my php/html form. I know I can use the form modules but, the form I need is similar to a "job application form" it has about 25+ fields. Plus it is posting to my db and sending an email confirmation to me and the applicant.
With that being said, I have tried several ways. I have setup a separate php page (which is a mix of php/html) and did a call from my cms page content as {php} include_once('pathtofile/form.php'); {/php} which did not work. I have tried {literal} include_once('pathtofile/form.php'); {/literal} which did not work either. It would either show nothing, show what I have typed. I have tried setting up a user defined for includes and it does not call the page. I have tried replacing each instance of in in my forms with {php} and {/php} which gives me a smarty error "line xxxx cannot recognize" etc etc.
Does anyone know the best way to call php pages that contain php/html. Below is a snippet of what the form looks like so you will see an idea of my challenge of using this with cms.
==========================
==========================
that is just a snippet to give you a visual. Any suggestions?
. Thanks in advance everyone.
I have been away for a while. I am working on a new project and I am having problems incorporating php with cmsmadesimple. To use php I usually set a user defined tags and than add it as {my_userdefinedname} to my pages. However, I am having a problem when what I needed call is a mixture of php and html. It defeats the purpose of cms when I have to setup over 100 userdefined tags for each instance of php in my php/html form. I know I can use the form modules but, the form I need is similar to a "job application form" it has about 25+ fields. Plus it is posting to my db and sending an email confirmation to me and the applicant.
With that being said, I have tried several ways. I have setup a separate php page (which is a mix of php/html) and did a call from my cms page content as {php} include_once('pathtofile/form.php'); {/php} which did not work. I have tried {literal} include_once('pathtofile/form.php'); {/literal} which did not work either. It would either show nothing, show what I have typed. I have tried setting up a user defined for includes and it does not call the page. I have tried replacing each instance of in in my forms with {php} and {/php} which gives me a smarty error "line xxxx cannot recognize" etc etc.
Does anyone know the best way to call php pages that contain php/html. Below is a snippet of what the form looks like so you will see an idea of my challenge of using this with cms.
==========================
Code: Select all
<form action="#ffStart" method="post" enctype="multipart/form-data">
<div class="FORMfields">
<h1 class="FORMfields"><?= FF_FORM_TITLE ?></h1>
<? if ($action == FF_DONE) { ?>
<br />
<div style="font: normal normal bold 18px verdana;">
Thank you for your submission.
</div>
<div style="margin-top:20px;font: normal normal bold 12px verdana;">
Note: Please click <a href="/">here</a> if your browser does not redirect in <?= SLEEP ?> seconds.
</div>
<br />
<? } else {
if ($action == FF_CONFIRM) {
?>
<h3 class="FORMfields">
Please confirm that the following data is correct:
</h3>
<?
} else {
?>
<div style="text-align:right;">
<span class="required">*</span><span class="help" style="padding-left:0px;font-size:9px;"> - required</span>
</div>
<?
}
?>
<?= $formBean->getIfError() ?>
<table class="tableHelpers">
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getLabelTag("Name") ?></div></td>
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getFieldTag("Name") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getLabelTag("Email") ?></div></td>
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getFieldTag("Email") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getLabelTag("Phone") ?></div></td>
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getFieldTag("Phone") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getLabelTag("Street") ?></div></td>
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getFieldTag("Street") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getLabelTag("City") ?></div></td>
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getFieldTag("City") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getLabelTag("State") ?></div></td>
<td class="tableHelpersFormFields2" ><div class="cell"><?= $formBean->getFieldTag("State") ?></div></td>
</tr>
<tr class="tableHelpersFormFields">
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getLabelTag("Zip") ?></div></td>
<td class="tableHelpersFormFields1" ><div class="cell"><?= $formBean->getFieldTag("Zip") ?></div></td>
</tr>
that is just a snippet to give you a visual. Any suggestions?