472,950 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

echo "<?php"

hi,
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...

if I use

echo "<\?php";

then the string is displayed as : <\?php

Is there anything I can do ??
Jul 17 '05 #1
5 2338
Jonny T <jo****@someisp3.com> wrote:
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...

if I use

echo "<\?php";

then the string is displayed as : <\?php

Is there anything I can do ??


Yes, have a look at the HTML source.

JOn
Jul 17 '05 #2
use htmlspecialchars like this
$phpstrsp="<?php";
$phpstrsp=htmlspecialchars($phpstrsp);
echo $phpstrsp;
"Jonny T" <jo****@someisp3.com> ???????/???????? ? ???????? ?????????:
news:c4**********@sparta.btinternet.com...
hi,
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...

if I use

echo "<\?php";

then the string is displayed as : <\?php

Is there anything I can do ??

Jul 17 '05 #3
Ike
Just looking at how I have done it succesfully in the past as....
$fp = fopen($savename, "w+");
fputs($fp, "<?php" . "\n");

//-Ike
"Jonny T" <jo****@someisp3.com> wrote in message
news:c4**********@sparta.btinternet.com...
hi,
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...

if I use

echo "<\?php";

then the string is displayed as : <\?php

Is there anything I can do ??

Jul 17 '05 #4
"Jonny T" <jo****@someisp3.com> wrote in message
news:c4**********@sparta.btinternet.com...
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...


Try:
echo "&lt;?php";

-or-

echo '<?php';
Jul 17 '05 #5
On Wed, 31 Mar 2004 14:23:21 +0000, Jonny T wrote:
hi,
i want to echo the string '<?php' in a php script like :

echo "<?php";

but when i try nothing gets displayed ...

if I use

echo "<\?php";

then the string is displayed as : <\?php

Is there anything I can do ??

echo '&lt;php'
You need to use the HTML entities character for '<' which is '&lt;'
(LessThan). This will also be valid (X)HTML too where '<?php' would not
even if it was displayed as you expected =)

Regards,

Ian
[XP honoured.. FU: comp.lang.php]

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #6

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

Similar topics

2
by: Ric | last post by:
i have a basic php file that is trying to select information from a mysql database. echo "<br>"; include("dbConnect.inc"); $query = "SELECT * FROM client"; $result = mysql_query($query) or...
1
by: Danny Anderson | last post by:
Hola, PHP folk! I have a php page that contains a self-processing form. The form holds search results. The search terms originally came from the previous page, but the user can repeatedly...
12
by: aa | last post by:
I am trying to read a.php file from another PHP file using fgets() and display its contents. As a.php starts with <? the browser IE6 does not show anything, although I can see all the contents in...
3
by: aa | last post by:
I am traing to output the following HTML string from PHP: "<td><input name='".$i-2."' size='2' type='text' onBlur='myfunction(".$i-2.")'></td>" But it somehow mistreats $i-2. PHP does not throw...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
16
by: rik | last post by:
I was flicking through a PHP book (one of the teach in 24 hour ones) and I came across something I had never seen before in PHP. It was a method of printing out without using the print method, it...
3
by: hSiplu | last post by:
hi all, I am creating a web project with php/mysql. one of qeury result is too high. it returs several thousand rows. But I can't show them in one page. So I wanna create more than one pages...
2
brettl
by: brettl | last post by:
Hey all. I'm not sure if this question should be posted here or in the XML forums. Please forgive me if its in the wrong place or feel free to move it. Any who, I'm using a SOAP service to...
2
by: Bill H | last post by:
I was working on some php code yesterday and one of the lines in it was: print "<?xml version=\"1.0\" ?>\n"; when I tried to run it I would get an unexpected $end on the last line of the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

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.