php function using include

November 16th, 2010 by Nov Piseth Leave a reply »

IIC University of Technology Evening Class (B205)
filename: func.php
formfunc.php

formfunc.php

<?php
include("func.php");
if(isset($_GET['btncal'])){
echo "My Add is". add($_GET['txtx'],$_GET['txty']);
echo "<br>";
echo "My Sub is". sub($_GET['txtx'],$_GET['txty']);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<form method="get">
X:<input  type="text" name="txtx" />
Y:<input  type="text" name="txty" />
<input type="submit" name="btncal" />
</form>
<body>
</body>
</html>

func.php

<?php
function add($x,$y){
$total = $x + $y;
return $total;
}
function sub($x,$y){
$sub = $x - $y;
return $sub;
}
?>
Advertisement

Comments are closed.


( ! ) Warning: Undefined array key 0 in /data/pis3th/public_html/wp-content/plugins/cardoza-facebook-like-box/cardoza_facebook_like_box.php on line 924
Call Stack
#TimeMemoryFunctionLocation
10.0002363936{main}( ).../index.php:0
20.0003364344require( '/data/pis3th/public_html/wp-blog-header.php ).../index.php:17
30.568510955856require_once( '/data/pis3th/public_html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.569510991904include( '/data/pis3th/public_html/wp-content/themes/cordobo-green-park-2/single.php ).../template-loader.php:106
50.727311849816get_footer( $name = ???, $args = ??? ).../single.php:73
60.727311850192locate_template( $template_names = [0 => 'footer.php'], $load = TRUE, $require_once = TRUE, $args = [] ).../general-template.php:92
70.727311850304load_template( $_template_file = '/data/pis3th/public_html/wp-content/themes/cordobo-green-park-2/footer.php', $require_once = TRUE, $args = [] ).../template.php:718
80.727411850712require_once( '/data/pis3th/public_html/wp-content/themes/cordobo-green-park-2/footer.php ).../template.php:783
90.727411850712wp_footer( ).../footer.php:3
100.727411850712do_action( $hook_name = 'wp_footer' ).../general-template.php:3059
110.727411851088WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:517
120.727411851088WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:332
130.728711824240call_user_func_array:{/data/pis3th/public_html/wp-includes/class-wp-hook.php:308}( $callback = 'cardoza_fb_like_popup', $args = [0 => ''] ).../class-wp-hook.php:308
140.728711824312cardoza_fb_like_popup( '' ).../class-wp-hook.php:308
WP2Social Auto Publish Powered By : XYZScripts.com