Jump to content

tobeyt23

Members
  • Posts

    259
  • Joined

  • Last visited

Posts posted by tobeyt23

  1. I am using cakephp have a controller users inside of that I am using the model companies. All loads and looks great, but when I try and do an ajax post to save the company info I get page not found, but when I do an ajax call to user all works fine. Has this happened to anyone else?

     

    function user() {
            $this->autoRender = false;
    
            if($this->RequestHandler->isAjax()) {
                if ($this->data) {
                      $this->User->create();
                            if ($this->User->save($this->data)) {
                       }
                }
            }
        }
    
    function company() {
            $this->autoRender = false;
    
            if($this->RequestHandler->isAjax()) {
                if ($this->data) {
                    $this->Companies->save($this->data);
                }
            }
        }
    

  2. I have a controller called users and have a form within that form I have fields for model companies. For the life of me I can't get the company info to save. If I use companies and then the users info does not save. What is the correct way to do this?

  3. This is what a came up with:

     

    <?php
    $_file      = 'text.txt';
    $_contents  = file_get_contents($_file);
    $_replace   = "Replaced";
    $_find      = '###FIND###';
    $_contents  = str_replace($_find, $_replace, $_contents);
    $_fo        = fopen($_file,"w") or die ("Error editing.");
    
    fputs($_fo,$_contents);
    fclose($_fo) or die ("Error Closing File!");
    ?>
    

  4. sorry basically im taking the you tube embed code which someone else is adding to our db. So i want to change the height and with which i am doing with:

     

    $vid            = '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/zMQ6LfyA-0o?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/zMQ6LfyA-0o?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>';
    $search         = array('<embed', '></embed>');
    $replace        = array('<param name="wmode" value="transparent" /><embed', ' wmode="transparent"></embed>');
    $find           = array('/height(=)(".*?")/', '/width(=)(".*?")/');
    $replacement    = array('height="175"', 'width="200"');
    
    $vid = str_replace($search, $replace, $vid);
    $vid = preg_replace($find, $replacement, $vid);
    

     

    I also need to then see if the rel=0 is added to the value="" and add it if not

  5. OK so I have a page that a user can not access unless they are logged in works great. On that page I have links to documents, if you direct link to those docs they work. They should not unless you are logged in. How can I implement this?

  6. I have the following code, works rotates the image. But it seems to lose its transparency and add color when rotated to say 45. How can I avoid this?

     

    // File and rotation
    $filename = 'placeholder.png';
    $degrees = 45;
    
    // Content type
    header('Content-type: image/png');
    
    // Load
    $source = imagecreatefrompng($filename);
    
    
    // Rotate
    $rotate = imagerotate($source, $degrees, 0);
    
    // Output
    imagepng($rotate);
    ?>
    

  7. Okay I have this but still don't know how to use the InitVectorBytes:

     

    $iteration1 = '42';
        $iteration2 = '25';
    
        while(--$iteration1):
            $data = hash('sha512', $data . SALT1. PASSPHRASE1);
        endwhile;
    
        while(--$iteration2):
            $data = hash('sha256', $data . SALT2. PASSPHRASE2);
        endwhile;
    
        return $data;
    

  8. Ok so I was asked to use this to encrypt my data:

     

    (first encoding)
    
    HashAlhorithm: SHA512
    
    Passphrase: somepassphrase
    
    Saltvalue: somesaltvalue
    
    PasswordIterations: 42
    
    Initvector: someinitvector
    
    
    (second encoding)
    
    HashAlhorithm: SHA256
    
    Passphrase: somepassphrase2
    
    Saltvalue: somesaltvalue2
    
    PasswordIterations: 25
    
    Initvector: someinitvector2
    

     

    How would I do this???

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.