Valhalla Legends Archive

Programming => Web Development => Topic started by: GSX on November 29, 2006, 07:49 PM

Title: PHP Include question
Post by: GSX on November 29, 2006, 07:49 PM
Yeah, I'm back... I gave up on coding that one gaming site, switched it to CMS... (Hahaha I'm a quitter)

But I recently came across something where I have basically the same issue...

I've read about 10 PHP tutorials, and have little to no knowledge of it. Most say you don't need PHP knowledge to use the Include() function, but I can't seem to get it to work... Anyways, here's what I got, and yeah, I'm dumb, I just need another set of eyes to tell me what I'm doing wrong, because it's probably something very newb.


'\\ From "menu.php"
<HTML>
  <BODY>
     <A HREF="link1">Link 1</A><BR>
     <A HREF="link2">Link 2</A><BR>
     <A HREF="link3">Link 3</A><BR>
  </BODY>
</HTML>



'\\ From "index.php"
<HTML>
  <BODY>

<?php include("menu.php"); ?>


     <p>Yeah... examples suck!</p>
  </BODY>
</HTML>


Yeah, menu.php doesn't show up. I'm sure this is terrible code, as I _SUCK_ with PHP... So yeah, any help appreciated.
Title: Re: PHP Include question
Post by: SNiFFeR on November 29, 2006, 08:30 PM
Who is your webhost?
Title: Re: PHP Include question
Post by: GSX on November 29, 2006, 08:41 PM
None at the moment... I was thinking I didn't have PHP installed and it was messing it up, but I installed it (I think?) and it still doesn't work...
Title: Re: PHP Include question
Post by: Ersan on November 29, 2006, 10:12 PM
I doubt you have php installed.
To test you make a file called info.php with the following code:
<?php phpinfo(); ?>
Title: Re: PHP Include question
Post by: GSX on November 29, 2006, 10:25 PM
Ok, I don't know what's going on with this now... But, whenever I try to view the PHP files index.php or menu.php, it says I have to download the file... Yeah... Which is funny, because the file is right there. It says it's downloading a PHP Script?

I'm viewing it via FireFox... Any ideas there?
Title: Re: PHP Include question
Post by: Ersan on November 29, 2006, 10:42 PM
which means there's no mimetype set aside for php, and if the file contents say <?php phpinfo(); ?> then php isn't installed.
Title: Re: PHP Include question
Post by: GSX on November 29, 2006, 10:47 PM
Newb Q's

    -     What is a "mimetype"?
    -     How do I fix my downloading PHP script problem?
Title: Re: PHP Include question
Post by: Ersan on November 29, 2006, 11:37 PM
1. .....
2. INSTALL PHP CORRECTLY
Title: Re: PHP Include question
Post by: GSX on November 29, 2006, 11:59 PM
I've uninstalled it and reinstalled it about 6 times, chaning various things each time... And still no workey...

Maybe I should just go buy a Mac...
Title: Re: PHP Include question
Post by: topaz on November 30, 2006, 12:26 AM
Quote from: GSX on November 29, 2006, 11:59 PM
I've uninstalled it and reinstalled it about 6 times, chaning various things each time... And still no workey...

Maybe I should just go buy a Mac...

Yes, because purchasing a Mac will surely fix your server's PHP problems.


man, i hate people like you so much.
Title: Re: PHP Include question
Post by: FrOzeN on November 30, 2006, 12:43 AM
GSX. You are not ready for php. Seriously.
Title: Re: PHP Include question
Post by: FrostWraith on November 30, 2006, 12:46 AM
Do you have any type of server installed?
Title: Re: PHP Include question
Post by: topaz on November 30, 2006, 12:56 AM
Quote from: FrostWraith on November 30, 2006, 12:46 AM
Do you have any type of server installed?

Probably, since he said he reinstalled PHP several times.
Title: Re: PHP Include question
Post by: rabbit on November 30, 2006, 05:47 AM
Doubtfully, given that if he did the PHP installer would add its own mimetype, or it's Apache.
Title: Re: PHP Include question
Post by: GSX on December 04, 2006, 12:00 PM
Quote from: topaz on November 30, 2006, 12:26 AM

Yes, because purchasing a Mac will surely fix your server's PHP problems.


man, i hate people like you so much.

I was kidding... Don't get your panties all in a bundle...

And I installed and uninstalled PHP probably 15 times, and I never installed it with a webserver.

I tried to at school today, and I still have the same problem.
Title: Re: PHP Include question
Post by: Ersan on December 04, 2006, 10:34 PM
Just give up.