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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:19:12+00:00 2026-05-20T10:19:12+00:00

what functions i have to use to encode/decode/escape/stripslash data for following purposes? when calling

  • 0

what functions i have to use to encode/decode/escape/stripslash data for following purposes?

  1. when calling a PHP script from JS like: page.php?data=don't_use_#_and_%_in_URL_params
  2. when a PHP script receive a parameter from JS like: don%27t_use_%23_and_%25_in_URL_params
  3. when running a MySQL query from PHP with data previously received from JS to prevent MySQL injections (lets say i need to insert in database the following sequence of characters: "``')
  4. when i need to compare in a MySQL statement a field value which contains "``' sequence with an expression
  5. when i need to retrieve a field value from a MySQL table and the field contains "``' and i want to use it in a PHP eval() macrosubstitution
  6. when i have to send data from PHP to JS in an AJAX response and it contains "``' characters
  7. and finally i have to eval() previous respond in JS

something like this diagram:

JS(encode) –> (decode)PHP(encode) –> (decode?)MySQL(encode?) –> (decode)MySQL(encode) –> (decode)JS

if anyone have the time and pleasure to answer, or to correct me if i made any mistakes here, thanks in advance

  • 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-20T10:19:12+00:00Added an answer on May 20, 2026 at 10:19 am
    1. encodeURIComponent
    2. $_GET
    3. PDO bound parameters
    4. PDO bound parameters in a database. Otherwise it is just a string in PHP
    5. No idea. You really should have asked a Question for each question you have. eval smells bad though.
    6. Pick a data format and use appropriate encoding for that. JSON is common.
    7. The only time you should go near eval() is JS is when you are implementing a support for json in browsers without a native version (and you can use Crockford’s json2.js for that). So don’t.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several functions that I wrote and I use regularly on my servers,
I have a C++ library and a C++ application trying to use functions and
I have a function that I use to add vectors, like this: public static
Can you use the bash getopts function twice in the same script? I have
I made some CMS in PHP which manipulates with data from MySQL. In my
Let's imagine that we have something like: $.post('somescript.php', 'WHAT CAN WE PUT HERE?', function(replyData)
I know that I have to use: rdtsc. The measured function is deterministic but
I have a function that I use called sqlf(), it emulates prepared statements. For
I have a function (for ease, I'll just use count()) that I want to
I have a syntax highlighting function in vb.net. I use regular expressions to match

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.