Jump to content

Recommended Posts

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..

 

 

Link to comment
https://forums.phpfreaks.com/topic/223753-php-page-links-and-content-please-help/
Share on other sites

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. 

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. 

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>";

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.