Jump to content

solarisuser

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by solarisuser

  1. Hey All, Can mkdir() set ownership by a particular user? Thanks
  2. Hi All, One of my jquery scripts asks for a default number to display. Instead of hard-coding this in the script, I'd like to figure out how to grab a php query string and pass it to the script. For example: 1) In the jQuery script.... "pages: 10" 2) URL will be, index.php?pages=10 How can I have the jQuery script see the pages variable in the URL? BTW - I've tried a few jQuery scripts that help with this but none of them worked, so I'd hopefully someone can help me out. Thanks!
  3. Hi All, I'm trying to figure out if a while loop is what I really need to use. My goal is to copy a dynamic amount of data from C:\ to D:\. I have a routine to detect the used hard disk space on C:\ and the free disk space on D:\. If D:\ does not have enough space for the copy, I delete a folder, then I want to run the code again to detect the used hard disk space on C:\ and the free disk space on D:\. If I still need more space, I delete another folder, and run the code again, etc. Right now I run the code to detect the hard disk size, and if I need to delete a folder, I have: while($size_to_copy > $size_free) { // delete folder // run code to update $size_to_copy and $size_free } However, running code inside the while loop to generate an updated $size_to_copy and $size_free do not seem to tell the while loop of the new values. Any direction on my next steps would be great - thanks!
  4. thanks but i got that part down no problem. the thing is, while im reading each line of text i need to use some regex to find out if that line has two occurances of "\" and delete that line, then continue... I need to use regex because the data is dynamically generated
  5. Hi All, I have a text file that contains directory paths. My goal is to delete the line from the text file if it has exactly two "\" characters, no more and no less. I've thought about using count_chars() but I can't figure out the best way to integrate it with preg_match_replace or something of the like. Any help would be much appriciated! Thanks
  6. I'm trying to add 180 days to an existing date, and then make sure if the month is a single digit, I want to add a 0 before it. For some reason its just not working, I am hoping someone can point out my error... thanks! var dateStr = "08/22/2001"; var millis = Date.parse(dateStr); var newDate = new Date(); newDate.setTime(millis + 180 *24*60*60*1000); var newDateStr = "" + (newDate.getMonth()+1) + "/" + newDate.getDate() + "/" + newDate.getFullYear(); myarray = newDateStr.split(/\//); if( myarray[0] <= 9 && myarray[0] >= 0) { var save = "/" + myarray[0] + "/"; alert(myarray[0]); newmonth = "0"+myarray[0]+"/"; alert(newmonth ); myregexp = save+"/"; alert(myregexp); newDateStr2 = newDateStr.replace(myregexp, newmonth ); alert(newDateStr2); }
  7. very cool , thanks. i was looking for something not using strlen and tons of if statements...
  8. Hi All, I have data in an array like this "12345, 56789, KL5-1231231,KL5-1230502". Is there a function that I can use to say.... if string length of each piece of the array is less than 6, put it in this array, and the rest of the data entries go in another array. For example: $original_array = ("12345", "56789", "KL5-1231231","KL5-1230502"); some_function_here... $array1 = ("12345", "56789"); $array2 = ("KL5-1231231","KL5-1230502"); Thanks
  9. I'm not sure how to do that =( I'm using JSON syntax to return the results and fill in the fields. Do I need to focus on using a function() that does something like .. var field = document.getElementById('country').value; if(field.length > 0) { document.getElementById('second_dropdown_id').update_second_dropdown(); } ?
  10. Hi All, I am using AJAX in a form so when someone enters a country, it populates the fields with the population, etc. This works fine in text fields. Then I am using a JS script that links two dropdown menus, so when you select "A" in the first dropdown, it does a mysql query and shows only the results relating to A in the second dropdown. This works fine when clicking on it. The problem: When I type in a country, AJAX fills in the first dropdown menu just fine. However the second dropdown menu does not update. When I click on the first dropdown menu, then it works. I would like to know how can I make the second dropdown update when AJAX fills in the first dropdown. Right now, I'm using onchange="update_second_dropdown();" on my first dropdown.... any suggestions would be a big help! Thanks!
  11. Hi All, I am using AJAX in a form so when someone enters a country, it populates the fields with the population, etc. This works fine in text fields. Then I am using a JS script that links two dropdown menus, so when you select "A" in the first dropdown, it does a mysql query and shows only the results relating to A in the second dropdown. This works fine when clicking on it. The problem: When I type in a country, AJAX fills in the first dropdown menu just fine. However the second dropdown menu does not update. When I click on the first dropdown menu, then it works. I would like to know how can I make the second dropdown update when AJAX fills in the first dropdown. Right now, I'm using onchange="update_second_dropdown();" on my first dropdown.... any suggestions would be a big help! Thanks!
  12. Hey There, Can you please post your code in [ code] (minus space) so I can see it all =)
  13. For daily, thats easy. Make a new field called "daily", and have the login code update that field with the CURRENT_TIMESTAMP whenever a successfull login occurs. Then for the actual code to determine if they are the first, you can select daily from table where daily != '', and figure out how to order the timestamp so the earliest one is first, and then use LIMIT 1 to get it. then grab the uid from that result and you know who it was...
  14. Look at Apache configuration on "UserDir"
  15. You should be looking at the limitations imposed by the web server (Apache, IIS, etc)
  16. You need to use some JavaScript ... Check this out, it works very well with PHP... http://www.salix.gr/ajax_linked_selectboxes
  17. Hi All, I have a bit of code that is parsed when user clicks on a submit button using POST. It looks something like this <img src=show_loading.jpg> $sql = mysql_query(SELECT .....); while($row = mysql_fetch_array($sql)) {.... } etc The code takes up to 10 seconds to run, and then uses header() to redirect the user to another page. The problem is, php parses through all the mysql queries, then once its completed, shows the loading picture for a second, then redirects using header(). I am wondering if I can use ob_start() to show the loading picture, then have the mysql code be parsed, and header() will redirect to another page when completed. I've played around with various iterations of ob_start() in different places but it doesn't have the effect I'm looking for. Anyone have any ideas? Thanks
  18. Hi All, I have a page that has 20 checkboxes, sometimes with multiple pages (pagination). The "id" for each checkbox is checkbox_XXXX where XXXX is the mysql id. It's similar to a shopping cart, where the user can select one or more checkboxes, and click "Add to Shopping Cart". I'd like to have a JS that verifies at least one checkbox has been selected before running the $_POST code to add to shopping cart, and if not, just throw an alert with a message. Thanks
  19. Hi All, I have a mac address (11:22:33:44:55:66) for example.. I need to remove the last three groups, leaving just 11:22:33 So far I have come up with: \[^\:]+) But its not really right... In addition, I need to add a "0" (zero) digit to single groups in a mac address like this: (0:aa:3:aa:bb:2) Any help would be much appreciated!
  20. Hi All, Does anyone have any idea what I should google to create a "splash page" that tells the user to wait while a few mysql quieries are run through the php page? It takes anywhere from 5 to 20 seconds, and I don't need a progress meter, just a splash page so they do not go anywhere and the user doesn't think there is a problem with their browser or network connection. Thanks
  21. Any beginner MySQL + PHP book out there , in addition to google, will give you the answer. example: $username = $_SESSION['the_username']; $result = mysql_query("SELECT file_uploads,field2,field3 FROM tables WHERE username = '$username'"); $row = mysql_fetch_array($result)) $file_upload = $row['file_uploads']; if($file_upload == 1) { echo "You have file upload permission!<br><br><input type=file blah blah>"; }
  22. www.zapatec.com look at their ajax form, its made for newbs and does what you want and more
  23. Hi All, I use the following to gather information and e-mail it: <textarea name="test" rows="5" cols="40">1. 2. 3. 4. </textarea> When it comes across in e-mail (plaintext), I see 1.\r\n2.\r\n, etc. Is there a function I can use against $_POST['test'] to make them actual carriage returns?
  24. Hello, I am trying to have JavaScript read "09/04/2007" as a date value, and add 50 days to it. Do I need to split it up into a different date format? I tried adding parseInt(50) but it didnt automatically know what I'm trying to do. Any help would be appriciated - thanks!
×
×
  • 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.