freaker87 Posted November 8, 2011 Share Posted November 8, 2011 Hello, I have created layout in php with the help of from some sites becoz i m new in php. I created it for my project of some kind of customer support. so please find attachment & see that, is this a good layout or if you have any solution to make it better or more flexible so tell me. So please check that.. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/ Share on other sites More sharing options...
Ortix Posted November 8, 2011 Share Posted November 8, 2011 you do realize no one in their right mind will download that... I suggest posting a screenshot and a pastebin Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286155 Share on other sites More sharing options...
freaker87 Posted November 8, 2011 Author Share Posted November 8, 2011 Because they think its a virus.... believe me its not a virus plz....Believe me if you think its a virus then tell me i'll post its screenshots ok... but its not a virus. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286161 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 8, 2011 Share Posted November 8, 2011 please screenshot. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286170 Share on other sites More sharing options...
freaker87 Posted November 8, 2011 Author Share Posted November 8, 2011 ok thats my screenshots & code here.......... Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286174 Share on other sites More sharing options...
freaker87 Posted November 8, 2011 Author Share Posted November 8, 2011 Here is my code & screenshots.. Here is the Code of my header.php <!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="X-UA-Compatible" content="IE=EmulateIE7" /> <title>My Layout</title> <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> </head> <body> <div id="wrapper"> <?php include('variables/variables.php'); ?> <div id="header"> <h2><?php echo $heading ?></h2> </div> <!-- end #header --> this is variable.php <?php $heading='My PROJECT'; $footer='Copyright © 2011'; ?> this is nav.php <div id="nav"> <a href="index.php">Home</a> <a href="about.php">About</a> <a href="#">Portfolio</a> <a href="#">Contact</a> </div> <!-- end #nav --> this is sidebar.php <div id="sidebar"> <h3>Navigation</h3> <li><a href="index.php">Home</a></li> <li><a href="about.php">About Us</a></li> <li><a href="#">Links</a></li> <li><a href="#">Portfolio</a></li> <li><a href="#">Contact</a></li> <h3>Box Two</h3> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <h3>Box Three</h3> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> <li><a href="#">Link Here</a></li> </div> <!-- end #sidebar --> this is footer.php <?php include('variables/variables.php'); ?> <div id="footer"> <p><?php echo $footer ?></p> </div> <!-- end #footer --> </div> <!-- End #wrapper --> </body> </html> this is index.php <?php include('includes/header.php'); ?> <?php include('includes/nav.php'); ?> <div id="content"> <h1>Heading1</h1> <h2>Heading2</h2> <h3>Heading3</h3> <h4>Heading4</h4> <h5>Heading5</h5> <h3>Paragraph Element</h3> <p> Quisque pellentesque sodales aliquam. Morbi mollis neque eget arcu egestas non ultrices neque volutpat. Nam at nunc lectus, id vulputate purus. In et turpis ac mauris viverra iaculis. Cras sed elit a purus ultrices iaculis eget sit amet dolor. Praesent ac libero dolor, id viverra libero. Mauris aliquam nibh vitae eros sodales fermentum. Fusce cursus est varius ante vehicula eget ultrices felis eleifend. Nunc pharetra rutrum nibh et lobortis. Morbi vitae venenatis velit. </p> <p> Quisque pellentesque sodales aliquam. Morbi mollis neque eget arcu egestas non ultrices neque volutpat. Nam at nunc lectus, id vulputate purus. In et turpis ac mauris viverra iaculis. Cras sed elit a purus ultrices iaculis eget sit amet dolor. Praesent ac libero dolor, id viverra libero. Mauris aliquam nibh vitae eros sodales fermentum. Fusce cursus est varius ante vehicula eget ultrices felis eleifend. Nunc pharetra rutrum nibh et lobortis. Morbi vitae venenatis velit. </p> <h3>Another Heading Starting Point</h3> <p> Quisque pellentesque sodales aliquam. Morbi mollis neque eget arcu egestas non ultrices neque volutpat. Nam at nunc lectus, id vulputate purus. In et turpis ac mauris viverra iaculis. Cras sed elit a purus ultrices iaculis eget sit amet dolor. Praesent ac libero dolor, id viverra libero. Mauris aliquam nibh vitae eros sodales fermentum. Fusce cursus est varius ante vehicula eget ultrices felis eleifend. Nunc pharetra rutrum nibh et lobortis. Morbi vitae venenatis velit. </p> <p> Quisque pellentesque sodales aliquam. Morbi mollis neque eget arcu egestas non ultrices neque volutpat. Nam at nunc lectus, id vulputate purus. In et turpis ac mauris viverra iaculis. Cras sed elit a purus ultrices iaculis eget sit amet dolor. Praesent ac libero dolor, id viverra libero. Mauris aliquam nibh vitae eros sodales fermentum. Fusce cursus est varius ante vehicula eget ultrices felis eleifend. Nunc pharetra rutrum nibh et lobortis. Morbi vitae venenatis velit. </p> </div> <!-- end #content --> <?php include('includes/sidebar.php'); ?> <?php include('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286177 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 8, 2011 Share Posted November 8, 2011 dude, you are suppose to upload it online then link it.... not point it to you c drive... upload it here Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286207 Share on other sites More sharing options...
freaker87 Posted November 9, 2011 Author Share Posted November 9, 2011 Here's the screenshots [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286507 Share on other sites More sharing options...
ZulfadlyAshBurn Posted November 9, 2011 Share Posted November 9, 2011 Thats not a php layout. Thats a folder layout... Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286552 Share on other sites More sharing options...
Adam Posted November 9, 2011 Share Posted November 9, 2011 That will be sufficient for a small website, yes. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286668 Share on other sites More sharing options...
freaker87 Posted November 10, 2011 Author Share Posted November 10, 2011 So what should i do to make it more better and if anybody have some useful tips or links so plz give me. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1286954 Share on other sites More sharing options...
Adam Posted November 10, 2011 Share Posted November 10, 2011 There's not a lot to say really. It's roughly a common set-up for small websites that don't stretch much beyond centralising the header/footer content. You could pass in a dynamic <title> and various tweaks like that, but that's about as far as it will take you. That's not a bad thing though, if that's all you need it for. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287025 Share on other sites More sharing options...
freaker87 Posted November 11, 2011 Author Share Posted November 11, 2011 Its not working good when i use javascript its give errors & sometime page open with two times I am using this in my nav.php <ul class="menu" id="menu"> <li><a href="#" class="menulink">Eng. Detail</a> <ul> <li><a href="#">Add Eng.</a></li> <li><a href="#">Modify Eng.</a></li> </ul> </li> <li><a href="#" class="menulink">Cust. Detail</a> <ul> <li><a href="#">Add Eng.</a></li> <li><a href="#">Modify Eng.</a></li> </ul> </li> <li><a href="#" class="menulink">Report</a></li> <li><a href="#" class="menulink">Admin Task</a> <ul> <li><a href="#">Add New Login</a></li> <li><a href="#">Change Password</a></li> </ul> </li> <li><a href="logout.php" class="menulink">Logout</a></li> </ul> <!-- end #nav --> <script type="text/javascript"> var menu=new menu.dd("menu"); menu.init("menu","menuhover"); </script> and this is my header.php <!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="X-UA-Compatible" content="IE=EmulateIE7" /> <title>Advanced Computing Labs</title> <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" /> <script type="text/javascript" src="../js/script.js"></script> </head> <body> <div id="wrapper"> <div id="header"> <h1>Advanced Computing Labs</h1> </div> <!-- end #header --> find the attachment of script.txt & changeit to the script.js [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287269 Share on other sites More sharing options...
trq Posted November 11, 2011 Share Posted November 11, 2011 Its not working good when i use javascript its give errors & sometime page open with two times Your going to need to be allot more descriptive than that. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287271 Share on other sites More sharing options...
freaker87 Posted November 11, 2011 Author Share Posted November 11, 2011 if anybody have some good & flexible php layout something like this which also have dropdown menus so plz give me or if you know any site or program which have some tutorial so you can plz send me link Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287274 Share on other sites More sharing options...
trq Posted November 11, 2011 Share Posted November 11, 2011 There is no definitive 'PHP layout'. It's up to you to plan your application and design it accordingly. If you want more hand holding, you might consider using a framework, be aware though that they are not something I would generally recommend new comers to jump straight into. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287276 Share on other sites More sharing options...
freaker87 Posted November 11, 2011 Author Share Posted November 11, 2011 Hey guys now i am having another problem in this layout i am using simple login form on index.php page this page calls chklogin.php page which is having this code <?php session_start(); include('connect.php'); $tbl_name="members"; mysql_select_db($Db, $link); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mypassword = md5($mypassword); $sql="SELECT * FROM $tbl_name WHERE uname='$myusername' and upass='$mypassword'"; $result=mysql_query($sql,$link); $row=mysql_fetch_array($result); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("username"); //Create the session session_register("myusername"); session_register("mypassword"); $_SESSION['uname'] = "$myusername"; $_SESSION['utype'] = $row['utype']; header("location:loginsuccess.php"); } else { //include ('index.php'); echo ("<script type='text/javascript'> window.alert('Wrong username or password!')</script>"); exit(); } ?> after this it calls loginsuccess.php which code is <? session_start(); if(!session_is_registered(myusername)){ header("location:index.php"); exit(); } require_once("login-index.php"); ?> now if all login detail is true then it calls login-index.php page but when it open the login-index.php page it also open the index.php also in one page whereas it should have to open only login-index.php only why its happening plz help me...... Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287302 Share on other sites More sharing options...
trq Posted November 11, 2011 Share Posted November 11, 2011 Can we see the code for login-index.php? Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287436 Share on other sites More sharing options...
freaker87 Posted November 12, 2011 Author Share Posted November 12, 2011 yes that is login-index.php <?php require_once('includes/header.php'); ?> <?php require_once('includes/nav.php'); ?> <div id="content"> <p align="right" class="wel">Welcome <?php echo $_SESSION['uname']; ?></p> </div> <!-- end #content --> <?php require_once('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287542 Share on other sites More sharing options...
trq Posted November 12, 2011 Share Posted November 12, 2011 Unless your header.php, nav.php or footer.php file incude your index.php file there is nothing in your code that could do what your describing. Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287555 Share on other sites More sharing options...
freaker87 Posted November 13, 2011 Author Share Posted November 13, 2011 if you wanted to see evry file content which i include so you can see them or download my attachment on 1st page Quote Link to comment https://forums.phpfreaks.com/topic/250680-is-this-a-good-php-layout/#findComment-1287793 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.