473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 4961
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John H. | last post by:
I installed the Microsoft Script Debugger and set the "Enable Script Debug" flag on in IIS. Also, I made sure that the "Disable Script Debug" flag was off in Internet Explorer. Everything ran...
2
by: Kate Riley | last post by:
Hi all - Thanks in advance for your help. I am using IE 6 and NN7. I was testing the <NOSCRIPT></NOSCRIPT>, so I was trying to turn off or disable JavaScript in my browsers. But in my...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
2
by: Chase | last post by:
I'm working in ASP.NET 2.0 and am having problems with some client side script on my .aspx pages. The script looks like this: <script language=vbscript> function OpenFile(FileToOpen) Set...
2
by: PamelaDV | last post by:
I am wondering if there is a way to disable the "X" used to close the Access application window? I know how to disable it for individual forms, but I would like to disable it for the application...
2
by: Water Cooler v2 | last post by:
How do you enable/disable JavaScript in Internet Explorer v6?
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
0
by: baskarpr | last post by:
In Internet Explorer (I use 6.0 ), there is a check box to enable/disable automatic configuration script. Is there any way to check /uncheck this option using Win API ( that can be implemented in VB...
3
by: bobleponge | last post by:
Hi aLL how can I do to enable and disable IE proxy just in one clik button with Visual Basic please. thank you.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.