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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:37:28+00:00 2026-05-23T04:37:28+00:00

$submit=$_POST[‘submit’]; $fullname=$_POST[‘fullname’]; $phone=preg_replace(‘/[^0-9]/’, ”, $_POST[‘phone’]); $phone = (int) $phone; $adress=$_POST[‘city’] . ‘ ‘ .

  • 0
$submit=$_POST['submit'];
$fullname=$_POST['fullname'];
$phone=preg_replace('/[^0-9]/', '', $_POST['phone']);
$phone =  (int) $phone;
$adress=$_POST['city']  . ' ' .  $_POST['district'] . ' ' . $_POST['adress'];
$friends=$_POST['friends'];
$school=$_POST['school'];
$info=$_POST['info'];
$dob = $_POST['year']."-". $_POST['month']."-".$_POST['day'];

Recently i added to my page:

foreach ($_POST as $key => $value) { 
$_POST[$key] = mysql_real_escape_string($value);
}   

i want to sanitize all $_POST’s (http://prntscr.com/22uot) ID 20 before adding mysql_real_escape_string() to my page, id 22 after. My page puts all variables to db table’s fields but when I want to add mysql_real_escape_string() to variable it puts nothing into the field. I dunno what to do.

  • 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-23T04:37:29+00:00Added an answer on May 23, 2026 at 4:37 am

    As clearly indicated in the manual (which is the first things you should browse, when in doubt):

    A MySQL connection is required before
    using mysql_real_escape_string()
    otherwise an error of level E_WARNING
    is generated, and FALSE is returned.
    If link_identifier isn’t defined, the
    last MySQL connection is used.

    Be sure you’ve connect to your database before using this function.

    $link = mysql_connect($dbhost,$dbuser,$dbpass);
    mysql_select_db($dbname);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

elseif(isset($_POST['submit'])) { // Look for their user $lookuser = mysql_query(SELECT * FROM `users` WHERE
I have come across scripts that use: isset($_POST['submit']) as well as code that uses:
I am trying to understand the difference between this: if (isset($_POST['Submit'])) { //do something
If the user manually clicks the 'submit' button, i use this code: if (isset($_POST['submit_findall']))
I am getting this error here is my code if(isset($_POST['submit'])) { $projTit=mysql_escape_string($_POST['projecttitle']); $projCat=mysql_escape_string($_POST['projectcategory']); $budget=intval(mysql_escape_string($_POST['budget']));
This $_POST['submit'] is driving me crazy. I don't see any reason why its value
I have: if(isset($_POST['submit'])) { if (empty($name)) { echo'<span class=error>ERROR: Missing Name </span><br/>'; } else
<?php $submitted = $_POST['submit']; $post-title= $_POST['post_title']; $post-content= $_POST['post_content']; $new_post = array( 'post_title' => '$post-title',
Here is my script.: <html> <body> <?php if(isset($_POST['submit'])) { echo $_FILES['upload']['tmp_name']/['name']/['error']/['type']; // i.e. echoing
if(isset($_POST['submit'])) { if(!isset($_POST['userName'])) { $username = 'Anonymous'; } else $username = $_POST['userName']; } I

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.