Jump to content

Trying to understand 'POST'


TEDSON

Recommended Posts

I'm having a little difficulty understanding this.

 

I have my PHP script working fine on my webpage now, that querys mysql and echoes the result , but my goal is not to navigate to the page but to just get a return from it via call from my application (http post maybe?)

 

So my hope is that someone can explain this in terms I can understand.

 

I need to pass variables to the php code so it only checks a given row in a table.

 

Example.

 

SELECT code FROM mytable WHERE user = $variable // this needs to be passed to the code, but not via a form on the page.

 

Most grateful for any explanaitions.

Link to comment
https://forums.phpfreaks.com/topic/212754-trying-to-understand-post/
Share on other sites

Hi

 

The easiest way is to use GET rather than POST. This way you can just use something like http://www.example.com/examplescript.php?someparameter=1 , and then refer to $_GET['someparameter'] in the script.

 

POST is possible (and necessary with larger amounts of data) but more complicated to do. GET might well be fine for what you want.

 

All the best

 

Keith

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.