Contact Me

Hi, you can contact me at the following email address:

my email address

3 thoughts on “Contact Me

  1. Ronald Royales says:

    Hi,

    I looked at your tutorial for Zend_Form_Element_File but I just don’t know how to use it can you send me a newer version where the form is seperated with the controller. below is a form, controller and view sample but I can’t seem to make setDestination work The given destination is no directory or does not exist. where does it save the file my controller is upload action is index. what is the url (root/upload/index/data)? PLEASE HELP.

    /////////
    // zend form class
    /////////
    class UploadForm extends Zend_Form
    {
    public function __construct($options = null)
    {
    parent::__construct($options);
    $this->setName(‘upload’);
    $this->setAttrib(‘enctype’, ‘multipart/form-data’);

    $description = new Zend_Form_Element_Text(‘description’);
    $description->setLabel(‘Description’)
    ->setRequired(true)
    ->addValidator(‘NotEmpty’);

    $file = new Zend_Form_Element_File(‘file’);
    $file->setLabel(‘File’)
    ->setDestination(‘/data’)
    ->setRequired(true);

    $submit = new Zend_Form_Element_Submit(‘submit’);
    $submit->setLabel(‘Upload’);

    $this->addElements(array($description, $file, $submit));

    }
    }

    /////////////
    //controller
    /////////////

    view->headTitle(‘Home’);
    $this->view->title = ‘Zend_Form_Element_File Example’;
    $this->view->bodyCopy = “Please fill out this form.”;

    $form = new UploadForm();

    if ($this->_request->isPost()) {
    $formData = $this->_request->getPost();
    if ($form->isValid($formData)) {

    // success – do something with the uploaded file
    $uploadedData = $form->getValues();
    $fullFilePath = $form->file->getFileName();

    Zend_Debug::dump($uploadedData, ‘$uploadedData’);
    Zend_Debug::dump($fullFilePath, ‘$fullFilePath’);

    echo “done”;
    exit;

    } else {
    $form->populate($formData);
    }
    }

    $this->view->form = $form;

    }
    }

    /////////////
    // index.phtml
    /////////////

    title; ?>
    bodyCopy; ?>
    form; ?>

  2. souleye says:

    Ahsan, thank you for this masterful tutorial. My question is after you created the module, how do you implement it on a page so that it can be used for searches. That’s my main issue right now. As far as presentation, I can take care of it. Thanks in advance.

  3. Shahbaz Ahmed says:

    Asalamu Alikum
    Dear Respected Sir, i need some Help in PHp Please Can u help me , i m from lahore aplease it request

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s