473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cant get include to work...

Hi

This may be easy to most of you, but as a newbiw; I'm struggling.

I am bringing in an include into a php file, but cant run the commands
within the include.

As an example, Within my php page I write:

{php}include("content/myinclude.php");{/php}

and the contents of myinclude.php is:

{php}
print "Hello";
{/php}
<br />This is just placeholder text

Then when I view the page in the browser I see that the include is
being brought in but is displayed as:

{php} print "Hello"; {/php}
This is just placeholder text

And the {php} doesn't execute.

I have set both the include and the page it is being brought into as
executable on the unix server it is sitting on.

I am right in saying that the result should only be:

Hello
This is just placeholder text

Aren't I?

Many Thanks

John

Jan 22 '08 #1
5 1150
I wish I could delete this message. Just figured it out. Sorry.
Jan 22 '08 #2
On Jan 22, 10:21 am, johnwebster9865 <johnwebster9...@yahoo.com>
wrote:
Hi

This may be easy to most of you, but as a newbiw; I'm struggling.

I am bringing in an include into a php file, but cant run the commands
within the include.

As an example, Within my php page I write:

{php}include("content/myinclude.php");{/php}

and the contents of myinclude.php is:

{php}
print "Hello";
{/php}
<br />This is just placeholder text

Then when I view the page in the browser I see that the include is
being brought in but is displayed as:

{php} print "Hello"; {/php}
This is just placeholder text

And the {php} doesn't execute.

I have set both the include and the page it is being brought into as
executable on the unix server it is sitting on.

I am right in saying that the result should only be:

Hello
This is just placeholder text

Aren't I?

Many Thanks

John
Are you actually writing {php} and {/php} in your code or is that just
for the sake of illustration?
Jan 22 '08 #3
On 22/01/2008 in message
<0d**********************************@t1g2000pra.g ooglegroups.com>
johnwebster9865 wrote:
>{php}
print "Hello";
{/php}
<br />This is just placeholder text
I am new to php as well but I haven't seen that terminology so far.

Shouldn't it be:

<?php
print "Hello";
?>

--
Jeff Gaines Damerham Hampshire UK
This is as bad as it can get, but don't bet on it
Jan 22 '08 #4
johnwebster9865 wrote:
Hi

This may be easy to most of you, but as a newbiw; I'm struggling.

I am bringing in an include into a php file, but cant run the commands
within the include.

As an example, Within my php page I write:

{php}include("content/myinclude.php");{/php}

and the contents of myinclude.php is:

{php}
print "Hello";
{/php}
<br />This is just placeholder text

Then when I view the page in the browser I see that the include is
being brought in but is displayed as:

{php} print "Hello"; {/php}
This is just placeholder text

And the {php} doesn't execute.

I have set both the include and the page it is being brought into as
executable on the unix server it is sitting on.

I am right in saying that the result should only be:

Hello
This is just placeholder text

Aren't I?

Many Thanks

John
Are you actually using {php}? Because that's not valid PHP syntax.
To execute PHP you need to start the section with <?php and end it with ?>

Example:

<?php
print "Hello World!"
?>

I would guess that you have been looking at some template engine that
uses {} to mark the beginning of sections, in this case a PHP section
and when parsing the template file the code between {php} and {/php} is
handled accordingly.

- Jensen
Jan 22 '08 #5
johnwebster9865 wrote:
I wish I could delete this message. Just figured it out. Sorry.
John,

Don't worry about it. We all were beginners at one time. And I'm sure
we've all made similar mistakes! :-)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 22 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tiernan | last post by:
Hey everybody. I'm verry new to PHP and MYSQL and have been working on a form that when it is submitted stores the information into a mysql database. The main problem is that i'm trying to finish...
2
by: Greg | last post by:
I'm new to html and web coding, this is a simple one - appreciate your help! I'm attempting to get my browser bar links to reside in a single .asp file to avoid multiple additions to pages when...
6
by: Fozya | last post by:
Hi, I have problems compiling some code that perfectly runs in VS.Net in the G++. Here is what I got: MyClass a; MyClass b; //assign values to a and b .......
6
by: Simon Mansfield | last post by:
Im trying to make a C program that takes in a date (birthday) and tells the user how many days it has been since that date. So far I have got this... It compiles ok but then crashes, with no idea...
10
by: andrea catto' | last post by:
I have this giant library, it's static and it's all compiled in __fastcall fashion. I can not call any of those functions from winforms... even doing a wrapper off the main class, I still cant...
1
by: otupia | last post by:
Exercise : Given the diagram below. Transform the diagram into C++ program. Class Grade Private members :char letter;float score; Public Members :void SetScore( float );float GetScore(...
5
by: Ouwet5775 | last post by:
Hello peeps. Well i have tried runing the folwoing program several times, and i cant figure out what i am doing wrong. The goal of this is to input values for an array, find the maximum and the...
4
by: Beemer Biker | last post by:
I am adding at bindtime an htmlbutton and an html dropdownlist. The idea is to select the item in the list, hit the button and my callback code uses the ID.selectedindex to act on the item that...
8
by: Huma123 | last post by:
Hi! My problem is that i cant able to run a simple c program cause of this error... Unable to open include file 'stdio.h' unable to open include file 'conio.h' while these header files r...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.