/    Sign up×
Community /Pin to ProfileBookmark

##section Of Website Isnt Working!!!##

hey i have a website [url]http://65.19.180.189[/url]
it pretty much is great, but when i goto hey i have a website [url]http://65.19.180.189/default.php?page=games[/url] the pictures dont work, all the pics & code r fine but dont work. Also when i clik on a game it opens in a new window (AHHH???) and says page cannot be displayed??

So heres my layout i have my default.php page which has everthing on it (header etc…) and has a table with<-START–>

[code=php]<?

# default page
$default = ‘default.php?page=home’;

# set document root path
$base = $_SERVER[‘OpenSAApachehtdocsnew’];

# list of all site pages + the id they will be called by
$pages = array(‘about’ => ‘about.php’,’contact’ => ‘contact.php’,’forum’ => ‘redirect.php’,’home’ => ‘home.htm’,’search’ => ‘./search/google.php’,’games’ => ‘./games/index.php’,’prices’ => ‘pricing.php’,’cheats’ => ‘./cheats/index.php’,’faq’ => ‘./faqz/faqs.php’,’chat’ => ‘chat.php’,’agames’ => ‘./games/agames.php’);

if(array_key_exists($_GET[‘page’], $pages))
{
foreach($pages as $pageid => $pagename) {
if($_GET[‘page’] == $pageid && file_exists($base.$pagename))
{
/* if somebody’s making a request for ?page=xxx and
the page exists in the $pages array, we display it
checking first it also exists as a page on the server */
include $base.$pagename;
}
} // end foreach
}
else {
/* if the page isn’t listed in $pages, or there’s no ?page=xxx request
we show the default page, again we’ll also just make sure it exists as a file
on the server */
if(file_exists($base.$default)) include $base.$default;
}

?>[/code]

<-END–>
What this does is that when you click on a pahge link it displays it inside the table (where i put the code) so thats y i dont want it 2 open in a new page. I was wondering how i cood mod the code to instead of-eg. index.php?page=home -BE- eg.index.php?catid=games&pid=4x4r
Finally could someone tell me y the pics dont work and y the games show “page cannot be displayed” when everthing is there and linked correctly.
Thx 2 any1 who helps ?

to post a comment
PHP

20 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyJul 09.2005 — Your images aren't showing up cause the images aren't in the location that you have written in your code...

None of the pages are opening in a new window for me. Please explain this more clearer...

And: eg. index.php?page=home -BE- eg.index.php?catid=games&pid=4x4r

You've already got one array set up, make this a multidimentional array.
Copy linkTweet thisAlerts:
@geekmanauthorJul 09.2005 — well it seems you were right the pics & links were (because of my frame like nav system) werent pointing correctly although would have been fine normally. Also do you know of a sample script etc... of the multidimentional array php nav u were talking about i a n00b u see. I want this nav system because with the games on http://65.19.180.189/default.php?page=games if u try 2 goto 1 (contridicting what i said earlier) the page opens to a blank page and not in the table. And i thought if i used the nav 4 the games i would open in the table. Do u have any other ways 2 make this happen thx alot ur the 1st person 2 ever help me with this ongoing prob.
Copy linkTweet thisAlerts:
@geekmanauthorJul 09.2005 — when i say goto 1 i meen goto a game, and when i say a blank page i meen a white 1 with the game on it but if u dont get it u can always see what happens 4 urself

BYE?
Copy linkTweet thisAlerts:
@Sup3rkirbyJul 09.2005 — Your problem is already fixed I assume, but I would like to note one small thing... If you are hosting that site on your own server, it is not a great idea to have your ip address posted on the internet. If you are using that as the site address, then you probably don't want to buy a domain name. But there are two free services I know of for domain names. fdns.net and dot.tk(MSN them)(haha, I used MSN instead of google in that sentence)(Did no one else get it?)
Copy linkTweet thisAlerts:
@geekmanauthorJul 10.2005 — i dont host my own site @ least not until i get broadband. i used 2 have a .com but is now stolen such a shame my site i found out yesterday was the top gaming site on some german site oh well. Ps i wood neva b sooo stupid as to give out my ip and i do have a .tk but find them annoying.

CAN SOMEOE PLEASE SHOW ME A MULTIDIMENSIONAL NAVIGATION SCRIPT!!!!

ie index.php?cat=games&pid=action

I CANT FIND ANYTHING LIKE IT!!!!

HEEEEEEEEEELLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!
Copy linkTweet thisAlerts:
@buntineJul 10.2005 — Do you realise we have a PHP forum? I will move this thread.
Copy linkTweet thisAlerts:
@geekmanauthorJul 10.2005 — soz i didnt realise can u tell me where ur gona move it?

like what pg url wood b nice thnx
Copy linkTweet thisAlerts:
@bathurst_guyJul 10.2005 — http://php.planetmirror.com/manual/en/function.array.php

Single Dimension Array:

