# General Website Questions



## MMJ (Oct 15, 2006)

in /index.html I have this line:


```
<div id="sidebar">
<?php include('/home/user/public_html/sidebar.php'); ?>
</div>
```
in tech/index.php i have the same line.

it only appears in tech/index.html. why?


----------



## deepdiver01 (Dec 23, 2004)

Looks like a path problem,and I amguessing that the sidebar.php file is sitting in the tech folder.

For the first index.php file, try

<?php include('/home/user/public_html/tech/sidebar.php'); ?>


----------



## MMJ (Oct 15, 2006)

I renamed index.html to index.php

Solved.


----------



## MMJ (Oct 15, 2006)

Question 2:

Why does it make a difference if a webpage is named index.html or index.php?


----------



## brendandonhu (Jul 8, 2002)

That's an absolute path so it will work in any directory on that server.
.html files aren't parsed for PHP by default. You normally need to use a .php file to use PHP code.


----------



## MMJ (Oct 15, 2006)

Thanks! Even if it has php tags?

Question 3: I have this line (/template/sidebar.php') template is a folder under public_html. why is it not finding it?

NOTE: My experience level does not apply to web design


----------



## covert215 (Apr 22, 2006)

You can use HTML in a php file, but you can't use php in an HTML file.


----------



## MMJ (Oct 15, 2006)

Thanks covert!

if you put / at the beginning of a file path what does it mean?


----------



## Eriksrocks (Aug 7, 2005)

A starting / means from the root directory, really like from your public_html folder or from the domain. If you don't have a / at the beginning it will use the current directory that your file is in as the starting point.

FYI ../ means to go back a directory from the current position, so if you had

domain.com/test/page.html and
domain.com/myfolder/new.html

and you had a link on /test/page.html and you wanted to link to /myfolder/new.html you could either do it like this:

/myfolder/new.html or like this: ../myfolder/new.html



> You can use HTML in a php file, but you can't use php in an HTML file.


Sure you can use PHP in an HTML file. All you have to add is a couple lines in .htaccess so that PHP will parse HTML files and you're set.


----------



## MMJ (Oct 15, 2006)

ok this is where the file is: 

public_html/template/123.php

This is how I put it in the webpage:

/template/123.php

but it doesn't find it. why?


----------



## Eriksrocks (Aug 7, 2005)

Can you access it at yourdomain.com/template/123.php?

It should work fine.  I don't know maybe try using /public_html/template/123.php.


----------



## MMJ (Oct 15, 2006)

to fix the problem I have put:

/home/mmj/public_html/template/123.php

but I want it to be cleaner than this


----------



## Eriksrocks (Aug 7, 2005)

Then just use a relative path as I described above instead of an absolute one.

e.g. don't have a / at the beginning and use a ../ or multiple ../s if you have to.


----------



## MMJ (Oct 15, 2006)

Question:

You know how on a lot of website they will have a link that ends with this "/#something" which jumps to another portion of the page. Well how do I work that?

EDIT:SOLVED


----------



## namenotfound (Apr 30, 2005)

covert215 said:


> You can use HTML in a php file, but you can't use php in an HTML file.


You could always add it in .htaccess 

AddType application/x-httpd-php .html


----------



## covert215 (Apr 22, 2006)

That just tells the server to read files with a .html extension as if they had a .php one


----------



## namenotfound (Apr 30, 2005)

Exactly, so you can have a .html file and be able to parse this <?php echo "Hello World"; ?> with no problem


----------



## covert215 (Apr 22, 2006)

But the file is not regarded as .html. It has the html extension, but the extension is related to the php file format.


----------



## namenotfound (Apr 30, 2005)

blah, we're both right them 

If you use AddType you don't have to change all your .html pages to .php AND .html is considered a php file with AddType

There, now we're both right


----------



## MMJ (Oct 15, 2006)

i have:

/home/user/public_html/template/css/menu.css

the file is in

www.mysite.com/template/css/menu.css

yet it doesn't work 

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

W3C CSS Validator Results

Errors
URI : http://www.mmj.xenweb.net/home/mmj/public_html/template/css/style.css

* Line: -1

File not foundhttp://www.mmj.xenweb.net/home/mmj/public_html/template/css/style.css: Not Found

URI : http://www.mmj.xenweb.net/home/mmj/public_html/template/css/menu.css

* Line: -1

File not foundhttp://www.mmj.xenweb.net/home/mmj/public_html/template/css/menu.css: Not Found


----------



## namenotfound (Apr 30, 2005)

Try using the actual url to the css files?

http://www.mmj.xenweb.net/template/css/style.css

http://www.mmj.xenweb.net/template/css/menu.css

Rather than /home/user/public_html/template/css/menu.css and see what happens


----------



## MMJ (Oct 15, 2006)

doesn't work. whats wrong with xenweb? i can't get to it.


----------



## namenotfound (Apr 30, 2005)

the xenweb forums are screwed up. Every link I click I get a "not found" error.
It seems every link is pointing /forums/vbseo.php which doesn't exist
The only page I can get to is the portal


----------



## MMJ (Oct 15, 2006)

I saw you signed in. How did you do that?


----------



## namenotfound (Apr 30, 2005)

I visited the site.
I'm always signed in, it keeps me logged in with a cookie.

I couldn't do anything on the site however.


----------



## MMJ (Oct 15, 2006)

Worked!

../template/css/123.css


----------



## namenotfound (Apr 30, 2005)

MMJ said:


> Worked!
> 
> ../template/css/123.css


Glad you got it working


----------



## MMJ (Oct 15, 2006)

Man! Xenweb still not working. Did you contact andrew? does he even know?


----------



## namenotfound (Apr 30, 2005)

I'm not sure, I contacted him last time it didn't work, a few days ago. This though is beyond weird because the portal works, but nothing else.


----------



## Eriksrocks (Aug 7, 2005)

How is the portal working?

_Fatal error: Call to undefined function: print_portal_output() in /home/xenwebco/public_html/index.php on line 44_

It looks like someone deleted some important file.


----------



## namenotfound (Apr 30, 2005)

Well NOW it's like that 
Earlier today it was working


----------



## Eriksrocks (Aug 7, 2005)

...and now it's all back up.


----------



## namenotfound (Apr 30, 2005)

Eriksrocks said:


> ...and now it's all back up.


Yeah, I think someone deleted a file on the server.... good to see it's working now


----------



## MMJ (Oct 15, 2006)

I have more than one . It says this is not valid xhtml. what should I do?


----------



## namenotfound (Apr 30, 2005)

MMJ said:


> I have more than one . It says this is not valid xhtml. what should I do?


You can only have one UNIQUE id per page. In your CSS change #whatever to .whatever making it a class. Then do


----------



## MMJ (Oct 15, 2006)

Thanks, I will look into it.


----------



## MMJ (Oct 15, 2006)

Thanks it worked.

I have some text on my websites that has these: <>.

They are not meant to be tags but the validator is thinking that they are and is giving me trouble. What can I do besides changing or removing them??


----------



## MMJ (Oct 15, 2006)

SOLVED 

used &lt; &gt;


----------



## Eriksrocks (Aug 7, 2005)

Yup.


----------



## MMJ (Oct 15, 2006)

In Cpanel when editing a file how can I make a tab-space? pressing tab moves to the next field in browsers.


----------



## MMJ (Oct 15, 2006)

What is the js code to go back in the browser once?


----------



## Eriksrocks (Aug 7, 2005)

MMJ said:


> In Cpanel when editing a file how can I make a tab-space? pressing tab moves to the next field in browsers.


Try copying the tab character or using spaces. 


MMJ said:


> What is the js code to go back in the browser once?


You can put this in the href attribute of a link element.

```
javascript:window.history.go(-1)
```


----------



## MMJ (Oct 15, 2006)

Eriksrocks said:


> Try copying the tab character or using spaces.


Yup, I thought that there might be some easier way.



Eriksrocks said:


> You can put this in the href attribute of a link element.
> 
> ```
> javascript:window.history.go(-1)
> ```


Like this?


```
[URL=javascript:window.history.go(-1)][/URL]
```


----------



## namenotfound (Apr 30, 2005)

MMJ said:


> Yup, I thought that there might be some easier way.
> 
> Like this?
> 
> ...


You need a word (or words) so it shows on the page 


```
[URL=javascript:window.history.go(-1)]GO BACK ONE PAGE[/URL]
```


----------



## MMJ (Oct 15, 2006)

I am surprised you still think I am that stupid


----------



## namenotfound (Apr 30, 2005)

MMJ said:


> I am surprised you still think I am that stupid


----------



## Eriksrocks (Aug 7, 2005)

MMJ said:


> Like this?
> 
> 
> ```
> ...


Namenotfound already explained it, but yes, like that.


----------



## MMJ (Oct 15, 2006)

What is the difference between htm & html?


----------



## Eriksrocks (Aug 7, 2005)

Nothing. They are both extensions. You can use .htm or .html - it doesn't matter. Traditionally old UNIX systems supported only three character extensions, hence .htm, but it doesn't matter now. Use whichever one you like.


----------



## namenotfound (Apr 30, 2005)

Eriksrocks said:


> Nothing. They are both extensions. You can use .htm or .html - it doesn't matter. Traditionally old UNIX systems supported only three character extensions, hence .htm, but it doesn't matter now. Use whichever one you like.


I thought that was old Windows systems 

But like you said, it doesn't matter anymore 



> # .htm as a 3 letter version of .html
> 
> The primary difference between .htm and .html is simply that .html can't be represented in a DOS/16 bit operating system which uses the 8.3 file naming convention. So, .html files were renamed .htm when they were written on DOS/Windows 3.x systems.
> 
> Most servers (but not all) that can handle 4 character file extensions can be set up to treat .htm and .html files exactly the same, just as they can be set up to treat .jpg and .jpeg files the same.


Source http://www.hwg.org/resources/faqs/shtmlFYIFAQ.html


----------



## Eriksrocks (Aug 7, 2005)

It probably was DOS systems. I wasn't sure...


----------



## namenotfound (Apr 30, 2005)

Leave it to Microsoft to limit the number of characters like that 

Files on Windows 3.0 were the same way, you couldn't have "Pictures of Trip" as a folder name, you had to use something stupid like "PicoT" 

Good thing those dark ages are behind us 

I believe Windows 95 was the first version of Windows to allow longer file names and folders.


----------



## MMJ (Oct 15, 2006)

Yup, with the FAT filesystem. I still remember the day when we switched from 3.1 to 95. I was like wow. look at that start menu  

Thanks people.


----------



## MMJ (Oct 15, 2006)

What is the difference between

```
[LIST=1]
```
and

```
[LIST=1]
```
?


----------



## Eriksrocks (Aug 7, 2005)

> _list-style-type: decimal;_ causes the list to be numbered with decimal numbers; 1., 2., 3., etc. This is most browser's default for ordered lists.


So usually you won't see a difference. But some browsers might use a different default. See here:
http://www.w3schools.com/css/pr_list-style-type.asp


----------



## MMJ (Oct 15, 2006)

What is the difference between html and shtml?


----------



## namenotfound (Apr 30, 2005)

shtml is the default extension for Server-Side Includes. (although some servers may be set up to use a different file extension for SSI)

Rather than have the server parse all HTML files for SSI, some servers are set up to only parse HTML files that have the shtml file extension.


----------

