Jump to content

Really simple PHP question


nullArray

Recommended Posts

I still only marginally understand the difference between POST, GET and REQUEST...

When you submit a form using the GET method form values will appear in the url.

http://localhost/form.php?name=Mr+Smith&age=101&submit=submit

GET /form.php?name=Mr+Smith&age=101&submit=submit HTTP/1.1

Host: localhost

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://localhost/form.php

With the POST method the form values get sent in the body of request and therefore not shown in the url.

http://localhost/form.php

POST /form.php HTTP/1.1

Host: localhost

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-gb,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://localhost/form.php

Content-Type: application/x-www-form-urlencoded

Content-Length: 35

name=Mr+Smith&age=101&submit=submit

Link to comment
Share on other sites

If you want to learn php fast, check out W3 Schools PHP. This is how I learned how to use it. They explain the difference between get post and request, and have a good section on PHP with MySQL databases.

I would definitely have to second the use of w3schools.com, as that's what I used to learn the little bit of PHP I used in ep502.

I really should get around to finishing that thing... if nothing else work out the security issues. :D

Link to comment
Share on other sites

@nullArray, i didnt mean to be harsh lol. just wondered why you using a very outdated version of php. I recommend you download and install wampserver 2 as it comes with php 5.2.

@digip, the errors can happen in php 5 but the style in which they are displayed is native to PHP 3 :)

Link to comment
Share on other sites

I recommend you download and install wampserver 2 as it comes with php 5.2.

I could be wrong, but I think nullArray uses a MAC, not windows. Personally, I like XAMPP Lite for windows. They even have an OSX version(beta): http://www.apachefriends.org/en/xampp-macosx.html

Link to comment
Share on other sites

I could be wrong, but I think nullArray uses a MAC, not windows. Personally, I like XAMPP Lite for windows. They even have an OSX version(beta): http://www.apachefriends.org/en/xampp-macosx.html

Oh you know me too well.

I used a Espresso.

Link to comment
Share on other sites

Oh you know me too well.

I used a Espresso.

I thought Expresso was just a text editor though, right?

xampp is Apache, PHP, MySQL and Pear so you can run and test websites on your local workstation before deployment to the web.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...