-
Posts
15,265 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
Here is a good place to look for answers.
-
How to calculate the entries within the last 40 business days?
requinix replied to TheBrandon's topic in PHP Coding Help
Excluding holidays, 40 business days = 8 whole weeks. It's a rather convenient number. So no special logic required. -
Yeah: what you expect a switch to help with. I don't see why you're thinking about using one.
-
Cookies not being read until second load.
requinix replied to narpassword000's topic in PHP Coding Help
Unless he include()s it, which he does. PHP assumes any file given there has PHP to execute regardless of extension. Using something that inspects headers (like Chrome or Firebug) can you see when the cookie is being set? -
Creating a Static HTML page from a MySQL Database and Using PHP
requinix replied to thara's topic in Apache HTTP Server
As long as all your teachers have unique names then sure. Otherwise you'll have to incorporate something unique into the URL (such as an ID number like in what I posted). "URL rewriting". Search around for those terms, there's plenty of material out there to learn what it is and how to use it. Note that you'll have to write a PHP script which accepts the teacher's name instead of their ID number, like profile/teachers/index.php?teaName=vivek%20obroi Then you can use URL rewriting to convert profile/teachers/vivek%20obroi.html to that. -
Creating a Static HTML page from a MySQL Database and Using PHP
requinix replied to thara's topic in Apache HTTP Server
I don't think you mean what you're saying. I think you mean you want friendly URLs like /teacher/21/Bob. Is that it? -
\p is only available in UTF-8 mode, which you specify with the /u flag. And +1 to what Psycho said. That filter_var line is way overcomplicated.
-
Then you should probably fix that. What's your code now?
-
If all you want to do is omit file extensions then Options +MultiViews in a .htaccess is enough. There's also a mod_rewrite solution that's more annoying. If you actually want to change the URLs into something different then "URL rewriting" is what you should be searching for.
-
Side comment: your table is a bit off and your signs are backwards (from what I can tell). Such a table normally looks more like Balance: $300 ID | Message | Amount | New Balance ---+---------+--------+------------ 5 | Paid | -$500 | -$200 4 | Debt | $100 | -$100 3 | Debt | $100 | $0 It starts off with an initial balance and changes for each transaction. But that's irrelevant. For the initial problem, just do the math as you run through the results. $pay_balance -= $pay_amount;
-
Well, there's </pre> <form action="'activate.php" method="'post'"><
-
How to get the above dash that's in ā for c and p?
requinix replied to yoursurrogategod's topic in HTML Help
Those letters don't have Unicode characters so you have to build it yourself with a U+0304 COMBINING MACRON. "c& #x304;" (remove the space) -
Need help accessing xml elements from simplexml
requinix replied to frobak's topic in PHP Coding Help
It's a bit more complicated than that because you have to deal with XML namespaces: the bit before the colon in the tag name and the URL associated with it. $xml->children("diffgr", true)->diffgram->children("")->NewDataSet->StdData->MAKE -
And what's your code now?
-
More secure. It's not because the stuff came from an AJAX call but how it gets added to the document.
-
-
In a query string the "only" thing you need to worry about is directly revealing information. Passwords, private keys, and session IDs* do not belong in there. ID numbers are generally okay because a user doesn't know what "447" corresponds to - they'd have to visit some page so that's where you handle authorization. For example, I have a PM #69384 on this site. You can go into your PM area and stick that number in the URLs you get but you won't be able to see anything. So what you have is fine. Stop worrying about it. All you have to do in the code for the page is to search for a PM that the user sent or received and that matches the ID number given. If you find it then great, and if you don't find it then tell the user they don't have that PM. Don't tell them they can't access the PM: they shouldn't know anything about it, including the fact that it exists. (Same way login forms shouldn't reveal whether a username exists - only that the username+password pair is invalid.) (* IMO they really shouldn't, but if you take proper precautions then it's okay.)
-
I don't see anything obvious. Are there any JavaScript errors? Have you checked whether the AJAX call works? Put in some alert() or console.log() statements?
-
The place to "catch the request" is DNS. Without it they can't even reach the server, let alone find out they have to be redirected somewhere.
-
requestObj() doesn't return anything.
-
Order or group using while loop- How can I get this output?
requinix replied to xwishmasterx's topic in PHP Coding Help
Use an ORDER BY. When you loop through and print out the results you can group them together. -
If you're quoting your strings correctly (which it doesn't look like you're doing - regular quotes, not smart quotes) then you don't have to do anything.
-
Like what?
-
require_once() the relevant files.
-
Count similar rows (and an idiot error thats making my brain hurt)
requinix replied to dropfaith's topic in PHP Coding Help
1. In PHP variables are case-sensitive. $_POST is not the same as $_Post. 2. Don't use multiple rows with all the same values. Add a column that counts how many there are, then set it to 1 (if the values don't exist yet) or increment it (if the values do exist).