Jump to content

[SOLVED] need help plss..?


subash85

Recommended Posts

frens.. i have attached the file...in the post.. hope you will all view the file and help me out for my problem.. actually i would like to make only one file for every adding and deleting process.. i am juz frustated with making lots of file for addin and deleting the data from database.. so i would like to make eg. add.php?action=something... and delete.php?action=something.. can yuo help me out thanking you...

 

[attachment deleted by admin]

Link to comment
Share on other sites

just use the isset() function in your index file and use that to include the corresponding files...

i.e.

in your index, after you do all your admin checking etc,

this example is for your do_add_ptype.php file.

 

if (isset($_POST['new_ptype'])) {

include ("do_add_ptype.php");

}

 

the isset($_POST['new_ptype'])) checks if the $_POST['new_ptype'] is set, i.e. if a form containing an element with the name new_ptype has been sent... and if this is true, the if statement then includes the corresponding file so it can be executed.

 

play around with this concept and you'll get it working? just make sure the $_POST['whatever'] has a unique identifier for each use case.

 

this way all your forms should be posting to index.php...

 

you might have to edit the do_add_ptype.php file a bit to make it work... and you can remove the dbconnect etc includes from the top of each file...

and maybe put them in a seperate folder

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.