phrozenflame Posted December 29, 2006 Share Posted December 29, 2006 What is the purpose and reasoning behind the isset() function. If you set a variable to something you should already know 100% that it is already set, why would you need isset() to tell you what you already know, what are the purposes and reasons behind this, I already read over www.php.net manuals a few times, under that section, but I still don't grasp this concept, I know unset() takes a variable off I guess you use that when you have a variable, and want to cut that variable off so you can use the same variable name later in the script, but isset() makes absolutely nosense to me, I know for debugging you could check your variables to make sure they are set, but I thought if you set them they were set, no if's ands or buts, the more help I get on this the better, and thank you in advance. Link to comment https://forums.phpfreaks.com/topic/32210-solved-isset/ Share on other sites More sharing options...
kenrbnsn Posted December 29, 2006 Share Posted December 29, 2006 The isset() function is very handy when checking whether session variables are set, whether a submit button was pressed on a form, or checking to see if a particular index is defined in an array in general.Ken Link to comment https://forums.phpfreaks.com/topic/32210-solved-isset/#findComment-149503 Share on other sites More sharing options...
phrozenflame Posted December 29, 2006 Author Share Posted December 29, 2006 After I dig deeper into php I am learning sql, and it's variations including mysql, but I was also told by numerous people, including people on this board, that you shoudl validate forms with javascript, and process them with php, if this is true then I would have no need for the isset() function in the forms right Link to comment https://forums.phpfreaks.com/topic/32210-solved-isset/#findComment-149506 Share on other sites More sharing options...
kenrbnsn Posted December 29, 2006 Share Posted December 29, 2006 Never depend on Javascript for validating forms.What happens if someone who has Javascript turned off fills out the form? What happens if a spammer screenscrapes your form and sends data directly to the processing script?You still would need the isset() function, if your script does one thing if the form was submitted and something else if it hasn't be submitted.Ken Link to comment https://forums.phpfreaks.com/topic/32210-solved-isset/#findComment-149509 Share on other sites More sharing options...
phrozenflame Posted December 29, 2006 Author Share Posted December 29, 2006 Thank you I understand now Link to comment https://forums.phpfreaks.com/topic/32210-solved-isset/#findComment-149513 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.