Now in check.php I have it echoing $_POST["url"] and then I have the ajax script alerting the msg just to troubleshoot.

If I enter box, it alerts box to me. If I erase box and enter ajax, for example, it will alert box and then alert ajax. If I erase ajax and enter something else it will then alert me each previous attempt...

if $_POST["url"] == the data in the text box then I have no idea why it's caching everything else. Thoughts?

The logic to this is probably off a bit, I had a stupidly ridiculous time wrapping my head around how to do this when it should have been easy. Sigh.

My main problem is that if I choose a url that exists it adds the number and works fine but if I try to change it after than to something that doesn't exist it continues to insert the modified url instead of keeping the new one.