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

Recommended Answers

All 5 Replies

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";
    }    

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

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.

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

Thank you for your help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.