Jump to content

Recommended Posts

Hi there, recently downloaded some files for a CMS system for my site from:http://www.codewalkers.com/c/a/Content-Management-Code/Cura-CMS/ However when I run the file install.php and click submit (On the first page) I get this error: Fatal error: Call to undefined function pma_splitsqlfile() in /home/latestne/public_html/tests/PHP Tests/codefx/install.php on line 23

 

Here is the code for install.php

<?
if(file_exists("settings.php")){
$setopen = fopen('settings.php', 'r');
$setread = fread($setopen, filesize('settings.php')); 
$setting = explode(",",$setread);
$_SESSION['database'] = $setting[3];
fclose($setopen);
}else{
if($_POST['Submit']){
	$dbh=mysql_connect ($_POST['hostname'], $_POST['username'], $_POST['password']) or die ('I cannot connect to the server because: ' . mysql_error());
	$dbs = mysql_list_dbs($dbh);
		while ($row = mysql_fetch_object($dbs)) {
   				if ($row->Database == $_POST['dbname']){
				$flag = 1;
			}
	}
if($flag=1){
	mysql_query('CREATE DATABASE `'.$_POST['dbname'].'`');
}
	mysql_select_db ($_POST['dbname']) or die("Sorry, but the database you typed does not exist.<br>I did try try and make a new one but that didnt work either please check with your server admin.");
	$getsql = fopen('database.sql', 'r');
	$sqlread = fread($getsql, filesize('database.sql')); 
	PMA_splitSqlFile(&$ret, $sqlread, 40000);
		foreach ($ret as $sql) {
			mysql_query($sql);
		}
	$formset = $_POST['hostname'].",".$_POST['username'].",".$_POST['password'].",".$_POST['dbname'];
	$getset = fopen('settings.php', 'w+');
	fwrite($getset,$formset);
	fclose($getset);
	header("location: ?");
	exit;
}else{
?>
<html>
<head>
<title>Cura Install</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>If you are seeing this document this is your first time installing cura. By 
  now you should have copied all your documents to the home directory and have 
  set up a database for cura to live in. </p>
<p>Please enter your server details in the form below</p>
<form name="form1" method="post" action="">
  <p><strong>Hostname</strong><br>
    If you dont know what this is leave it as localhost.<br>
    <input name="hostname" type="text" id="hostname" value="localhost">
  </p>
  <p><strong>Username<br>
    </strong>Please enter your username for access to your servers database.<br>
    <input name="username" type="text" id="username" value="username">
  </p>
  <p><strong>Password<br>
    </strong>Please enter your password for access to your servers database.<br>
    <input name="password" type="text" id="password" value="Password">
  </p>
  <p><strong>Database Name<br>
    </strong>This is the name of the database you have set up to store the data 
    from cura.<br>
    <input name="dbname" type="text" id="dbname" value="Database">
  </p>
  <p>
    <input type="submit" name="Submit" value="Submit">
  </p>
  </form>
<p> </p>
</body>
</html>
<?
exit;
}
}
?>

 

 

Can you help me? Thanks in advance! :P

 

 

Link to comment
https://forums.phpfreaks.com/topic/206838-fatal-error-call-to-undefined-function/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.