0

Can somebody explain to me how can I create a one page for all crud and my edit for to be the same with my create form?
I don't know how to use

if(iseet($_POST['action=create'])
if(iseet($_POST['action=edit'])
if(iseet($_POST['action=delete'])

Oh and if someone is intrested in accepting an apprentice to teach and review code.
I would be glad.
I mainly worked with wordpress or frameworks so some basics of php i have missed
Thank you

3
Contributors
5
Replies
23
Views
3 Years
Discussion Span
Last Post by dany12
0

Could you not do something like:

$action = $_GET['action']; // assume that action.php?action=edit

switch ($action) {

        case "Edit":
            echo "EDIT STUFF HERE";
            break;

        case "update":

            echo "Update here";
            break;
        /*.....*/

        default: 
        echo "Default";
    }    
0

Ok not a bad idea but from what i have heard switch has some performance issues and if is more quick.

I am waiting for further ideas

Thank you for your input

0

has some performance issues

First get it to work, then worry about performance.

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” -- Knuth.

0

I will look into it tomorrow and then post my results thank you all for your input.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.