Skip to main content
formatting
Source Link
saltcracker
  • 321
  • 3
  • 18

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET would be preferred over $_POST at all?

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET would be preferred over $_POST at all?

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

I've just started learning PHP and just done with $_POST$_POST/$_GET$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile"action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET$_GET would be preferred over $_POST$_POST at all?

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET would be preferred over $_POST at all?

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET would be preferred over $_POST at all?

Source Link
saltcracker
  • 321
  • 3
  • 18

PHP in same file as form or seperate? Speed

I've just started learning PHP and just done with $_POST/$_GET. Now I want to know, what is the pro's and con's of having the PHP to process the data from a form inside the same file, or send the data to another file (action="anotherfile")?

Logically I will think that sending it to another file would increase the time process it, but is that true? When I have the PHP script inside the same file, the page doesnt seem to reload when I hit the submit button (but the content changes). Or does it? If it does, wouldn't the only difference would be that I would have to type the script for the menu (lets say you have the same menu on all pages) in both files? Which would lead to more coding/less space?

Follow-up question: Is there any time where $_GET would be preferred over $_POST at all?