Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by davidannis

  1. Someplace in the code that is not shown it is inserting commas to separate thousands digits, I'm sure to make it easier for humans to read. I suspect it does it for the tax too but I can't tell without see the code in question. In any case, you'd need a very expensive cart to have taxes that high and a similar line to strip the commas would work. Barand is right - you should not store the values with the commas but we'd need to see all of the code to properly fix it.
  2. Try adding a line $total = str_replace(",","",$total); before the line $centinel_total = $total * 100;
  3. Looks to me like you carefully strip commas out of $totalex but then use $total without stripping out commas.
  4. You were right. I was not refreshing the sftp client, assuming incorrectly that it refreshed on a change in directories. In the script itself I was trapping the error on the resize incorrectly. I think I may have it now. You caught two errors. Now to fix the resize error. I'm feeling really stupid. Thanks for the help.
  5. The simple test script that I posted in its entirety does not work so there is nothing past the echo '<br>$result: '.$result; line. I have used sftp to look for the file. Can't display it. In the full script the resize throws an error because it is not there. I am pretty sure that It is not there.
  6. I have moved the upload directory out of public_html and I'm using fileinfo to revalidate mime type in addition to the gd getsimagesizes and the resize. I believe I can strip the EXIF data when I resize but I'll need to put some of it back because I don't want to remove copyright.
  7. Thank you for the response. When I try a simple script using file put contents: <?php $file2='/home/lineligh/public_html/Art3/artwork'.'/test1.txt'; $current = "Test\n"; file_put_contents($file2, $current); ?> I get a 5 byte file in the artwork directory as expected. The script I posted is a sample extracted from the whole in which I pulled the most bare bones pieces out to illustrate the problem and make sure that the problem wasn't occurring in some prior step. In the full script I validate the file and resize it using the gd imagescale, I move the file after the resize into a directory that has script execution disabled in htaccess but I'll also look at the link you provided to see if I can tighten it further. The actual script is also password protected (with a salted and hashed password) and only available to a limited number of users for whom I have real world identities. Each upload is logged with the user ID. Thanks, David
  8. I have a script that uploads files fine on my local server running MAMP but when I upload it I get no file upload. I have tried to simplify as much as possible to troubleshoot and came up with the following script: <?php ini_set('display_errors', 1); error_reporting(E_ALL); define('BASE_DIR', '/home/lineligh/public_html/Art3/'); define('IMG_UPLOAD_DIR',BASE_DIR.'artwork/'); $id='4'; print_r($_FILES); if (isset($_FILES['picture']['name'])) { //check size if ($_FILES['picture']['size'] > 900000) { $uploaderr = true; $uploaderrmsg.='File must be less than 900,000 bytes<br />'; } //check type if ($_FILES['picture']['type'] != "image/jpeg" && $_FILES['picture']['type'] != "image/png") { $uploaderr = true; $uploaderrmsg.='File must be a jpeg or png<br />'; } $uploaddir = IMG_UPLOAD_DIR; $uploadfile = $uploaddir . $id . '.' . end((explode(".", $_FILES["picture"]["name"]))); $result = move_uploaded_file($_FILES['picture']['tmp_name'], $uploadfile); echo '<br>'.$_FILES['picture']['tmp_name']."</br>"; echo $uploadfile; echo '<br>$result: '.$result; } ?> Which produces the following output: Array ( [picture] => Array ( [name] => Olivia-IMG_8678.jpg [type] => image/jpeg [tmp_name] => /tmp/phpe5Vpyq [error] => 0 [size] => 192649 ) ) /tmp/phpe5Vpyq /home/lineligh/public_html/Art3/artwork/4.jpg $result: 1 So, the file gets to the server, the move_uploaded_file function claims that it successfully renames the file and puts it in /home/lineligh/public_html/Art3/artwork/ but if I look for the file it is not there. I'm stumped as to what else to check. Webhosting company swears that my permissions are correct.
  9. The header was sent because of a blank line at the end of an included php file and because of the warning messages. Once I got rid of both the blank line and the warnings it works. Thank you all for the help.
  10. Adding http:// makes no difference Setting Error Reporting to E_ALL gives me warnings about undeclared variables and undefined indexes followed by an error because the header was already sent. error_reporting(E_ERROR); results in the same blank screen.
  11. I am trying to redirect to the login page if a user is not logged in. I have the following piece of code: $slashpos= strrpos($_SERVER['SCRIPT_NAME'], '/'); $path=substr($_SERVER['SCRIPT_NAME'],0,($slashpos+1)); header('Location: '. $_SERVER['HTTP_HOST'].$path.'login.php?message=This%20page%20is%20only%20for%20gallery%20personnel'); //echo 'Location: '. $_SERVER['HTTP_HOST'].$path.'login.php?message=This%20page%20is%20only%20for%20gallery%20personnel'; exit(''); If I execute the script as is I get nothing - a blank page. If I uncomment the echo line I get: Location: localhost:8888/Art3/theme/login.php?message=This%20page%20is%20only%20for%20gallery%20personnel which seems right to me. I have the following lines at the top of the script and I'm getting no errors ini_set('display_errors', 1); error_reporting(0); I have tried: just using 'Location: login.php?message=foo' and constructing the URL from $_SERVER['SERVER_NAME'] and $_SERVER['SERVER_PORT']
  12. Posted criticism of a website in Miscelaneous. Can you tell I'm angry? ;) I'll get over it.

  13. Bought my 12 year old a book on Unity coding yesterday. He's worked through the first 6 chapters and is now trying to teach the 9 year old neighbors. -proud papa

    1. sKunKbad


      Sounds great. My son is 10 and starting in with HTML. Hopefully by the time he is my age he will have some serious skills!


    2. TrickyInt



      Whish my parents could help me in the coding aspect, it's hard learning everything on your own.

    3. davidannis


      TrickyInt - that's why we're here.

  14. I believe there is a small typo here. Make sure that you have a space between Location: and http://
  15. You can use click the icon on the editor that looks like <> and then paste the code in the resulting box
  16. If you have linux hosting with shell access you can check sendmail directly. First log into your account with ssh then: steps from: http://smallbusiness.chron.com/check-sendmail-working-not-linux-49904.html or try the mail command http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/
  17. I used ISP and hosting company interchangeably and shouldn't have. It is only the hosting company that matters. Is the site hosted on linux or windows?
  18. Since you changed nothing in the script and things we expect to work don't I suspect something changed on the server. Do other forms on the server send email? If so are they broken too? I would check with your ISP and see if they changed or disabled outgoing mail.
  19. jazzman1 is saying change this: // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); to this: // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); if(mail($email_to, $email_subject, $email_message, $headers)) echo "MAIL - OK"; else echo "MAIL FAILED"; Note: only last line changes - the rest is there to show you where.
  20. I love it when in trying to formulate a coherent, well thought out post I come up with the answer that was eluding me.

    1. sKunKbad


      It has happened to me many times.

  21. I need to get away from this snow.

    1. Stefany93


      Southerner ? :D


  22. 日本語 べんきょう します。

  23. Sleep deprived and crabby

    1. Philip


      aren't we all... :)

  24. Going to sit on a beach for a few weeks with a keyboard and tablet and really learn jQuery. Be back in a month or so.

  25. I hate that I oscilate between being bored and being far too busy

    1. dalecosp


      But isn't that kind of normal?

  • 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.