PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
craka
Forum Newbie
Posts: 21 Joined: Thu Jul 11, 2002 9:04 pm
Post
by craka » Thu Jul 11, 2002 9:04 pm
Im trying to make a script that will print out html for people to use. It works all except for it prints out the name of my variable and the variable is made all big.(what theHTML Code would make it into)
So instead of getting <font face="vardana"> Text </font> (which is what i want)
im getting "text" in the font vardana...
I dont know if you get what im saying or trying to do but i cant figure it out and some help would be apriciated.
btw.. i cant spell.
cctrax
Forum Commoner
Posts: 36 Joined: Thu Jul 11, 2002 9:05 pm
Location: United States
Contact:
Post
by cctrax » Thu Jul 11, 2002 9:05 pm
want to know a little trick...lol
just use < and > (that will display the < >)
Last edited by
cctrax on Thu Jul 11, 2002 10:04 pm, edited 1 time in total.
craka
Forum Newbie
Posts: 21 Joined: Thu Jul 11, 2002 9:04 pm
Post
by craka » Thu Jul 11, 2002 9:23 pm
That worked... for that problem.. now im getting a parse error on line three of this
<?
echo ("<body bgcolor="#000000" link="#999999"> <p><font color="#FFFFFF"
size="5" face="Verdana, Arial, Helvetica, sans-serif"> $title </font>");
?>
And i dont know why.. line 3 is my closing php tag..
Please fogive me.. im new at php...
kenny
Forum Newbie
Posts: 12 Joined: Mon Jul 01, 2002 10:12 pm
Location: Florida
Post
by kenny » Thu Jul 11, 2002 9:51 pm
First of all, it's
Verdana not
Vardana . ALl you have to do is to escape your quotation marks, by putting backslashes in front of them, like this....
Code: Select all
<font face="verdana"> Text </font>
Hope I helped.
cctrax
Forum Commoner
Posts: 36 Joined: Thu Jul 11, 2002 9:05 pm
Location: United States
Contact:
Post
by cctrax » Thu Jul 11, 2002 10:04 pm
yup
You cannot place double quotation marks within a string that begins with double quotation makes...
You either have to make all of the quotation marks around the "#FFFFFF" (ect) single quotes, or you have to escape them (or use " lol)
jason
Site Admin
Posts: 1767 Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:
Post
by jason » Thu Jul 11, 2002 10:41 pm
Why not just use the htmlspecialchars() function to do this for you automagically?
mikeq
Forum Regular
Posts: 512 Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland
Post
by mikeq » Fri Jul 12, 2002 3:46 am
craka wrote: That worked... for that problem.. now im getting a parse error on line three of this
<?
echo ("<body bgcolor="#000000" link="#999999"> <p><font color="#FFFFFF"
size="5" face="Verdana, Arial, Helvetica, sans-serif"> $title </font>");
?>
And i dont know why.. line 3 is my closing php tag..
Please fogive me.. im new at php...
I think your original problem was related to the fact that you did not escape your double quotes, there is no need to us < etc.
echo "<body bgcolor="#000000">"; will work just fine.
PS using things like font tags etc is not good idea anymore, take a look at CSS, it's much more flexible
RandomEngy
Forum Contributor
Posts: 173 Joined: Wed Jun 26, 2002 3:24 pm
Contact:
Post
by RandomEngy » Fri Jul 12, 2002 11:36 am
jason wrote: automagically
That's got to be the best word ever!
Anyway, just for something semi on-topic you can use < and > as well. (less than and greater than, don't try to use &rt; ;) )