|
Note: You can get this functionality and more with MosModule.
Step1: Download the MosModule (superceed MosAddphp) script from my download. Install the MosModule in your mambots/ folder and create another folder in your website root called mosaddphp or mosmodule.
Step2:Copy the following code into a file called "mosaddphp/test.php"
Note: There is a hello.php in MosModule distribution that have this included.
Note: Do not include "<pre>" and "</pre>"
<pre>
<fieldset><legend><b>EXAMPLE</b></legend><form action="index.php" method="get">
<input type="hidden" name="option" value="<?php echo mosGetParam( $_REQUEST, 'option', "" ); ?>">
<input type="hidden" name="task" value="<?php echo mosGetParam( $_REQUEST, 'task', "" ); ?>">
<input type="hidden" name="id" value="<?php echo mosGetParam( $_REQUEST, 'id', "" ); ?>">
<input type="hidden" name="Itemid" value="<?php echo mosGetParam( $_REQUEST, 'Itemid', "" ); ?>">
<b>Enter Your First Name:</b> <input name="firstname" type="text" value="
<?php echo $mosaddphp_params[0];?>" size="20">
<input name="submit" type="submit" value="submit">
</form>
<p></p>
<?php
$firstname = mosGetParam( $_REQUEST, 'firstname', "" );
echo "<b> Your First Name is: <font size=+2>".$firstname."</font></b>";
if ($mosaddphp_params[1]){
echo "<p>This content is only displayed because there is a second parameter defined, the value of this parameter is <b>".$mosaddphp_params[1]."</b>";}
?>
</fieldset>
</pre>
Step3: Create a new Content Item and include the following text to the page:
{mosaddphp:test.php,enter your name here,2nd_parameter}
You can do the same with MosModule and the code is below:
Note: Extra space to avoid parsing the bot
{ mosmodule phpinc=hello.php,firstname,lastname}
Add comments:
|
Comments
There are no comments yet. Feel free to add one using the form below. You are not authorized to leave comments. Please login first. |
|