Hi. A few weeks a go i’ve opened a post here where I asked why i get a error when someone sign up on this website. kibsstudio.it
The person that made this website disappeared and i can’t understand at 100% how he made it.
I think that the error that people get comes from a bad configuration of the Controller page. Do you think is something wrong on this code? Could you actually help me to understand how to create a new sign up form? thank you
<?php
class AreaRiservata extends Page
{
private static $db = array(
'TitoloSeo' => 'Text',
'DescSeo' => 'Text'
);
private static $default_child = "AreaRiservataFile";
private static $allowed_children = array("AreaRiservataFile","SuccessAr");
private static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.SEO", new TextAreaField('TitoloSeo', 'Titolo Seo (Max 70 caratteri compresi di punteggiatura)'));
$fields->addFieldToTab("Root.SEO", new TextAreaField('DescSeo', 'Descrizione Seo (Max 160 caratteri compresi di punteggiatura)'));
return $fields;
}
}
class AreaRiservata_Controller extends ContentController
{
private static $allowed_actions = array(
'login', 'FileDl'
);
function ChildrenArearis(){
$newlist = AreaRiservataFile::get();
return $newlist;
}
public function FileDl() {
global $databaseConfig, $databaseConfigExt;
DB::connect($databaseConfigExt);
$username = $_POST['username'];
$surname = $_POST['surname'];
$filetitle = $_POST['filetitle'];
$filename = $_POST['filename'];
$datadownload = $_POST['datadownload'];
$email = $_POST['email'];
$insert = SQLInsert::create('"filsedl"');
$insert->addRows(array(
array('"ID"' => "", '"username"' => $username, '"surname"' => $surname, '"filetitle"' => $filetitle, '"filename"' => $filename, '"datadownload"' => $datadownload, '"email"' => $email)
));
$insert->execute();
}
}