0

i was having fun with php until i hit this road block...

geolocation.class.php is in the same directory as my index.php.. anyone has any idea why it can't find it? =(

/*
* this is part of the index.php
* /

<div id="midBox">
    	<table border="0" align="left">
        	<tr><td><script type="text/javascript">
						var date= new Date();
						document.write(date);
                    </script>
			    </td>
			</tr>
            <tr><td><?php $visitorIP= $_SERVER['REMOTE_ADDR']; echo "Your IP is: " .$visitorIP;  ?></td></tr>
            <tr><td><?php include('geolocation.class.php') or die(); // not found
 
						//Load the class (city precision)
						$geolocation = new geolocation(true);

					?>
                </td>
            </tr>
        
        </table>
    
    </div>

error message

Warning: include(1) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\index.php  on line 58

Warning: include() [function.include]: Failed opening '1' for inclusion (include_path='.://C:/wamp/www') in C:\wamp\www\index.php on line 58

Fatal error: Class 'geolocation' not found in C:\wamp\www\index.php on line 61
2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by saiprem
0

It seems your geolocation.class.php page is not there in the same directory

check where is it located and give correct path in your include to load the geolocation.class

ex:
include('somedirectorypath/geolocation.class');

or

include('../somedirectorypath/geolocation.class');

i was having fun with php until i hit this road block...

geolocation.class.php is in the same directory as my index.php.. anyone has any idea why it can't find it? =(

/*
* this is part of the index.php
* /

<div id="midBox">
    	<table border="0" align="left">
        	<tr><td><script type="text/javascript">
						var date= new Date();
						document.write(date);
                    </script>
			    </td>
			</tr>
            <tr><td><?php $visitorIP= $_SERVER['REMOTE_ADDR']; echo "Your IP is: " .$visitorIP;  ?></td></tr>
            <tr><td><?php include('geolocation.class.php') or die(); // not found
 
						//Load the class (city precision)
						$geolocation = new geolocation(true);

					?>
                </td>
            </tr>
        
        </table>
    
    </div>

error message

Warning: include(1) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\index.php  on line 58

Warning: include() [function.include]: Failed opening '1' for inclusion (include_path='.://C:/wamp/www') in C:\wamp\www\index.php on line 58

Fatal error: Class 'geolocation' not found in C:\wamp\www\index.php on line 61
0

the class file is there... i still don't understand why php gives me the error message. it actually finds it.. it is just the "or die()" pops the not found message.

0

It will be there, but it is not there in the right path

ex:

index.php
files2/class1.php
files1/class2.php

when index.php is executing, if you want to include files2/class1.php

include('files2/class1.php')

when index.php is executing, if you want to include files1/class2.php

include('files1/class2.php')


the class file is there... i still don't understand why php gives me the error message. it actually finds it.. it is just the "or die()" pops the not found message.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.