Jump to content

Barand

Moderators
  • Posts

    24,608
  • Joined

  • Last visited

  • Days Won

    831

Everything posted by Barand

  1. Same thing as what you are currently doing. Both will use the default timezone setting on the php server to give the time value. Your local time is currently UTC -6:00 (ie Central time, 3 weeks ago it was UTC -5:00 when DST applied) What is it on your server? Does your MySQL server have the same timezone setting?
  2. How strange. Google found 38,600,000 results when tried. Eight download locations on first page. What were you googling for? https://lmgtfy.com/?q=java+runtime+windows
  3. Only if it means I am of a generation that is willing to try things out and learn by experimenting, research and trial and error (lots of error). I didn't know the answer off the top of my head so I would have had to try it then relay the results of my trial to you. Or you could just as easily try it.
  4. I have built apps for clients that use it and used it when testing. I don't send that many emails myself to know if there is a problem. Whether or not it gets thrown into the spam bucket is down to algorithms on the server rather than the software sending the mail. PHPMailer just makes things a lot easier, especially if you want to send attachments etc. (Every notification email that PHPFreaks sends to me ends up in in my spam even though Freaks domain is in my contacts and I have specified "never block sender". For some reason they must look spammy.)
  5. Whenever I have a question like that I try it and see.
  6. A DNS lookup converts the domain name you enter into your browser into an ip address. A reverse lookup does it the opposite way round (IP ==> domain name)
  7. If there were such a thing, every spammer would be using it.
  8. Not all server vars are always available. See https://www.php.net/manual/en/reserved.variables.server.php
  9. Use rgba() function to specify background color or specify no background color. Example <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Sample</title> <style type="text/css"> #main { padding: 30px; width: 400px; background-image: url("https://images.pexels.com/photos/207142/pexels-photo-207142.jpeg"); } .inner { display: inline-block; width: 100px; height: 100px; border: 2px solid yellow; font-size: 40px; text-align: center; margin: 10px; } #A { background-color: #80FF80;} /* non-transparent */ #B { background-color: rgba(128, 255, 128, 0.5);} /* semi-transparent */ #C { background-color: none; } /* transparent */ </style> </head> <body> <div id="main"> <div class="inner" id="A">A</div> <div class="inner" id="B">B</div> <div class="inner" id="C">C</div> <div> </body> </html>
  10. "Unexpected end of file" errors occur when the php parser expects something but cannot find it. Usual causes are an opening { without a corresponding closing } or quots at the start of a string and then no closing quotes. You'll have to find it yourself as it's impossible from just the couple of isolated snippets that we can see.
  11. I also you suggest you check the manual for PDOStatement::execute() to see what it returns.
  12. The SQL tutorial link in my signature below may be of some use. It is based on a fictional school.
  13. if I were you I'd use a newline (\n) to separate the data instead of "@@@". if(isset($_POST['textdata'])) { file_put_contents('data.txt', $_POST['textdata']."\n", FILE_APPEND); } Then, if you data.txt file contains, say TESTA TESTB TESTC TESTD ... you can read it back and separate the items into an array using file(); $data = file('data.txt'); giving $data = Array ( [0] => TESTA [1] => TESTB [2] => TESTC [3] => TESTD )
  14. Pity. If you had read on you'd have seen he is writing to a text file.
  15. Turn your error reporting ON
  16. BTW, that line you added is missing a ";" from the end;
  17. In what way is it "not working"? What do you want to happen so you can say it is working? When posting, bear in mind we are not psychic and cannot see your screen and the data values you are seeing.
  18. It's hard to find something that is defined. Your first query selects productcode from products but the value for the options is "productid" The select is named "drpcode" yet you are expecting $_POST[''productid'] What jQuery? What AJAX function?
  19. I'm curious to know how that posted code outputs any settings with "off" (unchecked checkboxes aren't posted)
  20. +----------------+ +----------------+ | Make sure to |---+ +------->| (e.g. Courier) | +----------------+ | | +----------------+ | | | | +----------+ | | +->| use a |---+ | | +----------------+ +----------+ | | +------->| and use spaces | | | +----------------+ | +----------------+ | | +--->| monospace font |-----+ | +----------------+ | +----------+ | | not tabs |<----------+ +----------+ | +--------------------------------------------------------------------------+ | V +---------------+ | It also helps | +---------------+ | | | +-------------------+ +-------------------+ +------------------------>| if you sometimes |---------------------->| switch between | +-------------------+ +-------------------+ | | +-----------------+-----------------+ | | | | +-------------------+ +-------------------+ | overtype | | insert | +-------------------+ +-------------------+ | | | | | +----------+ | +----------=>| modes |<----------+ +----------+
  21. Plus a couple of related sections... Handling file uploads Uploading multiple files
  22. Sorry, there is an error $where = "max_price <= ?"; should be $where[] = "max_price <= ?";
  23. The query has inbuilt syntax errors. Your WHERE clause will always begin with "WHERE AND … " IMO a cleaner way to include conditions only if there is a value is $min_price = 10; $max_price = 50; $featured = 1; $binds = []; $where = []; $whereclause = ''; if ($min_price > 0) { $where[] = "min_price >= ?"; $binds[] = $min_price; } if ($max_price > 0) { $where = "max_price <= ?"; $binds[] = $max_price; } if (in_array($featured, [0,1])) { $where[] = "featured = ?"; $binds[] = $featured ; } if ($where) $whereclause = 'WHERE ' . join(' AND ', $where); $find_records = $db->prepare(" SELECT * FROM projects $whereclause "); $find_records->execute($binds); $result_records = $find_records->fetchAll(PDO::FETCH_ASSOC);
  24. Or you can use ? placeholders. $find_records = $db->prepare("SELECT * FROM projects WHERE min_price >= ? AND max_price <= ? AND featured = ? "); $find_records->execute( [ $min_price, $max_price, $featured ] ); $result_records = $find_records->fetchAll(PDO::FETCH_ASSOC);
×
×
  • 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.