-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
MySQL TIME format is HHH:MM:SS, so how do you divide that by a number and expect a sane result with colons in there?
-
Also $domainName=$row[DOMAINS]; 1) in your query you are retrieving "domains" (lowercase) 2) It should be $row['domains'], with quotes around the array index. Further, your <option> is wrong. The format should be: <option value="this-is-the-value-submitted-with-the-form">Text that is displayed in the dropdown</option>
-
I don't see anywhere that you are using $i, so what's it supposed to be doing? But yes it's hard to increment a value ($i++) if it doesn't initially have a value, so what's it supposed to increment? Maybe $i = 0; just before the loop but I still don't know what you're doing with it or if it's even needed. It could be because of the X/Y coordinates where you are inserting the text within the loop. The coordinates never change so it will just write over itself for each entry. Probably the $pdf->SetY(35); where 35 should be incrementing by some number each time it goes through the loop so each entry will be placed on its own line.
-
Something like that. Does it display in the PDF like you want? I'm not sure if you want this part repeating: $pdf->SetFillColor(192,192,192); $pdf->SetFont('Arial','B',10); $pdf->SetY(35); $pdf->SetX(25); $pdf->Cell(50,6,'Site',1,0,'C',1); $pdf->Cell(50,6,'Number of faults',1,0,'C',1); If not maybe that one should go before the while() loop. It looks like it might be a header containing "Site" and "Number of faults" so probably only want to output it once while the data repeats in the loop below it.
-
It's because of these lines: while($row = mysqli_fetch_array($result_topten)) { $site = $row['site']; $num_faults = $row['count']; } Think logically about what's going on here. You are rewriting/overwriting $site and $num_faults each time the loop runs. So at the end of the loop execution, $site and $num_faults will be the very last values they encountered of the result set. So you need to add the code that is adding those values to the pdf to be within that while() loop instead of after, so that each one gets added.
-
My guess is most people on this forum have never used that plugin. You might have better luck posting your question here: https://wordpress.org/support/plugin/woocommerce
-
But the first IN condition is getting posts with year > 2013, while the 2nd in might have dates pre 2013. Maybe not in reality, but could.
-
Running script depending on client Public IP
CroNiX replied to angelcause's topic in PHP Coding Help
Hope it's not a dynamic IP (which changes). Otherwise you'll have to be updating your code constantly. I think a log in system would be much better with permissions/user levels. If 'administrator' logs in, run script A, if 'maintainer' logs in, run script B, etc. -
You can always run it from a script and when it's complete email it somewhere or whatever you need to have it do. You can also just do it from a cronjob like this.
-
Just a guess here, but are you sure the file is located in the sysplugins dir? Your testInstall() indicates the dir is named "sysplugin".
-
It seems if you want to "count" it, you could just use CURL like this to only examine the file header and if the status returned is 200 than increment a counter or something.
-
You really shouldn't keep adding to an issue after you mark it as solved. Most people won't read it if it has the big green ANSWERED tag in the title.
-
It's probably slow because it's on a remote server, which means it has to retrieve the file first before it can run a function on it.
-
jpeg's don't do transparency. Use PNG as mentioned above.
-
Why do you NEED php to output that pure JS that doesn't even contain any PHP? It is totally unnecessary. Just put it in regular HTML in the HEAD of your document. You also have an extra <script> tag within a <script> tag and an extra } You also aren't using window.location correctly if you want to redirect. What's the replace doing? Nothing. <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> function redirect() { window.location = "http://www.something.com/"; } </script> </head> <body> <button onclick="redirect()">Redirect</button> </body>
-
What error are you getting? It seems it would be best to add a new column to your db's user table and hold the script name that you want that user to redirect to. Then when the user logs in redirect them to that page instead of in an if/else block. In your else statement above, you have a misplaced quote in the echo statement (no space between echo and first quote)
-
For one thing, their JS files (with a js extension), so php won't parse them (unless you set your server up to parse js as php)...meaning you can't have php directly in the js file.
-
And I would urge you to use PDO, or MySQLi instead of the MySQL extension. The MySQL extension has been deprecated and will be removed from PHP soon, so you'd have to rewrite everything. Might as well learn it now and become a bit more future-proof
-
You probably want 'password' to be '$password' too (has nothing to do with your code showing) $query = mysql_query("select * from login where password = 'password' AND username = '$username'", $connection);
-
There was nothing (visible) in your code that actually called repostEndSelect(), so it doesn't get executed. If you had a page that only had: <?php echo 'outside function<br>'; function repostEndSelect() { echo 'inside function'; } and ran it, you would only see "outside function" as the output. If you had <?php echo 'outside function<br>'; function repostEndSelect() { echo 'inside function'; } repostEndSelect(); //calls your function to execute it Then the output would be: outside function inside function
-
Where is $this->row and $this->rowset being defined? Regardless, $this->query_result wouldn't be an array index of either of those, it's a result. You should probably also check to see if those are isset() before trying to unset() them.
-
@ginergm, looks like he's using bootstrap, which is how they do it... http://getbootstrap.com/css/#forms
-
Hard to tell since that wasn't in your original code. Please post your most recent code.
-
It looks correct, does it work?
-
There are 2 types of mysqli functions, one for procedural coding, which you are using, and the other for OOP. See the example in the manual for procedural style. This doesn't have to do with your error, but this is also incorrect as it's using mysql function and not mysqli equivalent. $this->db_connect_id = mysql_pconnect($this->server, $this->user, $this->password);