Local Area Network connnection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gracepinas
Forum Newbie
Posts: 15
Joined: Sat Aug 15, 2009 1:04 am

Local Area Network connnection

Post by gracepinas »

Is it possible to connect a database from for example HR processor computer (serves as server) using php? how?

Is it possible to secure uploaded php codes in hr processor computer?
If possible then will it affect the user who wants the to view interface of the php? like does it need to enter password or something
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Local Area Network connnection

Post by yacahuma »

i dont know what is an HR processor. But if you have unix, mac, windows, you can install PHP and apache. PHP can do almost anything.
gracepinas
Forum Newbie
Posts: 15
Joined: Sat Aug 15, 2009 1:04 am

Connect to a LAN database

Post by gracepinas »

Is it possible to connect a mysql database that is based on a local area network?

How?
gracepinas
Forum Newbie
Posts: 15
Joined: Sat Aug 15, 2009 1:04 am

Re: Local Area Network connnection

Post by gracepinas »

yacahuma wrote:i dont know what is an HR processor. But if you have unix, mac, windows, you can install PHP and apache. PHP can do almost anything.
I am doing an online payroll system. Instead of uploading mysql database in webhost i'll create it in the HR processor's (payroll processor) computer
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Connect to a LAN database

Post by jackpf »

Code: Select all

mysql_connect('server_name:port', 'username', 'password');
Like that, I believe.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Local Area Network connnection

Post by jackpf »

What, so you want to connect to your own server from your web host's server?

You can do that. Just connect to your IP address in your script, and make sure you allow external connections to your server.
gracepinas
Forum Newbie
Posts: 15
Joined: Sat Aug 15, 2009 1:04 am

Re: Local Area Network connnection

Post by gracepinas »

for example my msql database and php codes are in payroll processor's computer.

if i'll open it in my computer just put in ip address of the payroll processor's computer?

ex. http://192.168.1.1/index.php

like that?

i dont need to enter computer's log in ?
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Local Area Network connnection

Post by jackpf »

I thought you were trying to access mysql???

But yeah, if you've opened port 80 in your firewall, then yes, on your LAN, other people can access your files being visiting your local (or external, if you've forwarded router ports to your pc) IP address.
gracepinas
Forum Newbie
Posts: 15
Joined: Sat Aug 15, 2009 1:04 am

Re: Local Area Network connnection

Post by gracepinas »

jackpf wrote:I thought you were trying to access mysql???

But yeah, if you've opened port 80 in your firewall, then yes, on your LAN, other people can access your files being visiting your local (or external, if you've forwarded router ports to your pc) IP address.
how to do that? how come i cannot view my officemate's php like this in my browser
can you help me?

http://192.168.3.0/AblePayrollOnline/index.php
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Local Area Network connnection

Post by jackpf »

What error do you get? Or is it "server not found" or something..?

And probably because he hasn't opened port 80 properly.
Post Reply