• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] site path from SQL ?

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
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
/index.php/walkthrough/view/Level%8%to%25
I want to use the title as the view name(path name?) but as I said, I am having some problems with this <_<

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!
 
Well, go read about that in CodeIgniter and PHP documentation. It seems you do not know what you are doing.

A cookie:

Code:
$name = new OTS_Title();
$name->find($title); 
        if($name->isLoaded()) {

Assuming that you didn't created OTS_Title class (since a class for a slug like that would be stupid), your problem is in your understanding. :p
 
Well, go read about that in CodeIgniter and PHP documentation. It seems you do not know what you are doing.

A cookie:

Code:
$name = new OTS_Title();
$name->find($title); 
        if($name->isLoaded()) {

Assuming that you didn't created OTS_Title class (since a class for a slug like that would be stupid), your problem is in your understanding. :p
Okey... true, I don't really know what I am doing :p anyways, a slightly tip of what / where I should read about would be nice :D (I am not 100% into programming / scripting :p).
 
Back
Top