I am currently working on a simple survey system for educational purposes. I know it is subject to SQL Injection, but I am new to PHP/MySQL and wanted to learn something basic so I have something to build upon later. Basically, I have an HTML form that processes the PHP on the same page: <form action="" method="post"> Please enter your first name: <input type="text" name="first_name" size="40" /><br /><br /> Please enter your last name: <input type="text" name="last_name" size="40" /><br /><br /> A number where you can be reached: <input type="text" name="phone" size="15" /><br /><br /> Was your technical issue resolved? …

Member Avatar
Member Avatar
+0 forum 11

I am new to PHP/MySQL and currently working on a project to learn it a little better. I have a bit of PHP code and it has a problem that I'm having a little trouble figuring out. Basically, it is taking session data and writing it to a MySQL database. Here is the entire code: <?php $con = mysql_connect("localhost","my_username","mypassword"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("myserver_imaging", $con); mysql_query ("INSERT INTO imaging (os,MAC,Model,AntiVirus,Browser,Email,Connectivity,Sound,Ports) VALUES ('".$_SESSION['imaging2']."','".$_SESSION['imaging3']."','".$_SESSION['imaging4']."','".$_SESSION['antivirus']."','".$_SESSION['browser']."','".$_SESSION['email']."','".$_SESSION['connectivity']."','".$_SESSION['sound']."','".$_SESSION['ports']."')"); OR die("Could not update: ".mysql_error()); mysql_close($con); ?> Now here's the problem. When I remove line 12 (the OR die statement), the data …

Member Avatar
Member Avatar
+0 forum 5

The End.