OK, I know I'm doing something very wrong, but I attempted to put it together like this (and I am fairly certain this is incorrect), as instead of adding the cat to my account and displaying the "you've found..." page it is sending me to the .../explore page (and not adding the cat to the account). Is it the "action" part of the form that needs to be altered..?
PHP Code:
public function pickupPet($species){
$document = $this->document;
$document->add(new Comment("
<form id='pickup_pet' action='explore' name='pickup_pet' method='post' role='form'>
<input id='pet_found' name='pet_found' type='hidden' value='{$species}'>
<button id='acquire' value='species' name='acquire' type='submit'>
<center>Pick up this cat?</center>
</button>
</form>
", FALSE));
return;
if($mysidia->input->post("pet_found")){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$species = $mysidia->input->post("pet_found");
$this->givePet($species);
$document->setTitle("Kitten Acquired!");
$document->add(new Comment("You've collected a new Fleet!. "));
}
}
public function givePet($species){
$mysidia = Registry::get("mysidia");
$newadopt = new StockAdopt($species);
$newadopt->append($mysidia->user->username);
return;
}
Also thank you for helping, Kyttias! I'm sorry I'm so very new with this all!