Hello. The text which to edit doesn’t appear in the form input window. As was found $_GET with id of the edited joke doesn’t appear in the index.html file after clicking on the link (in file: jokes.html.php):
Can you post some more of the code, we don’t all have a copy of the book. Specifically, the code that populates the $joke array, and the code you use in edit to retrieve the id.
$joke will be defined in either valid case (either you’ve posted a joke, at which point you’re saving an edit, or you’ve clicked on something that has taken you to the joke editing page, at which point there should be an ID in the query string.)
However, the jokes.html.php you’ve copied that line out of doesn’t appear to match the GitHub repository version. The version you’re showing has an array indexer, and the github version has a property accessor.
Now, there’s a chance i’m looking at the wrong branch of the repo here, but unless @TomB changed his formatting styles between branches… are you SURE you’ve got the correct version of the code samples?
@andreichornii: when you post code on the forums, you need to format it so it will display correctly. (I’ve edited your post above for you.)
You can highlight your code, then use the </> button in the editor window, or you can place three backticks ``` (top left key on US/UK keyboards) on a line above your code, and three on a line below your code. I find this approach easier, but unfortunately some European and other keyboards don’t have that character.