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>

_____________________________________________________

Link to comment
https://forums.phpfreaks.com/topic/282121-php-help/
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
https://forums.phpfreaks.com/topic/282121-php-help/#findComment-1449412
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
https://forums.phpfreaks.com/topic/282121-php-help/#findComment-1449415
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
https://forums.phpfreaks.com/topic/282121-php-help/#findComment-1449419
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.