View Single Post
  #3  
Old 12-27-2015, 06:20 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 114,144
Abronsyth is on a distinguished road
Default

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!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote