Jump to content

Phi11W

Members
  • Content Count

    64
  • Joined

  • Last visited

  • Days Won

    4

Phi11W last won the day on August 28

Phi11W had the most liked content!

Community Reputation

10 Neutral

About Phi11W

  • Rank
    Regular Member
  1. Do you also drive your car with all the dashboard indicator [warning] lights covered up? Sorry but, to me, this is just absurd. You need to get your site into surgery and "operate" on it, to fix the underlying problems, not just whack a Band-Aid on it and hope for the best! Sooner or later, one of those [ignored] warnings/errors is going to actually break your site and, suddenly, it'll be "all hands to the pumps", trying to get your site back up and running again, against a tidal wave of errors only one of which is the actual trouble-maker, and you'll [possibly] be losing money the whole time you're doing it. Surely it's got to be better to take the time and trouble to do that investigative and corrective work now, before the heat is on? We don't know what your application is or what it is supposed to do, so it's impossible for us to comment. I'm just hoping it isn't in the Nuclear Power industry ... $config->maxCoreTemp = 'q' ; . . . $reactor->shutdownIfTemperatureExceeds( $config->maxCoreTemp ); Regards, Phill W.
  2. Classic "Buffering" problem: Hugely simplifying your code, note what happens with/to the sHTMLTemp variable: $sHTMLTemp = ""; while ($unirow = mysql_fetch_array($uniresult)) // Where $result is your result set { if ($temp != $unirow['number']) { $sHTMLTemp = preg_replace("/(.+),/","\\1",$sHTMLTemp); print $sHTMLTemp ; print "</tr>"; $sHTMLTemp = ""; } /* Lots of putting stuff into sHTMLTemp */ } /* -- END WHILE -- */ On change of "number", you print out the sHTMLTemp variable and clear it down, ready to be loaded with the next Player's data. When you get to the end of the loop, though, It's all set up with the last player's data ... but you don't actually print it out! Regards, Phill W.
  3. This is actually quite an informative error message: "Too few arguments to function curlCall() ..." "... 1 passed in /clientzone/modules/products.php on line 33" "... at least 2 expected in /clientzone/includes/functions.php:0" You've defined a function curlCall that takes "at least 2" arguments . You're now calling that function with only 1 argument. Bzzzt!! PHP says "No". Regards, Phill W.
  4. No. It doesn't do anything at all with slashes. As I said: So your file might look like this ... ... and, if you entered "apple", the code would generate the link: <a href="https://blabla.com/blablabla/blablablabla/apple" target="_blank" rel="noopener noreferrer">apple</a><br/> If you are expecting multiple links to be generated based on what you enter, then please explain how you would expect this to work. Regards, Phill W.
  5. As given, the code loops through each line in the file, looks to see if that line contains the entered word and, if so, displays that line on screen, effectively creating the HTML link (because that's what each line of the file is!). It's a really clumsy way of doing this, because The links are hard-coded in the file, making them difficult to maintain, and The test (strpos) will find the given word anywhere in line, so if you were to enter the value "target", it would match each and every line! A simpler and safer way might be to hold just the words in the file, without all the HTML stuff, and search that, then create the HTML for the selected line: . . . $found = false; foreach ($lines as $line) { if ($line === $search) { $found = true; printf( '<a href="https://blabla.com/blablabla/blablablabla/%s" target="_blank" rel="noopener noreferrer">%s</a><br/>', $line, $line ); break; } } // If the text was not found, show a message if (!$found) . . . Regards, Phill W.
  6. What does the generated HTML look like (Use the "View Source" tool in your browser). Remember that your PHP is effectively just building a String that gets sent to the browser for it to make sense of. Copy the link URL out of the browser and make sure that that it works on its own. It may simply be that $row['linkpage'] isn't a valid URL. Regards, Phill W.
  7. One of the [Unwritten] Rules of Relational Databases: Rows in a Table have no intrinsic order. The only way to guarantee the order is to use the "order by" clause on your select statements. select sub, ... from table1 order by sub ; As Requinix quite rightly said - store numeric data values in a fields with a numeric Data Type. Regards, Phill W.
  8. Indeed it can and it absolutely should have. However, whilst an item should legitimately have a name and an id, you appear to also have given [one of] yours an Id. DOM navigation is case-sensitive, so ... "id" != "Id" ... and GetElementById only uses id. Something more like this: <td><input type="text" id="item1sum" value="" name="item1sum" placeholder="item 1 sum"></td> Attribute names (id, value) are case-sensitive and may appear only once within each Element. Pick one id for the element and stick to it. Use CSS for styling, rather than hard-coding it into every element. Regards, Phill W.
  9. item1cost and otem1charge are both String values, taken from the "value" property of the Element. Performing arithmetic on them may or may not work as expected. Better to convert them (parse* functions) to the correct Data Type first. There's no need for the ".value" bit on the totalcharge line. You're not reading a DOM Element property here - just working with variables. You're not actually displaying the calculated value! document.getElementByid('item1charge').innerText = "Total Charge = " + totalcharge ; Setting InnerHTML is risky - it leaves your site open to Cross-Site Scripting Attacks. Regards, Phill W.
  10. I would say no. The displaying of the form and it's processing are closely coupled. There's not much benefit in splitting them out into separate files. Just because you process the data before displaying the form doesn't mean that the code to do that processing has to go first in the file! Call a function that does the work. That function can be defined anywhere in the file. Also, there are limits on the number of redirects you can chain together, so why introduce another one when you don't need it? Regards, Phill W.
  11. You must not send anything back to the browser before issuing the redirect. No HTML tags, not even whitespace. In the code you show, you're sending most of the form before issuing the redirect. It's conventional to do the POST processing first, then render the rest of the Page if the User is still "here". something like this: if ( Posted_Data_Present() ) { ProcessPostedData_IncludingAnyRedirects(); } DisplayForm_IncludingPostedData(); Regards, Phill W.
  12. Never use the root (or any other "superuser") account for running applications. These uber-powerful accounts should be kept solely for your use to clean up the mess when an Application goes wrong. Keep the Biggest and Best tools in the toolbox for yourself. Create an account specifically for the application to use and grant that account only the permissions that it needs to do its job. +1 for not showing us your [root] password. -1 again, though, for hard-coding it into your PHP source code. Database credentials need to be carefully guarded and having them lying around in plain text, even in a PHP file, is not a Good Idea. All that said, we have no idea why your "index file is not opening" ... you've shown us no PHP code to examine, nor [database or PHP] errors to diagnose. Details, details, details ... 🙂 Regards, Phill W.
  13. This XPath expression will find a product if it is is stock and return no items if it's not. $items = $xml->xpath( "/ STOREITEMS / PRODUCT [ @ITEM = '$product_queried' and STOCK / text() = 'In Stock' ] " ); Regards, Phill W.
  14. Add this condition into your "select" statement so that it only retrieves the relevant items for displaying. Don't retrieve everything and then filter it in PHP code. Regards, Phill W.
  15. At it's most simplest, your solution is called an "If statement". The HTML page loaded into the User's browser submits data to your PHP for processing. As as essential part of that processing, you should validate the supplied data values against your chosen criteria. In this case, they need to enter a valid [Character Representation of a] Date that must be earlier than the current date. If the supplied data does not match your criteria, then you send error back message(s) that the HTML (or Javascript) has to show to the User. Regards, Phill W.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.