latest datatables editor PHP 2.5.0 installation resulting in 404 system error on a test script
latest datatables editor PHP 2.5.0 installation resulting in 404 system error on a test script
Hi
I have just loaded the latest PHP Datatables Editor Version 2.5.0 onto my hosted website dividendlook.com. Having created a simple script using Woody Snippets and calling in a wordpress webpage, the debug results in a series of 404 errors.
GET https://www.dividendlook.com/Editor-PHP-2.5.0/css/editor.dataTables.css net::ERR_ABORTED 404 (Not Found)Understand this error
test-datatables-editor-v1-1/:192 GET https://www.dividendlook.com/Editor-PHP-2.5.0/js/editor.dataTables.js net::ERR_ABORTED 404 (Not Found)Understand this error
test-datatables-editor-v1-1/:191 GET https://www.dividendlook.com/Editor-PHP-2.5.0/js/dataTables.editor.js net::ERR_ABORTED 404 (Not Found)Understand this error
test-datatables-editor-v1-1/:222 Uncaught TypeError: DataTable.Editor is not a constructor
at test-datatables-editor-v1-1/:222:16
Note all the above directories are valid and contain the javascript files
To invoke the script run
https://www.dividendlook.com/index.php/test-datatables-editor-v1-1/
The dividendlook.com site password is raellook147
Script below
<head>
<title>Test Datatables Editor v1.1</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.3.4/css/dataTables.dataTables.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/3.2.5/css/buttons.dataTables.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/3.1.0/css/select.dataTables.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/datetime/1.6.0/css/dataTables.dateTime.min.css" />
<link rel="stylesheet" type="text/css" href="../../Editor-PHP-2.5.0/css/editor.dataTables.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/2.3.4/js/dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.2.5/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.2.5/js/buttons.dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/3.1.0/js/dataTables.select.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/3.1.0/js/select.dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/datetime/1.6.0/js/dataTables.dateTime.min.js"></script>
<script type="text/javascript" src="../../Editor-PHP-2.5.0/js/dataTables.editor.js"></script>
<script type="text/javascript" src="../../Editor-PHP-2.5.0/js/editor.dataTables.js"></script>
</head>
<table id="example" class="display">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
<input type='hidden' id='passuserid' value='<?php echo $current_user->ID; ?>'>
<script type="text/javascript">
const editor = new DataTable.Editor({
ajax: '../../Editor-PHP-2.5.0/controllers/staff.php',
fields: [
{
label: 'First name:',
name: 'first_name'
},
{
label: 'Last name:',
name: 'last_name'
},
{
label: 'Position:',
name: 'position'
},
{
label: 'Office:',
name: 'office'
},
{
label: 'Extension:',
name: 'extn'
},
{
label: 'Start date:',
name: 'start_date',
type: 'datetime'
},
{
label: 'Salary:',
name: 'salary'
}
],
table: '#example'
});
new DataTable('#example', {
ajax: '../../Editor-PHP-2.5.0/controllers/staff.php',
columns: [
{
data: null,
render: (data) => data.first_name + ' ' + data.last_name
},
{ data: 'position' },
{ data: 'office' },
{ data: 'extn' },
{ data: 'start_date' },
{ data: 'salary', render: DataTable.render.number(null, null, 0, '$') }
],
layout: {
topStart: {
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }
]
}
},
select: true
});</script>
Any ideas on how to overcome this problem would be much appreciated.
Many Thanks
Colin
This question has accepted answers - jump to:
Answers
I'm seeing 404 not found with the link you provided:
Clicking on other links in that page seem to work so I assume the password provided works. Possibly the web server's log will provide more information. The 404 error is most likely not a Datatables/Editor issue but a web server configuration issue.
Kevin
I'm also seeing a 404 for https://www.dividendlook.com/Editor-PHP-2.5.0/js/editor.dataTables.js.
Are you sue that the unziped path is correct?
Allan
Thanks Kevin, I will investigate whether this is a web server issue.
Colin
Hi Allan, I will check the paths once I can establish a reliable connection with my hosting provider. I have always used a VPN to prevent my connection from dropping with Guru, but this may have some undesirable consequences with changing my IP address. I will contact Guru this morning.
Thanks Colin
Hi
The problem has been solved with my hosting provider.
The PHP installation of Editor-PHP-2.5.0 should have been loaded in the /public_html directory of my hosting server, otherwise the whole directory structure is not visible to the website dividendlook.com.
/public_html/Editor-PHP-2.5.0
so if you enter the following file (or others within Editor-PHP-2.5.0) into the browser, it is now visible unlike before.
https://www.dividendlook.com/Editor-PHP-2.5.0/js/editor.dataTables.js
Previously, I had loaded the Editor-PHP-2.5.0 directory and files in a moment of madness in dividendlook.com/
Thanks for your help
Colin
Good stuff, glad to head you've got it sorted.
Allan