Hello Otlanders!
I am doing a code where you can add a walkthrough to the database, and view it from there.
But I am having problems with making a path from a SQL name.
As an example
Anyways, I have tried to edit a code from the character controllers, but with no success:
into
Some information:
The name of the column where the title comes from is: title
For the Table name: Walkthrough
Thanks for your help in advanced!
I am doing a code where you can add a walkthrough to the database, and view it from there.
But I am having problems with making a path from a SQL name.
As an example
I want to use the title as the view name(path name?) but as I said, I am having some problems with this <_</index.php/walkthrough/view/Level%8%to%25
Anyways, I have tried to edit a code from the character controllers, but with no success:
PHP:
$this->load->helper("form");
if($_POST) {
$name = decodeString($_POST['name']);
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$player = new OTS_Player();
$player->find($name);
if($player->isLoaded()) {
$ide->redirect("../character/view/$name");
}
else {
error("$name could not be found.");
}
into
PHP:
public function view($title = null) {
$ide = new IDE;
$this->load->helper("form");
$title = decodeString($_POST['title']);
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$name = new OTS_Title();
$name->find($title);
if($name->isLoaded()) {
$ide->redirect("../walkthrough/view/$name");
}
else {
error("$name could not be found.");
}
}
Some information:
The name of the column where the title comes from is: title
For the Table name: Walkthrough
Thanks for your help in advanced!