ryanclemens Posted January 12, 2007 Share Posted January 12, 2007 Hello,I am new to this forum and to PHP.I have a code that I got but I can't get it to call the correct page. I am not sure if there is a special code that I have to put on the page that I am trying to call or what.here is the code that I have for my Nav.I have the page "see.php" loaded in the root folder. and for this page I just copied what was already used for the other pages and just added a movie. but when I use /see/ it doesn't find the page.Like I said I am super new at PHP but I really want to learn.please let me know if you need more.Thank you[code]<?php$menu = <<<MENU<div id="mn"><ul id="menu"><li id="home"><a href="/" title="Welcome to the Jupiter Hotel.">Home</a></li><li id="reserve"><a href="/reserve/" title="Get a room!">Reserve</a></li><li id="groups"><a href="/groups/" title="Group Packages">Groups</a></li><li id="play"><a href="/play/" title="Have a good time">Play</a></li><li id="deals"><a href="/deals/" title="Learn about hot deals.">Deals</a></li><li id="buzz"><a href="/buzz/" title="Read about Jupiter Hotel's buzz.">Buzz</a></li><li id="gallery"><a href="/see/" title="View images.">Gallery</a></li></ul></div>MENU;// adds id="active" to the active menu item by matching the url// code from: http://photomatt.net/scripts/intellimenu$lines = split("\n", $menu);foreach ($lines as $line) { $current = false; preg_match('/href="([^"]+)"/', $line, $url); if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) { $line = str_replace('<a h', '<a id="active" h', $line); } echo $line."\n";}?>[/code]Here is also the code to the see.php page[code]<?php $page_title = "Word on the street"; ?><?php include("_php/page_open.php"); ?><script type="text/javascript" src="/_js/prototype.js"></script><script type="text/javascript" src="/_js/scriptaculous.js?load=effects"></script><script type="text/javascript" src="/_js/lightbox.js"></script><link rel="stylesheet" href="/_c/lightbox.css" type="text/css" media="screen" /><div id="content"><div id="left"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="263" height="396" align="middle" class="greyborder"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="_swf/gallery_slideshow.swf" wmode="transparent" /><param name="quality" value="high" wmode="transparent"/><param name="bgcolor" value="#cccccc" wmode="transparent"/><embed wmode="transparent" src="_swf/gallery_slideshow.swf" quality="high" bgcolor="#cccccc" width="263" height="396" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed></object></div><div id="right_gal"><h2 class="chiller">Your eyes will thank you. </h2> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="320" height="240" class="greyborder"> <param name="movie" value="_videos/tripfilm.swf" /> <param name="quality" value="high" /> <embed src="_videos/tripfilm.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="240"></embed> </object> <br /> <span style="font-style: italic; font-size: x-small;">Video may take a minute to load...</span></p> <p> </p> <p> <strong>g a l l e r y :</strong> <a href="http://jupiterhotel.blogspot.com/" target="_blank">Let your eyes have some fun</a> </p><p> </p></div></div></div><?php include("_php/page_close_see.php"); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/ Share on other sites More sharing options...
pierrick Posted January 12, 2007 Share Posted January 12, 2007 Hi,[quote]<li id="home"><a href="/" title="Welcome to the Jupiter Hotel.">Home</a></li>[/quote]Above is your first item in the list. It seems to me the link does not link to any file, just the root dir ( / ).If you wanted the above link to ope the 'see.php' page you'd need to have this: <li id="home"><a href="/see.php" title="Welcome to the Jupiter Hotel.">Home</a></li>Provided, as you point out, that the 'see.php' page is in the root dir. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-159426 Share on other sites More sharing options...
ryanclemens Posted January 12, 2007 Author Share Posted January 12, 2007 that is what I thought also, but that link is just for the Home page "index.php"the but others in the code /reserve/ and what not actually link to reserve.phpso how does that happen?[code]<li id="reserve"><a href="/reserve/" title="Get a room!">Reserve</a></li><li id="groups"><a href="/groups/" title="Group Packages">Groups</a></li><li id="play"><a href="/play/" title="Have a good time">Play</a></li><li id="deals"><a href="/deals/" title="Learn about hot deals.">Deals</a></li><li id="buzz"><a href="/buzz/" title="Read about Jupiter Hotel's buzz.">Buzz</a></li>[/code]all those actually link to there php page and not a folder. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-159458 Share on other sites More sharing options...
ShogunWarrior Posted January 12, 2007 Share Posted January 12, 2007 There is probably what's called a .htaccess file which dynamically changes the URL /reserve/ to reserve.php for instance.This is done at the server level, not with PHP. If you are able to access the site via FTP then you should be able to find that file and download it, and we can help change it. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-159497 Share on other sites More sharing options...
ryanclemens Posted January 12, 2007 Author Share Posted January 12, 2007 Thank you, I just figured that part out.but thank you all for your help!! Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-159503 Share on other sites More sharing options...
ryanclemens Posted January 17, 2007 Author Share Posted January 17, 2007 ok so I got the .htaccess file and made some changes and then uploaded it to the server... everything was working fine, then I made some more changes and now those don't work.the changes I made before work fine but not the new ones.here is the code.the /packages/ doesn't work for me.[code]RewriteEngine onRewriteBase /RewriteRule ^sleep$ /sleep/ [R]RewriteRule ^sleep/$ sleep.phpRewriteRule ^groups$ /groups/ [R]RewriteRule ^groups/$ groups.phpRewriteRule ^reserve$ /reserve/ [R]RewriteRule ^reserve/$ reserve.phpRewriteRule ^play$ /play/ [R]RewriteRule ^play/$ play.phpRewriteRule ^eat$ /play/ [R]RewriteRule ^eat/$ /play/ [R]RewriteRule ^consume$ /play/ [R]RewriteRule ^consume/$ /play/ [R]RewriteRule ^connect$ / [R]RewriteRule ^connect/$ / [R]RewriteRule ^deals$ /deals/ [R]RewriteRule ^deals/$ deals.phpRewriteRule ^buzz$ /buzz/ [R]RewriteRule ^buzz/$ buzz.phpRewriteRule ^see$ /see/ [R]RewriteRule ^see/$ see.phpRewriteRule ^beta$ /beta/ [R]RewriteRule ^beta/$ beta.phpRewriteRule ^contact$ /contact/ [R]RewriteRule ^contact/$ contact.phpRewriteRule ^packages$ /packages/ [R]RewriteRule ^packages/$ packages.phpRewriteRule ^tester$ /tester/ [R]RewriteRule ^tester/$ tester.php[/code]this is the same format I used when I first made some mods and it worked fine. I copied this from another site I was working on.Please help!! this has been at me for about 5 days now. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-162457 Share on other sites More sharing options...
ryanclemens Posted January 17, 2007 Author Share Posted January 17, 2007 I have moved this post to the apache section.Thank you.Ryan Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-162473 Share on other sites More sharing options...
ShogunWarrior Posted January 23, 2007 Share Posted January 23, 2007 I don't see the point in this:[code]RewriteRule ^groups$ /groups/ [R]RewriteRule ^groups/$ groups.php[/code]Won't this rewrite [b]groups[/b] to [b]groups/[/b] which will then redirect the groups.phpSince the end in either case is groups.php change each of your double lines to the bottom one with a question mark:[code]RewriteRule ^groups/?$ groups.php[/code]This way [b]groups[/b] and [b]groups/[/b] will rewrite to the right page without an extra request. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-167232 Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 Am I missing something here or should those escape characters be "\" backslashes instead of "/" 's ? Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-167237 Share on other sites More sharing options...
ShogunWarrior Posted January 23, 2007 Share Posted January 23, 2007 In this circumstance they aren't escape characters since Apache Rewrite doesn't use them, they are literal directory separators. Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-167293 Share on other sites More sharing options...
simcoweb Posted January 23, 2007 Share Posted January 23, 2007 Ok, I see that now. Learn something new each day! :) Quote Link to comment https://forums.phpfreaks.com/topic/33946-new-to-php-cant-get-page-to-load/#findComment-167304 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.