dubt2nv Posted November 27, 2006 Share Posted November 27, 2006 basically im trying to echo out a line that includes html and links n stuff....im trying to allow the admin to be able to access it without the owner being able to see it....atm im having trouble closing the php correctly.....please help<?php if ($_SESSION['Level']=="Admin") { echo "<a href='add_contactuser1.php'><font color='#000099' size='2' face='Arial, Helvetica, sans-serif'>Add User</font></a><font color='#000099' size='2' face='Arial, Helvetica, sans-serif'>";}?> Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/ Share on other sites More sharing options...
kenrbnsn Posted November 27, 2006 Share Posted November 27, 2006 What problems are you having? The line you posted looks fine.More information is needed.Ken Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/#findComment-130912 Share on other sites More sharing options...
dubt2nv Posted November 27, 2006 Author Share Posted November 27, 2006 when im typing it up in edit plus....the closing '?>' doesnt seem to be the same colour as the opening '<?php'....Editplus notifies by colour if code has been closed and opened by using colour.....also the start of '<a href' also looks like it isnt being recognised as the '<' is colourless..... Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/#findComment-130917 Share on other sites More sharing options...
HuggieBear Posted November 27, 2006 Share Posted November 27, 2006 Forgetting the syntax colouring, does it look OK in a browser?Most syntax wont look correct if it appears inside and echo tag. Especially HTML code.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/#findComment-130918 Share on other sites More sharing options...
Malcerous Posted November 27, 2006 Share Posted November 27, 2006 Try it like this:[code]<?php if ($_SESSION['Level']=="Admin") { ?><a href='add_contactuser1.php'><font color='#000099' size='2' face='Arial, Helvetica, sans-serif'>Add User</font>[/url]<font color='#000099' size='2' face='Arial, Helvetica, sans-serif'><?}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/#findComment-130935 Share on other sites More sharing options...
Davka Posted November 27, 2006 Share Posted November 27, 2006 Malcerous has it right, but your original code should work fine too.Edit Plus just sees a '<' symbol and looks for the next '>' symbol, which it treats as the end of the tag. Any additional '<' symbols in between will be seen as text rather than as a new tag.So when you type<?php echo "<A Href='foo'>" ?>...edit plus sees this as a tag:[color=red]<?php echo "<A Href='foo'>[/color]...and this as faulty syntax: [color=blue]" ?>[/color]iow, it's not php- or javascript-ready program. If you want it to show your tags properly, close the php tag before starting your html, like Malcerous did. Quote Link to comment https://forums.phpfreaks.com/topic/28617-echoing-out-html-code-for-a-log-in-page/#findComment-130943 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.