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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:33:31+00:00 2026-05-26T15:33:31+00:00

Hey guy’s i’m making a website which involves submiting an ad for a gameserver.

  • 0

Hey guy’s i’m making a website which involves submiting an ad for a gameserver. I’m wondering if it is possible to strip PHP related tags from the content of the textbox? As if I leave it how it is now, It may become a security risk later on. Currently the only thing I am doing to the content is nl2br(). What is the best way to do this?

Thanks.

  • 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-26T15:33:32+00:00Added an answer on May 26, 2026 at 3:33 pm
    1. Why do you care about php code in textbox, can it be executed in any way?
    2. I suppose that you want to leave html tags but remove just php code (in other case you could just use strip_tags function or htmlspecialchars).

    So, the solution:

    <?php
    //here is content from the textarea (filled it for example)
    $content = 'some <?php echo "test"; ?> <?=test?> content <br/> here';
    
    $content = preg_replace('/<\?((?!\?>).)*\?>/s', '', $content); //strip all the php code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guy's I add made a PHP server status script for my website and
Possible Duplicate: upload files via iPad Hey guy's I'm trying to create a native
Hey guy's im making a 2D java game and i want to learn how
Hey guy's i'm making a Paddle/Pong game and right now i'm trying to find
Hey I am very new to Web Programming. I have been learning PHP from
Hey guys. I've just published my first Android application to show this guy who
Hey, I've developed an application with french and english translation. A guy sent me
Hey all, I'm reviewing the IntelliJ ability related to JPA ER Diagrams (http://www.jetbrains.com/idea/features/jpa_hibernate.html), and
Hey everyone, a new guy here in C#.Net. I'm trying to make an application
Possible Duplicate: How to create a custom sapi voice for tts Hey Guys here's

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.