Passing id to new fancybox

78 views
Skip to first unread message

Myq

unread,
Aug 1, 2012, 2:39:54 AM8/1/12
to fanc...@googlegroups.com
Let's say something like this opens when I click "Messages"

<div align="center" class="maintitle">Messages</div>
<?php
include 'mysql.php';  
    $sql_string="SELECT * FROM messages WHERE user='$user' and status='active' ORDER BY date_ent DESC";
    $result=mysql_query($sql_string);
    while ($row = mysql_fetch_array($result))  {
        $from    = $row["from"];
        $message      = $row["message"];
        $date_ent = $row["date_ent"];
?>
  <div align="left"><?PHP echo $date_ent; ?></div>
    <br>
    <br>
<div align="left"><?PHP echo nl2br($message); ?></div>
<div align="right"><a href="message.php?Submit=REPLY&id=<?PHP echo $row["id"]; ?>">[REPLY]</a> / <a href="teade.php?Submit=Kustuta&id=<?PHP echo $row["id"]; ?>">[DELETE]</a></div>
<br>
FROM:<?PHP echo $kellelt; ?>

This opens in a fancybox, my question is how can I pass the id, so when the user clicks "REPLY" it opens another fancybox with textfield to reply and all that and when they reply it is saved to database, or when the user clicks DELETE how can I pass the id so it deletes from database. I know it's done with ajax, but I'v never used it before and I could not find anything useful from Google, so I am asking you guys :) Please help me..

RavanH

unread,
Aug 2, 2012, 3:42:35 PM8/2/12
to fanc...@googlegroups.com
You seem to be doing all this with PHP and MySQL so my advise would be to forget about ajax and first make it work in PHP without FancyBox where each step in the process opens a new browser tab (just use target="_blank"). After you made it completely functional like that (you'll have to ask all PHP/MySQL related stuff elsewhere) then come back to integrate FancyBox into it. Use FancyBox in iFrame mode to replace each new browser window/tab...


Op woensdag 1 augustus 2012 08:39:54 UTC+2 schreef Myq het volgende:
Reply all
Reply to author
Forward
0 new messages