Page 1 of 1

Cant find the problem... need new eyes, and brain.

Posted: Thu Mar 21, 2013 4:11 pm
by tomtefan
I cant see my problem. and asked in guild i play with in guildwars 2.
They said they didnt see any problem either with the index file.

Iam remaking my old tattoo design website from scratch.
trying to make it better. more dynamic and easier to update.


All files are in the same folder. to make pathing easier.

I use Notepad++ (also have sublime text 2).
Notepad shows the php start-end as red.. while sublime show it white.

I use the shortcut: alt + ctrl + shift + R to open my file into chrome.
And it just types out the index file as text.

The coding worked.. when i had all files into ONE.
But when i splitted it up. it doesnt work...

Index.php
<?php
include("header.html");
include("navbar.html");
include("home.html");
include("footer.html");
?>

header.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Eldain-Design</title>
<link rel="stylesheet" href="layout.css">
</head>
<body>

<div class="wrapper"> </div>

<div class="header"> </div>

Navbar.html
<div class="navbar">
<div class="button"> <a href="index.php?page=home">Home</a> </div>
<div class="button"> <a href="index.php?page=design">Design</a> </div>
<div class="button"> <a href="index.php?page=gallery">Gallery</a> </div>
<div class="button"> <a href="index.php?page=contact">Contact</a> </div>
<div class="button"> <a href="index.php?page=about">About me</a> </div>

</div>

footer.html
<div class="footer"> Eldain Design </div>

</div>


</body>
</html>

--------------------------

This is my Css File.
-------------------------
*{
margin: 0px;
padding: 0px;
}

a{
text-decoration: none;
}

.wrapper{
width: 1000px;
height: 550px;
border: 1px solid #e1e1e1;
margin: 10px auto 0 auto;
}

.header{
width: 1000px;
height: 125px;
background-image: url(logo.jpg);
background-repeat: no-repeat;
}
.navbar{
width: 1000px;
height: 25px;
background-image: url(navbar_grad.jpg);
background-repeat: repeat-x;
}
.button a{
float: left;
width: 100px;
height: 25px;
line-height: 22px;
font-family: verdana;
font-size: 13px;
color: #000;
font-weight: bold;
text-align: center;
}
.button a:hover{
float: left;
width: 100px;
height: 25px;
line-height: 22px;
font-family: verdana;
font-size: 13px;
color: #fff;
font-weight: bold;
text-align: center;
}
.mainbody{
width: 1000px;
height: 375px;
font-family: verdana;
font-size: 11px;
color: #515151;
background: #e1e1e1;
}

.footer{
width: 1000px;
height: 25px;
background-image: url(navbar_grad.jpg);
background-repeat: repeat-x;
}
----------------------

Re: Cant find the problem... need new eyes, and brain.

Posted: Thu Mar 21, 2013 8:15 pm
by hallsofvallhalla
I would not recommend including html files with php

You are running the html inside of php brackets.

I personally would change them to php files then use echo.

Re: Cant find the problem... need new eyes, and brain.

Posted: Fri Mar 22, 2013 6:33 am
by Winawer
You're opening the file directly? That won't work because the PHP doesn't get interpreted.

Re: Cant find the problem... need new eyes, and brain.

Posted: Fri Mar 22, 2013 5:49 pm
by Jackolantern
hallsofvallhalla wrote:I would not recommend including html files with php

You are running the html inside of php brackets.

I personally would change them to php files then use echo.
Yep, that is likely the issue. Raw HTML is being include()'d into your PHP tags, which is likely going to cause a mountain of syntax errors.

You should only include correctly formatted PHP files. If you are needing to include HTML, PHP Heredoc format can help with large portions of formatted HTML so you don't have to bother with possible double-quote and single-quote issues with traditional strings.

Re: Cant find the problem... need new eyes, and brain.

Posted: Thu Mar 28, 2013 11:48 am
by tomtefan
you kinda lost me. but i think thats mainly because iam new to programing overall.

for me its like reading chinese. wich i have no skills in what so ever :D

but thanx anyways.
I will probably understand it in the end. it will just take some time.

and hopefully someone else had same problem as me.. but understand this better/faster, and it will help them aswell.