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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.