karimali831 Posted January 15, 2008 Share Posted January 15, 2008 I'm new to this and need help with 2 things. You'll maybe not understand, hope you do though 1) I setup a website @ http://team-300.net/templates/1/index.php and for any php page I create it would show the contents of the first page from http://team-300.net/templates/1/index.php?site=news and for example, if I do create a link "awards.php" http://team-300.net/templates/2/index.php?site=awards would still point to index.php?page=news showing the contents of that page (No redirection) the page itself 2) Also have 5 designs of that website, trying to show the contents of news.php for each news.php for each design e.g. http://team-300.net/templates/1/index.php?page=site the same as http://team-300.net/templates/2/index.php?page=site I have no clue of doing this, seems a little complicated. I do not want to do this manually for each theme as this will take very long and as I know there's another way but I just don't know how I can't point http://team-300.net/templates/2/index.php?page=news to templates/1/index.php?page=news as it would show template 1 and can't do the same for templates/2/index.php?page=news to point to templates/1/news.php as this will just show the contents, not the design/index.php iteslf. Also, try not to comment on frames if you can BUT if that's the only way, then I got no choice. Yeah, problem 1 is the main thing so if you can help I'll appreciate it. Thanks! Karim Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/ Share on other sites More sharing options...
btherl Posted January 16, 2008 Share Posted January 16, 2008 Please post your code (if any). It sounds to me like you want include("$page.php"); (after verifying that the value of $page is allowed). I'm having trouble understanding your question 1 though. For question 2, you can have a default template directory, and have your scripts use that if they cannot find a specific template. Is that the kind of thing you're looking for? Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-440628 Share on other sites More sharing options...
karimali831 Posted January 16, 2008 Author Share Posted January 16, 2008 I'll try explain 1 again with codes. I am able to use this fine -> <td width="196" height="42" valign="top"><? include("sc_files.php"); ?></td> BUT When using this code, it doesn't work. The "index.php?site=gallery will just point to the homepage. <a href="index.php?site=gallery" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','Bilder/gallery1_47.jpg',1)"><img src="Bilder/gallery_47.jpg" name="Image41" width="167" height="15" border="0"></a></td> I tried <? include("sc_files.php"); ?><onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','Bilder/gallery1_47.jpg',1)"><img src="Bilder/gallery_47.jpg" name="Image41" width="167" height="15" border="0"></a></td> But I know this is soo wrong Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-440809 Share on other sites More sharing options...
karimali831 Posted January 16, 2008 Author Share Posted January 16, 2008 Where can I get help elsewhere then? My topic is already on the second page. Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441189 Share on other sites More sharing options...
nikefido Posted January 16, 2008 Share Posted January 16, 2008 Where can I get help elsewhere then? My topic is already on the second page. i think you are confused on how "include" works - or trying to make it do something that it does not. What exactly are you attempting to do there? Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441294 Share on other sites More sharing options...
karimali831 Posted January 16, 2008 Author Share Posted January 16, 2008 The correct code for <? include("sc_files.php"); ?><onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','Bilder/gallery1_47.jpg',1)"><img src="Bilder/gallery_47.jpg" name="Image41" width="167" height="15" border="0"></a></td> Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441393 Share on other sites More sharing options...
teng84 Posted January 16, 2008 Share Posted January 16, 2008 i believe your coding structure will be ugly using your logic.. any ways heres how example you have a url formated this way http://team-300.net/templates/2/index.php?page=news and you wan the page to got to news..page swithc($_GET['page']){ case 'news': header('location: news.php'); exit; break; case 'articles': header('location: articles.php'); exit; break; } or maybe what you mean is include what is on the querystring something like swithc($_GET['page']){ case 'news': include 'news.php'; exit; break; case 'articles': include 'article.php'; exit; break; } does it make sense ? Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441413 Share on other sites More sharing options...
btherl Posted January 17, 2008 Share Posted January 17, 2008 Where can I get help elsewhere then? My topic is already on the second page. When you start paying us for advice, that's when we start delivering on time Until then, be happy that we even respond. Teng's code looks good. Once you've solved 1 with that, you might find the solution to 2 is clear. Oops, teng that is "switch" not "swithc" Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441655 Share on other sites More sharing options...
karimali831 Posted January 17, 2008 Author Share Posted January 17, 2008 Sorry I didn't know I had to pay for advice, thought this is a forum where you can get help. Maybe by paying changes to the website can be done? Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441782 Share on other sites More sharing options...
trq Posted January 17, 2008 Share Posted January 17, 2008 Sorry I didn't know I had to pay for advice, thought this is a forum where you can get help. Maybe by paying changes to the website can be done? Or you could simply learn some patience. Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-441784 Share on other sites More sharing options...
btherl Posted January 18, 2008 Share Posted January 18, 2008 The advice is free, but it doesn't come fast. I only check this site once a day (unless I've got nothing else to do), so you can expect 24 hours between each response from me. If you want someone to write code for you, then you can make an offer in the freelancing section of the forum. Regarding "include", what it does is add another page into your page as if it had been called directly. It's often used to choose between different pages based on a GET value, as in teng's second example. If you haven't already, you can try out his code and see what it does. You'll need to have news.php and article.php in the same place as index.php Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-442313 Share on other sites More sharing options...
karimali831 Posted January 19, 2008 Author Share Posted January 19, 2008 I'll say if my thread is on the 2nd/3rd page, it's is very likely that I wouldn't get a response. The thread goes to the 2nd page in just a day. Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-443385 Share on other sites More sharing options...
btherl Posted January 19, 2008 Share Posted January 19, 2008 Indeed. Regarding your question of where else you can get help, look here Quote Link to comment https://forums.phpfreaks.com/topic/86226-need-help-with-php-please/#findComment-443436 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.