-
Posts
15,290 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
Why (isset($_POST['submit'])) function not working?
requinix replied to tarunrathore's topic in PHP Coding Help
Sorry but no. The slash affects the URL, naturally, but it is by no means necessary for the form to work. Nor does it have anything to do with GET vs. POST. -
Put both the image and the caption inside the container DIV and use CSS to make them both somewhat block-ish. Give the container DIV an equal negative left margin so that it looks like there's no margin on the first image.
-
curlCall is some function defined somewhere in your application. Look at it to see how it is supposed to be called and then update your code accordingly.
-
Forget "common" and think about "purpose". A session cookie lasts potentially forever, but it disappears when the browser closes. Is "forever" a problem? User authentication should not last forever. A regular cookie lasts until some particular time, assuming it does not get refreshed. But once that time passes, the data contained by the cookie is lost. Is losing that data a problem? User tracking data should not disappear or else you'll mistakenly count too many users.
-
SQL statements are like a recipe: there are a variety of things you can combine together to get the desired end result, but you have to do them in a certain order for it to work. For example, WHERE clauses have to come before ORDER BY clauses.
-
Why (isset($_POST['submit'])) function not working?
requinix replied to tarunrathore's topic in PHP Coding Help
<form action="multi.php" action="post" class="py-4 px-5" id="form"> Take a closer look at that. If you don't see a problem, try reading each piece of it aloud to yourself. -
You can see the expiration time of the cookie. Five minutes is really short, though, so I doubt the timeout is coming from an expired cookie. Which means it's server-side and there's nothing you can do about it.
-
PHP pathing difference when running on CLI vs from bash script?
requinix replied to maxxd's topic in PHP Coding Help
I don't know why "config/config.json" and "./config/config.json" would work any differently. Are you sure that's happening? You have some code with the former that works fine, you add the leading ./ with no other changes, and it stops working? -
That is not PHPMailer. That is regular mail. Find, download, and use PHPMailer. Read the manual and they will tell you how to send HTML emails.
-
Sorry but no, it is not what you thought. Seems a quick primer is in order. PHP handles exactly one page request at a time. When it finishes with a page, it completely forgets everything that happened. You can't set a variable on one page and get it in another page. Obviously that would be a huge limitation to making a website work, and that is why things like databases and cookies and sessions exist. That means there is no transfer of "control" between pages. PHP doesn't remember that the user was on trial-offer.php and is now going to checkout.php. All it knows is that someone is trying to request checkout.php, and they may or may not be sending data too. $_POST is not a database or cookie or session. It's a variable. A variable that you can reference from anywhere in your code, but just like every other variable, it's only usable for that one page. If you made any changes to it (which is a bad practice so don't do that) then you could see those changes for the rest of the page, but whatever you do will not be available on another page. Same for $_GET. $_GET gets its information from the query string - the stuff after the question mark in the URL. PHP looks at the query string, parses it, and shoves the data into $_GET for your convenience. $_POST gets its information from POSTed form data. The most common way to send POSTed form data is with a <form> whose method=POST. PHP looks at the data sent to the server, parses it, and shoves the data into $_POST for your convenience. If you have a form with an action="" then the browser will be nice and assume you meant action="(the current URL)". That's how form data goes back to your page: because the browser told your server that it wanted the same URL with some POSTed data. If you have a form with an action="checkout.php" then the browser doesn't have to assume anything, and it will tell the server that it wants checkout.php with some POSTed data.
-
555 for files means readable (which is good) and executable (which is not). 555 for directories means readable (which is good) and browseable (which is also good). In general, files should be 0644 (writable by your account, readable by anyone else) and directories should be 0755 (writable by your account, readable and browseable by anyone else). In reality, it depends on the server setup.
-
That's fine, but a product and a subscription are not the same thing. You treat one differently than the other, not just internally but with the user experience too. And that distinction matters. But I take back what I said earlier. It's okay to add products things within checkout.php. It makes sense as a single click operation: user wants thing, doesn't want anything more, goes to checkout which also adds that thing to the cart. If you want. You're comparing apples and oranges. The database is the "source of truth" regarding what is currently in the shopping cart. It is not the source of truth for how things get into that cart. That is not at all what they mean. You know how variables defined outside a function are not available inside a function? The $_GET and $_POST (and other) superglobals do not have that restriction. There should never be any sending of POST data between your own PHP scripts.
-
I don't recommend using the checkout page as a way to add any product. Don't misunderstand: I'm not saying this subscription business should go in the checkout page. I'm saying it can go there - for your own ease of use. (The alternative is having an AJAX-y way of adding products, then when that request completes the button navigates to the checkout page.) What I would do is have the checkout page support adding a subscription product specifically. You can POST to it the subscription ID, then it adds the subscription to the cart if there isn't already a subscription in there. More or less, yes. It would submit the contents of the form to checkout.php instead of to the current URL. Before you continue, you should probably familiarize yourself with HTML forms and how they interact with the server. That's some rather important knowledge to have.
-
Okay, so then you need to check two ranges: 1. Existing logic, except you base the new start date as coming after the gap end instead of after the fill start. 2. Mostly the same logic, except (a) you determine the new end based on the gap start, then (b) adjust the new start according to the new end. Then decide which of those two new ranges you want to use.
-
Having your checkout page support form data to add the offer does kinda make sense. You can do that. If you have a page listing your subscription(s) then surely you have something to go with it like a subscription ID? Pass that to the checkout page. POST would be better since you're talking about something that modifies data.
-
You've posted quite a bit of code. How about you now post a description of the problem, including what you want to see happen and what is actually happening?
-
That's the only sound I know of that it could be playing...
-
That does sound relevant. Until it's fixed, you can turn off IPB's sounds through notification settings. Not sure exactly how it plays sounds - best guess being a temporary <audio> - but I think the "stream" term is a misnomer and it's more about the audio resource itself not releasing a sleep lock.
-
-vcodec copy That says to copy the existing video to the output. You need to re-encode the video as VP8.
-
Windows 10 1909 here. I have sleep disabled (desktop computer) and powercfg says nothing is happening. I normally have Chrome with the tab open, however most of the time the tab is in the background so eventually the forum stops polling for notifications (indicated by the pause ⏸ in the page title). And I do have desktop notifications enabled. Obviously IPB itself can't tell your computer to not go to sleep... What are your "advanced" power settings? Specifically under the Multimedia group. Here's mine:
-
Still looks right to me: - Start date = fill's start date (Wednesday 12pm) moved foward to the gap's start (Wednesday 1am) = a week later - End date = new fill's start date (Wednesday 1am) copied forward to the gap's end (Friday 4am) = 2 days later What was the result supposed to be, and why? 3v4l groups by output. Your code uses random numbers and current timestamps so the output from each run will be different. Protip: don't do that.
-
Looks right to me. https://3v4l.org/UJJfa You don't. 3v4l is meant for testing code across multiple versions. My code uses mutable DateTime objects. If you have to use immutable objects then the code needs to care about return values.
-
You'll have a database table that contains, at a minimum, (1) some identifier, (2) content, and apparently (3) some "answer to the issue". Right? Link to the page using the identifier, which could (and probably should) be a rewritten URL, then use the identifier to pull the content and whatever. I'm not really sure why there's a question here.
-
What's the HTML you're trying to render?
-
PHP pathing difference when running on CLI vs from bash script?
requinix replied to maxxd's topic in PHP Coding Help
...which it has to do by reading the file. That's the important part. "Working directory". AKA current working directory (cwd). Both of those paths should mean the same thing. What is the code for actually reading the file?