Thousands of ways to do this (LITERALLY)! But the way you have it is not one.
If (id == "$id" || pass == "$pass") {Run the Editing Script here. }
Else{ Error Message Stuff}
This posses a problem. If they enter an ID that is correct then it's all good. If that statement is false then it looks to the password to see if it equals. If either one is true then it goes through. Well ... defeats the whole purpose of a login script.
Your looking for something like:
if((id == $id) && (pass == $pass)){
echo "Do an include or something.";
}else{
echo "Sorry you do not meet our criteria. Go away.";
}
Do you see the difference between those? The one I put in will look to make sure that the id equals the right id and the password is set as well. Since you are working from a database (assuming MySQL) then do this SQL statement and look for results:
SELECT * FROM tbl_name WHERE id="$id" && pass="$pass";
Count the returned results. If it is 0 then they didn't enter a credential right. Let MySQL do the work. 🙂 I am lazy. Like I said there are Thousands of ways you can do this and I am sure another bright someone will answer this thread with something new. Learn, grow, code.
Chad