Jump to content

Weird Problem


Origin

Recommended Posts

I'm having a problem with a site I made. I know the server supports PHP cuz I have used it before.http://gfxsector.netThe php navigation is acting weird..The include is working because its incuding CuteNews... but it doesnt work when I click the other links.It brings the default page up no matter what link I choose. Include in the main content box

<?phpswitch($id) {default:include('cutenews/show_news.php'); break; case "1": include('cutenews/show_news.php'); break; case "2":include('dls.htm');break; case "3":include('sotwnews/show_news.php');break; case "4":include('affs.htm');}

A Navigation link

<a href="index.php?id=3" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('sotw','','images/sotw2.gif',1)"><img src="images/sotw.gif" alt="SOTW" name="sotw" width="25" height="39" border="0"></a>

Link to comment
Share on other sites

This will test if the id is set in the URL, if it is not it's default value will be 0.

<?php$id = 0;if(isset($_GET['id']))$id = intval($_GET['id']);  switch($id) {    case 1:    include('cutenews/show_news.php');    break;    case 2:    include('dls.htm');    break;    case 3:    include('sotwnews/show_news.php');    break;    case 4:    include('affs.htm');    break;    default:    include('cutenews/show_news.php');    break;  }?>

Post back if you have any questions. :)

Link to comment
Share on other sites

Guest chocolates_idol
Have you done this yet?$id=$_GET['id'];You have to put the value of the variable into the url to $id, otherwise you can't switch it. :)

oh yes. i am slightly fluent in the language hare too. [:
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...