Note that there are some explanatory texts on larger screens.

plurals
  1. POScript catching image
    primarykey
    data
    text
    <p>I have this script,so it goes to ../AdsCreate/CreateCar.php reads the form and inserts into databse and loads page into a certain div which all works fine.</p> <p>I have one problem one part of the form is to upload an image,now that it does not do I have been told it's because that script below serialize the data and does not do that for file based.</p> <p>Here is the script.</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(document).ready(function($) { $("#Submit").click(function() { var url = "../AdsCreate/CreateCar.php"; // the script where you handle the form input. $.ajax({ type: "POST", url: url, data: $("#myForm").serialize(), // serializes the form's elements. success: function(html){ $("#right").html(html); } }); return false; // avoid to execute the actual submit of the form. }); }); &lt;/script&gt; </code></pre> <p>Here is my form</p> <pre><code>&lt;form method="post" enctype="multipart/form-data" id="myForm"&gt; &lt;table class="default1" style="width: 100%" align="center"&gt; &lt;tr&gt; &lt;td class="content1" colspan="3"&gt;&lt;h3&gt;&lt;b&gt;Car Ads&lt;/b&gt;&lt;/h3&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="content1" width="70%"&gt;Make: &lt;input type="text" name="name"&gt;&lt;/td&gt; &lt;td class="content1" width="15%"&gt;Model: &lt;input type="text" name = "email"&gt;&lt;/td&gt; &lt;td class="content1" width="15%"&gt;Year: &lt;input type="text" name = "phone"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="content1" colspan="3"&gt;Main Photo: &lt;input type="file" name="photo"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="content1" colspan="3"&gt;&lt;input type="submit" value="Upload" id="Submit"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>How can I change the script so I can upload a form that also has a file upload??</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload