-
Posts
15,290 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
Do I have to create a new page for every single category?
requinix replied to imgrooot's topic in PHP Coding Help
Answer it this way: What is the hierarchy of the actual data? /browse/apples?city=new-york suggests the person is browsing apples and wants to see the ones for New York. /browse/new-york?category=apples suggests the person is browsing things about New York and wants to see the ones about apples. Only one of those should make sense - or at least make noticeably more sense than the other. ...which is why sites use IDs. But labels are nice for people to read (SEO doesn't care about URLs but humans do), which is why sites don't use just the IDs but also the labels too. Such as /topic/311294-do-i-have-to-create-a-new-page-for-every-single-category/ Use the ID, but verify that the rest of it matches (and redirect if it does not). -
Do I have to create a new page for every single category?
requinix replied to imgrooot's topic in PHP Coding Help
SEO doesn't care about the URL. It's a myth. The second one looks better. Either way you never create "hundreds of pages". Every single one should use URL rewriting to go through a single PHP script. For example, you can tell your web server that /browse/thing should map to /browse.php?city=thing (and append the ?category=apples). Then all you need is the single file to handle everything. -
If you send text emails then it's up to the email client to decide whether to convert the URL into a clickable email. Nearly all of them do. Yours aren't links because you're linking to localhost. If it was a .com or .net or one of the usual types of domain names then it would (probably) be made into a link. Switch that, or send HTML emails.
-
If you're using mysqli then look here. If you're using PDO then look here.
-
Ah. Judging by the description I thought you needed this script for you personally to run the occasional database query. You need to think of this as an API instead of a "bridge". Each IoT device has a key to identify it. Your script takes the key it receives and verifies it is valid and good for whatever action. Only then does it insert data. Make sure all of this is over SSL. It needs to be. You also need to switch to prepared statements instead of using that test_input thing you have.
-
POSTs don't follow the same rule because POSTs don't follow the same rule. It's written into the standards, and with the comment that the user might not want the site to redirect their data somewhere else. And I didn't say to give up. I said that you cannot automatically redirect like this so you have to do something else - such as support the old POST endpoints until you can be reasonably sure that all consumers have been updated to go to the new site.
-
So log into their system and use it. Don't make your own script to do random database stuff.
-
Does your host provide some phpMyAdmin package or similiar? It would be better to use something they've already set up than writing your own.
-
What is this "bridge"? Your code is safe in that people cannot read it directly. What you have to worry is about what all your code does. Have some script that outputs HTML files? Make sure it can't be tricked into outputting PHP files...
-
jQuery won't execute your scripts when you load it. Move your Javascript into one or two files that you include on every page, then adjust the events so that their events don't have to attach to specific elements. For example, instead of $('.filterable .btn-filter').click(function() { which looks for a particular set of elements, attach it to the whole document: $(document.body).on('click', '.filterable .btn-filter', function() { Then you can pull in whatever content from whatever page and the event handlers will already be set up.
-
The strange things we experience as website owners
requinix replied to JacobSeated's topic in Miscellaneous
Could be to "host" your content on their site so that they get traffic. Could be to try to increase their own legitimacy. Bots harvesting content for their own websites to drive more traffic to them and increase their ad revenue. Google does a decent job of distinguishing actual sites from spam sites. Likely either malicious probes or bots trying to spam you. There are tools to identify traffic patterns and react accordingly. fail2ban is one of the most popular and is primarily used to throttle IPs sending too many requests. Everything they do boils down to increasing advertising revenue. Keywords. If your reputable site has particular keyword content (even from comments) then it begins to establish a correlation between your actual content and their keywords. It's a long con. There isn't a whole lot of sabotage like that out there. It's mostly about associating spam sites/content with legitimate sites/content, thus suggesting a relevance to their content. If your site covers subject matter A, B, and C, and comments on your site also suggest spammy subject matters X, Y, and Z, then it suggest people interested in the former may also appear to be interested in the latter. -
Directory not writeable even though chown and chmod
requinix replied to StevenOliver's topic in Apache HTTP Server
Next time try StackOverflow. They don't mind giving you the right answers to the wrong questions. -
Directory not writeable even though chown and chmod
requinix replied to StevenOliver's topic in Apache HTTP Server
A "sudo user" doesn't make sense. sudo is a tool that lets you run commands as another user - typically root. Forget for a moment what you are trying to do. Why are you trying to do it? What is fiddling with permissions supposed to solve? -
Directory not writeable even though chown and chmod
requinix replied to StevenOliver's topic in Apache HTTP Server
You did inherit the privileges of the www-data group. But the permissions you applied to allow writing are not for the www-data group. They are for the owner of the directory, and in this case the owner of the directory is www-data the user. There is a user named "www-data" and there is a user group named "www-data". They are two separate (but related) things. -
What if you try running that query manually? Exactly as it is, copy and paste.
-
Directory not writeable even though chown and chmod
requinix replied to StevenOliver's topic in Apache HTTP Server
That's right: owner can write, everybody else cannot. www-data is the owner. Are you www-data? -
Is STOREITEMS the root node? Then each $items will be a single PRODUCT...
-
Directory not writeable even though chown and chmod
requinix replied to StevenOliver's topic in Apache HTTP Server
Can you tell me what the permissions 755 mean? -
How do you enforce no trailing slash, on homepage only?
requinix replied to simona6's topic in Regex Help
The "best websites" aren't on the first page because they follow the standard rules of SEO. It's because they're popular. They're long past the first date so they don't have to wear fancy suits and nice dresses anymore. You do not know better than the experts. Get vaccinations, wear a mask, and follow good SEO principles. -
Next time, please let people know you figured out that json_decode was the answer.
-
Okay... Does the debugger itself crash? Or does PHP crash and the debugger handles it gracefully? Hopefully PHP. Try this. Set a breakpoint on the line where it crashes and run the debugger. When it stops, grab the PID of PHP and hook into it with gdb. Then continue running and see if gdb can catch the problem. Then get a backtrace.
-
docker, wordpress and yaml_parse_file()
requinix replied to block34's topic in PHP Installation and Configuration
I don't know enough about the WP images to tell. I don't see anything OS-specific in there. Check /etc for any "release" files. -
Checkboxes are for multiple selections. If you do not want multiple selections then do not use checkboxes. Use radio buttons instead. So I'll make a minor change to my first question and repeat it here: do you know what the HTML markup is for radio buttons? When you have that, all you have to do is drop the <select> tags and replace each <option> with a radio button. (And then probably a little more markup or styling to make the radio buttons appear the way you want.)
-
What? Screenshot? Check your browser's Javascript console for errors.
-
Do you have any watches or conditions set up with the debugger? Exactly when/where does it segfault?