-
Posts
15,288 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
PDO. How to pass quote literal as part of query?
requinix replied to nik_jain's topic in PHP Coding Help
Posts edited. I don't see anything that says MATCH arguments cannot be sent through a prepared statement. What is the full code you have now regarding that query? -
Use two TBODYs, the first with edited rows and the second without. When one of the rows in the second gets edited, move it to the end of the first.
-
Reminder that when core.autocrlf controls when Git converts line endings: - true = CRLFs in your working directory, LFs in the repository - input = whichever in your working directory, LFs in the repository - false = no conversions For the project you were contributing towards, if they asked for core.autocrlf=true then they want LFs in their code. That means you need either the "true" or "input" settings, depending whether you care about having CRLFs in your working directory. That's only ever useful if you want to open or edit a file in a dumb editor - which used to be Notepad, but since the October update that's finally no longer the case. So I would use core.autocrlf=input - LFs normally but with graceful handling of CRLFs. If you're the only developer then it doesn't really matter, but most people use LFs.
-
You have to scroll down to the Strict Typing section to see that PHP will coerce by default. So the "int" hint does what you want.
-
How to insure good form data winds up in the table.
requinix replied to fatkatie's topic in MySQL Help
mb_check_encoding is fine to use if you want to verify you're receiving valid string data. If your "binding" does that already then you don't need to add it. -
How to insure good form data winds up in the table.
requinix replied to fatkatie's topic in MySQL Help
Can you be more specific about this "not being read" or "read twice"? What had you changed when this started happening? -
Error installing nginx in Ubuntu 18 under AWS
requinix replied to mstdmstdd's topic in Other Web Server Software
Here. This looks like a reasonable example I just happened to find lying around somewhere. server { listen 80; root /var/www/votes/public; index index.php index.html index.htm index.nginx-debian.html; server_name rather-long-name-demo.demo-apps.tk; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } location ~ /\.ht { deny all; } access_log /var/www/votes/storage/logs; # server_names_hash_bucket_size 64; } -
Error installing nginx in Ubuntu 18 under AWS
requinix replied to mstdmstdd's topic in Other Web Server Software
Don't edit the default file. Revert it to the original, disable it from sites-enabled, then create a new file in sites-available. The file only needs one server block, or two if you want http+https support. No http block, that's nginx configuration and would belong somewhere else if you needed one at all. -
Get Instant Payment Notification (IPN) data into PHP VARIABLE
requinix replied to christogonus's topic in PHP Coding Help
First step is to logs the contents of $data somewhere so you can look at what is in it. -
Error installing nginx in Ubuntu 18 under AWS
requinix replied to mstdmstdd's topic in Other Web Server Software
The page does say, but I'll admit it's not very clear about how. You've seen the server { } blocks, right? You can have more than one for different server_names and/or listens. On Debian-based Linux there is typically a /etc/nginx/sites-enabled and sites-available. sites-available is where multiple site configuration files are, and sites-enabled has a symlink to each one that should be enabled. -
How to add the ability to login with username or email for login?
requinix replied to Jedijon's topic in PHP Coding Help
Fair enough. I get the practicality of saying either/or, it's easy enough and doesn't require a variety of if/else checks. But usernames should be filtered to some degree - no "admin" or "administrator" or other misleading terms that may be relevant to the application (eg, "moderator", "author"), and allowing anything Unicode is funny when you consider emojis but scary if it also allows non-printables. -
How to add the ability to login with username or email for login?
requinix replied to Jedijon's topic in PHP Coding Help
Don't allow @s in usernames, then you can easily check what the value is supposed to represent and decide which column to check against. This is better than a simple "email = value or username = value" because... well, I don't know if I have concrete reasons that can be written out, but to me it feels better. Instinct. -
Depends, but the answer is probably that you have to figure it out for yourself. Typically by storing a list of the URLs you've hit then checking it whenever you think you want to crawl a new page.
-
Windows and Microsoft tend to use AVI for some inexplicable reason. Use a tool like FFmpeg to transcode the video into something safe like H.264+MP3.
-
MP4 is an extension. What matters is the underlying video and audio codecs being used. (And Windows' properties won't tell you what those are.) It also varies by browser.
-
By reading the documentation? DOMNodeList Or by looking at your own code a couple lines lower.
-
Error installing nginx in Ubuntu 18 under AWS
requinix replied to mstdmstdd's topic in Other Web Server Software
A security group shouldn't prevent DNS from working. Yes, you can do multiple websites. Guide -
Wow, the first thing you see when you get to that page is a huge blob of SEO keyword crap. Let's set aside the fact that you could generate a calendar yourself and How about copy and paste? If not that, exactly what are you trying to copy into a single column?
-
laravel confirm delete in an alert in my view
requinix replied to exceedinglife's topic in PHP Coding Help
Present the alert with Javascript so that you don't have to do multiple requests. That means embedding or otherwise constructing the "alert" HTML beforehand, then showing and/or hiding as necessary according to user action. -
IDs must be unique. You cannot reference multiple buttons by "btn" (which is a poor ID anyways). Change your onclick to clickvideo(this) then give your clickvideo a parameter with some descriptive name. That parameter will be the same as the "x" that you have there right now, so you don't have to try to get it some other way. The parameter is also going to be the HTML element as a whole. If you want its value then you can get it using .value.
-
Please do include the original code, not something edited for your post. If the Javascript isn't working then that would be a Javascript problem, right? So what is that code? And have you done a View Source of your page to make sure that the HTML is correct?
-
Error installing nginx in Ubuntu 18 under AWS
requinix replied to mstdmstdd's topic in Other Web Server Software
The server_name is the domain name of your website. If you want to go to http://ec2-whatever then your server_name would be ec2-whatever. If DNS isn't resolving yet and you're sure you typed it correctly (so copy/paste it), wait a while and try again. -
One thing at a time.
-
It's possible you're not aware that PHP has its own default timezone, and if you try to format a date (timestamp) then it'll format according to the PHP timezone. $bp_date_to_format = date_create_from_format('Y-m-d\TH:i:sP', $date); echo date_format($bp_date_to_format, 'd-m-Y H:i'); On the first line PHP will parse the date as you'd expect, and come up with a time that is equivalent to 12pm GMT+2. On the second line you will format it, and since PHP is using the UTC timezone (also the default) it will give you 10pm GMT+0. First of all, a GMT offset and a timezone are not necessarily the same thing. Remember daylight savings? A timezone like Asia/Beirut will be GMT+2 in half of the year and GMT+3 in the other half. If people can choose their timezone according to location (as opposed to choosing by offset) then you need to stick with that everywhere so you can handle DST changes automatically. PHP has an API for dates. It's DateTime and related classes. (Or the procedural versions of the same class methods, but the OOP style is recommended.) On the server side you have two options: 1. Always deal with dates in UTC, and convert to/from the user's timezone when you want to show/get a date 2. Set PHP's default timezone to be the user's timezone, and if you need to work timezone-less dates (eg, MySQL's DATETIME) then you convert to/from UTC.
-
So what you meant is that you want to validate a positive integer without leading zeroes? Then yes, that will do it; my answer would have been /^(0|[1-9]\d*)$/ but that's basically the same thing.