Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Website Search

   
CHMOD & file_get_contents() error ?
View previous topic :: View next topic  
Author Message
zebra242
New User


Joined: 12 May 2005
Posts: 6
Location: belgium

Posted: Sat Aug 06, 2005 5:50 am    Post subject: CHMOD & file_get_contents() error ?

Hi there,
don't seem to get this script working;

I used the code to config and search.php from the form.

* When adding [code below ] to search.php i get :

Quote:
Fatal error: Call to undefined function: file_get_contents() in /home/web/standard/www.virtual-state.be/www/technomad/search/search.php on line 13


Code:
<?php
/////////////////////////////////////////LAST MODIFIED
//the below is header information , believe it or not , about 80% of web-sites never send an acceptable header for which search engines require.if the header is not present or not functional by the search engines requirements , then your page may not be cached and much less likely to ever even be indexed by the search engine at hand. This header must be sent in the top just as it is and must not be moved for performance purposes as well as standards, this portion may not be moved to an outter file and included using the include method , it must remain where it is.
$filename = "search.php";
$lastmod = @filemtime($filename);
header("Last-Modified: " . date ("F d Y H:i:s", filemtime($filename)) . " GMT");
///////////////////////////////////////EXPIRES
$expires = 60 * 60 * 8760;
$exp_gmt = gmdate("D, d M Y H:i:s",time()+$expires)." GMT";
header("Expires: {$exp_gmt}");
//header("Cache-Control: max-age={$expires}");
//////////////////////////////////////ETAG
$content = file_get_contents($filename);
$etag = '"'.md5($content).'"';
header("ETag: {$etag}");
////////////////////////////////////
header("Pragma: public");
//header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// END HEADER INFO
// FALSE COOKIE SECTION, WHO REALLY NEEDS COOKIES ANYWAY?
//remembers last search performed , puts last search bak in searchbox
//added July,07,2005 By:Danny Pryor
if (isset($_POST['keyword'])) {
$value = $_POST['keyword'];
}else{
$value = "";
}
/////////////////////////////////
?>


--> commented line 13 out :

Code:
//$content = file_get_contents($filename);


* Althrough the search directory has CHMOD 777,site.dat has CHMOD 777 I still get :

Quote:
Database State = Not Writable, CHMOD <http://www.perlservices.net/en/faq/cute_ftp.shtml> "site.dat"!


Quote:
frosties search # pwd
/home/web/standard/www.virtual-state.be/www/technomad/search
frosties search # ls -la
total 87
drwxrwxrwx 4 2039 www 448 Aug 5 00:40 .
drwxr-xr-x 14 2039 www 968 Aug 5 00:18 ..
-rwxrwxrwx 1 2039 www 18009 Jul 30 19:39 Copying.txt
-rwxrwxrwx 1 2039 www 13797 Jul 31 20:38 admin.php
-rwxrwxrwx 1 2039 www 2819 Jul 31 20:37 config.php
-rwxrwxrwx 1 2039 www 678 Jul 30 19:39 css.css
drwxrwxrwx 2 2039 www 264 Jul 30 19:39 gfx
-rwxrwxrwx 1 2039 www 235 Jul 30 19:39 htmlcode.dat
drwxrwxrwx 3 2039 www 72 Jul 31 19:15 image
-rwxrwxrwx 1 2039 www 5877 Jul 31 16:59 index.php
-rwxrwxrwx 1 2039 www 56 Jul 31 20:47 keywords.dat
-rwxrwxrwx 1 2039 www 2648 Jul 31 20:38 login.php
-rwxrwxrwx 1 2039 www 6014 Jul 31 20:11 search.php
-rwxrwxrwx 1 2039 www 91 Jul 31 20:43 site.dat
-rwxrwxrwx 1 2039 www 0 Jul 31 19:56 site.txt
-rwxrwxrwx 1 2039 www 7496 Jul 30 19:39 top.gif


* When I add a site I get :
Site has been added successfully
* When I try to edit a site everything is empty
* When I try to view a site everything is empty

Quote:
Title
Description
URL
Keywords


* When I delete a site I get :
Record has been deleted successfully

Needless to say, but I'm clueless Sad
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 572
Location: South East Kentucky,U.S.A.

Posted: Sat Aug 06, 2005 5:34 pm    Post subject:

okay.......... first......... let me try to fill in a big gap........

That code you posted above is from my version of the web-site search script , it is not compatible with the admin panel for the original web-site search script developed by James here at CJ-Design.

Although , it could be implemented to work with the original admin panel .

My version is for a more low-level approach for advanced users.

as far as ' file_get_contents ,
Read the following by the php.net site to see if any of the following applies to your situation:http://us3.php.net/file_get_contents

As far as site.dat , you may or may not be telling the script to look in the correct location, especially since you seem pretty confident that the file has the proper CHMOD directive

See if any of this helps and get back to us and let us know .

If you still experience any difficulties getting it going , I'm highly interested in helping you get it going
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
zebra242
New User


Joined: 12 May 2005
Posts: 6
Location: belgium

Posted: Mon Aug 08, 2005 8:55 am    Post subject: Database State = Not Writable, CHMOD "site.dat"

Danny,
thanks for your reply.

I uploaded back the original versions of search.php and config.php
and removed the header.

Still the same problem :
# Database State = Not Writable, CHMOD "site.dat"!

I don't understand it reads other CHMOD settings.
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 572
Location: South East Kentucky,U.S.A.

Posted: Mon Aug 08, 2005 1:26 pm    Post subject:

I've seen it on several ocassions............ check the filepaths.............

Unfortunately , I've seen the Admin panel say that site.dat was not writable , when in fact , the file location wasnt correctly set .
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
zebra242
New User


Joined: 12 May 2005
Posts: 6
Location: belgium

Posted: Tue Aug 09, 2005 10:16 am    Post subject: it works now

thanks
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 572
Location: South East Kentucky,U.S.A.

Posted: Tue Aug 09, 2005 2:32 pm    Post subject:

well , dont give up on utilizing my version in the forums................... i'd like to see it up on another site. im sure that others are using it but they always seem to just grab code and run ( it seems ). if you're not afraid of a little dirty work , I believe that you would definately agree once youve seen the difference;)
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
zebra242
New User


Joined: 12 May 2005
Posts: 6
Location: belgium

Posted: Tue Aug 09, 2005 10:21 pm    Post subject: i will try

... to get it up and running. But first it was necessary to get a search engine on my site.

Maybe an idea : Google sitemaps makes it possible to upload a sitemap in textformat (http://www.google.com/webmasters/sitemaps/docs/en/other.html#text_file). Maybe it's a good thing to integrate Website Search with it.

Anyway thanks.
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1432
Location: Michigan

Posted: Wed Aug 10, 2005 2:48 am    Post subject:

hmm a sitemap tool Confused i think my version could do that

but yes phpdummy's version is nice but phpdummy i wouldnt mind knowing who uses my version as well, 18 people downloaded it from me and i wouldnt mind knowing what they think of it
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

offical rules:
http://www.cj-design.com/forum/viewtopic.php?t=2002

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 572
Location: South East Kentucky,U.S.A.

Posted: Wed Aug 10, 2005 10:23 am    Post subject:

well , I thought that this guy named "DarkCarnival" was going to put my version up on his site...... Laughing
yeah , forgive me for begging to see someone using my version.....I am totally guilty....

I accounted for one of your downloads on your version DarkCarnival , just checkin it out, doin that "Siskel & Ebert" deal ......
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1432
Location: Michigan

Posted: Wed Aug 10, 2005 3:28 pm    Post subject:

oh ok, well i didnt add it since you had an example on your site already

but yes i too wouldnt mind seeing my version being used as well phpdummy
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

offical rules:
http://www.cj-design.com/forum/viewtopic.php?t=2002

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
PHPDUMMY
CJ-Design.com Moderator



Joined: 09 Mar 2005
Posts: 572
Location: South East Kentucky,U.S.A.

Posted: Wed Aug 10, 2005 3:54 pm    Post subject:

LOL.........doesnt it just make ya feel like a school kid once again.......... beggin for the attention........... lmao...... nawh...j/k.....
_________________
Cheers,
Danny
C-J Search Engine All Tidied Up V4.0http://www.cj-design.com/forum/viewtopic.php?t=1820

C-J Search Engine MySQL !http://www.cj-design.com/forum/viewtopic.php?t=1555
Back to top
darkcarnival
CJ-Design.com Admin



Joined: 10 Jul 2003
Posts: 1432
Location: Michigan

Posted: Wed Aug 10, 2005 4:39 pm    Post subject:

almost i guess but it is a good feeling to see your work being used

i almost wish we could post our version on the cj site to let others know of the different versions available
_________________
Admin of CJ-Design Forum
watch out spammers, I'm watching you!

offical rules:
http://www.cj-design.com/forum/viewtopic.php?t=2002

Elite Bulletin Board v0.5 try it out today!
http://www.elite-board.z42.us/

version 0.9 coming soon!
Back to top
Display posts from previous:   
       CJ Webmaster Forums Forum Index -> PHP Scripts » CJ Website Search All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional, Mods by CJ Website Design