PHP Error Help

I am getting this error

[font=Segoe UI][size=13px][font=Times New Roman][/size][size=12pt]Fatal error[/size][/font][/size][size=13px][font=Times New Roman][/size][size=12pt]: Call to undefined function check_image() in[/size][/font][font=Times New Roman][/size][size=12pt] [/size][/font][font=Times New Roman][/size][size=12pt]/home/vetnets1/public_html/control/spotlight_engineer/aed_spotlight.php[/size][/font][font=Times New Roman][/size][size=12pt] [/size][/font][font=Times New Roman][/size][size=12pt]on line[/size][/font][font=Times New Roman][/size][size=12pt] [/size][/font][font=Times New Roman][/size][size=12pt]21[/size][/font][/font]

Here is the code:

[font=Segoe UI][/size][size=13px][/color]

<? [/size][/font]include("../../global.php"); include("app_vars.php"); include("../../library/check_image.php"); if(count($_POST) > 0) { // Determine type of banner link switch($link_opt) { case '0' : $link_url = $int_url; break; case '1' : $link_url = $ext_url; break; case '3' : $link_url = $linkmurl; break; default : $link_url = $int_url; } # If an image has been specified... if($img_size > 0) { if(check_image($img, array("width" => $MAX_IMAGE_WIDTH))) { $fp = fopen($img, "r"); $img_data = addslashes(fread($fp, $img_size)); fclose($fp); } else { unset($img_name, $img_type, $img_size); $onLoad = " onLoad=\"alert('The image did not meet size requirements and was not stored with the Spotlight.');\""; } } else { unset($img_name, $img_type, $img_size); } require("../../datalink.php"); if(($a) && ($_POST["go"] != "index.php")) { $_POST["go"] .= $spotliteID; } header("Location: " . $_POST["go"]); exit(); } if($r) { $query = "UPDATE spotliteDB SET img_name = NULL, img_type = NULL, img_size = NULL, img_data = NULL WHERE spotliteID = $spotliteID"; mysql_query($query) or mysql_error_handler($query, $PHP_SELF); } if($e) { include("../../datalink.php"); } ?> the builder
Manage Spotlights ::

Spotlight Title:
Image:
<? if(strlen($img_name) > 0) { ?>Delete Image<? } ?> (size: <?= $MAX_IMAGE_WIDTH ?> pixel width)
Descriptive Text: <?= $desctext ?>
Category <? if(is_array($thisAppCats) && isset($_COOKIE['usereqID'])) $search = "AND spotlightcatid IN (".$appCats[$thisApp].")";
		$query = "SELECT * FROM spotlightcatsDB WHERE 1 $search ORDER BY name";
		$result = mysql_query($query) or  mysql_error_handler($query, $PHP_SELF);
		while($row = mysql_fetch_array($result, MYSQL_ASSOC))
		{
			extract($row);
			?>
			<option <? if($spotlightcatID==$categoryID) echo "SELECTED"; ?> value="<?= $spotlightcatID ?>"><?= $name ?></option>
			<?
		}
		?>
		</select>
	</td>
</tr>
<tr>
	<td align="right" class="copyFont">Link Description:</td>
	<td align="left"><input type="text" name="link_desc" size="43" maxlength="100" value="<?= $link_desc ?>"></td>
</tr>
<tr>
	<td align="right" valign="top" class="copyFont">Link URL:</td>
	<td align="left">
> Link to page within my website
<?
			$query = "SELECT * FROM pageDB ORDER BY title";
			$result = mysql_query($query) or mysql_error_handler($query, $PHP_SELF);
			
			while($row = mysql_fetch_object($result))
			{
				echo "\n				  <option value=\"" . $row->pageID . "\"";
				if($link_url == $row->pageID) echo " selected";
				echo ">" . $row->title . "</option>";
			}
			
	  ?>
	 </select><br><br>
    </td>
</tr>
<?php
	# Get the appID of the multimedia library, then see if the user logged in has access to the app
	$query = "SELECT `appID` FROM `appsDB` WHERE `folder` = 'multimedia'";
	$result = mysql_query($query) or mysql_error_handler($query, $PHP_SELF);
	if($mmapp = mysql_fetch_object($result))
	{
		if(in_array($mmapp->appID, $apps))
		{
?>
<tr>
	<td><input type="radio" name="link_opt" value="3"<? if($link_opt == 3) {echo " checked";} ?>></td>
	<td class="copyFont">Link to multimedia library</td>
</tr>
<tr>
	<td></td>
	<td>
	  <select name="linkmurl" onclick="link_opt[1].checked=true;">
	  	<option value="0">No specific media</option>
	  <?php
			$query = "SELECT * FROM `media` ORDER BY `name`";
			$result = mysql_query($query) or mysql_error_handler($query, $PHP_SELF);
			while($row = mysql_fetch_object($result))
			{
				echo "\n				  <option value=\"" . $row->id . "\"";
				if($linkurl == $row->id) echo " selected";
				echo ">[".$row->type."] " . $row->name . "</option>";
			}
	  ?>
	  </select><br><br>
    </td>
</tr>
<?php
		}
	}
?>
<tr>
	<td><input type="radio" name="link_opt" value="1"<? if($link_opt == 1) {echo " checked";} ?>></td>
	<td align="left" class="copyFont">Link to external page or website</td>
</tr>
<tr>
	<td></td>
	<td align="left"><input type="text" name="ext_url" size="35" value="<? if($link_opt == 1) {echo $link_url;} else {echo "http://";} ?>"><br></td>
</tr>
Window: > Open link in the current window
> Open link in a new window

<input type=“hidden” name=“spotliteID” value="<?php
echo $_GET["spotliteID"];

?>">
 
 
<input class=“gadbutton” style=“width:110px” type=“button” value=“Next »” onClick="document.forms[0].go.value = 'spotlocation.php?spotliteID=<?php

echo $_GET["spotliteID"];

?>’; document.forms[0].submit();">



<? include("../footer.php"); ?> ___________________________________________________________________________________________________________________

I have the check_image.php file in the library directory as indicated in the include at the top…any help would be greatly appreciated.

Regards,

Probably include paths are not correct, or check_image() function is located elsewhere (in the file that is not included to this script).

I am not sure what your mean…the path for the check_image.php file is correct…as I am not sure what you mean that the the file may be elsewhere…any assistance would be great…thanks a ton…

From the code you posted, it is not clear where your check_image() function is defined. If it is defined in the file check_image.php, then your error message means that script can not find definition of this function. Have you checked this include file, can you see the check_image() function there?

Here is the code for the check_image.php file which is the included file:

<?php // CHECK IMAGE Purpose: To analyze an image file and check to ensure that is conforms to the specified requirements. Input: $image_path - a string containing the file path to the image, which must already be copied to the local server $image_reqs - an associative array containing the requirements with which to check the image, formatted as follows, with unneeded parameters either being discluded or specified as being null: ex: $image_reqs = array("width" => 300, "height" => 170, "filesize" => 30720, "type" => "gif,jpg,jpeg,png"); Output: A boolean value stating whether or not the image meets the stated specifications. */ function check_image($image_path, $image_reqs) { # Get information for the specified image $image_info = getimagesize($image_path); # Store the information into variables $image_width = $image_info[0]; $image_height = $image_info[1]; $image_type = $image_info[2]; $image_filesize = filesize($image_path); # Analyze the image $widthIsFine = (! $image_reqs["width"] || $image_width <= $image_reqs["width"]); $heightIsFine = (! $image_reqs["height"] || $image_height <= $image_reqs["height"]); $filesizeIsFine = (! $image_reqs["filesize"] || $image_filesize <= $image_reqs["filesize"]); $typeIsFine = (! $image_reqs["type"] || in_array($image_type, explode(",", strtoupper($image_reqs["type"])))); # If the image meets all requirements... if($widthIsFine && $heightIsFine && $filesizeIsFine && $typeIsFine) { # Return a value of true return true; } # If the image does not meet all image requirements... else { # Return a value of false return false; } }?>
Sponsor our Newsletter | Privacy Policy | Terms of Service