PHP script to disable/enable internet access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Derek White

    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.
  • Paulus Magnus

    #2
    Re: PHP script to disable/enable internet access

    "Derek White" <dnlwhite323@ho tmail.com> wrote in message
    news:89cac064.0 310071334.2daa8 a3@posting.goog le.com...[color=blue]
    > 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.[/color]

    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


    Comment

    • sk

      #3
      Re: PHP script to disable/enable internet access

      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
      Wij geloven in onafhankelijk denken en het aangaan van oprechte connecties. Wij laten jouw business betekenisvol groeien. Hoe? Dat lees je op onze site.




      Paulus Magnus wrote:[color=blue]
      > "Derek White" <dnlwhite323@ho tmail.com> wrote in message[color=green]
      >>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.[/color][/color]
      .....[color=blue][color=green]
      >>
      >>Any help would be appreciated.[/color]
      >
      > 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?[/color]

      Comment

      Working...