-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Missed Something During Install
requinix replied to jim.davidson's topic in PHP Installation and Configuration
What box? Screenshot? -
XML, actually. But the answer to your question is "just use HTML".
-
Most of the improvements to forms degrade nicely: type=email being treated as text, placeholders being ignored, that sort of thing. You can fairly easily pick up the slack with some Javascript. And even the existing support for some things are weird, notably type=date, so you'd want your own custom implementation anyways. The semantic improvements are also backwards compatible. The DOM-related stuff is harder. I wouldn't build sites that relied on that functionality unless you can be fairly sure it's supported (some bits are quite common, and mobile phone browsers are typically even better at supporting some of the cooler things). Despite all the cool stuff I still see Javascript and many HTML 5 features as tools to improve a website, not to build a foundation upon.
-
How so?
-
Try array_count_values.
-
Php Script Causing Too Many Simultaneous Connections.
requinix replied to compixtr's topic in Apache HTTP Server
Is there more to the log messages than you're posting? What you've posted isn't enough to determine what's happening. Only thing we can say now is that the 302 probably means the script redirected someplace. -
It's possible with just PHP but there aren't enough details to know for sure. The whole thing is a little vague about what the site is supposed to do or be about. Speaking of details, using a relevant title for threads will get you more help and sooner. "New Here, Need Help" doesn't tell us anything about what's in the thread so some of us are less likely to open it up and see what the question is.
-
The reason behind that 500 was recorded somewhere. See if you can't find it in the server logs. "slew"
-
Keep a flag with the records that indicates whether something is archived or not. The main page shows the ones with archived=0 and the archive page shows the ones with archived=1. [edit] Assuming that "archived" doesn't entail anything more than where the records show up. Like whether they've been backed up somewhere.
-
Besides minor things like not checking that the individual fields were submitted (I mean submitted, not filled in) and doing a SELECT * when all you need is their ID, name, and password, You're giving a different error message for bad emails and bad passwords. That reveals to a malicious user that an account exists and lets them focus their efforts on finding a password. You should use the same "bad email and/or password" message in both cases.
-
selectOne() is a function, not a property. You have to call it like a function. And it returns a single value, not an object. echo it directly. echo $database->selectOne("ww3_users", "username");
-
Does it compile? The syntax looks right. Maybe Netbeans just doesn't like completing anonymous objects.
-
I don't know what inspired you to put this in the math section... JFGI
-
Php On A Seperate Business Logic Server From Web Serve...how?
requinix replied to bluesclues9's topic in Apache HTTP Server
Sounds like #1 is just a reverse proxy. -
On that note I personally "namespace" the constants const PARAM_FOO = "foo"; const PARAM_BAR = "bar"; and then use PARAM as the type hint in the docblock. /** * Do something * * @param PARAM $p Thing to do */ public function doSomething($p) { Since the IDE can already pick up the docblock, an intelligent check for class constants named PARAM_* seems like a reasonable idea.
-
You might discover down the road that such information could be useful. If there's even the slightest chance of that then record the views in a database.
-
strip_tags() is only used once and that's when the data is coming directly from the user. And only if you actually do want to strip out anything that resembles HTML tags. The only thing you truly need* is mysqli_real_escape_string() on the input just before you put it into a query, and htmlspecialchars() or htmlentities() on anything just before you put it into your HTML page. So 1. strip_tags() 2. mres when it goes into the query 3. Retrieve from database 4. htmlspecialchars() when it goes into the HTML * If you haven't otherwise verified that the input is safe. Like numbers are inherently safe.
- 3 replies
-
- backslash problem
- striptags
-
(and 2 more)
Tagged with:
-
Track the products viewed in the session. Just their identifiers is enough, don't need the whole thing. If the current product isn't in there then increment the counter and add it to the list.
-
1. Use __FILE__ instead. file_put_contents(__FILE__, ''); 2. You (the user cron is running tasks as) probably don't have write permissions on the file. That's good. Your script probably shouldn't try to overwrite itself. 3. Speaking of, what are you trying to do?
-
Implode Error (Invalid Argument) Please Help
requinix replied to levorion's topic in PHP Coding Help
Without it the "are there more results" condition and "add this to the array" actions happen at the same time. There's no chance to insert some "only add it if it's a result and not mysql_fetch_array() saying it ran out of results" conditional logic. The actual fix is separating the two so you can add the extra step in between; the temporary variable is just a means to that end. -
Implode Error (Invalid Argument) Please Help
requinix replied to levorion's topic in PHP Coding Help
The problem is the while loop a few lines above. while($products[]= mysql_fetch_array($result_products,MYSQL_ASSOC)); mysql_fetch_array() will eventually return false. That'll be added into the $products array. When you foreach over it you'll get that false at the very end. So use a temporary variable. $products = array(); while($product = mysql_fetch_array($result_products,MYSQL_ASSOC)) $products[] = $product; -
If I'm understanding you right then no, that's not possible. Try copying the file over like I said.
-
Can't you just rename the current file to, like, PaymentModuleMod.bak.php, and move the modified version into its place? Most likely (there are other possibilities): PaymentModule.php includes the definition of some class. $paypal is an instance of that class. So when code calls $paypal->validateOrder() it'll run the code contained in that file.
-
Can you find out the value of $replace_word?
-
Parse Error: Syntax Error, Unexpected T_Echo
requinix replied to AcEBALL23's topic in PHP Coding Help
Probably, considering that's what the title says. Shows how much attention I pay to those things. At the end there's an if block that's missing a closing ) and the on the line below has to be inside the quotes (which aren't terminated either, thanks to the extraneous backslash).