PHP Programming

  • Wanna Join? New users you can now register lightning fast using your Facebook or Twitter accounts.
May 17, 2005
1,689
22
0
41
#1
So I am working on a real quick Alkaholiks Webpage, and I used php ... but now when I click the link and it goes to "index.php?site=media" it still shows the news content when its supposed to show the following file content_media.html

The funny thing it works on my server but the exact same files dont work on Alkaholiks Server. I bet you get an idea when you look at it lol

www.militaryminded.net/alkaholiks_web1/ <- works here click on a link
www.alkaholiks.com <- its not working with the EXACT SAME files.

Any idea?
 

Keith

ackright
Apr 22, 2002
329
2
0
44
#2
How do you include content_media.html? Do you have your paths to the files right? That's crazy how it works on one server and not the other.

Also, whenever I include/require html pages, I only put the html I need in those files minus any head and body tags, since those are already present and you're not linking directly to those files anyways.
 
May 17, 2005
1,689
22
0
41
#6
I did put a body tag in them right, but usually it still should work. Maybe the Alkaholiks PHP is running on a low low version? But then again it cant be. I been browsing google for past hours and have no clue.
 

Keith

ackright
Apr 22, 2002
329
2
0
44
#7
I just said that about the body/head tag as being my personal way of coding. Can you get the addy of the host for www.alkaholiks.com? They usually have all the info on what version of PHP they use and what kind of server it's on. Can you post or send the PHP code you used to include those pages? It'd give a better idea of what's going on.
 
Apr 25, 2002
424
3
18
45
www.rcanedesign.com
#8
Id have to see the source to tell you for sure but i bet it has to do with different versions of php on the two servers. Depending on how your grabbing the variable from the GET string it could be a syntax issue

$site = $_GET["site"];
or
$site = $_REQUEST["site"];

should work to set the variable, but it really depends how you choose the file to include. Let me know if you need a hand, programming is my day job
 
May 17, 2005
1,689
22
0
41
#9
The code was written pretty quick so I aint sure if its too clean, cause it was a 24 hour job, but lol shit worked.

Anyway the concept is that the index.php includes on the left hand side the following www.alkaholiks.com/navi.php and then on the right side the certain file.

Inside the index.php at the top there is following switch code:

<?php
switch($site)
{
case media: $content = "content_media.html"; break;
case news: $content = "news2.php"; break;
case extras: $content = "content_extras.php"; break;
case tour: $content = "content_tour.html"; break;
default: $content = "news2.php"; break;
}
?>
Then to include the navi ...

<? include("navi.php"); ?>
and finally the include for the main content

<? include("./".$content); ?>
 
May 17, 2005
1,689
22
0
41
#10
It worked now ... I changed the code too:

<?php
$site=$_GET['site'];
switch($site)
{
case media: $content = "content_media.html"; break;
case news: $content = "news2.php"; break;
case extras: $content = "content_extras.php"; break;
case tour: $content = "content_tour.html"; break;
default: $content = "news2.php"; break;
}
?>
Thanks to Swishersplitter for pushing me in the right direction!