$fruits = array("a" => "orange", "b" => "banana", "c" => "apple");

Multi Dimension Array:

$fruits = array (

"fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"),

"numbers" => array(1, 2, 3, 4, 5, 6),

"holes" => array("first", 5 => "second", "third")

);


I don't understand why you are making your site like this?

Why don't you want the links on the page to link to games.php rather than default.php?page=game ?

You don't really need any of this code.

Also, you may want to change default.php to index.php .

default is on M$ servers, index on *nix.
Copy linkTweet thisAlerts:
@buntineJul 10.2005 — 
soz i didnt realise can u tell me where ur gona move it?

like what pg url wood b nice thnx
[/quote]

To the PHP forum. A redirect link is left in the General forum when a thread is moved.
Copy linkTweet thisAlerts:
@geekmanauthorJul 10.2005 — i want it like this becuase then it will appear in the table which makes it easier 4 me 2 maintain the site ie i only reely have 2 edit 1 page, i no this might seem stupid but hey im only 14 ill get better with time 4 now this is the easiest way 4 me to get my site running. also i realise the difference between index & default but i am a n00b @ php so it has taken me a while to stop the site from falling apart, this was just a test and it will be fixed @ a later stage PS thank u soooooooooooooo much 4 that i was lookin everywhere.

BYE

<EDIT>

oh sory now i get it, well that wood meen that i would have 2 hav either a frame within a frame or a whole different main page 4 games and either wood reely b defeating my purpose 4 this system.
Copy linkTweet thisAlerts:
@bathurst_guyJul 10.2005 — Ok, well there are many different ways to skin a cat. I like to have each page on their own and have the header and footer included. Much easier to understand I think. There is a thread in this forum where I showed another person how to do this if your interested.
Copy linkTweet thisAlerts:
@bathurst_guyJul 10.2005 — Sorry I don't understand your edit.

Maybe this will help you understand a bit more:
[CODE]
$pages = array(
'about' => 'about.php',
'contact' => 'contact.php',
'forum' => 'redirect.php',
'home' => 'home.htm',
'search' => './search/google.php',
'games' => array(
'game1' => './games/game1.php',
'game2' => './games/game2.php'),
'prices' => 'pricing.php',
'cheats' => './cheats/index.php',
'faq' => './faqz/faqs.php',
'chat' => 'chat.php',
'agames' => './games/agames.php');
[/CODE]
Copy linkTweet thisAlerts:
@geekmanauthorJul 11.2005 — i used to do my webite with includes i will think about it again, but for now dont worry about the code, i got it working last night and realised it wood take alot of wrk to list all the games. so instead i have default.php (the main oage) and games.php(indentical to the main 1 but the arrays r 4 the games.) so instead u goto eg.games.php?games=4x4r

but many thanx. altho i do have 1 prob when i goto the game it shows the page and the flash box but says the movie is not loaded, even when i left it on ovr night, but when i goto it manually its fine??? u dont have 2 help seen as u hav done so much already, its just this is the most help i have ever got and well i want 2 get it all working. THANX

oh and about the edit it was l8 and i wasnt thinking clearly i think that maybe i have stated the same thing over and over again(u no the easy maintainence bit(s)) sorry
Copy linkTweet thisAlerts:
@SpectreReturnsJul 11.2005 — Sorry, but I don't understand a thing you say....
Copy linkTweet thisAlerts:
@geekmanauthorJul 11.2005 — here look at the difference http://65.19.180.189/games/games.php?game=4x4r

now goto http://65.19.180.189/games/4x4r/4x4rally.html

why wont the first 1 work???

major prob pls help
Copy linkTweet thisAlerts:
@bathurst_guyJul 11.2005 — if your referring to the swf its because you dont have it linked correctly. its in the folder 4x4r
Copy linkTweet thisAlerts:
@geekmanauthorJul 11.2005 — yes i am refering to swf but if u look @ the first link youll notice that there is actually a flash thing there but when u right click on it, it says movie not loaded and has a black screen and stays like that for ever ill dbl chek the links but im pretty sure theyre ok.

Ps sory 2 the moderators 4 just plain changing the subject.
Copy linkTweet thisAlerts:
@bathurst_guyJul 11.2005 — re-read my last post

if your referring to the swf (which you said you now are) [B]its because you dont have it linked correctly[/B] location should be [B]4x4r/4x4rally.swf[/B] not [B]4x4rally.swf[/B]
Copy linkTweet thisAlerts:
@geekmanauthorJul 12.2005 — k i changed the link in the html file(this did nothing) and i have that script i showed earlier pointing to the html file, i have already tried to link my script to the swf directly but thats worse.
Copy linkTweet thisAlerts:
@geekmanauthorJul 12.2005 — i just found that there was some kind of restriction in the parameters of the swf file like "allowscriptaccess = same domain" i removed it i think @ least dreamweaver says so i wonder tho if theres some other protection hmmmm?
×

Success!

Help @geekman 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.18,
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,
)...