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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:28:42+00:00 2026-05-24T03:28:42+00:00

im trying to write a function that will sanitize data coming from the client

  • 0

im trying to write a function that will sanitize data coming from the client side.
im using zend framework and i know that it offers functions to do that. but im not using zend_form so i dont know how to use those functions

i wanna be able to sanitize the data from sql injections… before save them in the db or doing any further processing with that data.

so my question is , is there any function out there or a library that can do that ?
im looking for a function that will take as an input a string and return the sanitized one.

thank you

  • 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-24T03:28:43+00:00Added an answer on May 24, 2026 at 3:28 am

    If you use prepared statements with PDO, Zend_Db or another ORM then the parameters will be escaped properly so that takes care of sanitizing in most cases.

    PDO Example:

    $pdo = new PDO($dsn, $username, $password);
    $pdo->prepare("INSERT INTO some_table (col1, col2, col3) VALUES (?,?,?)");
    $pdo->execute(array($valueCol1, $valueCol2, $valueCol3));
    

    Before you even get to that step though you should validate the data which is what Zend_Validate is for. You dont have to use Zend_Validate with Zend_Form if you dont want to – you can just create validator instances and then validate different values.

    Example from the ZF Documentation:

    $validator = new Zend_Validate_EmailAddress();
    
    if ($validator->isValid($email)) {
        // email appears to be valid
    } else {
        // email is invalid; print the reasons
        foreach ($validator->getMessages() as $messageId => $message) {
            echo "Validation failure '$messageId': $message\n";
        }
    } 
    

    Zend_Form is just a handy way to handle form processing and make things easily reusable.

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

Sidebar

Related Questions

I'm trying to write a function that will return the number of levels from
I am trying to write a function that will pull valid phone numbers from
I am trying to write a function that will understand how to login using
I am trying to write a function that will pull the name of a
I'm trying to write a regex function that will identify and replace a single
I am trying to write a JavaScript function that will return its first argument(function)
I'm trying to write a custom function that will let me retrieve a cell
I am trying to write a function that will take an xml object, an
i am trying to write a function that will make DataRow[column] return nullable typed
I'm trying to write a function that will let me red-shift or blue-shift a

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.