Get exclusive CAP network offers from top brands

View CAP Offers

Specific PHP tutorial?

LadyHoldem asked 1 year ago
Google and I aren’t communicating very well today, I’m looking for a tutorial that will help me add PHP elements (starting with a simple header, navigation menu and footer) to a page that already exsists, without changing the url of the particular page to .php … is that possible?

I’ve been searching PHP tutorials for two days, have the folders for main, footer, header, etc built, they work if i change the page to .php .. they do not call the css file in the .html version..

~LadyH

8 Answers
fonzi answered 1 year ago
yes its possible, but you will need mod rewrites.

you can also include something like this in an html file

[/CODE]

I say something like this because it depends on your server. and the version of php it’s running. And some require a mod rewrite.

here’s some good mod rewrite sites for you

xxhttp://www.mod-rewrite.com/forum/

xxhttp://www.mod-rewrite-wizard.com/

I’ve done what you’re trying to do, it just seems to be a little different every time because of hosting issues.[CODE][/CODE]

I say something like this because it depends on your server. and the version of php it’s running. And some require a mod rewrite.

here’s some good mod rewrite sites for you

xxhttp://www.mod-rewrite.com/forum/

xxhttp://www.mod-rewrite-wizard.com/

I’ve done what you’re trying to do, it just seems to be a little different every time because of hosting issues.

fonzi answered 1 year ago
yes its possible, but you will need mod rewrites.

you can also include something like this in an html file

? include (‘/myfile.php’); ?

I had to leave out the < > from the beginning and end of that or it wouldn’t show

I say something like this because it depends on your server. and the version of php it’s running. And some require a mod rewrite.

here’s some good mod rewrite sites for you

xxhttp://www.mod-rewrite.com/forum/

xxhttp://www.mod-rewrite-wizard.com/

I’ve done what you’re trying to do, it just seems to be a little different every time because of hosting issues.

cowboy answered 1 year ago
Yup, easy, use the PHP include tag with .htaccess.

You’ll find the .htaccess code here:

http://www.thejackol.com/htaccess-cheatsheet/

BlackjackInfo answered 1 year ago
You can do this without mod_rewrite, by adding something like this in your apache configuration:

AddType application/x-httpd-php .htm

cowboy answered 1 year ago
Create a text document called htaccess.txt, that consists only of the following:

AddHandler application/x-httpd-php .html .htm

Then upload it to the directory you want to use and rename it .htaccess

Now use the PHP include tag as described above.

LadyHoldem answered 1 year ago
cowboy wrote:
Create a text document called htaccess.txt, that consists only of the following:

AddHandler application/x-httpd-php .html .htm

Then upload it to the directory you want to use and rename it .htaccess

Now use the PHP include tag as described above.

I rarely mess with my .htaccess but since I aready have one.. I assume I can just add this line to it? Does it matter where? Top or bottom?

Messing with an empty domain right now, using code from old pages, in hopes of not screwing up 400 pages in one shot .. but when I move the codes and new groovy menus n such to the exsisting page, i’ll want to keep its htaccess file <span title=” title=”” class=”bbcode_smiley” />

Thanks for your replies guys! Saved me hours of searching already!

~LadyH :hattip:

cowboy answered 1 year ago
Yes, just add that to your existing .htaccess file.

LadyHoldem answered 1 year ago
YAY! Finally!!! Thnx!!