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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:06:28+00:00 2026-06-07T23:06:28+00:00

I am having an issue with special characters with a web script that I

  • 0

I am having an issue with special characters with a web script that I have that executes a command to send a username to my game server to reward them for voting.

<form action="index.php" method="GET">
<input type="submit" value="Submit" />
</form>

It submits to the database with the correct information special characters and all – but when executed to my gameserver it negates the special characters and they can abuse it by using the name Testusername/ or Testusername// and receive multiple rewards daily.

I have tried using hidden types but my system cannot work with POST.

Any ideas? I’m helpless.

EDIT *

Any 0-9 _ a-z characters are allowed special characters being !@#$%^&*()_+[}{} etc. I am using escape strings and I am not worried about sql injection I tried multiple ways of sanitizing and they all failed. I am using mySQL but not for the sending of the reward it is there as a log and to verify users that haven’t voted in the last 24 hours and prevent them from doing it again. Basically putting it plain they vote with the username Test and get their reward and vote with the username Test/ and it says Test voted again ingame and the receive x2 the rewards

  • 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-07T23:06:30+00:00Added an answer on June 7, 2026 at 11:06 pm

    Simple preg_replace should do it:

    $username = preg_replace('#[^a-z0-9_]#', '', $username);
    

    This strips everything but:

    • Lowercase alpha characters
    • Digits 0 through 9
    • underscore

    If uppercase is OK, then add A-Z to the regex, or perhaps strtolower() the input beforehand. Do this before you save the input or send it to the other server.

    I’m a little unsure of your exact dilemma with the game server, but ideally, you should get a response from the other server to see what username was actually entered before you save it, and you wouldn’t have to filter it at all because you would have the filtered value from the other server.

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

Sidebar

Related Questions

Having an issue here that I have tried everything I can think of but
I am having a certian issue with special characters in my XML. Bascially I
I am having an issue with inserting words with special characters into my database.
I am having some issues with special characters in Crystal Reports. I have some
I am having an issue that is really killing me. I have a directory
My <meta charset=utf-8> and I'm having special charcter problem html content on web server
I having issue that content assistant / intellisense is working in methods such as
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Just started mongo and started having issue with querying already. i have a collection
I'm having a minor css issue. I have a series of layered divs and

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.