declaring multiple variables with includes as well?
Posted: Thu Nov 08, 2007 12:41 pm
Im kinda confused about this simple thing, a little help would save me alot of time. Lets say i have a code like this:
Then some random html, and so on. But then, in the same document,
Do the variables cancel between every "mysql_close()"?
And, if I never close the connection between closing tags (<?php ?>) & html, will i have to re-open the connection at the next set of php tags?
Code: Select all
<?php
$con = mysql_connect("localhost","user","pass")or die(mysql_error())
$ip = $_SERVER['REMOTE_ADDR']
(some random code having to do with $ip)
mysql_close($con)
?>Code: Select all
<?php
$con = mysql_connect("localhost","user","pass")or die(mysql_error())
$ip = mysql_fetch(blahblahblah)
(some random code having to do with $ip)
mysql_close($con)
?>
<p>and now ima stick an include that has the variable $ip declared as a seperate thing</p>
<? include('ip.php'); ?>Do the variables cancel between every "mysql_close()"?
And, if I never close the connection between closing tags (<?php ?>) & html, will i have to re-open the connection at the next set of php tags?