1

I am a newbie in web development. I working on a project where the site has a Career page where the details ie name, sex, etc with a resume has to be submitted.

I have implemented it using Ajax and Jquery, but the problem is I am not getting the file details in the PHP when the form is submitted.

Nitin Kabra
  • 3,146
  • 10
  • 43
  • 62
  • did you mean the complete $_POST is empty? – spotlr Sep 04 '11 at 14:18
  • 1
    I am getting a 404 error when browsing to your HTML page! Assuming the source isn't huge, you might just want to paste it into your question. – Kiley Naro Sep 04 '11 at 14:19
  • You will not be able to upload a file using jQuery's $.ajax() function this way. You can find external libraries to help you do this, either via the iFrame method or whatever other way.. The jQuery Form plugin have a nice implementation of what you seek: [http://jquery.malsup.com/form/](http://jquery.malsup.com/form/) – Bassem Sep 04 '11 at 14:29

3 Answers3

0

do you use <form action="upload_file.php" method="post" enctype="multipart/form-data">?

Start debugging by printing everyting with var_dump($_POST) or print_r($_POST)

Bokw
  • 789
  • 1
  • 9
  • 21
0

You said you're newbie, i will recommend you to learn any php framework such as Codeigniter for this stuff instead of messing up with your code CodeIgniter

You will end up saying that is PHP that easy?

Pawan Choudhary
  • 1,073
  • 1
  • 10
  • 20
0

add the action='formular.php' ... like

<form id="contactform" name="contactform" method="post" enctype="multipart/form-data" action="your_php_file.php>
spotlr
  • 319
  • 5
  • 15
  • its giving error even after adding it Notice: Undefined index: file_upload in D:\wamp\www\baldev\upload.php on line 9 – Nitin Kabra Sep 04 '11 at 14:28
  • Even if the enctype was set for the form $.ajax() will not allow him to upload the file! [Answer provided previously here](http://stackoverflow.com/questions/4545081/how-do-to-file-upload-using-jquery-serialization) – Bassem Sep 04 '11 at 14:32