keneso Posted April 6, 2015 Share Posted April 6, 2015 Hi, I have created a custom page, and need to add a custom form to it. I tried adding the form to the page, but I get some of the custom php displayed, most probably is because my custom form has honeypot field, and time limit with this in the header: <?php session_start(); $_SESSION['time'] = time(); $sol = array(); for($i=1;$i<=3;$i++): $sol[] = rand(1,9); endfor; $_SESSION['sol'] = array_sum($sol); //print_r($_SESSION['sol']); ?> <!DOCTYPE html> The code in the form is this <?php if(isset($_SESSION['lastname'])){ echo $_SESSION['lastname'];}?> And the output in the page (inside the field) is this <?php if(isset($_SESSION['lastname']))?> Of course the same is with other fields. Or maybe there is a much easier way to do it using WHMCS settings? Thank you 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted May 12, 2015 Share Posted May 12, 2015 If you are putting this code on a WHMCS page (i.e. in a TPL file) then you would need to use these tags to open and close PHP: {php} {/php} So instead of this: <?php if(isset($_SESSION['lastname']))?> You would use this: {php} if(isset($_SESSION['lastname'])){/php} 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.