-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
If you say "$y=$x+$z" you are not defining a math equation but are doing an assignment: take $x, add $z, and save that to $y. If $x or $z changes that won't affect $y because you're changing them after you did the addition and assignment.
-
If you do it that way (with a fixed format, contrary to the requirements) do a preg_match() for the basic format then a checkdate for the real validation. Writing a regex for all valid dates is pretty complex.
-
He said the table will have millions of rows. Unless there's going to be a very specific WHERE, there'll be some amount of pagination.
-
Using a javascript form on external website
requinix replied to henrikstef's topic in PHP Coding Help
Learn the math and write the code to translate it. Don't use their form. What coordinate systems are you converting from and to? -
If the problem is that the include()s are simply not working then you need to use absolute paths when giving filenames: "menu.php" alone isn't enough. include ($_SERVER["DOCUMENT_ROOT"] . "/menu.php");If the problem is the links lead to 404s then you need to use absolute paths when giving URLs: "menu.php" alone isn't enough. Menu
-
Make of 2 regular expressions 1 regular expression
requinix replied to phpuser2013's topic in Regex Help
Those two are not compatible: the second requires the "content" be only letters, numbers, and underscores while email addresses need @s. -
Removing Multiple/Possible Characters From End of Variable
requinix replied to ChrisC123's topic in PHP Coding Help
So the criteria is "everything up to the first hyphen, underscore, or number"? if (preg_match('/^[^0-9_-]+/', $device, $matches)) { echo $matches[0]; }Or only letters? '/^[a-z]+/i' -
...Which would require querying for and downloading all howevermanymillion rows. No thanks.
-
Did you also change the -11s? [edit] And the last line should be $host = substr($host, 0, -11);
-
With that WHERE the question makes more sense. If you need accuracy then a SELECT COUNT(*) will do it, but make sure you have indexes on the fields you're using. If you don't need an exact figure an EXPLAIN SELECT may give you numbers close enough.
-
Create a Breadcrumbs Trail For a Website
requinix replied to BorysSokolov's topic in PHP Coding Help
Then I think you'd be best suited by putting the breadcrumbs in those *hero.html files directly. Simple HTML. -
...You're doing the exact same thing in not just three places but in both branches of an if. It's not a problem of code reuse but of code redundancy.
-
If it'll have that much data then you don't need to bother with a count, right?
-
I'm pretty sure this thread is spiraling away from the really simple problem of removing "www" and "mysite.com" from the HTTP_HOST. $host = "www.john.smith.mysite.com"; // $_SERVER["HTTP_HOST"] if (strncmp($host, "www.", 4) == 0) { $host = substr($host, 4); } if (substr_compare($host, ".mysite.com", -11 /* -strlen(".mysite.com") */) == 0) { $host = substr($host, -11); }
-
1. Maybe it's just what you've posted but it appears you're trying to search for a user with the email address "test". Try without the WHERE condition. 2. You can make it check for errors anywhere you want. You should check a] after connecting, b] after preparing, and c] after executing.
-
Create a Breadcrumbs Trail For a Website
requinix replied to BorysSokolov's topic in PHP Coding Help
Depends on how your site works. Really, really depends. So how does it? -
[php] Edit single column in database returns false
requinix replied to mikk809h's topic in PHP Coding Help
"unlock" is a reserved word. -
LOOK UP Primary keys in a table and get the keys in assoc array
requinix replied to sribhaskar's topic in PHP Coding Help
Then how is it not working? -
It'd be much easier to if we had some code to look at...
-
PayPal is successful: they've been in business for about 15 years now.
-
If you use $url elsewhere there's an unrelated problem: $_SERVER['QUERYSTRING'] needs an underscore: QUERY_STRING. And there needs to be a ? between PHP_SELF and the QUERY_STRING.
-
wrap { ?
-
Go to the YouTube video, click Share, click Embed, and copy/paste that HTML into the page. No PHP involved.
-
LOOK UP Primary keys in a table and get the keys in assoc array
requinix replied to sribhaskar's topic in PHP Coding Help
It works. Did you know that it will return multiple rows?