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

  • Home
  • SEARCH
  • 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 8196171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:23:37+00:00 2026-06-07T05:23:37+00:00

I wish to let certain users enter some fields, which will in turn populate

  • 0

I wish to let certain users enter some fields, which will in turn populate a (new) php file. The (new) file will be a language file containing simple array values:

$lang['example'] = 'text for example';

Basicly I will just populate the file with each row and everything seems grand. However, I need to know how to filter the inputs so that ', " and similiar stuff won’t break the string and open up space for potential injections.

Since php allows a lot of ways to style your code, I’m not sure a addslashes() would be enough for this matter.

How do I filter input so that it can be in strings in a php file?

I couldn’t find any other question regarding this matter, just database filtering.

Extra information:
I don’t want any html in these boxes. It should be able to handle ' and ", and the real question is can you do something like this:

$lang['example'] = 'hackkyyyyy
>>>
// do evil stuff
<<<
';

By that, I mean can you in an other way then ' or " break a string in php?

  • 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-07T05:23:39+00:00Added an answer on June 7, 2026 at 5:23 am

    Usual I use var_export, just an exaple:

    file_put_contents("temp.php",'<?php'. var_export($_POST,true));
    

    when I need the array:

    $a = include "temp.php";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some integers, let's say one two and three . I wish to
Let's say I have an existing application written in Java which I wish to
I have set of components that i wish to let the users download from
I wish to write JSP which generates XML file, which has syntax, similiar to
I use Flex 4 wish I can let users drag/drop photos from their computer
Possible Duplicate: How to serialize an IList<T>? I wish to serialize an class (let's
I wish to make the uploaded file contents only viewable on the browser i.e
I wish fetch data in a XML file, where Tag is a variable.. My
I wish to add the mouseover events to a panel which contains more than
I wish HTML could do something semantically equivalent to this; <dl class=main-list> <definitionitem> <dt>Some

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.