Thank you so much. I was struggling to get this type of code (particularly) for the past 5 years and today i found it. I need small help here. Here you are trying to insert, edit and update in the webform. I will insert a record by uploading from back end or using macro in excel. now what i want is : the moment user logs in with their credential i want the data to be visible for edit and update (which was assigned against them). The data has the names of the users. (it is just audit allocation). When updated they should be able to use a drop down of correct and incorrect. Thats it. Thank you so much for your help. Murugan
I’m glad that you found it helpful and yes this is based on web using php, if you want to desktop application then you should try any other desktop language, PHP is mainly for online application, if you are using Excel then you should use something like Dot NET.
Hi Javed,
Thanks for response. I am looking at Web application only. In fact I’ve developed one Web application in my team with xammp where 40 people use to access this across Chennai and Bangalore for inserting a record but sadly I failed to create a code for editing and updating and now when I put your code it is working but drawback is all the records are visible for editing and updating. I want only the records that were updated by the respective users. Thanks Murugan
This is simple, all you need is to create two different tables of admin and users, also create two login in 1 for admin and another for user, admin login will redirect to the admin dashboard where he can insert, edit and update, while users can only view record. Hope this help you.
Hi Javed,
So speed in your response. 🙂 I think you did not understand my requirement. Let me tell you in this way. We both are using the site and you have updated 10 record and I have updated 10 record. Now when I want to edit and update I should be able to edit only my records and not your records. Thanks Murugan
You just need to add 1 column in your table with name something like InsertedBy and insert logged in user userid at the time of record insertion, and on the page where you are placing edit link, check if InsertedBy == logged in user so display edit link simple 🙂
Thanks..i got it :-). I have not inserted column.(just to make it simple). below is the code
$sel_query=”Select * from new_record WHERE submittedby='”.$_SESSION[“username”].”‘ ORDER BY id desc;”;
Thanks Paola, but edit file already contain auth.php file in the top, yes delete.php does not contain, although only login user can see delete link but yes you are right it is better to use auth.php in delete file also.
Javed
HI, just dl, open and review this “edit” php. Very simple and clean! Thank you for sharing. I wish your best future success, for your published work is helping many.
Alex
Pingback: Simple User Registration & Login Script in PHP and MySQL | HTML CSS PHP Tutorials
Reblogged this on Dinesh Ram Kali..
LikeLike
Pingback: Allow Only Logged in Users to View Files | HTML CSS PHP Tutorials
Hi Javed,
Thank you so much. I was struggling to get this type of code (particularly) for the past 5 years and today i found it. I need small help here. Here you are trying to insert, edit and update in the webform. I will insert a record by uploading from back end or using macro in excel. now what i want is : the moment user logs in with their credential i want the data to be visible for edit and update (which was assigned against them). The data has the names of the users. (it is just audit allocation). When updated they should be able to use a drop down of correct and incorrect. Thats it. Thank you so much for your help. Murugan
LikeLike
Hi Murugan,
I’m glad that you found it helpful and yes this is based on web using php, if you want to desktop application then you should try any other desktop language, PHP is mainly for online application, if you are using Excel then you should use something like Dot NET.
LikeLike
Hi Javed,
Thanks for response. I am looking at Web application only. In fact I’ve developed one Web application in my team with xammp where 40 people use to access this across Chennai and Bangalore for inserting a record but sadly I failed to create a code for editing and updating and now when I put your code it is working but drawback is all the records are visible for editing and updating. I want only the records that were updated by the respective users. Thanks Murugan
LikeLike
This is simple, all you need is to create two different tables of admin and users, also create two login in 1 for admin and another for user, admin login will redirect to the admin dashboard where he can insert, edit and update, while users can only view record. Hope this help you.
LikeLike
Hi Javed,
So speed in your response. 🙂 I think you did not understand my requirement. Let me tell you in this way. We both are using the site and you have updated 10 record and I have updated 10 record. Now when I want to edit and update I should be able to edit only my records and not your records. Thanks Murugan
LikeLike
You just need to add 1 column in your table with name something like InsertedBy and insert logged in user userid at the time of record insertion, and on the page where you are placing edit link, check if InsertedBy == logged in user so display edit link simple 🙂
LikeLike
Tried this. but i am not getting the result. Please help
$sel_query=”Select * from new_record where where
submittedby
= ‘$login_session’ ORDER BY id desc;”;LikeLike
Hi Javed,
Thanks..i got it :-). I have not inserted column.(just to make it simple). below is the code
$sel_query=”Select * from new_record WHERE submittedby='”.$_SESSION[“username”].”‘ ORDER BY id desc;”;
LikeLike
Great you got the point, i can actually gave you the logic so you can write query for your own program. 🙂
LikeLike
Yep. I agree. Now I’m going to make a higher level by going through your dependant validation list…Thanks Murugan
LikeLiked by 1 person
in zip the files edit.php and delete.php need at the top include(“auth.php”)
LikeLike
Thanks Paola, but edit file already contain auth.php file in the top, yes delete.php does not contain, although only login user can see delete link but yes you are right it is better to use auth.php in delete file also.
LikeLike
javed
thank you so much for providing this wonderful work of yours.thank you so much
LikeLike
Javed
HI, just dl, open and review this “edit” php. Very simple and clean! Thank you for sharing. I wish your best future success, for your published work is helping many.
Alex
LikeLike