471,354 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

PHP script to disable/enable internet access

Ok here's the deal.
We are finally getting DSL again...
but our PC is in the living room... and the youngest has figured out
that if he hits the right keys... he can bring up Internet Explorer.
All is fine and dandy right now, but come next week... that things
wont be so dandy.

I am setting our LInux router/server back up soon, and would like a
quick, easy way to enable and disable our internet access. What I
would like to do is have a simple PHP page that says

(iff network status = inactive)

Your Internet Access is DISABLED
Enter passcode to enable internet access

[TEXTBOX]

Then [OK]

so on clicking "OK" if password = suchandsuch then run script"
"/sbin/network start" or whatever the script is and refresh the page
then

iff network = active

Your Internet Access is ENABLED

[DISABLE]
upon clicking of "DISABLE" run script /sbin/network stop and refresh
the page

Something to that effect.

Any help would be appreciated.
Jul 17 '05 #1
2 4613
"Derek White" <dn*********@hotmail.com> wrote in message
news:89*************************@posting.google.co m...
Ok here's the deal.
We are finally getting DSL again...
but our PC is in the living room... and the youngest has figured out
that if he hits the right keys... he can bring up Internet Explorer.
All is fine and dandy right now, but come next week... that things
wont be so dandy.

I am setting our LInux router/server back up soon, and would like a
quick, easy way to enable and disable our internet access. What I
would like to do is have a simple PHP page that says

(iff network status = inactive)

Your Internet Access is DISABLED
Enter passcode to enable internet access

[TEXTBOX]

Then [OK]

so on clicking "OK" if password = suchandsuch then run script"
"/sbin/network start" or whatever the script is and refresh the page
then

iff network = active

Your Internet Access is ENABLED

[DISABLE]
upon clicking of "DISABLE" run script /sbin/network stop and refresh
the page

Something to that effect.

Any help would be appreciated.


How about unplugging the cable between the PC and the switch/hub/server and
putting it in a cupboard? Or using some parental control, software filtering
system?

Paulus
Jul 17 '05 #2
sk
Amen. Or how about setting a password on your PC and having it lock when
not in use?

I mean, if you really want to do this, the simplest way would be to
forget about PHP and just write two shell scripts on your router box
that bring the internet interface up... and bring it down. They should
be one-liners like "/sbin/ipconfig le0 up" and "/sbin/ipconfig le0
down". If you want something fancier than a couple of scripts on your PC
to run these remotely, you could write 1-line CGIs or PHP scripts that
run the 1-line shell scripts, and stick 'em in a password protected
directory.

--
Steve Koppelman
http://www.hatless.com/

Paulus Magnus wrote:
"Derek White" <dn*********@hotmail.com> wrote in message
Ok here's the deal.
We are finally getting DSL again...
but our PC is in the living room... and the youngest has figured out
that if he hits the right keys... he can bring up Internet Explorer.
All is fine and dandy right now, but come next week... that things
wont be so dandy.

I am setting our LInux router/server back up soon, and would like a
quick, easy way to enable and disable our internet access. .....
Any help would be appreciated.


How about unplugging the cable between the PC and the switch/hub/server and
putting it in a cupboard? Or using some parental control, software filtering
system?


Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kate Riley | last post: by
2 posts views Thread by Chase | last post: by
3 posts views Thread by bobleponge | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.