How to connect people to my local PHP server file. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to connect people to my local PHP server file.

Hi. So I want to make a little IRC web service only available to people I allow. I really don't want people messing with this so I want to keep it private. I have the HTML/CSS/JS set up with AJAX, and I have the PHP file set up. My only issue is: How do I make it so users can send messages to the local PHP server file on my laptop (when I turn the server on, of course)? I REALLY don't want to have to rent a server or something like that, I only want to have it a file on my laptop. I would rather it not be a URL but a file user's of my choice receive that connects with my PHP file which then signs them in to their account on my DB and sends them the HTML/CSS/JS files (which also need to connect to the PHP server, because this is inter-relay. I feel like there is some easy solution to have an address to my PHP file that's not a URL, but I'm relatively new to PHP so I need suggestions, please. I CAN switch from PHP as my server-side language to Node.js (if it makes a difference or better suites what I'm trying to do here). Thanks.

15th May 2018, 2:49 AM
privrax.
privrax. - avatar
4 Answers
+ 4
What you mean not url? PHP needs http protocol. How do you identify users? You could check their ip address. You could than send 404 response codes to unauthorized users. Or use passwords. You should change html files to php files then you could check if the login session exists.
15th May 2018, 5:39 AM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Save yourself a whole load of hassle and rent a server. You can get one for dirt cheap these days. Mine costs me £5 a month, which is nothing really. Plus, they handle all the security stuff for you. Otherwise, what you're suggesting is unnecessarily complex.
15th May 2018, 6:24 AM
Bagshot
Bagshot - avatar
0
Alright, I will consider renting. Any suggestion on best places to rent?
15th May 2018, 2:11 PM
privrax.
privrax. - avatar
0
And yes, I am going to use a password system.
15th May 2018, 2:12 PM
privrax.
privrax. - avatar