-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Using something like Local would explain a lot. But I don't know Local much. Are you sure you're using it? What little I can find that describes technical details suggests that it should be running everything in a separate environment - like a separate operating system - than your own, so you shouldn't be seeing any error messages that mention files in C:\... How did you come to use Local, too? Is that something you were told to do by someone when you wanted to have a copy of the site?
-
There's no way to craft a magical link that will do the sorts of things you're describing - without adding some code on the target page. The cleanest option is to cause the page to be rendered with the desired tab in view right from the start, which would allow you to use the # anchor immediately. But it requires changing something on the server so that it outputs the proper HTML and such so that the correct tab is shown by default. If that's not an option then you have to come up with a scheme for fragments where the target page can inspect it on load and decipher (a) that it needs to load a particular tab and (b) scrolls to the target. But it can be less complicated than it sounds: if you use #commentform as the fragment then Javascript can extract that from the URL, find the element, determine which tab it belongs to based on its ancestor elements, switch to that tab, and then do the scroll action to the element. The first option would be easier to explain if we knew the PHP (?) code on the server that renders the page; essentially you do something like /path/to/page?tab=reviews#commentform in your link, grab the "reviews" in code, and output (I assume) the correct CSS classes to set that particular tab as the default active tab. The browser would handle the scrolling. The second option would be easier to explain if we knew the markup of the tabs and comment form.
-
That /var/cpanel is not a default setting for php.ini so something put that value there... Where is this php.ini exactly? What is the setup you have for running this site on Windows - are you using XAMPP or WampServer or what?
-
You can't simply copy php.ini settings from one machine and put them on another machine. Same way you can't take a remote that worked on one TV and expect it to work on a different TV. Remove/undo those settings you copied.
-
Passing data between pages to get a filtered output
requinix replied to KSI's topic in PHP Coding Help
You can't detect what the user clicked on, but you most certainly can have the link tell the page what was clicked on. Such as by a query string of ?status=Hot. Grab that status from the query string and incorporate that into the query and page.- 1 reply
-
- codeigniter
- php
-
(and 1 more)
Tagged with:
-
...Have you tried putting #commentform in the URL?
-
Uploading Image with PHP from non-root folder
requinix replied to AnxiousInSeattle's topic in PHP Coding Help
I would say ginerjm had the answer and I just stepped in to help address a bit of confusion about it. -
Uploading Image with PHP from non-root folder
requinix replied to AnxiousInSeattle's topic in PHP Coding Help
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. -
Returning data count from a particular day after comparing 2 tables
requinix replied to JJM50's topic in MySQL Help
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? -
What is the exact name of the input fields?
-
SSL & The LetsEncrypt Expiration of October 1st
requinix replied to l008com's topic in PHP Installation and Configuration
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? -
I see that you're using the parseInt function. What does it do?
-
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
-
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.
-
Could be. Or it could be that you added the new "getConnection" without removing the old one.
-
Okay. What's the code you have now?
-
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.
-
Take the code Barand provided and apply the change you made using $e to it.
-
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...
-
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.
-
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?
-
Showing all data initially before a filter in CodeIgniter
requinix replied to JJM50's topic in MySQL Help
I don't know what "day 0" is, but you can get a string representing today's date with, surprisingly enough, the date() function.