My site is basically 5 "pages" and about 30 "helper pages" that are called by php includes, sometimes 1 or 2 "helper pages" per "page", sometimes 10+ per "page."
Because these are includes I have certain variables and my mysql connection code in the "page" and the helper pages relies on these variables. For example, here is my "edit.php" page:
<form method="POST" enctype="text/plain" action="<?php echo $actual_link; ?>">
<div class="one-hundred"><?php include("include/pages/vehicle.php"); ?></div>
<div class="fifty"><?php include("include/pages/vehicle_valuations.php"); ?></div>
<div class="fifty"><?php include("include/pages/vehicle_features.php"); ?></div>
<div class="thirty-three">
<?php
include("include/pages/purchased_info.php");
include("include/pages/vehicle_Titles.php");
?>
</div>
<div class="thirty-three"><?php include("include/helper_content/warranty_lookup.php"); ?></div>
<div class="thirty-three"><?php include("include/pages/vehicle_advertising.php"); ?></div>
<div id="buttons">
<input type="submit" id="Submit" value="Submit">
</div>
What I'm wondering is if I direct my browser directly to www.____.com/include/pages/vehicle.php the page fails, because of the missing mysql connection script and missing variables. Is there a way to detect if someone is accessing the page directly, or through an iframe or ajax or include?