Jump to content

Recommended Posts

Hello,

 

Can anyone please help me building a site in php?  ;D

 

Basicly what i want to do is:

 

i have a bunch of links. when i click that links the dynamic content from a mysql db appear above the links.

I need to do this without open a new page because i'm using mootools with the acoordeon script, and inside each "tab" theres contents. when i'm inside one tab i want to have links, and clicking each link new contents appears.

 

Don't know if i'm explaining clear what i want to do...

 

When i do this opening a new page is easy, i just put on the links something like newpage.php?id=games and then the page newpage.php open and the recordeset from games is echoed. but how to do that without leaving the page? refreshing or something like that.. i'm lost :/

 

Thanks in advance.

 

btw.. i'm working with dreamweaver but i can write the code on had with no problem

Link to comment
https://forums.phpfreaks.com/topic/74713-refresh-page-with-new-contents/
Share on other sites

Do it the same as you would to open a new file, but instead of parsing the information to another page, parse it back to the page your on.

 

<?php
while($data = mysql_fetch_array($sql_query){

if($_GET[id] = $data[link_id]){
// display information
}
// Show link
}
?>

 

Basically, loop through the links in the database, and then foreach one check to see if the parsed value matches the value in the database.... If it does, display the information relating to that link, if not do nothing - just display the rest of the links.

 

I don't fully understand what you are tyring to do, so the code above may be completely along the wrong lines

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.