2016-04-15 8 views
1

私はループの下にあるドロップダウンリストのhtmlの下に1つのPHPブロックを持っています。他のPHPブロックはfaceboxを使用したポップアップウィンドウです。今すぐドロップダウンコンテンツをクリックして、2番目のPHPブロックに値を渡します。同じPHPファイルに値を渡す

<?php 


     $msql="select notification_id,applicant_id,notification_dis from app_notification where applicant_id=$app_id order by notification_id desc " ; 
     $result_msql=$bd->query($msql); 
     while($messagecount=$result_msql->fetch_assoc()) 

     { 
     $not_id= $messagecount['notification_id']; 
     $comment=$messagecount['notification_dis']; 


     ?> 




      <div class="comment_ui" > 



     <a href="#info" class='view_comments' rel='facebox' id="<?php echo $not_id; ?>"></br> <?php echo "check1---$not_id".$comment."";?> 
       </a>     

      </div> 

////もう一つは、

 <?php 



     echo $_POST['not_id']; 
     $mysql_hostname = "localhost"; 
     $mysql_user = "root"; 
     $mysql_password = ""; 
    $mysql_database = "test"; 
    $prefix = ""; 

     $bd = new mysqli($mysql_hostname, $mysql_user,   $mysql_password,$mysql_database) or die("Opps some thing went wrong"); 


      echo "check2---$not_id"; 

      $msql_show="select header_type,notification_main,notification_dis from app_notification where notification_id=$not_id"; 
      $show_msql=$bd->query($msql_show); 

      while($message_show=$show_msql->fetch_assoc()) 
      { 
       $header=$message_show['header_type']; 
       $main=$message_show['notification_main']; 


      $msql_multi="SELECT file_name FROM biz_logo WHERE w_id=(SELECT w_id FROM post_job 
      WHERE job_id=(SELECT job_id FROM job_notice WHERE 
      notice_id=(SELECT notice_id FROM app_notification where notification_id=$not_id)))"; 
      } 
      $msql_multi=$bd->query($msql_multi); 
      while($message_multi=$msql_multi->fetch_assoc()) 
      { 

       $file_name=$message_multi['file_name']; 



      } 



      print "<center><h1>".$header."$not_id</h1></center>"; 
    print"<span style='margin-right:50em'><table> 
       <p><t>".$file_name."</t></p><tr><td>".$main."</td> 
    </tr> <tr><td></td></tr></table><span> ";    
      ?> 





     <?php }?> 
+0

クリックしたときにnot_idを使用したい – iftekhar143

+0

ajaxまたはyoを使用して2番目のブロックに値を渡す(関数に変更する)必要がありますクリックしてページを提出する必要があります。 – VipindasKS

+0

「$( "view_comments。 ")(関数(){ \t VAR ID = $(この).ATTR(" ID")をクリックし、 $アヤックス({ タイプ: "POST" を、 URL: "notifications.php"、 データ: "not_id =" + ID、 キャッシュ:偽、 成功:機能(データ){( "作業") 警告;} });偽 リターン; }); ' – iftekhar143

答えて

0

PHPで手動でセッションを使用するかは

$_SESSION["favcolor"] = "green"; 
$_SESSION["favanimal"] = "cat"; 


<?php 
// Echo session variables that were set on previous page 
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>"; 
echo "Favorite animal is " . $_SESSION["favanimal"] . "."; 
?> 

が必要な場合は、HTMLを使用する必要がある場合や、InputBox関数とポストを使用することができますですgetメソッド

+0

ドロップダウンでコンテンツをクリックすると、そのコンテンツのIDは2番目のブロックに送信されます IDはデータベースから取得できます..ここshow notification_id – iftekhar143

+0

2番目のブロックがfaceboxを使用してポップアップにコンテンツを表示することを理解しています。そうであれば、popup.phpを作成して変数をクエリ文字列として渡すことができます。 popup.phpのような? not_id = 1(何でも)。これを行うには、faceboxオプションを参照してください。明らかに、コードの2番目のブロックはpopup.phpになければなりません。 – VipindasKS

+0

コードはnotification VipindasKS

関連する問題