Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by requinix

  1. I would say ginerjm had the answer and I just stepped in to help address a bit of confusion about it.
  2. So unfortunately there's three different "roots". Which one someone means depends on context. 1. When it comes to files and directories in Linux, / is the root. Not "home" - that's where your personal files are, and is typically /home/something. 2. When it comes to figuring out where stuff is when you're dealing with PHP code, the "root" means the place where your web server starts holding files. That would be /opt/lampp/htdocs. 3a*. When it comes to URLs and other things you see when you're browsing a website, the root is also / according to what's in your browser's address bar. Not including the http(s) or domain name but the first slash right after. The second and third are closely related: the root of where your web server is hosting files is /opt/lampp/htdocs and that is the same as / in the address bar. Unless you tell your server differently, if you go to http://localhost/MyProject/uploads/whatever.ext then the web server is going to look for the web root (/opt/lampp/htdocs) + the path portion of the URL (/MyProject/uploads/whatever.ext) and try to find a file named /opt/lampp/htdocs/MyProject/uploads/whatever.ext. What ginerjm is talking about is the second one, and whose value you can get in PHP with $_SERVER["DOCUMENT_ROOT"]. You do not set that value yourself. PHP gives it to you for free. If you want to take a file upload and always place it in the root of your web site + /MyProject/uploads/ then you need the DOCUMENT_ROOT plus that path part (and probably plus a file name itself). $fileDestination = $_SERVER["DOCUMENT_ROOT"] . "/MyProject/uploads/" . $fileNameNew; Now here you've got a slight problem: that /MyProject piece. That's not going to be there in the real site, but you have it in your setup. You have two basic choices for how to deal with that: 1. Tell your web server to host files out of MyProject. That requires going into the server configuration and changing some values. There's a right way and a wrong way of doing this, so rather than deal with that, just ignore this option. 2. Put all your MyProject files into the htdocs directory. This is really easy. The downside is that you can't have multiple websites anymore because http://localhost is always going to be what's in /opt/lampp/htdocs and that's always going to be the "MyProject" stuff. Once you've moved the files you can get rid of the "MyProject" stuff in your code and your local site will be one step closer to working like the real site will. $fileDestination = $_SERVER["DOCUMENT_ROOT"] . "/uploads/" . $fileNameNew; * There's a 3b option where you might say "well no, I consider the root of my site to be http://localhost/MyProject". Saying things like that is an easy way to get everybody confused so stick with 1, 2, and 3a.
  3. The Let/Action/Draft/Publish thing is a different concept than the Chocolate/Candy thing. Giving the latter as an example only makes the former more confusing. Are you trying to get the status of each thing as it was on a particular date? Wouldn't that mean that the status of each thing is effectively the most recent "status_to" value you have?
  4. Installing the certificate may not be enough. PHP is using OpenSSL. What version of that do you have? Is it at least 1.1.0?
  5. I see that you're using the parseInt function. What does it do?
  6. If the problem is that you have multiple names in the column then you need to fix it by not storing multiple names in the column. Probably with a new table. pk | database_id | name ---+-------------+----- 1 | 1 | Joe 2 | 2 | Susan 3 | 3 | Richard 4 | 3 | Joe 5 | 4 | Jane 6 | 4 | Sam 7 | 4 | Steve 8 | 5 | Gloria 9 | 5 | Joseph
  7. You're asking if someone could create their own website under *.basemaps.cartocdn.com.
  8. The error is complaining that you're trying to treat a boolean value as if it were an array. There are two variables on that line. One of them is $_POST. I really hope you don't have code that somehow turns it into a boolean. The other variable is $answer...
  9. I'll skip the question about what's wrong and try again. Take Barand's code. It's good code that demonstrates the singleton pattern, and is based on what you started with. Then do the thing with $e you tried that added getMessage() to the error output. With those in place you will still get the error that you had before, but now it will include a message from $e that should point you towards what the underlying problem is.
  10. Could be. Or it could be that you added the new "getConnection" without removing the old one.
  11. The code (when unchanged) seems fine, but I'm no WordPress expert. You are using that, right? I didn't notice you changed "wp_mail_from_name" to be "WordPress" - that should not be there either. The "blogname" option should also be correct. In the WP options, there should be a title set. That would be provided for whatever "wp_mail_from_name" controls.
  12. Take the code Barand provided and apply the change you made using $e to it.
  13. Not the most helpful message, is it? You get that when a PDOException is thrown. It's available as the $e variable and very likely has some useful information inside of it...
  14. You've posted a few pieces of code without any context to how they are used. That makes it really difficult for anyone but you to know what you're talking about. If clickedD.php is where the AJAX request with the dentist's name is sending its data then only clickedD.php has the dentist's name available to use. The AJAX happens after the page loads, so PHP cannot time travel and take the information from it and retroactively change what happened when it was first creating the page. Without knowing more about what you're doing, I would say that you "have to" use clickedD.php and AJAX to modify the page with whatever information you want - information which would have to be returned by clickedD.php itself. But I suspect there's an easier method to do what you want. No way for me to know what it is, but I do believe there is one.
  15. 1. The second argument to add_filter() is the name of a function WP should call when it wants to use whatever filter. The name of your function is "new_mail_from_name" and not "alphaequipment". 2. get_option() will want the name of the option it should get. An option name would be like "blogname". You very likely do not have an option named "alphaequipment.com". Have you tried using that add_filter + function code without making any changes to it?
  16. I don't know what "day 0" is, but you can get a string representing today's date with, surprisingly enough, the date() function.
  17. You are putting $_POST values directly into the query. The first step to fixing your problem is to stop doing that and to use prepared statements instead.
  18. if(isset($fdate)){ $content['fdate'] =$fdate; }else{ $content['fdate'] = ''; } if(isset($tdate)){ $content['tdate'] =$tdate; }else{ $content['tdate'] =''; } That looks relevant. Have you tried changing those two empty strings to be something else?
  19. CSS classes is not some magical transformation thing where you put some mystical letters on your HTML and it mysteriously gains some supernatural attributes like "makes the text black". They aren't some special codes you enter into your keyboard to unlock secret powers on a webpage. A class is a name. A simple name. And only a simple name. w3-#000000 is not a simple name. It's got this placeholder at the end that says "okay, I put some thing in here, now insert that somewhere else". And that does not work. Take some time away from memorizing the w3.css stuff to learn about what CSS is and how it works. Because w3.css is CSS. Not some fancy alternative to a prettier internet, but a bunch of pre-fabricated concepts that some people far out on the fringes of the world wide web decided would be Good Thingsā„¢ that other people might want to copy.
  20. An unset upload_tmp_dir is completely okay. What are you trying to install? What error is it giving?
  21. You're doing a new container/row for each result from the query. Shouldn't you be using a single container/row and then a new card for each result?
  • 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.