简体   繁体   English

通过node.js页面运行PHP前端站点并将两者连接在一起

[英]Running PHP frontend site with node.js page connecting both together

I have created a php site, doing the basic stuff reading from a sqlite database, logging in etc. This is currently running on xampp on port 80 and all is fine. 我已经创建了一个php站点,进行了从sqlite数据库中读取基本信息,登录等操作。当前它在端口80的xampp上运行,一切正常。

I have created another page which is ran on node.js it uses socket.io and express.io. 我创建了另一个在node.js上运行的页面,它使用socket.io和express.io。 Currently running on port 8080. 当前在端口8080上运行。

I want to click on a link on the php site that directs me to the node.js page which are both on different ports. 我想单击php网站上的链接,该链接将我定向到都在不同端口上的node.js页面。 I hope this is understandable, I have done alot of searching on the matter and cannot find a viable solution. 我希望这是可以理解的,我已经在此事上做了很多搜索,但找不到可行的解决方案。

Change the link to include the port of the node server, like so: 更改链接以包括节点服务器的端口,如下所示:

<a href="http://localhost:8080/yourNodePage">Node Page</a>

If you want to go back from Node to PHP: 如果要从Node返回到PHP:

<a href="http://localhost/yourPHPPage">PHP Page</a>

Maybe 也许

<a href="http://localhost:8080">Link</a>

If i am wrong please specify your Problem 如果我错了,请注明您的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM