PDA

View Full Version : undefined function include_once


mopey
03-11-2001, 05:35 PM
Hi guys,

big night. Learnt telnet, sql dumps, database setup *yadda yadda* all for one script *lol* I have an error though that's not going away.

The script in question is supposed to work with both php3 and 4, and for the most part it does. The problem however is this:

Fatal error: Call to unsupported or undefined function include_once() in /home/dailyfin/dailyfinancial-www/show_news.php3 on line 8

I think the problem is that I had to change all the .php extensions to .php3 as the server I'm putting this on (not a hostmatters one), doesn't support php4.

Line 8 is the following:

include_once("database.inc.php3");

database.inc.php3 is the following:

<?php

$database_login="**secret squirrel**";
$database_pass="**secret squirrel**";
$database_host="localhost";
$database_name="**secret squirrel**";
$db=mysql_connect($database_host,$database_login,$ database_pass);
mysql_select_db($database_name,$db);

?>

So is this just what I presumed and a php3 thing, or is there a quick fix. It's a news poster type thing. The backend works fine - just this one line to display everthing.

Let me know if you need anything else to work it out.

Greg Moore

Annette
03-11-2001, 06:00 PM
Have you tried simply changing it to "include" alone? Or does the script make other calls that preclude it from using a vanilla setting?

mopey
03-11-2001, 08:12 PM
Annette,

Very good question - I haven't a clue. With luck Marty our resident PHP Guru will have a chance to give his opinion on the matter :) From my understanding of it, it's making a call on the database (essentially giving it a kick in the ass) before it displays the data from the news posts.

Oh.. if you read this, what's the chance of enabling an account to upload images? Again, it's for a different hosting company so I'll be prodding their admin too about it. The install mentions chmod'ing the dir to -777. The script allows for the user to upload an image from their hard drive to go alongside the article - the main reason I'm suffering through this setup instead of grabbing a nice easy drop and forget one somewhere else :)

The images get uploaded to a folder in the main dir (domain-www/folder)

If that's a bad thing just email me instead. As I said it'll be SEP (someone else's problem) *lol*

Greg Moore

mopey
03-11-2001, 09:39 PM
Marty,

You're a champ! I'll try that and get right back to you :)

Greg Moore

mopey
03-11-2001, 09:51 PM
Marty gets a gold star :)

Works like a charm - thanks....

Annette,
Same thing as you suggested I know but I figured I'd defer to Marty - credit to you too.

Just have to get an answer from their admin regarding uploading files to a folder for the script and I can put this site to bed *finally* It's been almost a month of SSI's, PHP's, building third party information into it etc. :) All for the pleasure of being unknown to the client *chuckle*

Greg Moore