Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:25:41+00:00 2026-05-27T01:25:41+00:00

I am developing a joomla component and I want to know what is the

  • 0

I am developing a joomla component and I want to know what is the best secure way to POST and GET data through a form submit.

<form action="index.php?<?php echo JUtility::getToken()?>=1" method="post" name="adminForm">    
    <input type="hidden" name="option" value="<?php echo OPTIOIN_NAME; ?>" />
    <input type="hidden" name="task" value="save" />
    <input type="hidden" name="controller" value="mycontroller" />
    <input type="hidden" name="id" value="<?php echo $this->my_data->id; ?>" />


    <?php echo JHTML::_('form.token');?>

    //my code is here

</form>

model.php

function getPostData(){

     if (!JRequest::checkToken('REQUEST')) {
         // return 403 error
         JError::raiseError(403, JText::_('ALERTNOAUTH'));
         // belt and braces approach to guarantee the script stops
         jexit('Invalid Token');
  }

     $this->_data->id = JRequest::getVar('id', 0, 'POST', 'INT');
     //....


}

This is the way I am sending data and I don’t know this is a good method or not. Please Help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:25:42+00:00Added an answer on May 27, 2026 at 1:25 am

    I think this method you use is ok. Just one thing: if you’re getting the data from POST, I guess your token will be available in POST too, so your call to JRequest::checkToken( ‘REQUEST’ ) could be changed to JRequest::checkToken( ‘post’ ).
    Another important thing is that you should always use $db->Quote() method if your manually crafting database queries using vars from request.
    Finally, as Thilo said, you should use HTTPS for “critical” transactions such as payments.

    I hope it helped!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m using mootools 1.1 for developing joomla component. i want to get the
I am developing component and I want to know how to validate email value
I'm now developing a component for Joomla 1.5. I want to update the header
I'm developing components for Joomla! and want to know if there is a framework
I am developing a Joomla component and one of the views needs to render
I am developing a component for Joomla website. This website has a sophisticated template
I'm developing this website with Joomla! 1.5.22 I want to look for the file
I'm planning on developing a Joomla custom component and storing the files in a
I have gone through the tutorial for component development at http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.7_-_Part_06 . While the
I'm developing a component in Joomla 1.6, is a Document Manager and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.