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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:12:34+00:00 2026-06-17T07:12:34+00:00

I think, I am missing some vulnerabilities in my code. Light me, I’ve just

  • 0

I think, I am missing some vulnerabilities in my code.
Light me, I’ve just converted my script in PDO and this is for safe and not only!

<?PHP
require_once("./include/membersite_config.php");

if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("login.php");
exit;
}

?>
<?php $utilizator = $fgmembersite->UserFullName() ?>

<?php require ("../SQL.php");

### De aici am setat creearea directoarelor pentru poze ###
$model         = mysql_real_escape_string("$_POST[model]");
$marca         = mysql_real_escape_string("$_POST[marca]");

 mkdir ("\\server\\htdocs\\panou\\poze\\{$marca}/{$model}", 0777, true);
$director_poza = ("poze/{$marca}/{$model}/");    
$numetmp_poza  = $_FILES['numepoza1']['name'];
$numepoza1     = $director_poza.$numetmp_poza;
$numetmp_poza  = $_FILES['numepoza2']['name'];
$numepoza2     = $director_poza.$numetmp_poza;
$numetmp_poza  = $_FILES['numepoza3']['name'];
$numepoza3     = $director_poza.$numetmp_poza;
if(move_uploaded_file($_FILES['numepoza1']['tmp_name'], $numepoza1))
if(move_uploaded_file($_FILES['numepoza2']['tmp_name'], $numepoza2))
if(move_uploaded_file($_FILES['numepoza3']['tmp_name'], $numepoza3))
{
list($width,$height,$type,$attr)= getimagesize($numepoza1);
switch($type)
{
case 1:
$ext = ".gif"; break;
case 2:
$ext = ".jpg"; break;
case 3:
$ext = ".png"; break;
default:
echo "Format foto neacceptat";
} }### Gata creeare director si upload poze ###

$insertie = "INSERT INTO modele 
(id, marca, model, utilizator, despre, data, data_luna, data_zi, img1, img2, img3, doi_g, trei_g, patru_g, info_ecran, rezolutie_ecran, multitouch_ecran, protectie_ecran, sunet_sonerii, sunet_mainilibere, sunet_mufa_jack, memorie_card, mcard_tip,   mcard_capacitate,intern_memorie, date_gprs, date_edge, date_viteze, date_wifi, date_bt,   date_nfc, date_usb, camera_spate, camera_fata, camera_tehnologii, camera_video,   performanta_os,performanta_chipset, performanta_cpu, performanta_cpu_core, performanta_cpu_tip, performanta_rami, performanta_gpu, performanta_senzori, performanta_gps, performanta_java, altele_radio, altele_mesajerie, altele_filme,  baterie_autonomie, baterie_mAh, baterie_convorbire, SEO_cuvinte_cheie)
  VALUES
  ('',        '$_POST[marca]','$_POST[model]','$utilizator','$_POST[despre]','$_POST[data]','$_POST[data_luna]','$_POST[data_zi]',
'$numepoza1','$numepoza2','$numepoza3','$_POST[doi_g]',
'$_POST[trei_g]',
'$_POST[patru_g]',
'$_POST[info_ecran]',
'$_POST[rezolutie_ecran]',
'$_POST[multitouch_ecran]',
'$_POST[protectie_ecran]',
'$_POST[sunet_sonerii]',
'$_POST[sunet_mainilibere]',
'$_POST[sunet_mufa_jack]',
'$_POST[memorie_card]',
'$_POST[mcard_tip]',
'$_POST[mcard_capacitate]',
'$_POST[intern_memorie]',
'$_POST[date_gprs]',
'$_POST[date_edge]',
'$_POST[date_viteze]',
'$_POST[date_wifi]',
'$_POST[d ate_bt]',
'$_POST[date_nfc]',
'$_POST[date_usb]',
'$_POST[camera_spate]',
'$_POST[camera_fata]',
'$_POST[camera_tehnologii]',
'$_POST[camera_video]',
'$_POST[performanta_os]',
'$_POST[performanta_chipset]',
'$_POST[performanta_cpu]',
'$_POST[pe rformanta_cpu_core]',
'$_POST[performanta_cpu_tip]',
'$_POST[performanta_rami]',
'$_POST[perfo rmanta_gpu]',
'$_POST[performanta_senzori]',
'$_POST[performanta_gps]',
'$_POST[performanta_java]',
'$_POST[altele_radio]',
'$_POST[altele_mesajerie]',
'$_POST[altele_filme]',
'$_POST[baterie_autonomie]',
'$_POST[baterie_mAh]',
'$_POST[baterie_convorbire]',
'$_POST[SEO_cuvinte_cheie]')"; 

if ($dbh->query($insertie)) 
{
print '<center><h1>Telefonul/Tableta a fost publicat(a) cu succes!</h1><br />
Vei fi redirectionat in cateva momente inspre adaugarea unui nou model de tableta sau         telefon!</center>
  <meta http-equiv="refresh" content="5; URL=adauga-tableta-tel.php"/>'; 
}
 else(mysql_error())     
?>

Please come with some help not links to read about.

  • 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-17T07:12:35+00:00Added an answer on June 17, 2026 at 7:12 am

    Well, you should be using pdo’s prepare statements

    http://php.net/manual/en/pdo.prepare.php

    I’m not gonna rewrite all that code for you, but thats a good place to start.

    As far as saftey goes, IIRC, pdo only allows you to execute one query at a time, so sql injection is a bit harder. But i would still go with preparing because you are pulling all that data out of the post

    for example, from the url above

    /* Execute a prepared statement by passing an array of values */
    $sth = $dbh->prepare('SELECT name, color, calories
        FROM fruit
        WHERE calories < ? AND color = ?');
    $sth->execute(array(150, 'red'));
    $red = $sth->fetchAll();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think that Im missing some pieces for this. Im somewhat new to JavaScript
I googled for this for quite awhile. I think I am missing some big
I think I'm missing some fundamentals here so hopefully this post can clarify this.
I've noticed this a few times and I'm starting to think I'm missing some
I am fairly new at EC2 technology so I think I am missing some
I think I'm missing something really obvious here... must be... but for some reason
I think I am missing smth back in my theoretical background on this thing.
I think I'm missing some classes in my library. If I type in 'import
I've a straight forward question, I think I'm missing some point. My test app
I think I'm missing some fundamentals on how MVC forms work. I have a

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.