PDA

View Full Version : Need hepl About PHP Include files


yadew
01-27-2006, 10:55 AM
Hi I am new to php.


I want to run the script
____________________________________________________________
<?php
include("math_lib.php");
?>
<html>
<head>

<title>Include files</title>
</head>
<body>
<?php
print(to_pow(6,10)."<br />");
print(multiply(5,100) ."<br />");
print(divide(5,0) ."<br/>");
print(subtract(100,50) ."<br />");
print(add(100,50) ."<br />");
?>
</body>
</html>
____________________________________________________________


But it showing the error

Warning: main(math_lib.php): failed to open stream: No such file or directory in c:\program files\easyphp1-8\www\1.php on line 2

Warning: main(): Failed opening 'math_lib.php' for inclusion (include_path='.;C:/Program Files/EasyPHP1-8\php\pear\') in c:\program files\easyphp1-8\www\1.php on line 2

Fatal error: Call to undefined function: to_pow() in c:\program files\easyphp1-8\www\1.php on line 23
________________________________________________________

How can i overcome the problem.

chump2877
01-27-2006, 11:11 AM
http://us3.php.net/manual/en/function.include.php

Use the full the URL:

include 'http://www.yourserver.com/math_lib.php';

see if that helps....


Also, what are you trying to do with this code:

print(to_pow(6,10)."<br />");
print(multiply(5,100) ."<br />");
print(divide(5,0) ."<br/>");
print(subtract(100,50) ."<br />");
print(add(100,50) ."<br />");

firepages
01-27-2006, 11:15 AM
no use an absolute or relative path


<?php
include_once 'c:\program files\easyphp1-8\www\math_lib.php';
?>


just get the path correct !

yadew
01-27-2006, 11:28 AM
no use an absolute or relative path


<?php
include_once 'c:\program files\easyphp1-8\www\math_lib.php';
?>


just get the path correct !


From where and how I can get the path

firepages
01-27-2006, 11:31 AM
where is math_lib.php located ? I assume you have a copy of that file ? if not you need to.

yadew
01-27-2006, 11:40 AM
where is math_lib.php located ? I assume you have a copy of that file ? if not you need to.


Sorry sir math_lib.php is not in my php folder

Now from where i can get it

firepages
01-27-2006, 11:51 AM
where did you get the script from ? math_lib.php would have been distributed (or linked to) with that script , I googled for it but no joy.