troubleshooting Question

why my $_SERVER['PHP_SELF'] is not working

Avatar of tankergoblin
tankergoblin asked on
PHP
8 Comments1 Solution348 ViewsLast Modified:
How would i go about making a PHP self submitting form that would accept HTML for input into a text box and output the result of the same html page... much like www.practiceboard.com ?

This is my basic form

when i press submit nothing shows...

<?php
if(isset($_POST['login'])){

                  $studentID = $_POST['studentID'];
                  $password =  $_POST['Password'];
                echo $password;
                  
                  $newStudent = new student;
                  $newStudent->login($studentID, $password);
                  
                  }?>




<form method="post" id="customForm" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
                  <div>
                        <label for="studentID">Student ID:</label>
                        <input id="studentID" name="studentID" type="text">
                        
                  </div>
                  <div>
                        <label for="Password">Password:</label>
                        <input id="Password" name="Password" type="Password">
                        
                  </div>
                  
                  <div>
                        <input id="send" name="Login" type="submit" value="Login">
                  </div>
            </form>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros