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 7722417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:10:00+00:00 2026-06-01T04:10:00+00:00

Being a newbie I thought I understood what to do from a security standpoint

  • 0

Being a newbie I thought I understood what to do from a security standpoint but I still need some help.

I have a form that takes in a number of things about a camera’s details. Such as the camera name and a number of other options that are part of an html select. I process this in php:

$db = &JFactory::getDBO();

if (isset($_POST['addcamera'])) {

    //process changes to camera options 
    if ( !empty($_POST['camera_type']) && !empty($_POST['camera_status']) && !empty($_POST['camera_name']) && !empty($_POST['camera_quality']) && !empty($_POST['email_notice']) )
    {       
        $add_name = JRequest::getVar('camera_name', 'Default Camera', 'post', 'STRING');
        $add_quality = JRequest::getVar('camera_quality', '', 'post', 'STRING');
        $add_motion_detection = JRequest::getVar('camera_status', '', 'post', 'STRING');
        $add_email_notice = JRequest::getVar('email_notice', '', 'post', 'STRING');
        $camera_type = JRequest::getVar('camera_type', '', 'post', 'STRING');
        //and so on...

        //then I add to DB
        $query_insert_camera = "INSERT INTO #__cameras (camera_status, camera_name, camera_quality, email_notice, camera_type, camera_hash, camera_sensitivity, user_id) VALUES ('".$add_motion_detection."','".$add_name."','".$add_quality."','".$add_email_notice."','".$camera_type."','".$add_camera_hash."','".$add_sensitivity."','".$user->id."')";
        $db->setQuery($query_insert_camera);
        $db->query();

I do use jquery validation for my forms and on the php side of things since I’m using Joomla I’m using getVar: http://docs.joomla.org/Retrieving_and_Filtering_GET_and_POST_requests_with_JRequest::getVar. I believe I’m covering myself from XSS and SQL attacks but could someone confirm that this is the right approach?

Is there anything else I’m missing?

  • 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-06-01T04:10:01+00:00Added an answer on June 1, 2026 at 4:10 am

    In my opinion, as long as you keep your joomla core up to date, there are less risks.

    These links might give you an idea not only about the XSS and SQL attacks in joomla for your extension:

    • http://www.itoctopus.com/10-reasons-why-your-joomla-website-got-hacked
    • http://docs.joomla.org/Category:Security_Checklist

    You can use one of these plugins as well to reinforce your security against those attacks:

    • http://extensions.joomla.org/extensions/access-a-security/site-security/site-protection

    And here’s the code of getVar where you can see how protected your site is against SQL injection and XSS:

    • http://hg.joomla.org/joomla-platform/src/247ba8d88526/libraries/joomla/environment/request.php#cl-84
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have being studying (newbie) .NET and I got some doubts. Reading from a
Being a newbie I have read forums and posts but still can't work out
Very primitive question but I am stuck (I guess being newbie). I have a
Being newbie in SQL, can some help me adapt this trigger to either sqlite
Being a newbie to using matplotlib ,I was trying out some code ,from examples
As being quite a newbie in linux, I have the follwing question. I have
I have no idea where to start debugging being a newbie. I got the
I'm probably doing something wrong, being a newbie. Could you please help me out?
As someone who came from Java background and being a newbie to Ruby, I
Being the 'newbie' I have been staring at the 'documentation and api reference' docs

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.