Ibshas25 Posted December 7, 2010 Share Posted December 7, 2010 i want to portray this code within echo but cant seem to get it to work specially with "LI classes" <ul id="sliding-navigation"> <li class="sliding-element"><h3>Projects Page</h3></li> <li class="sliding-element"><a href="UserSearchPBT.html">User Managment</a></li> <li class="sliding-element"><a href="RolSearchPBT.html">Roles Managment</a></li> <li class="sliding-element"><a href="teams1.html">Teams</a></li> <li class="sliding-element"><a href="">Methodologies</a></li> </ul> Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/ Share on other sites More sharing options...
trq Posted December 7, 2010 Share Posted December 7, 2010 Post your actual code. Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143954 Share on other sites More sharing options...
Ibshas25 Posted December 7, 2010 Author Share Posted December 7, 2010 lines 79 to 89 is where i want to add the above for styling on the page <?php error_reporting(E_ALL ^ E_NOTICE);?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Project Name List Menu </title> <link rel="stylesheet" type="text/css" href="stylespb.css" /> <script type="text/javascript" src="jquery-1.4.3.js"></script> <script type="text/javascript" src="jquery.json-2.2.js"></script> <script type="text/javascript" src="prjlistmenu.js"></script> <style type="text/css"> body { color:#999 font-size:12px; font-family:Arial, Helvetica, sans-serif; } form { display:block; width:260px; } form .input{ width:100px; float:right; } form label { width:260px; clear:both; text-align:right; white-space:nowrap; } form textarea { display:block; width:260px; } form .input_1_Chr { width:10px; float:left; } </style> </head> <?php session_start(); if ($_SESSION['isloggedin']=="Y") { echo "userid=".$_SESSION[userid]." user =".$_SESSION[user]; } else { // echo "invalid user now redirect to login page here"; header("Location: login.php"); exit; } ?> <body> <div id="navigation-block"> <img src="background.jpg" id="hide" /> <h2><span></span></h2> <p><h1> Project Name List Menu</h1></p> <form id="iletisim"> <div id="formdiv"> <table><tr><td colspan="2"><span id="successfailmessage"></span></td></tr> <tr><td colspan="2"> </td></tr> <tr><td colspan="2"> <div style="OVERFLOW: auto; WIDTH: 350px; HEIGHT: 100px"> <span id="prjlist"></span> </td></tr> <tr><td colspan="2"> <?php if($_SESSION[issysadmin]=="Y") { echo " <a href='RolSearchPBT.html'> <span> Role Management</span></a>"; echo "<a href='teams1.html'> <span> Teams Management</span></a>"; echo "<a href=''> <span> Methodology Management</span></a>"; } ?> </td></tr> </table> <input type="hidden" id= "prjid" value="0" name="prjid" /> <input type="hidden" id= "prjname" value="" name="prjname" /> <input type="hidden" id= "userid" value="<?php print $_SESSION[userid]; ?>" name="userid" /> </div> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143957 Share on other sites More sharing options...
trq Posted December 7, 2010 Share Posted December 7, 2010 Post the code where yo u have tried to echo this unordered list. Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143960 Share on other sites More sharing options...
Ibshas25 Posted December 7, 2010 Author Share Posted December 7, 2010 this is what i have tried on lines 79 to 89 but does not work <div style="OVERFLOW: auto; WIDTH: 350px; HEIGHT: 100px"> <span id="prjlist"></span> <h2><span></span></h2> <ul id="sliding-navigation"> </td></tr> <tr><td colspan="2"> <?php if($_SESSION[issysadmin]=="Y") { echo "<li class="sliding-element"><h3>Projects Page</h3></li> "; echo " <li class="sliding-element"><a href="UserSearchPBT.html">User Managment</a></li>"; echo " <li class="sliding-element"><a href="RolSearchPBT.html">Roles Managment</a></li>"; echo " <li class="sliding-element"><a href="teams1.html">Teams</a></li>"; </ul> } ?> </td></tr> Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143961 Share on other sites More sharing options...
trq Posted December 7, 2010 Share Posted December 7, 2010 You need to escape double quotes when used within a double quoted string, otherwise php thinks your trying to end the string. eg; echo "<li class="sliding-element"><h3>Projects Page</h3></li> "; should be.... echo "<li class=\"sliding-element\"><h3>Projects Page</h3></li>"; Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143966 Share on other sites More sharing options...
hennzo Posted December 7, 2010 Share Posted December 7, 2010 the code echo "<li class="sliding-element"><h3>Projects Page</h3></li> "; should be : echo "<li class=\"sliding-element\"><h3>Projects Page</h3></li> "; OR echo '<li class="sliding-element"><h3>Projects Page</h3></li> '; Link to comment https://forums.phpfreaks.com/topic/220918-how-to-portray-css-within-echo/#findComment-1143976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.