Jump to content

gw1500se

Members
  • Posts

    1,033
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by gw1500se

  1. Yes, for Linux use cron and for Windows use task scheduler.
  2. Did you look at the httpd error log?
  3. That means there is something in the array. See what it there with this: echo "<pre>"; print_r($_FILES['userfile']); echo "</pre>";
  4. My bad. The first error is a warning/notice. You did not specify the Content-type correctly but it assumed the correct value. As for the 2nd error it looks like you are running PHP version 5.1 or earlier. Version 5.2 or better has json built in. Your version does not and you will need to install php-pecl-json.
  5. The 2nd error is because the first failed. You don't show what '$context' contains but I'm guessing you only need 1 parameter, the file path.
  6. if (is_array($_FILES['userfile'])) { foreach($_FILES['userfile']['name'] as $name) { $type = pathinfo($name, PATHINFO_EXTENSION); if(!in_array($type, $allowed)) die("Error: Only jpg, jpeg, gif and png files are allowed.-".$type); } } }
  7. I mean do the other $msg errors work?
  8. A good IDE will help you with your indents which are still messed up making it difficult to read. I don't see where you initialize '$msg' to an empty string and I am not sure what happens when you concatenate to a variable that does not yet exist. Poor programming practice even if that works. Do the other errors show up?
  9. It looks like you are missing one 'if' and have an extra 'else'. Where are you checking the file type? You need to practice good programming practice by properly indenting your code. if (move_uploaded_file($_FILES['userfile']['tmp_name'][$ct], $uploadfile)) { if ($mail->addAttachment($uploadfile, $filename)) { /* You need to check for the desired file types here berfore you add it to the attach array */ $attachmentNames[] = $_FILES['userfile']['name'][$ct]; } else { $msg .= 'Failed to attach file ' . $_FILES['userfile']['name'][$ct]; } } else { $msg .= 'Failed to move file to ' . $uploadfile; } /* Where is the if for the next else, which doesn't belong here anyway? */
  10. ??? You do it with PHP. Check the file type and if is it unacceptable do not attach it.
  11. Use explode with '.' on the file path, then look at the last array element and that is the file type.
  12. First please use the code icon (<>) for your code and specify PHP and HTML as appropriate. What you omitted from your post is what error are you getting or what are you getting that is different from what you expect?
  13. You don't show any code or error. Is the slash stored in the database as the string '&#047' or as '/'? If you are using regex as the search string you need to escape the slash (i.e. \/).
  14. You needed to escape the " as I said in my correction.
  15. Correction: Add \ in front of the " that do not start or end the echo.
  16. Your 'if' makes no sense. 'if' is a PHP statement yet you are starting PHP after the if. Also you are testing the result of 'echo' not the value of $chk. I am guessing but I think you want: <?php if ($chk == 0) { ?> . . . <?php } else { ?> . . . <?php } ?> That having been said, it is a poor way to program. You should do something more like: <?php if ($chk} == 0) { echo " <div class="container"> <div class="row" style="color:red"> <br><br><br><br><br><br> <center>Database Update Failed</center> </div> </div>" } else { echo " <div class="container"> <div class="row"> <br><br><br><br><br><br> <center>Database Updated</center> </div> </div>" } ?>
  17. It should be /etc/php.ini. You will need root privileges to edit it.
  18. No, as far as I know they are system wide and need to be enabled in php.ini. Enabling extensions will have minimal effect as opposed to actually using them in a script.
  19. The keys are the items within the []
  20. Assuming your swap space is sufficient, I guess you are stuck with trying to reinstall PHP and maybe Apache.
  21. Its possible but you might try going to 512K on your memory first. Magento is a separate thing so it would not effect PHP max memory. It would only effect total memory and I assume you have at least 8G. How big is your swap? Although I doubt that would cause a memory fault.
  22. Fault 11 is memory. You probably need to change memory_limit in your php.ini. I think it is 128M by default so you might try 256M.
  23. oci_fetch_assoc returns an array of all the rows returned by the query. Call it once then put $value in a 'for' loop to process each row. $rows=oci_fetch_assoc($stid); foreach ($rows as $row) { . . . }
×
×
  • 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.