Jump to content

mxcnlink

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

About mxcnlink

  • Birthday 05/12/1987

Contact Methods

  • MSN
    mxcnlink@hotmail.com

Profile Information

  • Gender
    Male
  • Location
    Chihuahua, México

mxcnlink's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I've been developing PHP websites for a bit more than 3 years now, since I first learned the basics. I'm glad I found this website/forum/community since I've realized it's full of resources, and people like me who enjoy PHP. I hope I can help around and contribute to the community, while getting help and feedback from you guys too! - Javier
  2. Hello, Are you sure you're using the right PHP version? Make sure it supports Objects, at least 5.0: In a clean *.php file type the following: <?php phpinfo(); ?> ...and take a look at the output checking for the PHP version.
  3. Thanks for the follow-up! I'm taking a look at your suggestions now. Regarding the "@" in the mysql statements: that's just because of a copy/paste from a production script, and for sampling the problem here... the script never does reach that far anyways, and I do have it without the "@" right now. I appreciate your help. I'll post again with my results.
  4. Hi everyone, I've been stuck with this problem for a while now, and I really can't figure out what's going on; the script is simple: get a file from the user through the web form, upload the file to whatever the tmp directory is, read the file, insert the contents into the database... Here is the script code [upload.php] <?php if(isset($_POST[go])) { if(!empty($_FILES['pdf_file']['name']) && $_FILES['pdf_file']['type'] == "application/pdf") { $file_name = $_FILES['pdf_file']['tmp_name']; $instr = fopen($file_name, "rb"); $file_image = mysql_real_escape_string(fread($instr,filesize($file_name))); $connect = @mysql_connect("localhost", "XlocalYuserZ", "UsersPassWord"); $select_db = @mysql_select_db("DbName", $connect); $query = mysql_query("INSERT INTO files_tbl (pdf_file) VALUES('" . $file_image ."')"); fclose($instr); } else { ?> <p>Not a valid file!</p> <?php } ?> <p>File uploaded correctly.</p> <?php } ?> <div style="width:735px"> <form method="post" action="upload.php" class="page_form" enctype="multipart/form-data"> <fieldset><legend>Upload file</legend> <table border="0" cellpadding="3" cellspacing="1" style="width:700px;"> <tr> <td class="left_middle"><label for="pdf_file">PDF File to upload:</label></td> <td class="right_middle"><input type="file" name="pdf_file" id="pdf_file" class="txt_common" /></td> </tr> <tr> <td colspan="2" class="right_middle"><input type="submit" name="submit" value="Upload to Database" class="button" /></td> </tr> </table> <input type="hidden" name="go" value="1" /> </fieldset> </form> </div> The code is pretty straight-forward, as you can see; it does not work however and I've been unable to find out why. It seems to upload some times, some others not, which is weird, but it might just be the server messing around with me... hehe... I have already granted 775 permissions on this PHP file. All the script does is hang forever, it happens with any web browser, no error messages, nothing... I hope some of you guys can give me a hand; I've been using Google in order to find related problems but it's not been enough... maybe apache permissions? .htaccess files? I truly don't know what to try. Regards, - Javier
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.