mintygreen Posted January 8, 2011 Share Posted January 8, 2011 Hi i would first like to say that it has been 3 years since i stopped coding because i had got a virus on my computer and lost all my scripts. And i no longer had the scripts backed up on my server at the time, as the host sold his reseller account. So now i am trying to get started back up and im missing my favorite php script, and i no longer know how to code it. I am looking for a simple php script that i can integrate into a simple html website, the code worked as following. When you clicked on a link it loaded the corresponding content into a overflow frame (?php=home), and the content was preloaded, but only visible with the use of & if script. So that there was no need to reload the whole web page when you clicked a link, it just loaded basic html content within the php script... as far as i can remember it was like. } else { # result report ?> <html><head> <title>Report on your selection</title> </head><body> <h2>Here are the examples that you chose</h2> <?=$freport?><br> <a href=<?=$PHP_SELF?>>Restart demo</a><br> <a href=http://www.wellho.net>Our Home Page</a><br><br> Example by Well House Consultants, Copyright <?= date("Y") ?> <br>Want to know how to do this? <a href=http://www.wellho.net/course/ph.html>Learn Here!</a> </body> <?php } ?> That is close but, not quite right.. I know this is kinda of a vague question but this is really important to me and i would greatly appreciate and help.. Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/ Share on other sites More sharing options...
gizmola Posted January 8, 2011 Share Posted January 8, 2011 These days, people would do something like this with javascript, by hiding/unhiding divs. This supposes I guess that all your content is static. If that's the case I have a hard time understanding why you would want to load up a giant page just to prevent a small amount of traffic back and forth. My recommendation would be to look at jquery() as writing the code to do this, even if you have only a beginners understanding of javascript. jquery also supports ajax and makes it trivial to implement, which is another alternative to doing requests, but for what are in essence full pages, I still don't see the point. Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/#findComment-1156584 Share on other sites More sharing options...
mintygreen Posted January 8, 2011 Author Share Posted January 8, 2011 Well the content could be on separate static files, just so long as the whole page does not reload because it has allot of graphics to load. And there will be a win amp radio through out the site.. and if i the site has to reload then so does the radio and then you loose music... this way the music is always playing, only the content within the div changes. Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/#findComment-1156592 Share on other sites More sharing options...
mintygreen Posted January 8, 2011 Author Share Posted January 8, 2011 Thanks for help i guess.. but not really... I found it on my own after 6 hours of search.... And would have taken you guys probably like 2 mins. <? $phpself = $_SERVER['PHP_SELF']; //its you php page. switch($_GET['id']) { case '1': print "hey buddy, you are on 1st id.<br> its a login page"; break; case '2': print "you are on the second id. <br> its a forum page"; break; } echo "<a href=$phpself?id=1>Login</a><br><a href=$phpself?id=2>forum</a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/#findComment-1156737 Share on other sites More sharing options...
gizmola Posted January 9, 2011 Share Posted January 9, 2011 That code in no way answers the question about how to do what you asked for. Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/#findComment-1156887 Share on other sites More sharing options...
mintygreen Posted January 9, 2011 Author Share Posted January 9, 2011 Your right... it did not work but this did <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a> <div id="contentarea"></div> Quote Link to comment https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/#findComment-1156904 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.