Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Php Form Query

Options
  • 01-11-2007 2:40pm
    #1
    Closed Accounts Posts: 66 ✭✭


    Hi All
    This is my first tech thread so hello and sorry for burdening you with my simplistic questions...

    I am literally only new to php and am currently stumped with the whole process
    My question basically is ...I am following the php form tutorial @ http://www.tizag.com/phpT/forms.php and i got as far as the process.php section....when they say create a new file is this seperate from the html i have just done is it saved in the same folder... i really cant get my head around what happens when the information is submitted...how are the results displayed


    any help much appreciated
    cessy


Comments

  • Closed Accounts Posts: 1,444 ✭✭✭Cantab.


    cessy wrote: »
    Hi All
    This is my first tech thread so hello and sorry for burdening you with my simplistic questions...

    I am literally only new to php and am currently stumped with the whole process
    My question basically is ...I am following the php form tutorial @ http://www.tizag.com/phpT/forms.php and i got as far as the process.php section....when they say create a new file is this seperate from the html i have just done is it saved in the same folder... i really cant get my head around what happens when the information is submitted...how are the results displayed


    any help much appreciated
    cessy

    You can just include all your HTML code in your .php file... PHP code is enclosed with <?php ?> tags.

    You should use Jedit or Eclipse editor with syntax highlighting -- everything should be obvious then.


  • Closed Accounts Posts: 583 ✭✭✭monkey tennis


    Your webserver (commonly either IIS or Apache) is set up to treat files ending in '.php' differently from html files, in that it invokes the PHP pre-processor before displaying the page. First, the html page (with the form) sends off the data that you entered to the PHP page (or rather, the web server stores this data for use when loading the PHP page). The webserver hands off the PHP code to the PHP pre-processor, which does whatever the PHP code tells it to do, then hands the resulting text (HTML) back to the web server for display.


  • Registered Users Posts: 413 ✭✭ianhobo


    Hi there,
    I don't think your question is specifically related to PHP, but is generally just the web process and http. The same sequence of events happens when you submit a form,regardless of whether is PHP,ASP, JSP....

    When you enter an addresss into into your web browser, your browser makes a http GET request to the web address, and usually what gets returned first is index.html. When you use html forms, and press the submit button, you are asking to browser to make a similar http GET request, its just a bit more specific this time

    In the html page, there is a "form" section. This form has a name,maybe form1. another of the attributes of the html tag "form" is that it has an "action" section. Basically, this tells the web browser who to communicate the form information to after submit has been pressed. if there is no action tag, then the form will be posting/sending the info to itself for processing, (or pre-processing, before the html is processed again as is the case with PHP, classic asp, jsp....)

    When you press submit, the browser bundles all the form info (your input boxes and radio buttons) into a little http object. It then makes a http request to to the file that was given in the previous "action" bit. (by the way, this "action=.." file can be local,or on another server somewhere).

    When this file is called, it is given the info from your form, and goes along and processes it. It extracts the data from the http request and assigns it to local variables in order to use it :)

    I hope that helps a bit....


  • Closed Accounts Posts: 66 ✭✭cessy


    ok understanding it alot better now thanx guys!!


Advertisement