By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

include function inside an isset function

P: 92
is it possible to use an include function inside an isset function?

something like:

[php]
if(isset($_POST['submit']))
{
include("insert.php");
}
[/php]
Jan 7 '08 #1
Share this Question
Share on Google+
4 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Backups.

Yup. In fact, just like you have there; a call to include() inside of a conditional block.
Jan 7 '08 #2

P: 92
What if the input type that I use is button instead of submit, will the isset function work?
Jan 8 '08 #3

Markus
Expert 5K+
P: 6,050
What if the input type that I use is button instead of submit, will the isset function work?
Nope. It is not good practice to check whether the form is submitted through the the 'submit' button because, as we know, there are many other ways of submitting a form.

Iff you're going to use a regular type=button ( i shall assume you're doing some sort of validation before submitting ) you should check for some other element and see if that is selected. eg. a 'terms and condition' select box.
Jan 8 '08 #4

P: 92
what shoulf i use then? i need to use two buttons with different actions. could i use the if(isset()) condition? and what input type should i use?
Jan 9 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.