Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
I'm having trouble with probably something simple, but I just can't figure it out and neither can I find the answer online.
I have an HTML Form, which is used to update some user info. It is automatically populated with an Ajax livesearch. The user can then edit the info and update it.
However, I want it to redirect to an Insert into OR an Update page. I want this because if the user didn't use the livesearch, it just add's the new info to the database.
What I have atm is this:
<form action="<?php if($_GET['id']){
echo 'update.php?id='.$_GET['id'];
} Else {
echo 'insert.php';
} ?>" method="post">
However this returns me a nice "Undefined index: id" ;)
Any words of advice?