Jump to content

bals28mjk

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by bals28mjk

  1. Are you using a debugger? What is the error?
  2. Good catch. Perhaps a \s*\d+\s* would be a more efficient regex. *Wipes off rust* haven't been coding in a long while. I think that one searches for zero or more spaces, followed by at least one digit, followed by zero or more spaces. I changed the spacing to allow for zero spaces to take into account spaces at the beginning and end of the string.
  3. Untested, but try: $string = "1 2 3 4 5 6"; preg_match_all('/\s+/',$string, $matches); print_r($matches); http://www.php.net/manual/en/ref.pcre.php
  4. The object you are getting the length for is for the input. So when you do inputObject.length it's getting the length of the input box, not the characters in the zipcode. If you want that I believe you can use form1.zip.value.length. If you are validating forms in js I advise you look into doing it with the use of regular expressions.
  5. Hey DarkWater, thanks for the help, another person helped me with this and fortunately, I got it now. I can kind of see where you were going with this. I'm starting the path with http:// instead of c:\\. Is that what you were referring to?
  6. Thanks for specifying. Now can you specify that specification? This is pretty much what you told me not to do, but maybe a visual can help. I don't know how else to open the file and this outputs only the source: $d=new DOMDocument; $f=file_get_contents($fullPath); $d->loadHTML($f); echo $d->getElementById("d")->nodeValue;
  7. Hey DarkWater thanks for the reply, I'm not sure exactly what you mean, would you mind specifying?
  8. Hey. Has anyone worked with the PHP DOM here? I'm trying to get data from files with .php extensions. It allows for xml, html, but I couldn't find anything for .php extensions. It's important to note that you are allowed to add html/xml text for the DOM classes in the form of a string. Though, I only know how to get data from asource file with PHP; how would you grab the file after all PHP parsing? Can someone help me out? What's the best way of going about this? Thanks.
  9. Yeah. (I'm testing on a local system.)
  10. Hey. I'm trying to open a batch file on win xp, but the exec function doesn't seem to be working. exec($path); I've tried different combinations of /,//,\ to navigate to the directory. Nothing happens when I open the file via a browser, but i tried it in a cli window and it opens the cmd.exe, but recloses immediately and none of the code gets executed. Anyone know what's going on here? Thanks.
  11. Hey everyone, how are you all? Not sure how I would do this, but I want to build an app similar to browsercam native to my computer, win xp. (For those of you who don't know browsercam takes screen shots in various browsers/platforms.) I'd imagine I'd have to use window shell commands (executed within php), my knowledge of windows is limited, but as always, I can learn. May someone guide me into the right direction?
  12. @grissom That's odd, JavaScript accepts endlines. I'd just include the txt file in a hidden form and grab the values with JavaScript. <HTML> <HEAD> <TITLE>A php JS test with foo</TITLE> </HEAD> <BODY> <SCRIPT type="text/javascript">; onload=function() { alert(document.getElementsByTagName("input")[0].value); } </SCRIPT> <input type="hidden" value="<? include("helloworld.txt"); ?>"> </BODY> </HTML>
×
×
  • 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.