I've been readint he tutorial y'all have on this site...it's great.
Anyway, to "learn" this stuff, I try tinkering with scripts, but it won't work for some reason. It displays the jokes, but for some reason, when I tell it to add a joke, it won't. Here's the code I've been trying to use. (Can someone also explain to me how 'if("ADD" == $submitjoke){' is supposed to work...I don't understand how that is triggered when the user clicks on the button and submits the form .... maybe I M just to used to JavaScript, but I want to UNDERSTAND the language, so please help. (since it displays the info fromt he database, I know that it is connecting.)
if("ADD" == $submitjoke) means "if the variable submitjoke is equal to ADD then..." in other words, this like checks if the user has pressed the submit button or if s/he has simply entered the url. I like to do it the following way (which I think makes more sense):
The variable named $submit will only contain the value 1 if the form has been submitted. In php, 1 = Boolean true, so the if statement will only execute if the form has been submitted.
Bookmarks