-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Maybe. Post your code.
-
Your Javascript that toggles from fixed/+60 to relative needs to clear the top value too.
-
Does your 404.php have a line header("HTTP/1.1 404 Not Found");in it? If so, what's the code for the file?
-
Separate from that, don't use persistent connections (ie, mysql_pconnect()) unless you know exactly what you're getting into. The "persistent" may seem cool and all but it has drawbacks that can kill your site if you aren't aware of them.
-
Uh, no? It's either a mysqli_result object or false. The object probably isn't in the form you expect it to be. What does print_r($jstring);output? Oh, and $jstring = (array)json_decode($array);Don't do that when json_decode() can give you an array directly. $jstring = json_decode($array, true);
-
Whatever you use to read from (eg, mount) the network shares will involve a username and password. If not then it would authenticate anonymously. What I said regarding user accounts and access to resources is still relevant as far as that's concerned.
-
The authentication happens through Windows automatically, and only in the case where your existing credentials don't work will Windows prompt you to enter someone else's. If you're running through Apache then it may be the LOCAL NETWORK system account, which (as it implies) is only good for local resources. You would need to run Apache as a different user and make sure that user, either by itself or the group(s) it belongs to, has access to those resources. If you're running through IIS then it's still the same story except you'll be running as IUSR or IUSR_machine. Either give that user access to the resources, or make it run as a different user that does.
-
The "solution" is to not execute that. It's not SQL. If you want more help then you have to give a lot more information about what you're doing.
-
Really sparse on the details, there. I don't know what that is, but I do know that's not a valid SQL query.
-
I take it the extensionless links didn't work before you put that rewriting in? Did you see how it said So... have you looked in the server error log for more information about the error?
-
original price * (1 - discount as a decimal figure) original price * (1 - 0.10) I don't know what you're talking about. Try writing a detailed explanation of what you're doing. And post the code you've written so far. And make sure to mention exactly how it doesn't work.
-
Because you're making the form submit to that URL. As in that's where the data goes. You want it to stay on your site so you can verify the password, and if it's valid then you send them to the other site. [edit] Well, actually, I don't know what get_option() will do if you give it a URL instead of an option name. Probably return false/null/empty string. What you were trying to do should have been $o = '
-
Thanks for mentioning you already had something with WordPress. Saved me the effort of having to write out something you won't use. I don't know WP. That form goes somewhere and will execute some code somewhere. That's where you should be looking for how to do this redirect thing.
-
60 seconds. Really simple stuff here. <?php if (isset($_POST["password"]) && $_POST["password"] == "correct password") { header("Location: http://www.example.com"); exit; } ?> <html> <body> <form action="" method="post"> <p><input type="password" name="password" /> <input type="submit" /></p> </form> </body> </html>
-
The first one with numbers is correct. You should actually have another table for the categories too id | category ---+--------- 1 | Dogs 2 | Cats 3 | Birds 4 | Fishso if you really wanted to search by name it would be SELECT p.* FROM posts p JOIN categories c ON p.category = c.id WHERE c.category = "Dogs"But most of this should be happening automatically: you show all the categories in a list, their links go to some page using the category ID, and that page shows whatever posts are in that category. You don't specify "Dogs" or "Birds" anywhere but have the code output it. Example: echo "<ul>"; foreach (/* SELECT id, category FROM categories ORDER BY category */ as $row) { echo "<li><a href='/posts.php?category=", $row["id"], "'>", $row["category"], "</a></li>\n"; } echo "</ul>"; // links to the posts under the category $category = (int)$_GET["category"]; echo "<ul>"; foreach (/* SELECT id, title FROM posts WHERE category = $category */ as $row) { echo "<li><a href='/post.php?id=", $row["id"], "'>", $row["title"], "</a></li>\n"; } echo "</ul>";
-
how to trap the current date to the next date?
requinix replied to phpbigenner's topic in Application Design
Your assignment, php"bigenner", is to write a post explaining what "trap", "current date", and "next date" mean as used in the thread title. There should be at least 3 sentences and a total of 50 words or more. -
Use a proper JOIN in your query, not the form where you specify multiple tables in the FROM. SELECT table1.Id, table1.Name, table2.comment FROM table1 JOIN table2 ON table1.Id = table2.UidThat will still give you 2 and 4. Now turn it into a LEFT JOIN ...FROM table1 LEFT OUTER JOIN table2 ON table1.Id = table2.Uid...The LEFT means that for every row in the "left" table (table1) there may not be corresponding rows in the "right" table (table2). With the default INNER JOIN, if there are no matching rows then the row from the left table is thrown out; with an OUTER JOIN (be it LEFT or RIGHT) the row is kept and the missing values become all NULL. Id | Name | comment ---+-------+-------- 1 | Joe | NULL 2 | Greg | Good customer 3 | Susan | NULL 4 | Max | Great Guy
-
MySQLi identifying multiple queries on same object
requinix replied to munkey's topic in PHP Coding Help
You do exactly the same thing as you did with the mysql_* functions: execute the query, assign the result somewhere, and look it later. $q1 = $db->query("SELECT xyz FROM abc....."); //Query 1 $q2 = $db->query("SELECT efg FROM def....."); //Query 2 $q3 = $db->query("SELECT pqr FROM hij....."); //Query 3 echo "query 1 returned {$q1->num_rows} rows\n"; echo "first row of query 2 is " . implode(", ", $q2->fetch_array()), "\n"; echo "query 3 has {$q3->field_count} columns\n"; -
If you're calling this things "sqls" then you are not ready to manage their security. Hire a consultant.
-
I would not try to do this in SQL. It's possible, but disgustingly ugly. Fall back to using PHP code. You'd have to strip out those stupid tag things anyways so you can fetch the related data while you do.
-
Installing apache, php and mysql on Debian (Raspberry Pi)
requinix replied to cbassett03's topic in Linux
Sounds like you need to build it yourself from the source. The hardest part is the configuration: there are tons of options, many you'll want and many you won't. apt is the package manager, apt-get is one of the commands available to control it. -
pdo_mysql.default_socket is missing in php.ini
requinix replied to premm's topic in PHP Installation and Configuration
The php.ini won't be generated for you. You have to edit it (or make a new one) yourself. -
So no two products with the same price, huh? Can you alter the ID/Description table to include a column actually dedicated to the price, rather than stuffing it in a place it doesn't belong?
-
Does that "=A" mean anything? Is it more than just inserting the price in at the "{price}"? How do you relate the two tables? Does table 2's ID pair with table 1's ID_product? Any reason why the description is in its own separate table when they sound like they match up with individual products?