first question: hmm, if you include the file it would work, or you can call the script with a command line variable:
script.php?name=blabla
if you call the script through an inputform use this in the form:
<input type="hidden" name="name" value="which name....">
and no, this would be correct:
PHP Code:
if ($submitnewname == "Submit") {
$sql = "UPDATE yp SET Name='".addslashes($newname)."' WHERE Name='".addslashes($Name)."'";
the function is called addslashes