Jump to content

PHP HeLp?


jamesharry404

Recommended Posts

Hello Friends,

There is a Question for you guys,

Please tell me this code is correct or not.

I want id on another page for delete the same id details.

Is it wrong so please give me the correct one.

I am waiting for you code.

Thank you in advance.

<a href="target.php?id=<?php echo $pageid ?>">For Get it in php</a>

_____________________________________________________

Edited by jamesharry404
Link to comment
Share on other sites

its correct

 

NO IT'S NOT!  Don't use the GET method to add/delete or modify.  Use a form method POST and a delete button.  If you want to do it the way you have it, then target.php should have a form using the POST method and the passed in $_GET['pageid'] and a delete or confirm button.

Link to comment
Share on other sites

Well-designed apps/sites are RESTful, which is a fancy way of saying that GET should only be used to retrieve information and POST should only be used to modify information. Those methods are HTTP verbs. They have meaning, and should be used according to those meanings.

 

If you have a list of items that a user should be able to delete one-by-one, just make each entry its own form that uses POST. There's no rule saying you can only have one form on a page.

Link to comment
Share on other sites

Well-designed apps/sites are RESTful, which is a fancy way of saying that GET should only be used to retrieve information and POST should only be used to modify information. Those methods are HTTP verbs. They have meaning, and should be used according to those meanings.

 

If you have a list of items that a user should be able to delete one-by-one, just make each entry its own form that uses POST. There's no rule saying you can only have one form on a page.

 

Yes, multiple forms or one form with multiple buttons with unique values of page_id.

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.