I want the value that was inserted into the search-form to remain after i am redirected to the search results page i use <input id="......" type="text" value="<?php echo htmlspecialchars($_POST['terms'])?>" /> I"ve used this :
How to execute a PHP code in templates? **
The script can execute a PHP code in templates. We don’t recommend this solution, but if it is necessary, please use it with consideration. To enable execution of a PHP code in templates:
edit the “database/config/general.php” file and change value of the “$config[’embed_php’]” variable to:
$config['embed_php'] = true;
edit any template from the “templates/default/” directory and insert the code there e.g.:
<?php phpinfo(); ?>
Templates with extension tpl can be viewed by an internet browser. We recommend to hide these files when PHP code is included in template files. In the “templates/default/” directory create a “.htaccess” file with content:
Options +Indexes IndexIgnore *.tpl <files *.tpl> order allow,deny deny from all </files>
in the search box it shows me this message : Parse error: syntax error, unexpected , expecting ',' or ';' in /home/vhosts/sunpower.eu5.org/core/libraries/tpl-parser.php(120) : eval()'d code on line 1<br><center><a target='_blank' href='www.freewebhostingarea.com'><img src='users.freewebhostingarea.com/i/freehosting.png' border='0' width='88' height='15' alt='Free Web Hosting'></a></center> the eval code is ok .... what should i do ?
I've changed the code but still nothing , it don't save the form value and post it on the search page in the same search form . Under <!-- BEGIN HEAD --> in container.tpl i've inserted <?php phpinfo(); ?> I've changed <input id="s" type="text" value="<?php echo htmlspecialchars($_POST['terms'])?>" /> to this <input id="......" type="text" value=" <?php echo htmlspecialchars( isset( $_POST['terms'] ) ? $_POST['terms'] : null ); ?> " /> the form remains empty when i hit search button and i am redirected to the serch result page my edited sites' source is www.sunpower.eu5.org/backups-1348669890.zip I don't know what to do , can you give me the edited container.tpl ? or the whole form source from container.tpl ?
wooooooohoooo ! I've done it , all i had to do was to add name="terms" after <input id="s" :D --- Now the search script looks like this : ------> <!-- IF:START SEARCH-FORM --> <form method="post" action="$sLinkSearch" id="searchForm2"> <fieldset> <span> <label for="$lang[search]">$lang[search]</label><input id="s" name="terms" type="text" size="15" value="<?php echo htmlspecialchars( isset( $_POST['terms'] ) ? $_POST['terms'] : null); ?>" /></span> <em><input type="submit" value="$lang[search] »" class="submit" /></em></span> </fieldset> </form><!-- IF:END SEARCH-FORM --> - Thanck you so much ! Now I have a fully functional Jquery google search in Quick.cart :p