Hi all,
I am looking into creating a php form whereby a user enters his/her details into the actual script,

eg the the form is on the same file as the coding.

Im using the form action $_SERVER['PHP_SELF']

so when i use this function do i output the form first? or do $_POST's and if the first 1 is blank display the form?

Any help would be greatly appreciated

Shaun

    You would have to output the form first so that it can be filled in!

    I usually do it like this:

    <?php
    
    if(isset($_POST['submit'])){
    
    // Do your processing here
    } else {
    	// print your form from here
    }
    ?>

      so basically you look to see if the submit value has been set? if not display the form, if it is do the processing?

        Write a Reply...