PHP Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SlammedMedia
    Confirmed User
    • Apr 2008
    • 1573

    #1

    PHP Question

    I currently have php includes in my page like the one below...

    <?php include ("header.php"); ?>

    and I'm getting the following error when building my template:

    Template not saved: Your template currently contains raw PHP code using <? and ?> tags; you should instead use the special {php} or {phpcode} template functions for raw PHP code (see the software manual for details on these template functions)

    How should it look written properly?

    Thanks
    ICQ: 350-260-628
  • edgeprod
    Permanently Gone
    • Mar 2004
    • 10019

    #2
    Well, this isn't a problem with PHP. It's related to whatever you're using it with. Is this with CPanel or something similar? A software package using Smarty? Need more info.

    Comment

    • Voodoo
      ♥ ♦ ♣ ♠
      • Sep 2002
      • 10600

      #3
      Code:
      {php} include ("header.php"); {/php}
      Try this. I'm not 100% on it though. I don't know what template engine you're using.

      "I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

      Comment

      • edgeprod
        Permanently Gone
        • Mar 2004
        • 10019

        #4
        Is this TGPX? Looks like it.

        Comment

        • 19teenporn
          Confirmed User
          • Apr 2011
          • 3034

          #5
          Smarty in the house.

          Comment

          • edgeprod
            Permanently Gone
            • Mar 2004
            • 10019

            #6
            Originally posted by Voodoo
            Code:
            {php} include ("header.php"); {/php}
            Try this. I'm not 100% on it though. I don't know what template engine you're using.
            This is correct, if you're using TGPX. Single quotes are preferred for this instance, so:

            Code:
            {php} include ('header.php'); {/php}

            Comment

            • Jacob[Soft]
              Confirmed User
              • Mar 2010
              • 873

              #7
              Originally posted by edgeprod
              Well, this isn't a problem with PHP. It's related to whatever you're using it with. Is this with CPanel or something similar? A software package using Smarty? Need more info.
              agree, nothing to do with php, can you write in detail what you were doing and maybe post some screens, providing that we can help you.

              Comment

              • edgeprod
                Permanently Gone
                • Mar 2004
                • 10019

                #8
                Originally posted by Jacob[Soft]
                agree, nothing to do with php, can you write in detail what you were doing and maybe post some screens, providing that we can help you.
                It's TGPX. Just confirmed it on ICQ. I had a hunch.

                Comment

                • CHMOD
                  Confirmed User
                  • Jun 2003
                  • 1697

                  #9
                  If you think about security, your code could cause issues though. I would write it this way:

                  if(!file_exists('header.php')) {die("ERROR MESSAGE HERE");}
                  include ('header.php');

                  Sell our Silicone Dolls and make big money!

                  Our website:
                  https://www.sexdolls-shop.com/

                  Signup:
                  http://www.sexdollscash.com/sliiing/registration.php

                  Contact:
                  [email protected]

                  Comment

                  • edgeprod
                    Permanently Gone
                    • Mar 2004
                    • 10019

                    #10
                    Originally posted by CHMOD
                    If you think about security, your code could cause issues though. I would write it this way:

                    if(!file_exists('header.php')) {die("ERROR MESSAGE HERE");}
                    include ('header.php');

                    Yeah, we addressed that through ICQ, and got rid of the includes, haha.

                    Comment

                    • just a punk
                      So fuckin' bored
                      • Jun 2003
                      • 32393

                      #11
                      Originally posted by SlammedMedia
                      I currently have php includes in my page like the one below...

                      <?php include ("header.php"); ?>

                      and I'm getting the following error when building my template:

                      Template not saved: Your template currently contains raw PHP code using <? and ?> tags; you should instead use the special {php} or {phpcode} template functions for raw PHP code (see the software manual for details on these template functions)

                      How should it look written properly?

                      Thanks
                      It's because you are trying to insert your PHP code into a smarty template. Read this: http://www.smarty.net/docsv2/en/language.function.php
                      Obey the Cowgod

                      Comment

                      • CHMOD
                        Confirmed User
                        • Jun 2003
                        • 1697

                        #12
                        Originally posted by edgeprod
                        Yeah, we addressed that through ICQ, and got rid of the includes, haha.

                        Sell our Silicone Dolls and make big money!

                        Our website:
                        https://www.sexdolls-shop.com/

                        Signup:
                        http://www.sexdollscash.com/sliiing/registration.php

                        Contact:
                        [email protected]

                        Comment

                        Working...