My javascript (Yes there's Jquery, but no I don't think that's why the error is here): <script src="http://code.jquery.com/jquery-2.0.0.js"/> <script> function updateDesc(){ //Get current description var curDesc = ""; $.ajax({ url: "desc.php", type: "POST", data: {'id': <?php echo $_SESSION['id']; ?>, 'op': 'get'}, dataType: "json", success: function(d){ curDesc = d.desc; } }); var descPrompt = prompt("Change description to:", curDesc); if(descPrompt){ $.ajax({ url: "desc.php", type: "POST", data: {'id': <?php echo $_SESSION['id']; ?>, 'to': descPrompt, 'op': 'update'}, dataType: "json" }); var go = confirm("Description changed! Go to profile?"); if(go == true){ window.location = "myprofile.php"; } } } </script> HTML: The console: The area in which line 76 is if(isset($_GET['error'])){ switch($_GET['error']){ case "user_exists": ?> <script> alert('Sorry! That user already exists!'); </script> <?php break; case "wrong_captcha": ?> <script> alert('The captcha you entered is wrong!'); </script> <?php break; case "shortuser": ?> <script> alert('Usernames need to be at least 6 characters!'); </script> <?php break; case "shortpass": ?> <script> alert('Passwords need to be at least 6 characters!'); </script> /*Line 76 */ <?php break; case "password": ?> <script> alert('Passwords do not match!'); </script> <?php break; case "login": ?> <script> alert('Incorrect login!'); </script> <?php break; } } PHP: BUT where I referenced doing the function: <input type="submit" value="Change description?" onclick="updateDesc()"><br> HTML:
Well, first thing I see is this: <script src="http://code.jquery.com/jquery-2.0.0.js"/> SCRIPT is NOT an 'empty' tag by the specification, so you cannot make it XML style self closing. You MUST type </script>. I'm trying to make sense out of your code, and not having a whole lot of luck -- it's, well... gibberish or I'm just not seeing enough of it in your posts. I'm wondering why the devil you have PHP outputting alerts based on getData of all things...It's like you've got how PHP and Javascript work together confused, or worse you're using AJAX on something that shouldn't even be being sent server side yet! Though this also reeks of using pointless jquery+scripting with multiple AJAX submits via a bunch of annoying dialog boxes to do a static form's job.