顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


主題 - NARs

頁: [1] 2 3 4
1
網頁技術 / jQuery data table無法呈現?
« 於: 2016-06-24 17:26 »
我想要將curl的資料以jquery datatable呈現 (like this https://datatables.net/examples/api/row_details.html),

response.php :
代碼: [選擇]
echo json_encode($results);

datatables.php:
代碼: [選擇]
    <script>
    function format ( d ) {
    // `d` is the original data object for the row
    return '<table cellpadding="3" cellspacing="0" border="0" style="padding-left:50px;">'+
        '<tr>'+
            '<td>message:</td>'+
            '<td>'+htmlspecialchars(d.message)+'</td>'+
        '</tr>'+
        '<tr>'+
            '<td>id:</td>'+
            '<td>'+d.id+'</td>'+
        '</tr>'+
       
    '</table>';
    }
 
    $(document).ready(function() {
    var table = $('#example').DataTable( {
       
"ajax": {
        'type': 'POST',
        'url': 'response.php',
        "columns": [
            {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": ''
            },
            { "data": "datetime" },
            { "data": "message" },
         
        ],
        "order": [[1, 'asc']]
    } );
     
    // Add event listener for opening and closing details
    $('#example tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );
 
        if ( row.child.isShown() ) {
            // This row is already open - close it
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            // Open this row
            row.child( format(row.data()) ).show();
            tr.addClass('shown');
         }
      } );
     } );
    </script>
html :
代碼: [選擇]
<body>

    <table id="example" class="display" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th></th>
                <th>datetime</th>
                <th>message</th>
               
            </tr>
        </thead>
        <tfoot>
            <tr>
                <th></th>
                <th>datetime</th>
                <th>message</th>
               
            </tr>
        </tfoot>
    </table>
  </body>
echo json_encode($results) 是有資料的,但是為什麼會不能呈現出來?

2
各位大大,
要如何將JAva的回傳ArrayList中map 的key和value以表格呈現?


代碼: [選擇]
   ArrayList<Map<String, Object>> arylist = new ArrayList<Map<String, Object>>();
   int index = 0;
   for (SearchHit hit : hits)
   {
        for (Map.Entry entry : map.entrySet())
        {
            map.put(entry.getKey().toString(), entry.getValue());
        }
        arylist.add(index, map);
       index++;
   }
return arylist ;

3
各位大大,
在CSS中,設定了位置,但是在firefox、IE顥示,位置是我想要的排版位置
,但是在chrome中,位置會偏上移,請問要怎麼解決不同瀏覽器的排版呢?

在firefox、IE 中要設定如下 :
代碼: [選擇]
margin-top:-400px; /*map position */
margin-left:-400px; /*map position*/

但是在chrome中卻要改成
代碼: [選擇]
margin-top:-300px; /*map position */
margin-left:-300px; /*map position*/

4
資料庫的格式是varchar(20)
儲存的形式是 2013-12-23 22:43:04
請問要如何取出有相差1分鐘內的紀錄?


例如:
id time
1 2013-12-23 08:20:04
2 2013-12-23 08:20:54
3 2013-12-23 08:20:24
4 2013-12-23 10:43:14
5 2013-12-23 10:43:04
6 2013-12-23 07:43:04
7 2013-12-23 05:43:04
8 2013-12-23 03:43:04


則可以取出

1 2013-12-23 08:20:04
2 2013-12-23 08:20:54
3 2013-12-23 08:20:24


4 2013-12-23 10:43:14
5 2013-12-23 10:43:04

5
網頁技術 / 請問如何讀取mysql畫出圖形?
« 於: 2013-12-11 11:52 »
希望能讀取資料庫資料畫出如附件的圖形,
請問有軟體或套件可以畫出如附件的圖形嗎?

6
Linux 討論版 / 如何在crontab 執行shell script ?
« 於: 2012-08-08 14:14 »
各位大大,
我想要在crontab中排程定時執行一支shell script

test.sh :
代碼: [選擇]
export PATH=/bin:/sbin:/usr/bin:/usr/sbin

test1=$(route)

echo "$test1" > aaa.txt

echo "#`date`" >> aaa.txt

我以root的身份執行crontab -e ,加入下面這行在下午一點38分時執行

38  13  *  * *  /home/pinky/test.sh

可是如果有執行的話,應該會新增資料在aaa.txt,可是卻沒有執行這支test.sh,請問是那裡錯了嗎??

7
各位大大,
請問要如何用crontab的方式去定期(每天凌晨3點)去終止正在執行的java class(test.class) ??

8
各位大大,
我目前呈現的比例是,
代碼: [選擇]
map.setCenter(new GLatLng(locate[0],locate[1]), 16);請問在google map上要怎麼設定比例,因為所有的marker都在台灣,所以要如何讓map主要只呈現台灣地圖,就可以一次看到所有的marker ?

9
database 討論版 / SQL 語法查詢?
« 於: 2012-06-11 12:27 »
我有一個shoplog table,
表格中的欄位有:
buyer (varchar),buyer_region(varchar),shop(varchar),shop_region(varchar),shoppingtime(datetime),
假設資料內容如下:
+---------------+---------+----------------+---------+---------------------+
| buyer | buyer_region| shop | shop_region| shoppingtime |
+---------------+---------+----------------+---------+---------------------+
| alan | taipei | a_shop | kao | 2012-06-11 00:12:13 |
| john | tainan | b_shop | tainan | 2012-06-12 00:13:15 |
| mary | taichung | c_shop | taipei | 2012-06-11 00:20:40 |
| vivi | kao | d_shop | kao | 2012-06-14 00:21:11 |
| tom | taipei | a_shop | taichung | 2012-06-11 00:22:15 |
| alan | taipei | a_shop | kao | 2012-06-11 00:12:13 |
| alan | taipei | a_shop | kao | 2012-06-12 05:31:23 |
| tom | taipei | a_shop | hsinchu | 2012-06-11 00:22:15 |
| alan | hsinchu | a_shop | kao | 2012-06-19 00:31:23 |

請問要怎麼取出本週內,在同一個buyer_region的buyer向同一個shop_region的shop的次數,也就是buyer,buyer_region| shop,shop_region這四個值要一樣,歸類為同一群,並且也可以顯示各群購買的時間區間??

以上面的例子的話,如果是取出6/11~6/17內在同一個buyer_region的buyer向同一個shop_region的shop的次數,
結果應該是

+---------------+---------+----------------+---------+----------------+---------------------+
| buyer | buyer_region| shop | shop_region| counts | firsttime | endtime
+---------------+---------+----------------+---------+----------------+---------------------+
| alan | taipei | a_shop | kao |3 |2012-06-11 00:12:13 |2012-06-12 05:31:23
| john | tainan | b_shop | tainan | 1 |2012-06-12 00:13:15 |2012-06-12 00:13:15
| mary | taichung | c_shop | taipei | 1 |2012-06-11 00:20:40 |2012-06-11 00:20:40
| vivi | kao | d_shop | kao | 1 |2012-06-14 00:21:11 |2012-06-14 00:21:11
| tom | taipei | a_shop | taichung | 1 |2012-06-11 00:22:15 |2012-06-11 00:22:15
| tom | taipei | a_shop | hsinchu | 1 |2012-06-11 00:22:15 |2012-06-11 00:22:15

請問這要怎麼做呢??

10
各位大大,
請問如果要5分鐘執行一次,和一小時執行一次 , 執行的都是同一個任務,
請問要麼做?

11
網頁技術 / 如何使用保留原本form的值?
« 於: 2012-05-09 16:07 »
各位大大,
要如何在用form的POST傳值到同一頁的PHP後,form裡面原本輸入的表格資料不會消失。
因為我在用form傳送使用者輸入的表格資料查詢到同一頁的PHP時,form裡面原本填入的表格內容會不見,
請問各位大大這要怎麼改呢?

代碼: [選擇]
    <form method="post"  action="<?php echo $_SERVER[&#39;PHP_SELF&#39;]; ?>">   
<table width="500" border="1">
             <tr>
                 <td colspan="3"  >查詢條件</td>
            </tr>
  <tr>
              <td>查詢日期</td>
    <td>
                 <input id="f_rangeStart" name="f_rangeStart"/>
                 <button id="f_rangeStart_trigger" type="button">...</button>
                  <script type="text/javascript">
                  RANGE_CAL_1 = new Calendar({
                          inputField: "f_rangeStart",
                          dateFormat: "%Y-%m-%d",
                          trigger: "f_rangeStart_trigger",
                          bottomBar: false,
                          onSelect: function() {
                                  this.hide();
                          }
                  });
               
                </script>
                </td>
    <td>
                <input id="f_rangeEnd"  name="f_rangeEnd"/>
                <button id="f_rangeEnd_trigger" type="button">...</button>
               
           <script type="text/javascript">
                  RANGE_CAL_2 = new Calendar({
                          inputField: "f_rangeEnd",
                          dateFormat: "%Y-%m-%d",
                          trigger: "f_rangeEnd_trigger",
                          bottomBar: false,
                          onSelect: function() {
                                  this.hide();
                          }
                  });
               
                </script></td>
 
      </tr>
             
  <tr>
             
    <td colspan="3">  <input type="submit" name="submit_form" value="查詢" /></td>
   
      </tr>
  </table>
       
</form>


12
網頁技術 / open flash chart 使用 ?
« 於: 2012-05-08 16:51 »
各位大大,
我用open flash chart去呈現每一個規則所佔的比例的pie chart,可是在網頁上呈現時卻一片空白,
有大大使用過這個套件嗎?請問是那裡錯了嗎?

chart.html
代碼: [選擇]
    <html>
    <head>
        <title></title>
    <script type="text/javascript" src="js/swfobject.js"></script>
    <script type="text/javascript">

    swfobject.embedSWF(
      "open-flash-chart.swf?t=" + (new Date()).getTime()", "pie_chart",
      "700", "400", "9.0.0", "expressInstall.swf",
      {"data-file":" data.php "} );
    </script>
    </head>
    <body>
    <div id="pie_chart">
    </div>
    </body>
    </html>


data.php
代碼: [選擇]
    <?php
    $die 
false;
    
$link = @mysql_connect(&#39;localhost&#39;,&#39;user&#39;, &#39;pwd&#39;) or ($die = true);
    
if($die)
    {
        echo &
#39;<h3>Database connection error!!!</h3>&#39;;
        
echo &#39;A connection to the Database could not be established.<br />&#39;;
        
echo &#39;Please check your username, password, database name and host.<br />&#39;;
        
echo &#39;Also make sure <i>mysql.class.php</i> is rightly configured!<br /><br />&#39;;
    
}
    
mysql_select_db(&#39;testdatabase&#39;);
    
include_once &#39;php-ofc-library/open-flash-chart.php&#39;;
    
$query mysql_query(&#39;select count(*) counts,rule from  book where modifydate between &#39;2012-05-06&#39; and &#39;2012-05-12&#39; and cat = &#39;computer&#39; group by rule ;
    
&#39;);
    
While($queryRow mysql_fetch_array($queryMYSQL_ASSOC))
    {
        
$label[] = $queryRow[&#39;rule &#39;];
        
$dataForGraph[] = intval($queryRow[&#39;counts&#39;]);
    
}
    
$title = new title( &#39;The grades distribution : &#39;.date("D M d Y").&#39; are&#39; );
    
$title->set_style( &#39;{color: #567300; font-size: 14px}&#39; );
    
$chart = new open_flash_chart();
    
$chart->set_title$title );

    
$pie = new pie();
    
$pie->set_alpha(0.6);
    
$pie->set_start_angle35 );
    
$pie->add_animation( new pie_fade() );
    
$pie->set_tooltip( &#39;#val# of #total#<br>#percent# of total strength&#39; );
    
$pie->set_colours( array(&#39;#1C9E05&#39;,&#39;#FF368D&#39;,&#39;#1A3453&#39;,&#39;#1A3789&#39;) );
    
$pie->set_values( array(new pie_value($dataForGraph[0], "rule" $label[0]),
                    new 
pie_value($dataForGraph[1], "rule " $label[1]),
                    new 
pie_value($dataForGraph[2], "rule " $label[2]),
                new 
pie_value($dataForGraph[3], "rule " $label[3])) );

    
$chart->add_element$pie );
    echo 
$chart->toPrettyString();
    
?>



13
請問各位大大,
我的頁面在PC和NB上的顯示會有版面不一樣的問題,例如,top.php(呈現logo)在PC上和NB上的顯示不一樣,在PC上是很正常,可是在NB上會沒有完整呈現logo,如果去調整比例,又會變成PC上看起來比例不對,請問這要怎麼解決?

代碼: [選擇]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
<link href="style.css" rel="stylesheet" type="text/css" />

</head>


 <frameset rows="10%,*" cols="*" frameborder="0" >
    <frame src="top.php" name="top" scrolling="no" />
    <frameset rows="*" cols="210px,*">
      <frame src="left.php" name="left" noresize scrolling="no" />
      <frame src="content.php" name="center" noresize scrolling="no"/>
    </frameset>
    <noframes></noframes>
   

<body>
</body>
</html>

14
database 討論版 / 批次存入TABLE ?
« 於: 2012-03-16 13:51 »
請問各位大大,

要如何將A_table 的紀錄是不是中有超過100筆的話,要如何將"ID最小的超過的筆數"(也就是將比較舊的資料所超過的筆數)移到B_TABLE
中,並且將移到B_TABLE的紀錄從原本A_TABLE中刪除??

15
database 討論版 / SQL 條件查詢?
« 於: 2012-03-13 12:32 »
請問各位大大,
要怎麼取出同時有兩個條件的情況下的紀錄?
stime 是 2012-03-12 而且 etime 是null 以及 etime 是 2012-03-12的紀錄?
ID stime etime
1 2012-03-10 15:48:05 2012-03-12 10:48:05
2 2012-03-11 07:48:05 null
3 2012-03-12 08:48:05 null
4 2012-03-12 09:48:05 null
5 2012-03-12 15:48:05 2012-03-12 17:48:05
6 2012-03-12 18:45:05 2012-03-12 19:48:05



以上面的例子的話,取出的紀錄應該是 5筆
1 2012-03-10 15:48:05 2012-03-12 10:48:05 // etime 是 2012-03-12
3 2012-03-12 08:48:05 null //stime 是 2012-03-12 而且 etime 是null
4 2012-03-12 09:48:05 null //stime 是 2012-03-12 而且 etime 是null
5 2012-03-12 15:48:05 2012-03-12 17:48:05 // etime 是 2012-03-12
6 2012-03-12 18:45:05 2012-03-12 19:48:05 // etime 是 2012-03-12

16
各位大大,
有一台遠端主機,可以遠端連到host,想在VM上安裝一套工具,它是以live CD 的安裝方式,請問可以在VM上在無網路的情況下安裝嗎?

17
網頁技術 / google map function ?
« 於: 2011-10-07 11:39 »
各位大大,
我用下拉式選單新增了幾個點,我想要當選了其中一點,按下button 之後,map會自動移到所選的那個位置,
但是這樣寫法好像有錯,大大可以指導一下嗎?

代碼: [選擇]
<form name="jump">
<p align="center">
<select name="menu">
<option selected>Choose One</option>
<option value="42.2734","-83.7133">p1</option>
<option value="42.2734","-83.7133">p1</option>
<option value="46.2734","-83.7133">p2</option>
<option value="21.2734","-83.7133">p3</option>
<option value="45.2734","-83.7133">p4</option>
<option value="34.2734","-83.7133">p5</option>
<option value="342734","-83.7133">p6</option>
<option value="32.2734","-83.7133">p7</option>
</select>
<input type="button" onClick="javascript:moveMarker[document.jump.menu.selectedIndex].value;" value="GO">
</p>
</form>


18
PHP程式設計討論區 / 如何取得IP ?
« 於: 2011-09-27 15:11 »
各位大大,
這是我的code,可是如果使用者有v6,會只有取得v6,如果使用者沒有v6,就會取得v4
代碼: [選擇]
if (!empty($_SERVER['HTTP_CLIENT_IP']))
      $ip=$_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
else
      $ip=$_SERVER['REMOTE_ADDR'];

        echo $ip;
可是如果使用者有v6時,要如何同時顯示使用者ipv4 和ipv6 ?

19

請問各位大大,
要如何在按鈕按下後就會出現兩個loading等待執行的圖案




代碼: [選擇]
<html>
   <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Testing</title>
     <script type="text/javascript" >
    function loadAjax(aaa,bbb,ccc){
         if(window.XMLHttpRequest){
         xmlhttp=new XMLHttpRequest();
      }else{
         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }

      xmlhttp.onreadystatechange=function(){
         if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById(ccc).innerHTML=xmlhttp.responseText;
         }
      }

      xmlhttp.open(aaa,bbb,true);
      xmlhttp.send();

   }
   
   
   function showString(str) {document.getElementById('StringLoading').innerHTML = str;} //回傳值會將等待圖案取代
function showValue(str) {
document.getElementById('ValueLoading').innerHTML = str;
document.getElementById("Test").disabled=false;
}
//回傳值會將等待圖案取代
</script>
   </head>
   
   <body>
   
  <table width="500" border="1">
   <applet id="myapplet" code="myapplet.class" name="myapplet" width="0" height="0" >
      <PARAM NAME=value VALUE="<?php echo $_SESSION[&#39;value&#39;] ;?>">
  </applet>
  <tr>
    <td>Show String :</td>
    <td><div id="StringLoading" style="float:left;">
<img src="images/Loading.jpg" style="vertical-align:middle;padding:6px"/>  //執行等待圖案...
 </div></td>
  </tr>
  <tr>
    <td>Show Value :</td>
    <td><div id="ValueLoading" style="float:left;">
     <img src="images/Loading.jpg" style="vertical-align:middle;padding:6px"/></div></td>  //執行等待圖案..
  </tr>
  <tr>
    <td> <input type="button" value="Test"  name="submit" onclick=javascript:loadAjax("GET","updateDB.php","Server");loadAjax("GET","re-updateDB.php","complete")></td>
    <td>&nbsp;</td>
  </tr>
</table>

   </body>
   </html>


20


各位大大,
alert 出來的divvalue是undifined,請問要怎麼取得text 值???

代碼: [選擇]
<script>
     var divvalue = document.getElementById("first").value ;  //
     alert(divvalue);
</script>


<div id="first">
<input type="hidden" value="" />
 </div>


21
網頁技術 / button事件,連接db?
« 於: 2011-08-29 18:56 »

要如何在按下時,connect mysql , 執行PHP 的mysql的update 指令???




代碼: [選擇]
import java.applet.*;
import java.net.*;

import javax.swing.JApplet;

public class Applet_php extends Applet {
public void init(){


} public void go2(){
int sum=0;
for(int i =1;i<=5;i++)
sum =sum +i;
try {
getAppletContext().showDocument(
new URL("javascript:showString('" + sum +"')")
);
} catch (MalformedURLException me) { }

}
public void go(){
int sum=0;
for(int i =1;i<=10;i++)
sum =sum +i;
try {
getAppletContext().showDocument(
new URL("javascript:showString2('" + sum +"')")
);
} catch (MalformedURLException me) { }

}


public static void main(String[] args) {
}

}



代碼: [選擇]
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>

<body>
<script language="JavaScript" type="text/javascript">
function showString(str) {
  document.getElementById('strDemo').innerHTML = str;
}
<?php
  $dbhost 
= &#39;127.0.0.1&#39;;
    
$dbuser = &#39;mysql_user&#39;;
    
$dbpass = &#39;mysql_password&#39;;
    
$dbname = &#39;mysql_databaseName&#39;;
    
$conn mysql_connect($dbhost$dbuser$dbpass) or die(&#39;Error with MySQL connection&#39;);
    
mysql_query("SET NAMES &#39;utf8&#39;");
    
mysql_select_db($dbname);
    
$sql "update customer set status =1;";
    
$result mysql_query($sql) or die(&#39;MySQL query error&#39;);
   


?>


function showString2(str) {
  document.getElementById('strDemo2').innerHTML = str;
}
</script>
<div id="strDemo"></div>
<div id="strDemo2"></div>
<applet  id="myapplet" code="Applet_php.class" name="myapplet" width="30" height="20"></applet>
<input type="button"  name="groovybtn1"  id="btn" class="groovybutton"
   value="Begin " onclick="document.getElementById('myapplet').go2();"   >  //要如何在按下時,執行PHP 的mysql的update 指令???
</body>
</html>



22
網頁技術 / 同一個頁面javascript 傳值給PHP ?
« 於: 2011-08-24 14:44 »
想要在同一個頁面 把javascript 的值傳給PHP,透過Javascript variable 傳給 Form variable ,
再由Form variable 傳PHP variable
可是在PHP一直沒取到值,請問我在同一頁的PHP用post接可以嗎?

page1.php
代碼: [選擇]

             <script>

function showAppletMsg(str) {
document.getElementById('MSg').innerHTML = str;  //接收由applet傳回的訊息

document.InfoPassed.PhpVariable.value = str.length;//訊息長度隱藏在form裡PhpVariable
document.InfoPassed.submit();  //加了這行,頁面一直在跳動,好像一直在傳值????

}
              </script>
              <form name="groovyform" >  //按鈕執行applet
                  <input type="button"  name="groovybtn1"  id="btn" class="groovybutton"
          value="Begin" onMouseOver="goLite(this.form.name,this.name)"             
                  onMouseOut="goDim(this.form.name,this.name)"
                  onclick="this.disabled=1; document.getElementById('applet1').go();"   >
      </form>

                <applet id="applet1" code="myapplet.class" name="myapplet" width="0" height="0" >
      <PARAM NAME=parm1 VALUE='number'>
        </applet>
           
                <form name="InfoPassed" action="page1.php" method="post"  target="_self">
       <input type="hidden" name="PhpVariable" value="">
</form>
<?php

if(isset($_POST["PhpVariable"])){  //接收js傳來的訊息????
$value $_POST["PhpVariable"];
                         echo 
$value;
}
?>





23
網頁技術 / 按鈕事件 ?
« 於: 2011-08-23 17:49 »
目前按鈕按下後,會啟動applet執行,再回傳訊息回來,也就是把applet傳回結果把等待圖(Loading1和Loading2)換成傳來的訊息 ,

1.要如何在按了Start 按鈕後,按鈕就不能再按, 直到applet傳回訊息?
2.以及如何在按了Start 按鈕後,才會再出現Loading1和Loading2 的等待圖 案,直到applet傳回訊息蓋掉??


代碼: [選擇]
<script>

function showmsg1(str) {document.getElementById('Loading1').innerHTML = str;} 
function showmsg2(str) {document.getElementById('Loading2').innerHTML = str;}
</script>
<table width="723" border="0" align="center">
          <tr>
          <td width="411" align="center">
          <input type="button" name="button" id="btn" value="Start" style="background-repeat:no-repeat;border-width:0px;background-color:transparent;height:25px;width:90px;cursor:hand;font-weight:bold;font-size:16px;font-family:Arial;color:#000000;background-image:url('images/ROvlBW.gif');" onclick="document.getElementById('applet').go();" />
          </td>
          <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="center" style="font-size:20px">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
    <td width="411" align="center" style="font-size:20px">Msg_1 from Applet  : </span></td>
    <td width="295"><div id="Loading1" style="float:left;">
 <img src="images/Loading.jpg" style="vertical-align:middle;padding:6px"/>
 </div></td>
   
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="3">&nbsp;</td>
  </tr>
  <tr>
     <td width="411" align="center" style="font-size:20px">Msg_2 from Applet  </span></td>
    <td><div id="Loading2" style="float:left;"><img src="images/Loading.jpg" style="vertical-align:middle;padding:6px"/></div></td>
    <td>&nbsp;</td>
  </tr>
</table>


24
請問各位大大,
PHP要怎麼去接applet 的訊息 ??

25
網頁技術 / googlemap marker的訊息?
« 於: 2011-08-18 17:24 »
滑鼠移入各點時出現描述,可是卻會移到別點座標上,也就是當我移到A點上時,會顯示訊息,可是座標值移到B點,這是那裡錯了嗎??????


代碼: [選擇]

<?
while($row = $db->fetch_array())
      {
          $latitude = $row['Latitude'];
         $longitude= $row['longitude'];
              $desc = $row['Description'];
?>
            <script language="javascript">
           var marker = new GMarker(new GLatLng(<? echo $latitude ?>,<? echo $longitude ?>));  // 從DB取出各點標示在地圖上

                     //滑鼠移入各點時出現描述,可是卻會移到別點座標上,這是那裡錯了嗎??????
 
  GEvent.addListener(marker,'mouseover',function(){
marker.openInfoWindowHtml(" <? echo $desc ?>");
});
   
GEvent.addListener(marker, 'mouseout', function () {
marker.closeInfoWindowHtml();
});
 
                         GEvent.addListener(marker, "click", function(marker, point) {
                             ................
                        });

  map.addOverlay(marker);
                                           
</script>
<?
}
?>


26
網頁技術 / PHP下載檔案毁損?
« 於: 2011-08-17 14:52 »
各位大大,
在用PHP下載test.zip檔案後,檔案的大小都只有1KB,而且下載後也毁損不能打開,請問是那錯了嗎?


代碼: [選擇]
<?php
if(empty($_GET[&#39;path&#39;]) || empty($_GET[&#39;filename&#39;]))
{
   echo &
#39;error path&#39;;
   
exit();
}

if(
file_exists($_GET[&#39;path&#39;]))
{
   
$FILEname urlencode($_GET[&#39;filename&#39;]);

   
if(ini_get(&#39;zlib.output_compression&#39;))
      
ini_set(&#39;zlib.output_compression&#39;, &#39;Off&#39;);

   
header("Content-Type: application/octetstream; name=$FILEname"); //for IE & Opera

   
header("Content-Type: application/octet-stream; name=$FILEname"); //for the rest

   
header("Content-Disposition: attachment; filename=$FILEname;");

   
header("Content-Transfer-Encoding: binary");

header("Content-Type: application/zip");

   
header("Cache-Control: cache, must-revalidate");
   
header("Pragma: public");
   
header("Last-Modified: " gmdate("D, d M Y H:i:s") . "GMT");

   
readfile($_GET[&#39;path&#39;]);
        
echo "success";
}
else
   echo &
#39;file doesnt exist&#39;;
?>

27
網頁技術 / PHP下載檔案?
« 於: 2011-08-15 19:10 »
請問各位大大,
連接沒有問題,可是一直不能下載檔案,請問這是有那裡錯了嗎?

代碼: [選擇]


<?php

// define some variables
$local_file "local.zip";
$server_file "server.zip";
$ftp_user_name="user";
$ftp_user_pass="userpass";
$ftp_server="192.168.1.1";
$port "3837";
// set up basic connection
$conn_id ftp_connect($ftp_server,$port);

// login with username and password
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);
// uncomment if you need to change directories
if (ftp_chdir($conn_id"DOWNLOAD")) {
    echo 
"Current directory is now: " ftp_pwd($conn_id) . "\n";
} else {
    echo 
"Couldn&#39;t change directory\n";
}


// try to download $server_file and save to $local_file
if (ftp_get($conn_id$local_file$server_fileFTP_BINARY)) {
    echo 
"Successfully written to $local_file\n";
} else {
    echo 
"There was a problem\n";
}

// close the connection
ftp_close($conn_id);

?>


28
Linux 討論版 / tomcat connector ?
« 於: 2011-08-11 19:43 »
因為我的伺服器要同時應用PHP與JSP,卻又希望同時使用80 port,如果是把sample.jsp 放在var/lib/tomcat6/webapps/ROOT/中是可以執行的,但是如果放在我所指定的virtual host 網站目錄中是不能執行的,但是PHP是可以執行的,請各位高手救救我.........


OS: ubuntu
*在 /etc/apache2/sites-enabled/000-default 定義的virtual host 是在/usr/local/mysites


29
網頁技術 / 下載檔案存放的位置?
« 於: 2011-08-11 14:27 »
各位大大,
因為要透過javascript 去呼叫java ,java程式需要下載檔案到client端,所以要傳入儲存的位置參數給JAVA,但是因為client端作業系統的不同,所以無法事先指定client端的下載位置,請問是要取得瀏覽器執行的位置當作下載位置?還是各位大大有更好的方法?

30
當我用webmin時可以順利的連到mysql資料庫,也可以作所有的事情。
可是當我用phpmyadmin或自己寫的php程式想要連結到mysql時都會出現錯誤訊息,
查了mysql 的error log 訊息是:
[Mon Jul 25 19:21:17 2011] [error] [client 192.168.1.1] PHP Warning:  mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO) in /usr/local/testSite/connect_DB.php on line 14

請問這是什麼原因呢?

頁: [1] 2 3 4