PHP_SELF not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sayub
    New Member
    • Apr 2010
    • 10

    #1

    PHP_SELF not working

    Hello,
    Following is my code. As I press the 'submit' button I expect the form to reload itself. But I get an error message saying that I don't have access to the page. Please help.

    Code:
    <html>
    <head>
    <title> Subscribe/Unsubscribe </title>
    </head>
    <body>
    <form action = "<?php echo $_SERVER[PHP_SELF] ?>" method = "POST" >
    <h1> Subscribe/Unsubscribe </h1>
    <p><strong> Action: </strong><br>
    <input type = radio name = "action" value = "sub" checked> subscribe
    <input type = radio name = "action" value = "unsub"> unsubscribe
    <p><input type = submit name = "submit" value = "Submit Form"
    </form>
    </body>
    </html>
    Last edited by Dormilich; May 6 '10, 04:24 PM. Reason: Please use [code] tags when posting code
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Take a look at the HTML source (in your browser: right click -> view source) and you'll see why.

    Comment

    Working...