/    Sign up×
Community /Pin to ProfileBookmark

local site will not load correctly, but same site running remotely loads fine

to make testing and stuff easier, i decided to run a copy of my website locally on my linux partition. after getting apache, mysql, and php installed and running, the site comes up and appears normal. i can change between the different sections of my site and everything, but most of the things in the sections don’t work correcty. to make an explanation easier, have a look at my real site [url]http://www.ipwnj00.net[/url] . first of all, if you click around the different sections, the picture of the name of the section will change accordingly. in my local version, it doesn’t change…it stays exactly the same. the picture changes by a simple function that is in its own php file and is included in each section of the site. the function takes the parameter $PHP_SELF. here’s the first bit of the function. maybe it’ll help determine why its not changing on my site running locally.

[code=php]
function printNavBar($curpage)
{
$navbar = ”
<table align=”center” cellspacing=”15″ cellpadding=”0″>
<tr>
<td><A HREF=”index.php” target=”_self”>”;
if($curpage ==’/index.php’)
$navbar .= “<img src=”homebtn2.jpg” border=”0″></a>”;
else $navbar .= “<img src=”homebtn.jpg” border=”0″></a>”;
[/code]

also, on my real site if you go to the downloads section and then press games or videos or something, the database gets queried with the correct parameters and the content of the page changes correctly. on my local version, the url in the address bar will change correctly, but absolutely nothing changes in the page itself. same thing happens in the pics and guestbook page. none of the links generated by my php actually changes anything other than the url in the address bar. it seems weird to me becasue the first page is always shown correctly, so its obviously connecting to the database correctly, but i can’t get it to change after that. i’m guessing its an incorrect setting in my httpd.conf, php.ini, or in mysql, but i can’t figure it out. any of you have any ideas what it might be? i’ve skimmed through php.ini and httpd.conf, and couldn’t find anything that could be causing the problem. i’d really appreciate any help.
thanks

*EDIT* the printNavBar() function also serves to test what resolution the user’s system is set to and pass that in to the sections that use that information. the pics section, for example, is created and behaves very different when your resolution is under 1024 x 768. i’ve noticed that if i clear my cache, run the pics section with the url [url]http://127.0.0.1/Pics.php?width=800&height=600,[/url] which should format the contents different from 1024×768, it loads no different. i remembered that if no value is passed in for $width or $height, it defaults to 1024×768. it seems that none of the php variables being passed in through the address bar are being used/recognized, which would explain my problems (not sure about the nav bar though…). i guess my next question is, how do i fix that? *EDIT*

to post a comment
PHP

1 Comments(s)

×

Success!

Help @thrice spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...