PHP Woes

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
mg66
-


Joined: 15 Aug 2004
Posts: 85
Location: USA, Illinois

PostPosted: Mon Nov 28, 2005 5:40 am    Post subject: PHP Woes Reply with quote

My dynamic php site has been working flawlessly for some time and as of yesterday it has a problem.

At my site at http://www.bghi.us and http://www.metromain.net I click on a link and in the address bar I see the url but it it just refreshes to the main page. I have reinstalled php, abyss and checked the code for the index.php but cant seem to crack this. My coding probably isnt good as I have just bungled along. It appears to a global issue as it doing the same thing on both domains.

Here is my index.php if someone has some pearls of wisdom to offer or maybe something else I can try. I am out of ideas.

<?
if (empty($x)) {
$x='bghi_home';
}else{
$x=$_GET['x'];
}
?>

<div align="center"><center>

<table border="0" cellspacing="0" width="975">
<tr>
<td align="center" colspan="3" width="100%"><p
align="center"><?php include("includes/bghi-header.php"); ?></p>
</td>
</tr>
<tr>
<td valign="top" width="16%" bgcolor="#000000"><?php include("includes/leftnav.php"); ?></td>

<td align="center" valign="top" width="84%" ><p
align="center">



<?php
changelocation($x);
function changelocation($x) {
switch ($x) {
case 'bghi_home':
include ('hunt_pages/bghi_home.php');
break;
case 'uptime':
include ('stats/index.php');
break;
case 'hunt_2000':
include ('hunt_pages/bghi_hunt_2000.php');
break;
case 'hunt_2001':
include ('hunt_pages/bghi_hunt_2001.php');
break;
case 'hunt_2002':
include ('hunt_pages/bghi_hunt_2002.php');
break;
case 'hunt_2003':
include ('hunt_pages/bghi_hunt_2003.php');
break;
case 'hunt_2004':
include ('hunt_pages/bghi_hunt_2004.php');
break;
case 'hunt_2005':
include ('hunt_pages/bghi_hunt_2005.php');
break;
}
}
?>



</p>
</td>
</tr>
<tr>
<td align="center" colspan="3" width="100%"><?php include("includes/bghi-footer.php"); ?></td>
</tr>
</table>
</center></div>
_________________
mg66

http://sv650.metromain.net
http://photography.metromain.net
http://weather.metromain.net
http://www.metromain.net
http://www.bghi.us


Abyss Web Server X2
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Nov 28, 2005 7:05 am    Post subject: Reply with quote

Functions need to be declared at the top of your PHP script. This maybe the
reason why , also you posted changelocation() before it was even created so
that maybe another problem. Please check your code and try again. :-)

Sincerely, TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Mon Nov 28, 2005 3:10 pm    Post subject: Reply with quote

TRUSTpunk wrote:
Functions need to be declared at the top of your PHP script. This maybe the
reason why , also you posted changelocation() before it was even created so
that maybe another problem. Please check your code and try again. :-)

Sincerely, TRUSTpunk


Well, yeah.
Calling the function before it's come into being won't work afaik, but it seems to be when I visit your site, so I doubt that's the problem.
So, if it allways shows home, this tells me that your coding at the top isn't working.
Try something like
Code:
if (!isset($_GET['x']))
  $x='bghi_home';
else
  $x=$_GET['x'];

_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
mg66
-


Joined: 15 Aug 2004
Posts: 85
Location: USA, Illinois

PostPosted: Mon Nov 28, 2005 7:38 pm    Post subject: Reply with quote

Thanx very much. You guys rock! Changed the items that you both suggested and back up and running again.

Once again, thanx for sharing your knowledge.
_________________
mg66

http://sv650.metromain.net
http://photography.metromain.net
http://weather.metromain.net
http://www.metromain.net
http://www.bghi.us


Abyss Web Server X2
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group