Jump to content

lindylex

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lindylex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I solved it. Within my php.ini file arouund line 661 uncomment this extension=php_gd2.dll
  2. What module(s) do I need to install to get the image to work? http://www.white-hat-web-design.co.uk/articles/php-captcha.php This is what my W.A.M.P. i nstall looks like http://mo-de.net/d/php_info/
  3. unsider, thanks for the speedy reply and yes I am looking for Captcha. Thanks, Lex
  4. I need to implement a graphic string that a user must enter to send the contents of a form. I have 3 questions. 1. What is this validation called? 2. Ho can I do this with PHP? 3. Can you point me to a location where this technique is explained?
  5. MadTechie, thanks for this solution. I was trying to use that class DirectoryIterator built for PHP 5. I will experiment later and share my discoveries. Thanks, Lex
  6. Rohan Shenoy, have ever tried to point "rmdir("path/to/a/nonemptydriectory")". If you try it you will notice that you have to remove all the files within it first. Lex
  7. This is a simple delete all files in a directory and then delete the directory but it does not work. Does any one have an idea? function del_this_directory ($directory_to_del){ foreach (new DirectoryIterator ($directory_to_del) as $file){ if (!is_dir ($file)){ unlink ($file ->getPathname ()); } } //This will remove the directory rmdir($directory_to_del); } del_this_directory ("../del/"); This will delete the directory if I do this without obviously no file(s) within the directory. function del_this_directory ($directory_to_del){ /* foreach (new DirectoryIterator ($directory_to_del) as $file){ if (!is_dir ($file)){ unlink ($file ->getPathname ()); } } */ //This will remove the directory rmdir($directory_to_del); } del_this_directory ("../del/"); I think something here "foreach (new DirectoryIterator ($directory_to_del) as $file){" is keeping the directory open. An not letting me delete the empty directory. Just to let you know the permission for this directory is 0777 so that's not the problem. Thanks
  8. [sOLVED SOLUTION] Edit the PHP configuration file it should be "php.ini". Find the following line. ; Maximum size of POST data that PHP will accept. post_max_size = 8M Chang it to an acceptable size that should match the max upload worst case scenario. post_max_size = 20M Yore done only 4 days later. Also get XDEBUG http://www.xdebug.org/docs/install This will help you debig your work much better that what php has built in, check Appache logs also. Thanks, All.
  9. Xeoncross, I installed php_xdebug and it is way better for debugging, thanks so much. Look what I found as the error. ( ! ) Warning: POST Content-Length of 8604201 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 I guess I need to fix this in a config file. Where and what do I edit to do this? Get php_xdebug from http://www.xdebug.org/docs/install Thanks, Xeoncross
  10. Sometimes it works 1/30 + tries. array(1) { ["uploadedfile"]=> array(5) { ["name"]=> array(3) { [0]=> string(12) "DSC_0500.JPG" [1]=> string(12) "DSC_0624.JPG" [2]=> string(12) "DSC_0500.JPG" } ["type"]=> array(3) { [0]=> string(10) "image/jpeg" [1]=> string(10) "image/jpeg" [2]=> string(10) "image/jpeg" } ["tmp_name"]=> array(3) { [0]=> string(80) "C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\phpD3.tmp" [1]=> string(80) "C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\phpD4.tmp" [2]=> string(80) "C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\phpD5.tmp" } ["error"]=> array(3) { [0]=> int(0) [1]=> int(0) [2]=> int(0) } ["size"]=> array(3) { [0]=> int(2376919) [1]=> int(3448569) [2]=> int(2376919) } } }
  11. This is what I get as an output when I upload two files. var_dump($_FILES, $_POST); Everything uploads fine. array(1) { ["uploadedfile"]=> array(5) { ["name"]=> array(3) { [0]=> string(12) "DSC_0500.JPG" [1]=> string(0) "" [2]=> string(12) "DSC_0624.JPG" } ["type"]=> array(3) { [0]=> string(10) "image/jpeg" [1]=> string(0) "" [2]=> string(10) "image/jpeg" } ["tmp_name"]=> array(3) { [0]=> string(80) "C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\php8A.tmp" [1]=> string(0) "" [2]=> string(80) "C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\php8C.tmp" } ["error"]=> array(3) { [0]=> int(0) [1]=> int(4) [2]=> int(0) } ["size"]=> array(3) { [0]=> int(2376919) [1]=> int(0) [2]=> int(3448569) } } } array(6) { ["preview_themes"]=> string(3) "dsl" ["create_this_folder"]=> string(0) "" ["MAX_FILE_SIZE"]=> string( "10240000" ["experation0"]=> string(9) "One Month" ["experation1"]=> string(9) "One Month" ["experation2"]=> string(9) "One Month" } ---------------------------------------------------- 0 << the length of form field create_this_folder lllloookkk C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\php8A.tmp << temp name DSC_0500.JPG << original name image/jpeg << type 2376919 << size << temp name << original name << type 0 << size C:\Documents and Settings\Administrator\Local Settings\Temp\PHP\upload\php8C.tmp << temp name DSC_0624.JPG << original name image/jpeg << type 3448569 << size When I upload three files this is when it breaks. array(0) { } array(0) { } ---------------------------------------------------- Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 12 Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 21 Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 22 0 << the length of form field create_this_folder lllloookkk Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 27 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 28 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 29 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 30 << size Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 27 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 28 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 29 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 30 << size Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 27 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 28 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 29 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 30 << size Does anyone have ideas?
  12. uniflare, The "$_POST["create_this_folder"] - it is saying this POSTED variable does not exist." it does exist. It contains a value. Ii works when I have two files selected but not three. "$_FILES ['uploadedfile'] does not exist." this also exists but then dies when I try to upload three files. uniflare, thanks for the help so far. This the html form code. <html> <?php function display_themes_in_drop_down($path ){ //Strip The Underscore Out $things_to_replace="/_/"; $replace_with=' '; // Open the folder $dir_handle = opendir($path) or die("Unable to open $path"); // Loop through the files while ($file = readdir($dir_handle)) { if ($file !='..' && $file !='.'){ //echo "$file<br>"; $file= preg_replace ($things_to_replace, $replace_with ,$file); echo '<option>'.$file.'</option>'; } } // Close closedir($dir_handle); } ?> <HEAD> <SCRIPT language="JavaScript" SRC="../js/form_validation.js"></SCRIPT> </HEAD> <title>:::Upload Your Image:::</title> <body> <!--<form enctype="multipart/form-data" name="stuff_to_upload" action="" onsubmit="return check_if_theme_exist (this);" method="post">--> <form enctype="multipart/form-data" name="stuff_to_upload" action="create_del_folders.php" onsubmit="return check_if_theme_exist (this);" method="post"> <!--<form name="stuff_to_upload" onsubmit="return check_if_theme_exist (this);" method="post">--> Choose a topic to upload to Or Create a topic to upload to<br> <br> <select name="preview_themes" onChange = "limit_one_theme_only(this)"> <option>Choose a theme</option> <?php display_themes_in_drop_down ("../photos");?> </select> <input type="text" size = "20" name="create_this_folder" onKeyPress = "limit_one_theme_only_1(this)"/> <br><br> <input type="hidden" name="MAX_FILE_SIZE" value="9000000" /> Choose files to upload: <br><br> <input type="hidden" name="MAX_FILE_SIZE" value="10240000" /> Downloadable<input type="checkbox" name="dl0"> <select name="experation0"> <!--<option>-------------------</option>--> <option>One Month</option> <option>Two Months</option> <option>Forever</option> </select> <input name="uploadedfile[]" type="file" /> <!-- Signature Photo<input type="checkbox" name="signature0" value="true"> --> Color <input type="radio" name="borc0" value="c" > B/W <input type="radio" name="borc0" value="b"> <br> Downloadable<input type="checkbox" name="dl1"> <select name="experation1"> <!--<option>-------------------</option>--> <option>One Month</option> <option>Two Months</option> <option>Never</option> </select> <input name="uploadedfile[]" type="file" /> <!-- Signature Photo<input type="checkbox" name="signature1" value="true"> --> Color <input type="radio" name="borc1" value="c" > B/W <input type="radio" name="borc1" value="b"> <br> Downloadable<input type="checkbox" name="dl2"> <select name="experation2"> <!--<option>-------------------</option>--> <option>One Month</option> <option>Two Months</option> <option>Never</option> </select> <input name="uploadedfile[]" type="file"/> <!-- Signature Photo<input type="checkbox" name="signature2" value="true"> --> Color <input type="radio" name="borc2" value="c" > B/W <input type="radio" name="borc2" value="b"> <br><br> <input type = "submit" value="Upload File"/> </form> </body> </html>
  13. I keep getting this error "Notice: Undefined index: ". I am trying to do something very simple. Take some files submitted from a form for upload and save them to a certain theme directory. <?php $things_to_replace="/\s/"; $replace_with='_'; $path_of_folder=preg_replace ($things_to_replace, $replace_with ,$_POST["create_this_folder"]); //Cleanup work because of IE 6 if (strlen($path_of_folder)!=0){ if ($path_of_folder[0]=='_'){ $path_of_folder=substr ($path_of_folder,1); } } if (strlen($_POST["create_this_folder"]) == 0){ echo strlen($_POST["create_this_folder"])." << the length of form field create_this_folder <br>"; echo "lllloookkk <br>"; for ($i=0; $i<3; $i++){ echo $_FILES ['uploadedfile']['tmp_name'][$i]." << temp name <br>"; echo $_FILES ['uploadedfile']['name'][$i]." << original name <br>"; echo $_FILES ['uploadedfile']['type'][$i]." << type <br>"; echo $_FILES ['uploadedfile']['size'][$i]." << size<br>"; } } ?> This is the error I receive when I submit all three at once. If I do two or less everything is fine, three kills it. I have no idea. Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 6 Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 15 Notice: Undefined index: create_this_folder in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 16 0 << the length of form field create_this_folder lllloookkk Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 21 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 22 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 23 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 24 << size Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 21 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 22 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 23 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 24 << size Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 21 << temp name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 22 << original name Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 23 << type Notice: Undefined index: uploadedfile in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\php_study\manipulate_image\php_code\create_del_folders.php on line 24 << size Thanks, Lindylex
  14. "lindylex, are you not familiar with the AUTO_INCREMENT property in MySQL?" rhodesa, now I am thanks. Thanks, craygo, Ken2k7 and rhodesa
  15. rhodesa, When some remove the image from the table how does the datase handle the next file? I assume the id is a sequence of numbers like id 0 = 1st image id 1 = 2 nd image when you delete id 0, 1st image, then what will be the id of the next photo uploaded? Thanks, for the quick reply? Lex
×
×
  • 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.