rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 wow, thankyou, that's alot, hate to ask more!, but if it's ok could you tweak the code because the original code i posted doesn't work, could you quickly run over it? Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2007 Share Posted August 24, 2007 We are not here to write code for you. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 .. im asking for you to run over the original code and check where the error is it displays no error although it doesn't work. Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2007 Share Posted August 24, 2007 What efforts have you yourself actually made? Zero. You didn't even write the code. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 Wow i saw php help forum and thought... but i guess i'm mistaken, ok i have made effort lookin g through the code Quote Link to comment Share on other sites More sharing options...
trq Posted August 24, 2007 Share Posted August 24, 2007 So what exactly is the problem then? Elaberate on not working. Quote Link to comment Share on other sites More sharing options...
Barand Posted August 24, 2007 Share Posted August 24, 2007 See http://www.phpfreaks.com/forums/index.php/topic,156548.msg680442.html#msg680442 For someone needing so many posts to solve their problem you seem very quick to criticise others Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 When i select the file then upload it, it doesn't do anything apart from load for say 40 seconds, then it says it uploaded, but it doesn't upload it, the file is set in a subdir called jsellenraad, and the file to be uploaded is supposed to go to /jsellenraad/images Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 24, 2007 Share Posted August 24, 2007 Heres What you Need, Study this and then come back for the rest... http://w3schools.com/php/php_file_upload.asp http://www.php-mysql-tutorial.com/php-mysql-upload.php (RECOMMENDED FOR YOU) http://www.tizag.com/phpT/fileupload.php Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 ..will do. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 What I have so far <?php <?php /** * @Courtesy of php-mysql-tutorial.com * @copyright 2007 */ include config.php if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $query = "INSERT INTO upload (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); echo "<br>File $fileName uploaded<br>"; } ?> <form method="post" enctype="multipart/form-data"> <table width="350" border="0" cellpadding="1" cellspacing="1" class="box"> <tr> <td width="246"> <input type="hidden" name="MAX_FILE_SIZE" value="9999999999"> <input name="userfile" type="file" id="userfile"> </td> <td width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td> </tr> </table> </form> is this ok? Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 Nearly solved, .. Parse error: parse error, unexpected T_IF in /home/frand2/public_html/jsellenraad/upload.php on line 11 file i just posted Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 sorry didnt include first part this is from 1 to like 21: <center>Welcome back, Johan, to upload a new painting, press 'Browse...', then navigate to the picture file you wish to add, then click 'Open/OK/Accept' on the navigational window, then press 'Submit Query'.</center> <?php /** * @Courtesy of php-mysql-tutorial.com * @copyright 2007 */ include config.php if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0) // LINE 11 ERROR { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 ... help? Quote Link to comment Share on other sites More sharing options...
trq Posted August 25, 2007 Share Posted August 25, 2007 include config.php should be... include 'config.php'; Quote Link to comment Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.