[請益] js+rshiny之間用php連接

看板PHP作者 (rlearner)時間8年前 (2016/12/14 11:43), 編輯推噓1(1013)
留言14則, 3人參與, 最新討論串1/1
這個問題不知能不在該板題問@@ [環境架設/問題簡敘] 我在實體機上ubuntu上架設了shiny server 測試用的shiny範例程式所放路徑: $cd /opt/shiny-server/samples/sample-apps 並放了幾個範例程式,如下 http://140.128.197.58:3838/sample-apps/ (問題所在!!!!)但在嘗試leaflet地圖套件時出錯: http://140.128.197.58:3838/sample-apps/leaflet1/ 不過leaflet應用在js上就可以了@_@ http://140.128.197.58:3838/sample-apps/html-samples/leaflet.html 這是用rshiny抓取伺服器上mysql的資料 http://140.128.197.58:3838/sample-apps/rmysql2/ [目的] 所以我想用js寫好的leaflet套件用php連接rshiny 或直接用php連sql也可 [程式碼] 以下是js呈現leaflet的code http://140.128.197.58:3838/sample-apps/html-samples/leaflet.html <html> <head> <title>A Leaflet map!</title> <link rel="stylesheet" href="" rel="nofollow">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/> <script src="" rel="nofollow">http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <style> #map{ height: 100% } </style> </head> <body> <div id="map"></div> <script> // initialize the map var map = L.map('map').setView([24.179,120.601], 16); // load a tile layer L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="OpenStreetMap" rel="nofollow">http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map); L.marker([24.179,120.601]).addTo(map) .bindPopup('A pretty CSS3 popup.<br> Easily customizable.') .openPopup(); </script> </body> </html> [環境版本] ubuntu 14.04.05 shiny-server 1.5.1 R 3.3.2 leaflet 1.0.1 請問可能行嗎?? php初學者讓如何入門?? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.128.101.143 ※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1481686984.A.988.html

12/14 13:50, , 1F
不太懂你的用 php 連接 rshiny 是指?
12/14 13:50, 1F

12/14 13:51, , 2F
我翻了一下 shiny,應該直接就可以處理掉你要的部份
12/14 13:51, 2F

12/14 13:51, , 3F
而且看起來你也透過 shiny 接上 mysql 了,你的目的是什麼啊
12/14 13:51, 3F

12/14 16:24, , 4F
抱歉問太急我整理一下
12/14 16:24, 4F

12/14 16:26, , 5F
因為無法在shiny上執行leaflet(地圖套件)
12/14 16:26, 5F

12/14 16:27, , 6F
所以我想直接用php連mysql並用js讀取,這是一步@@
12/14 16:27, 6F

12/14 16:36, , 7F
若是後者,那你必須先知道js該收到的是怎樣format的r
12/14 16:36, 7F

12/14 16:36, , 8F
esponse。
12/14 16:36, 8F

12/14 16:36, , 9F
而php就依照規格去query result並print需要的respons
12/14 16:36, 9F

12/14 16:36, , 10F
e
12/14 16:36, 10F

12/14 17:15, , 11F
好的 感謝
12/14 17:15, 11F

12/14 22:09, , 12F
leaflet 我用過,他是純 js 的東西啊,不需要特殊規格的後端
12/14 22:09, 12F

12/14 22:10, , 13F
支援。你可以打開 console 確認一下有哪些 error 再來處理
12/14 22:10, 13F

12/15 20:51, , 14F
好的
12/15 20:51, 14F
文章代碼(AID): #1OKB_8c8 (PHP)
文章代碼(AID): #1OKB_8c8 (PHP)