473,804 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble with echo <br />

I'm an extreme newbie, and have been nosing around the PHP.Net site for a
few days. Only, the search function returns alot of information that's not
truly relevant due to Coding samples at the bottom of the pages.

What I'm trying to determine is :

Which is better for printing info to a page based on dynamic variables?
IE - if I have a boolean = True, should I use PrintF, print, echo to spit
out the info?

Also, when I use either, and have a <br /> in the statement, it puts <br>
instead, and I can't for the life of me get it to put /> there at the end.

And one more thing (begins a rambling rant o questions), the syntax for
boolean use (basic format?)

I used
$good = TRUE

if($good == TRUE) { echo "blah <br />" } and it doesn't seem to trigger.

If I use = TRUE, it triggers, but i think that's wrong for some reason.

-Khai
Dec 2 '05
14 16489
Khai wrote:
Man, you were so right. AS soon as I saw the first Try $good = TRUE; it
dawned on me that I never set the $good to anything except FALSE. So when
it was testing for $good == TRUE it was coming up false, because $good was
never ever set to true, it was just an empty var. *smacks forhead*.

However, I changed my echo setup and went with escaping to HTML, IE:

<?php if ($good = TRUE) { ?>
blah blah <br />
<?php }; ?>

THat seems to work better, but still having issues getting the <br />
instead of the <br> it keeps punching out. Perhaps it's just in cache and I
need to clear it.


How do you know it is producing <br>? Where are you looking at it?
It looks as if something along the way is rewriting your XHTML as HTML.

Colin
Dec 7 '05 #11

"Colin Fine" <ne**@kindness. demon.co.uk> wrote in message
news:dn******** ***********@new s.demon.co.uk.. .
How do you know it is producing <br>? Where are you looking at it?
It looks as if something along the way is rewriting your XHTML as HTML.

Colin


I'm looking at the output in the browser (FireFox), and then view source.

My code is simply an <?php IF ( ) { ?> html code <br /> <?php } ?> to
generate an output. I've also tried echo, and print_f and when I look at the
output in a browser, via view source, it changes the <br /> to a <br>

*screaming and losing hair*

-khai
Dec 7 '05 #12
In our last episode,
<We************ ********@comcas t.com>,
the lovely and talented Khai
broadcast on comp.lang.php:

"Colin Fine" <ne**@kindness. demon.co.uk> wrote in message
news:dn******** ***********@new s.demon.co.uk.. .
How do you know it is producing <br>? Where are you looking at it?
It looks as if something along the way is rewriting your XHTML as HTML.

Colin
I'm looking at the output in the browser (FireFox), and then view source. My code is simply an <?php IF ( ) { ?> html code <br /> <?php } ?> to
generate an output. I've also tried echo, and print_f and when I look at the
output in a browser, via view source, it changes the <br /> to a <br> *screaming and losing hair*


I don't understand why that outputs anything.

() should never be true, so if() should never execute whatever
is in the brackets.

if(1) outputs

html code <br />

but that isn't an html document, and in any event
my firefox doesn't change the <br /> to <br>
--
Lars Eighner us****@larseigh ner.com http://www.larseighner.com/
"We have no opinion on your Arab - Arab conflicts, such as your dispute with
Kuwait." -- Bush's Ambassador April Glaspie, giving Saddam Hussein
the greenlight to invade Kuwait.
Dec 7 '05 #13
Khai wrote:
"Colin Fine" <ne**@kindness. demon.co.uk> wrote in message
news:dn******** ***********@new s.demon.co.uk.. .
How do you know it is producing <br>? Where are you looking at it?
It looks as if something along the way is rewriting your XHTML as HTML.

Colin

I'm looking at the output in the browser (FireFox), and then view source.

My code is simply an <?php IF ( ) { ?> html code <br /> <?php } ?> to
generate an output. I've also tried echo, and print_f and when I look at the
output in a browser, via view source, it changes the <br /> to a <br>

*screaming and losing hair*

-khai

That's my point. By that time your output has gone through your server
and your browser. Have you looked at it with a different browser? (I'm
not aware that Firefox or any other browser alters the source it
receives when you ask to see it, but it's not impossible).

Is there a way you can look at it as it leaves your server (I admit I
can't quite see how).

Colin
Dec 8 '05 #14
Lars Eighner wrote:
In our last episode,
<We************ ********@comcas t.com>,
the lovely and talented Khai
broadcast on comp.lang.php:
"Colin Fine" <ne**@kindness. demon.co.uk> wrote in message
news:dn****** *************@n ews.demon.co.uk ...
How do you know it is producing <br>? Where are you looking at it?
It looks as if something along the way is rewriting your XHTML as HTML.

Colin


I'm looking at the output in the browser (FireFox), and then view source.


My code is simply an <?php IF ( ) { ?> html code <br /> <?php } ?> to
generate an output. I've also tried echo, and print_f and when I look at the
output in a browser, via view source, it changes the <br /> to a <br>


*screaming and losing hair*

I don't understand why that outputs anything.

() should never be true, so if() should never execute whatever
is in the brackets.

if(1) outputs

html code <br />

but that isn't an html document, and in any event
my firefox doesn't change the <br /> to <br>

I think you are being excessively literal, Lars. The word 'an' implies
that the code he just quoted is a schema, not the whole of the code.

Colin
Dec 8 '05 #15

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

Similar topics

4
7866
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my "languages" files and these are describes for things on my website. Example text looks like this:
6
12159
by: Lasse | last post by:
I have done this simple function, it seems to work as intended, to solve a problem i have had for a while. I couldnt find any sample around that was working for me. I would like to test it with you and see if there are any improvments that i should make ;-) It should be fast and if possible compatible with todays modern browser-standards. It should be activated by the onload-event. This is my code, free for all to use:
7
19168
by: noor.rahman | last post by:
I have an XML file that stores data from an HTML form. I use XSL to display the data in HTML format. The data may have newline characters. However, XSL is not displaying the newlines properly in the browser. I even replaced all the newlines with <BR/> tags but eventhough I see the tags in my source, I don't get a line break in the output document. Any help would be greatly appreciated.
7
2755
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
5
6081
by: SteveB | last post by:
How can I write a break on Web Form using C#?
2
2540
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
1
3172
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
7
3633
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
2
2088
by: kaotik78 | last post by:
I've racked my head on this all day long. I've been using php for 3 days now and this is the first hang up I've had and it's driving me nuts, but I can't pull myself away from trying to fix the problem. I need help or a push in the right direction. I have a contact form and a validate form. I'll keep this short and sweet, if it can work for one field, I can figure it out for the rest. I have session_start() at the top of both form and...
0
9711
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
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10335
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
10088
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...
0
6862
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
5529
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...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.