A beginner's question...How do I use $_POST instead of $_GET? (PHP)

Posted by ggfan on Stack Overflow See other posts from Stack Overflow or by ggfan
Published on 2010-04-15T04:04:21Z Indexed on 2010/04/15 4:13 UTC
Read the original article Hit count: 175

Filed under:

Okay, for all my coding so far I been using GETs and only $_POST on the same script.

Ex: profile.php would show all the posts an user made and under each of their post, they can edit their post. The way I been using it is through $_GETs. So..

    //this is the link users click to edit their post
    echo '<td><a href="editad.php?posting_id='.$row3['posting_id'].' ">Edit</a>';

//on the editad.php
$posting_id=$_GET['posting_id'];
if (isset($posting_id)){
   //show all the forms, sqls to do the editing
}
else{ //if the $_GET hasn't been set
   echo "You have not specified which ad to edit. Please go back";
}

How do I do this via POST? Thanks :)

© Stack Overflow or respective owner

Related posts about php