cyphix
05-26-2004, 11:02 PM
How to do it? PHP is giving errors when I try to echo it! :mad:
|
||||
Using < and > in PHPcyphix 05-26-2004, 11:02 PM How to do it? PHP is giving errors when I try to echo it! :mad: sad69 05-26-2004, 11:24 PM I just tried this and it worked just fine: <body> <?php echo "< and >"; ?> </body> Unless I'm misunderstanding.. what errors are you getting? Sadiq. cyphix 05-26-2004, 11:32 PM As soon as it hist this line.. echo "<form action=\"formmail.cgi\" method=\"post\">"; It gives this error: Parse error: parse error, expecting `','' or `';'' sad69 05-26-2004, 11:46 PM That's a Javascript error, isn't it? You don't need to use those codes, just use the < and > normally: echo "<form action=\"formmail.cgi\" method=\"post\">"; Sadiq. raf 05-27-2004, 12:00 AM or better still echo '<form action="formmail.cgi" method="post">'; Check theline right above the line you posted. probbly missed the ; at the end or so on that line. It's a PHP error, by the way. <edit>not sure what you are trying to do. Are you trying to send the formtag as html code, or do you want to have it displayed on screen?</edit> cyphix 05-27-2004, 10:12 AM Yes.. my first code is correct.. I need the <> displayed on screen so I need to use < and > sad69 05-27-2004, 05:20 PM Ok... so you solved it or no? Sadiq. cyphix 05-27-2004, 06:02 PM No, still problems. :( firepages 05-27-2004, 06:08 PM did you try Raf's code ? and check as suggested the lines above the reported error ? , as sad69 says unless you are outputting javascript you don't need to use <> etc SDP2006 05-27-2004, 06:40 PM Why not htmlentities(); ? <?php $entities = array('>','<'); $gt = htmlentities($entities[0]); $lt = htmlentities($entities[1]); echo $lt."b".$gt."bold".$lt."/b".$gt; // outputs <b>bold</b> ?> raf 05-27-2004, 07:09 PM cypics, echo '<form action="formmail.cgi" method="post">'; will output the htmlcode you need for a formtag. if you'd look at the pagesource inside your browser, then you'd see <form action="formmail.cgi" method="post"> It does not produce any visible output when the page is loaded. If you use echo htmlentities('<form action="formmail.cgi" method="post">'); then you wiil see <form action="formmail.cgi" method="post"> on screen as visible output. If you look at the source in your browser, then you'll see <form name="registration" action="ffff" method="post"> hope this clears it up for you. cyphix 05-28-2004, 05:05 PM Ok, I feel so stupid... the error it was getting was because there was non-escpaped quotes on the line above & I definately thought it was referring to the line below since it was the first line with these tags in them... I always make sure to escape my quotes but I copied this code from another file & forgot to escape them lol Anyway.... I used htmlentities & have it all working! ;) Thanks for all the help guys! raf 05-28-2004, 05:13 PM You're welcome. I must be spychic :D Check theline right above the line you posted. probbly missed the ; at the end or so on that line. It's a PHP error, by the way. It's just like my boss says : why doesn't everyone just do what i say so we'll at least get something done around here! cyphix 05-28-2004, 07:16 PM lol :p |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum