-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
Hmm... Strap it down? Buckle it in? Quick question: What's table3 for?
-
Did you remove the RewriteCond? Because it has to be there.
-
Few reasons. Apache might be chrooted, maybe you don't have permissions. Try going to just /.
-
Unless you put a query string in the substitution URL, mod_rewrite will keep the original. Apache 2.4 has a flag to disable that but it's so new I doubt you have it. RewriteRule ^index.php$ http://www.bmeteor.co.il/? [L,R=301] That does stick a ? in the URL. The alternative is doing the redirection in index.php itself (like right at the top). if ($_SERVER["QUERY_STRING"] == "act=ecommerce&cat=5175&id=ERR&sort=price") { header("Location: http://www.bmeteor.co.il/"); exit; } By the way, you know the full name isn't necessary if it's your site? Including the [R] flag is enough to make it redirect. RewriteRule ^index.php$ /? [L,R=301] header("Location: /");
-
Drop the leading / from the RewriteRule.
-
You can. The problem is that jQuery might not be able to tell the difference between text and JSON. echo "true"; Then in the JavaScript pass dataType: "json" to .ajax(). That's one option. The other is pure PHP: header("Content-Type: application/json"); // ... echo "true"; The application/json tells jQuery that the result is JSON and not a string.
-
...They're just links. It doesn't matter whether a page is PHP or ASP, you can use whatever links pointing wherever you want. Am I missing the point? Is there something else going on?
-
Yes.
-
You can: prepend all your paths with /. $_SERVER["DOCUMENT_ROOT"] is an absolute path to the root of your website... on the server. / is an absolute path to the root of your website... on the client.
-
mysql error: for the right syntax to use near ')
requinix replied to newphpcoder's topic in MySQL Help
AVG of what? -
And what did you try?
-
For SELECTs, yes. No. mysql_fetch_*() will return false if there is no data to read. It will not error. I'm not being picky - I'm trying to correct statements that are flat-out wrong.
-
Oh please. If by "no data to be returned" you mean "isn't SELECT, SHOW, EXPLAIN, or other type of query that creates resultsets" then yes. If you mean to include (executable) SELECTs that don't return any rows then no: mysql_query() will always return a resultset resource regardless of how many rows it found. Uh, no. OP: mysql_query() returned false because the query couldn't be executed. Print out the query and check for problems. There is probably something wrong with it.
-
Good God man, WTF is up with that code?
-
That's a rather paranoid approach to input validation. You really have to log it? What are you going to do with it, send a nasty letter? && has higher precedence than ||. If your condition had parentheses it'd look like (numeric $name) or (integer $name and numeric $surname) or (integer $surname) That's not what you want. I'd tell you to add parentheses but the facts are that form input is always a string and that is_int() checks the type of variable, not its contents. That means it will never return true for something from a form (eg, $_GET or $_POST). So just get rid of them. numeric $name or numeric $surname
-
In IIS, change the application pool for your website to a classic ASP.NET pool. PHP isn't making use of integrated mode anyways.
-
You can grab the first thing that looks like a number using value.match(/\d+(\.\d+)?/)[0]
-
For some reason you're including form_functions.inc.php more than once. Don't do that. Easy way to avoid it is to use require_once().
-
I personally like having parentheses around the whole thing because of how it looks (literally) to me. $firstName = (isset($_SESSION['memberFirstName']) ? $_SESSION['memberFirstName'] : ''); If you're not sure about the precedence thing then I recommend using the parentheses too, but ultimately it's up to your preferences and style.
-
1/2 and 3/4 are identical pairs. The parentheses around the condition mean nothing, but parentheses around the whole ternary could make a difference depending on operator precedence. $variable = $condition ? $a : $b; // equivalent to $variable = ($condition ? $a : $b) because ?: has higher precedence than = $variable == $condition ? $a : $b; // equivalent to ($variable == $condition) ? $a : $b because == has higher precedence than ?: Operator precedence table
-
Yes, in that you can put any expression in the conditional part of a ternary operator. (For that particular code you'd want either isset() or !empty() but I don't think that's what you're asking about.)
-
I've moved this from HTML Help. Now that you're here, check out the guidelines sticky and make sure you haven't missed out on anything important.
-
This topic has been... screw it, "moved" to Website Critique. http://www.phpfreaks.com/forums/index.php?topic=356425.0
-
Because ASP.NET does things differently than PHP, of course. If you cannot modify the form then you'll have to parse the query string or form data yourself. That's not fun. If you can then change the name to Code_value[] and $_POST["Code_value"] will be an array.