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? Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333538 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. Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333549 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. Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333553 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. Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333555 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 Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333558 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. Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333560 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 Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333562 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 Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333565 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 Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333568 Share on other sites More sharing options...
rofl90 Posted August 24, 2007 Author Share Posted August 24, 2007 ..will do. Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333572 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? Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333588 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 Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333611 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); Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333613 Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 ... help? Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333659 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'; Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333663 Share on other sites More sharing options...
rofl90 Posted August 25, 2007 Author Share Posted August 25, 2007 Thanks Link to comment https://forums.phpfreaks.com/topic/66440-hi-a-bit-of-php-help-needed/page/2/#findComment-333665 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.