Jump to content

$_GET


izapharry

Recommended Posts

what is the working of this line

  'http://localhost/movies/moviesite.php?fm=$fm

why we have to post the variable like this

what is the benefits and disadvantage of of this style of  coding ?

 

It's a $_GET variable. Disadvantages? It's shown in the URL, which means that it's not exactly acceptable for passwords etc. It also can't handle as much text as $_POST can. Advantages? It makes dynamic pages pretty easy to whip up in comparison to $_POST variables. Allows for users to visit the page without having to POST to it. Allows bookmarking etc.

Link to comment
https://forums.phpfreaks.com/topic/171974-_get/#findComment-906791
Share on other sites

  • 2 weeks later...

what is the working of this line

  'http://localhost/movies/moviesite.php?fm=$fm

why we have to post the variable like this

what is the benefits and disadvantage of of this style of  coding ?

disadvantages are hackers trying to input code

you would need something like this to avoid that

 

the call: whatevevername.php?id=1

 

the receiving code

 

if(isset($_GET['id'))

{

$id=htmlspecialchars($_GET['id'];

}

 

that messes up a hack attempt instead of just trying to bring the data into a variable that could be executed for example if you echoed echo "$id";

 

if there was a hack in there you would be executing the code

 

i do that with post too

Link to comment
https://forums.phpfreaks.com/topic/171974-_get/#findComment-915094
Share on other sites

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.