PHP code not working

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
stinhambo

PHP code not working

Post by stinhambo »

I have a form that I use in my static XHTML pages which works great. Here is an exerpt from the code -

#footercontent" enctype="multipart/form-data">



Company:
" />



I have tried to create a custom tag and global content blocks but even if I strip the <?php from the code it still doesn't work properly. I'm going mad as I'm 95% of the way to getting the site finished!!

Can someone help me out?
cyberman

Re: PHP code not working

Post by cyberman »

Have you tried something like this?



Company:

You have to allow smarty plugins in config.php ...
stinhambo

Re: PHP code not working

Post by stinhambo »

I'll give that a go!

I was coding at about 4am so I probably run out of steam and decided to post here.

I'll show off the site when I'm done :)
stinhambo

Re: PHP code not working

Post by stinhambo »

I have enabled smarty tags but the bloody editor keeps cutting down my code.

I start with this -

" enctype="multipart/form-data">

So I convert it to this -



I then get error messages such as 'Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/hambo/public_html/185theterrace/tmp/templates_c/%%89^89F^89F8ECB5%%globalcontent%3Acontactform.php on line 6' on the HTML page and when I go back to the CMS I get this -




For the full page I want to convert -

">

#footercontent" enctype="multipart/form-data">




Company:
" />




       
Name:
" />





Phone Number:
" />





Email:
" />





Message:













">

Thank you!
Your message has been sent!



PS. I am putting the above in a Global Conent Block and the PHP for the form in a User Defined Tag.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: PHP code not working

Post by calguy1000 »

turn off the editor and try again.

wysiwygs are a curse :)
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
stinhambo

Re: PHP code not working

Post by stinhambo »

aha thats better but just a couple of problems...

1. No email is sent

2. My class variables aren't working - . It used to have '<?php=' but if I put '{php}=' it comes up with an error (unexpected =)

3. When I submit the email it jumps to the front page...


PS. I love this CMS though!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: PHP code not working

Post by calguy1000 »

try {php}echo $variable;{/php}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
stinhambo

Re: PHP code not working

Post by stinhambo »

tried that and it didn't work :(
stinhambo

Re: PHP code not working

Post by stinhambo »

I'm trying out the feedback form now...
Locked

Return to “CMSMS Core”