Code:
<?php
$new = 1;
?>
<html><head></head><body>
<?php
echo $new;
?>
</body></html>
Would it print the number 1 to the screen, or would it be blank? I thought this was easier than have an entire paragraph of text.
<?php
$new = 1;
?>
<html><head></head><body>
<?php
echo $new;
?>
</body></html>
Originally posted by The Red Guy
Which means that variables are global in the file declared, and even though you close one instance of php and open another, it's still there?
<?php include('variabe.inc.php'); ?>
the proper way using include is by saving the file as .php likeOriginally posted by Robert
PHP:<?php include('variabe.php.inc'); ?>
<?php include 'variable.inc.php'; ?>
Originally posted by kabatak
the proper way using include is by saving the file as .php likebecause people will be able to see whats inside when they call a .inc filePHP:<?php include 'variable.inc.php'; ?>
You could include any file, but the whole point of the end being .php is so that if a user calls that file in a browser window, they wont see what is inside it. Whereas if they called a .inc it would prompt to download and they could see the info in it.Originally posted by The Red Guy
I mean, I could include a file like extensions.inc and nothing goes wrong!
Originally posted by The Red Guy
After some learning of the language, I'm a getting the hang of it now. However, does it even matter if the file is named inappropriately? I mean, I could include a file like extensions.inc and nothing goes wrong!