title: File Path Back Slashes
body: <p>I have put together a fairly basic local database driven website using PHP, Appache, and PHPMyAdmin. The site allows users to upload cad detail files in two formats. Along with the file paths, they can also upload the name of the file, the related service group, as well as the detail ID.</p>
  
  <p>Basically everything is working smoothly except for a small issue when uploading a file from the upload page. Everything submits to the database just fine but the links to the files are missing the necessary backslashes.</p>
  
  <p>I can however go into the database itself and enter the backslashes into the file path.</p>
  
  <p><strong>Form:</strong></p>
  
  <pre><code>&lt;form method="post" action="add.php"&gt;
   &lt;table border="0"&gt;
  
  
   &lt;tr&gt;&lt;td&gt;Detail ID: &lt;/td&gt;&lt;td&gt;&lt;input type="number" name="id" /&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;tr&gt;&lt;td&gt;Detail Name: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="name" /&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;tr&gt;&lt;td&gt;Service Group: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="service" /&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;tr&gt;&lt;td&gt;PDF: &lt;/td&gt;&lt;td&gt;&lt;input type="file" name="pdf" enctype="multipart/form-data"/&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;tr&gt;&lt;td&gt;DWG: &lt;/td&gt;&lt;td&gt;&lt;input type="file" name="dwg"/&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" value="Submit" /&gt;
      &lt;input type="reset" value="Reset" /&gt;&lt;/td&gt;&lt;/tr&gt;
  
   &lt;/table&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP:</strong>
      
  
  <pre><code>$con=mysql_connect("localhost","root","");
   /* Select the database */
   mysql_select_db("hrg_test");
  
   /* Store the values submitted by form in variable */
   $id=$_POST['id'];
   $name=$_POST['name'];
   $service=$_POST['service'];
   $pdf=$_POST['pdf'];
   $dwg=$_POST['dwg'];
  
  
   /* Write a query to insert details into database */
   $insert_detail=mysql_query("INSERT INTO hrg_test (id, name, service, pdf, dwg) VALUES ('$id',      '$name',     '$service',     '$pdf',     '$dwg')");
  
   if($insert_detail)
   { echo "Detail Succesfully Added! &lt;br /&gt;&lt;br /&gt;&lt;a href='add.html'&gt;Add Another Detail&lt;/a&gt;"; }
   else
   { echo "Error".mysql_error(); }
  
   /* closing the if else statements */
  
   mysql_close($con);
   ?&gt;
  </code></pre>
  
  <p>I've read about the magic quotes and stripslashes, although i'm not sure how to tie them in if that's the issue. Maybe i am just going about it the wrong way. </p>
  
  <p>Any help would be greatly appreciated.</p>