473,770 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2380
Jonny T <jo****@someisp 3.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 htmlspecialchar s like this
$phpstrsp="<?ph p";
$phpstrsp=htmls pecialchars($ph pstrsp);
echo $phpstrsp;
"Jonny T" <jo****@someisp 3.com> ???????/???????? ? ???????? ?????????:
news:c4******** **@sparta.btint ernet.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****@someisp 3.com> wrote in message
news:c4******** **@sparta.btint ernet.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****@someisp 3.com> wrote in message
news:c4******** **@sparta.btint ernet.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
3248
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 die("no select"); $row = mysql_fetch_array($result,MYSQL_ASSOC); while ($row = mysql_fetch_array($result)) {
1
3143
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 refine the results on the page in question until the target item can be found. This search refinement is where the self-processing form comes to play. The search results are listed in a table with a radio button at the end of each row. What I...
12
2280
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 View-Source. I tried to skip the line with <? using the following code: @ $fp=fopen("a.php","r"); while (!feof($fp)) { $line=fgets($fp);
3
2446
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 any errors but the browser renders the table incorrectly. I got round this by introducing another variable j=i-2 and using it in place of i-2 It works. However I am interested to understand why is does not work with i-1. Any comments?
1
6827
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
16
1946
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 was something like : <?= $myVar; ?> Is this an out dated method? Is it compatible with all versions of PHP (since implementation at least)?
3
1724
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 then I shall use "<<previous<< 2 3 4 5 >>next>>" scheme. but i don't have any idea. If user clicks 3rd page. I shall show the 3rd page. How should I do this ? should I again query the whole or a portion ? what is the function
2
3730
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 display a list of news articles. I'm outputing the results using XSLT. I'm using the following code to strip the returned pubdate and then calculate the time between today's date and the pubdate. <xsl:template match="f">
2
1312
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 script. After a while of debugging the code, commenting out lines etc I figured out the above line was causing the issue by changing it to:
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.