Jump to content

Jim from Oakland

Members
  • Posts

    41
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Jim from Oakland's Achievements

Member

Member (2/5)

0

Reputation

  1. Am getting back to coding after a while away. I remember a lot but cannot remember even more. In a variable within a class I have a file name. I want to extract the file name EXTENSION. I am using end (to get last array entry) with explode (which makes 2 element array containing 1. the file name w/o extension and 2. the extension itself) as follows: $sFileExt = end(explode('.', $FileName)); I get this notice: Only variables should be passed by reference. I did try making the delimiter (a period char) a variable too. Same message. I does work by the way.
  2. I need some assistance with php specifically and web dev generally. I am a fairly proficient programmer per se. Have done non-web programming, especially Excel VBA. Before that I did some basic and a bit of C. I've done some reasonably sophisticated stuff with html and php including some cool php classes and even a bit of AJAX. But a lot of it is just hacking! I'd rather spend time doing the beefy stuff rather than tinkering, testing, trying, failing, misunsderstanding so many topics like I do now. All too often I stumble over otherwise basic topics that I know too little about (e.g. HTTP, CSS, java script, Apache etc. etc.). Worse yet, its hard to know just what I don't know. For example, the more I read about sessions and cookies the more I'm confused. I'm still not clear about what to do if cookies are turned off. Some say pass session id via url or via a POST. Others say no never. I hacked for three hours just trying to figure out how to determine if cookies are enabled! Errrghh. I have some smallish personal projects that I want to do -- nothing too sophisticated I think -- and some hope of doing some more sophisticated stuff like on-line publishing of a "modularized" version of a large report requiring much more sophisticated "content management" expertise than I have. I'm hoping to find someone who is knowledgeable and proficient with php and web generally and who'll work on a retainer type arrangement: e.g. I send some bucks -- say for five hours at a time -- and you work until that amount is used up. Hourly rate is negotiable and, of course, based on experience. Jim jim@jimeyer.net
  3. Phreax I need to sort an array (configured as shown) based on one of the second dimension keys. [1] ['File_Name'] => test.doc; [1] ['File_Type'] => MS Word; [1]['Size'] => 50; [2]['File_Name'] => test.pdf; [2]['File_Type'] => Adobe PDF [2]['Size'] => 150 [3]['File_Name'] => test.xls; [4]['File_Type'] => MS Excel; [5]['Size'] => 60; For example, I'd like the order of the 1st dimension keys (integer indices) to reflect the order if the array is sorted by the "File_Type" key. Jim (sort of)
  4. phreax I posted this on javascript too. I want to initiate a download from client computer, with button click. I do not want the browser to try to open the file like it does on a normal link. I'd like to use browsers' save as dialog, like using the right click in IE that provides the "Save Target As" option. Thanks a lot!
  5. I THINK this is the right place to ask... I have a file listing that serves up LINKS to files in a directory. I would like to give users the option to "save" the file to her/his computer. Here's what I want: In IE if I right click on the link I get the "Save (target) As" dialog box. How do I do that that with a button? Specifically what might js code look like? pseudo code <script "language=javascript"> function saveAsDialog(sFileName) { fileSaveAs("application/text", sFileName); } </script> Jim
  6. Apaches I am using a modified version of the basic, commonly available php code (e.g. it can be found at the php manual website) which allows user to upload a file to a directory at my website. I am using the same EXACT same code on two different accounts at the same hosting service. The code works swimingly on one account and not the other. The $_FILES array reports error # 6 which is something like "cannot find temporary directory" (where file is uploaded to). The hosting service uses Apache. The hosting service provider tells me that they do not provide "support" for php so for the moment I am stuck. I hope to be able ask them about more specific things to check for me. OR, can I tell the web server (using code) where to store the uploaded file? Thanks.
  7. This is not solved. Perhaps I need to try another topial forum?
  8. Thanks teng84 I DID do the print_r($_FILE). That is how I know that the web server (Apache) cannot locate the temp directory where the uploaded file goes. I get error # 6. I can also see the file name.
  9. Thanks for the suggestion If youlook closely at my codeyou'll see that I am doing exactly the same action as the suggested code. FWIW I did try it anyway and it ALSO gives error #6, temp directory not found. I presume that this error has to do with something my host service is doing; but I am at a dead end with them. Jim
  10. Phreax I'm a lightweight PHPer so go easy on me. I am using basic, commonly available php code (e.g. at php manual website) to allow user to upload a file. I am using the same exact code on two different accounts from the same hosting service. Code works fine on one account and not the other. $_FILES array reports error # 6 which is something like "cannot find temporary directory" (where file is uploaded to). Host company tells me that they do not provide "support" for php so for the moment I am stuck. I hope to be able ask them about more specific things to check for me. OR, can I tell the web server (using code) where to store the uploaded file? Thanks.
  11. oops, wrt to parseInt()... ...If the first non-whitespace character is not numeric, the function returns the Not-a-Number value NaN. Perhaps the regex option is the one I need.  Does someone have an example of how to do it in javascript? TIA phreax
  12. Based on content of a variable holding the id/name of a specific html input field like this: sInputName = 'item11_element23_value'; I need to extract the item number and element number from that name (11 and 23 respectively, in the example.)  //for the example would return 11 iItemIndex = extractItemIndex(); //for the example would return 23 iElementIndex = extractElementIndex(); There may be as many as three  digits for either criterion. Thanks soo much!
  13. I found the error.  It DID relate to a field with a name attribute but not an id attribute. FYIyou can indeed useinputs that are notin a form.  The must have an ide attribute though.
×
×
  • 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.