Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. Well the path returned by pathinfo uses backslashes, so I have to use backslashes for the rest unless I replace them all with forward slashes, which I don't think I've tried. And my editor doesn't like it when I don't escape them, so I assumed I had to (PHP Designer 7). This is the error:
  2. Anyone? I'm really lost on this one.
  3. Put the IPs in an array and loop through them using a foreach() and basically say, if $_SERVER['REMOTE_ADDR'] == $value, do whatever.
  4. When I click that link, I get this: An HTTP error occurred while getting: http://i37.tinypic.com/2mhvh2r.png Details: "connect timed out".
  5. Check the variable $_SERVER['REMOTE_ADDR']
  6. Am I the only one not seeing images?
  7. Not without knowing the rest of the code. I'm guessing there is a lot more going on than what you showed us there. Your best bet is to modify the code to query the DB for multiple groups and levels instead of just levels.
  8. You should be able to read that error and know your result then.
  9. That depends on what is in $levels. And you can't really get both of those without breaking the query for the rest of them.
  10. You would have to know the contents of the entire page before you knew if it contained a div with a certain class. Are you generating the rest of the page? I'm assuming that the div would have already been added by the time you're running the above code? If so, set a variable when that div is created and then read the variable when you get to this part of the page. The only other option would be to write the contents of the page to a variable and check the variable for the string containing the div.
  11. A quick google search turned up this: http://stackoverflow.com/questions/244506/how-do-i-check-for-valid-not-dead-links-programatically-using-php
  12. Your question doesn't make ANY sense. Try again.
  13. I'm not sure that's the best way to check for valid links. You're probably hitting the script processing limit because file_get_contents can take a while depending on server load and where you are grabbing the file from. I'm not sure what the answer is, but I don't think looking for an input element on the page is the most efficient way to go about it.
  14. You'll probably have to do this with Javascript. The onclick action in the button will pass a parameter to a JS function that then redirects to your page with a variable in the query string.
  15. By the way, it's a Windows server running IIS. I know... the horror.
  16. I'm trying to create a simple data dump to a text file. It was all working fine and now fopen doesn't like my relative paths. So I'm using an absolute path to the file: C:\\Program Files\\FDS\\DTManage\\Web\\DTM\\php\\DTBill\\sources\\snapshot\\snapshot.txt But fopen keeps saying it can't open the file. It's acting like it isn't there. $path_parts = pathinfo(__FILE__); $filename = str_replace('\\', '\\\\', $path_parts['dirname'])."\\\\snapshot.txt"; if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; } Can someone tell me why this isn't working?
  17. Umm... ok, but I already solved it so I'm not sure why you're replying.
  18. Ok... got it figured out. I was using PHP's number_format() function to format the "billtotalx" value and it was throwing a comma into the value, which was causing it not to be evaluated as a number. DAMN.
  19. WTF... for(i=1;i<totalboxes;i++) { if(document.getElementById('bill'+i).value != null && document.getElementById('bill'+i).value != '') { total += Number(document.getElementById('bill'+i).value); } } alert(billtotal); total = total*1 + billtotal*1; alert(total); The first alert gives me the number. The loop is working fine, but when I try to add the two together, I get "NaN". This is insane!
  20. Anyone else have any ideas? parseFloat triggers a result of NaN. Using eval doesn't change anything. Here is the entire function: function calculate_ger(_box) { // ger calculation including totals for GER and Billable units var gerbox = document.getElementById('ger'+_box); var billbox = document.getElementById('bill'+_box); var ratebox = document.getElementById('price_rate'); var retval = billbox.value * ratebox.value; gerbox.disabled = "false"; gerbox.value = retval.toFixed(2); gerbox.disabled = "true"; // billable units total calculation var billtotal = 0; var totalboxes = document.getElementById('boxcount').value; var billtotal = parseFloat(document.getElementById('billtotalx').value); var billtotalbox = document.getElementById('billtotal'); var i=0; for(i=1;i<totalboxes;i++) { if(document.getElementById('bill'+i).value != null) { billtotal += parseFloat(document.getElementById('bill'+i).value); //alert(billtotal); } } billtotalbox.disabled = "false"; billtotalbox.value = billtotal; billtotalbox.disabled = "true"; } The first part works great. I don't understand why the second part isn't.
  21. I guess you didn't bother to look at their documentation? It's the 3rd example: http://tinymce.moxiecode.com/examples/example_03.php
  22. I was under the impression that unless you were using strings (which I'm not), it worked fine as an addition. I also trying wrapping the values in the Number() function and that resulted in a NaN result.
  23. billtotal = 30,000.00 at the start I have this: var totalboxes = document.getElementById('boxcount').value; var billtotal = document.getElementById('billtotalx').value; var billtotalbox = document.getElementById('billtotal'); var i=0; for(i=1;i<totalboxes;i++) { if(document.getElementById('bill'+i).value != null) { billtotal += document.getElementById('bill'+i).value; alert(billtotal); } } I have 8 fields that are being added to an existing total. This is an onkeyup function and the alert shows this as it loops: 30,000.000 30,000.0005 30,000.00050 30,000.000500 30,000.0005000 30,000.0005000 30,000.0005000 30,000.0005000 The fields that it is adding contains: 0 5 0 0 null null null null So it looks like it is appending instead of adding. What am I doing wrong??
  24. Yeah, I've done the whole AJAX thing and I don't have any issues there. My only new issue is that I've never dealt with one of these grids and I don't know how the data is stored or read or retrieved after updating. I'll play around with what Mchl posted and see what I can do with it. Honestly, this is a lot of work when I probably could have created this interface with pure PHP a lot faster... but I want the end user experience to be good so I'm trying to go above and beyond.
  25. Do you have any code for the first option you suggested that you wouldn't mind sharing?
×
×
  • 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.