GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Question (https://gfy.com/showthread.php?t=1059664)

SlammedMedia 03-01-2012 07:48 PM

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

edgeprod 03-01-2012 07:54 PM

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. :)

Voodoo 03-01-2012 07:55 PM

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.

edgeprod 03-01-2012 07:55 PM

Is this TGPX? Looks like it.

19teenporn 03-01-2012 07:55 PM

Smarty in the house.

edgeprod 03-01-2012 07:58 PM

Quote:

Originally Posted by Voodoo (Post 18795390)
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}

Jacob[Soft] 03-01-2012 07:58 PM

Quote:

Originally Posted by edgeprod (Post 18795388)
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.

edgeprod 03-01-2012 07:59 PM

Quote:

Originally Posted by Jacob[Soft] (Post 18795400)
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. :thumbsup

CHMOD 03-02-2012 12:54 AM

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');

:2 cents:

edgeprod 03-02-2012 01:04 AM

Quote:

Originally Posted by CHMOD (Post 18795728)
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');

:2 cents:

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

just a punk 03-02-2012 01:40 AM

Quote:

Originally Posted by SlammedMedia (Post 18795374)
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

CHMOD 03-02-2012 02:39 AM

Quote:

Originally Posted by edgeprod (Post 18795740)
Yeah, we addressed that through ICQ, and got rid of the includes, haha. :thumbsup


:thumbsup


All times are GMT -7. The time now is 12:49 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123