Jump to content

myndcraft

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

myndcraft's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I was originally going to do as you suggested by doing some string manipulation prior to creating the link, but my knowledge of java is zero and thats the page which is generating the link. I will, though if I need to figure it out, but I was hoping there was a way to rebuild the path in the php page itself.
  2. I understand this is breaking against good form, but hopefully someone can help me out. For an internal application a jsp page (not written by me) is calling a php page. The link is formatted like this javascript:openNotesWindow('http://cumulus/Firestar/notes.php?recordID=6626&recordName=FA08021_FPO.jpg&cumulusUser=cumulus&recordPath=:/Volumes/Stock/Photodisc/Business%20&%20Industry%20Illustrated/FPO:FA08021_FPO.jpg') The problem is that the 'space' (%20) is causing a problem when I load my variables $theVars = $HTTP_GET_VARS; $recordID = $theVars["recordID"]; $action = $theVars["action"]; $recordName = $theVars["recordName"]; $cumulusUser = $theVars["cumulusUser"]; $noteText = $theVars["noteText"]; $noteSubject = $theVars["noteSubject"]; $submit = $theVars["submit"]; $noteIDX = $theVars["noteIDX"]; $recordPath = $theVars["recordPath"]; recordPath is now equal to ':/Volumes/Stock/Photodisc/Business' rather than ':/Volumes/Stock/Photodisc/Business%20&%20Industry%20Illustrated/FPO:FA08021_FPO.jpg' Is there a way to change the way I am handling the "getting" of the variables to not break the path string? If there isn't can anyone think of a way to manipulate the array '$theVars' to essentially rebuild the full and proper path?
  3. Well I thank you tremendously because it works, but could you walk thru what's happening there? I am trying to reason myself thru it and am getting hung up.
  4. well we are almost there now! So it works in that if I enter text in both fields there is no error AND if I leave one field blank it errors as well which is correct. The problem is it also errors if I leave both fields blank which should be acceptable. Thanks btw for helping out thus far
  5. Hi waynewex. Unfortunately the same thing happens. I see the contents of the fields displayed, but if leave one blank the error never appears.
  6. /bumping to the front page for the daytime crew
  7. Hi Thorpe, so I am encountering a problem here somewhere. So here is the codeā€¦ echo $bumper_left . " " . $bumper_left_color; if ((isset($bumper_left) && !isset($bumper_left_color)) || (!isset($bumper_left) && isset($bumper_left_color))) { $errmsg .= "Mismatch error"; } echo $errmsg; If I set both values in the form I see them both in the initial echo. If I refresh the page and enter just one field I see only that field, but the errmsg echo never appears. Any thoughts?
  8. Logic and reasoning have left me for a warmer climate so I'm turning to forum members. I have two variables that have been set from a form lets call them $item1 and $item1_color What I am trying to do is append to an error string ($errmsg) if either variable has been set or is not empty AND the other variable has. So basically if a user selects an item, but not the color set the error. Or if they have set the color, but not selected an item set the error. Can someone help me with the best way to do this? Thanks!
  9. Not sure, just started looking at php myself, but you might want to delete the mysql user/pass information from that first connect statement.
  10. I'm very new to php, but it would appear when you are linking to your nav page and html page you aren't supplying a correct path. If I had to guess you are including "nav_all.html" when it should be "../nav_all.html"
  11. Well you could do a ping like this <?php $count = 4; $url = "google.com"; $result = exec( "/sbin/ping -c {$count} {$url} | /usr/bin/grep \"packets\" | awk -F\", \" '{print \$3}'" ); // do whataver with result to determine site availability ?>
  12. And because I was running on too little sleep here is the code I was using that worked on the test machine, but produced the errors in the above post. <?php $dirArray = getContents("."); function getContents($curDir){ $openDir = opendir($curDir); while($entryName = readdir($openDir)) { if(filetype($entryName) == "dir" && $entryName != "." && $entryName != "..") { $dirArray[] = getContents($entryName); } else { if($entryName != ".DS_Store"){ $dirArray[] = $entryName; } } } closedir($openDir); return $dirArray; } ?>
  13. Well halfway there... I think. It did work on my test box, but when trying on a live server sandbox I ran into a bunch of errors
  14. I'll preface my first post here with the fact that I am brand spanking new to PHP, I do have familiarity with other programming & scripting languages though so hopefully I will be on the ball here shortly. What I'm trying to do is get a list of all files contained in a folder and it's sub folders. I found this function which works on just the main directory the php file is called from <?php $dirArray = getContents("."); echo count($dirArray); function getContents($curDir){ $openDir = opendir($curDir); while($entryName = readdir($openDir)) { if($entryName != ".DS_Store" && filetype($entryName) != "dir"){ $dirArray[] = $entryName; echo $entryName; } } closedir($openDir); return $dirArray; } ?> So after looking at that and expanding on it a bit I came up with this <?php $dirArray = getContents("."); echo count($dirArray); function getContents($curDir){ $openDir = opendir($curDir); while($entryName = readdir($openDir)) { if(filetype($entryName) == "dir") { $dirArray[] = getContents($entryName); } else { if($entryName != ".DS_Store"){ $dirArray[] = $entryName; echo $entryName; } } } closedir($openDir); return $dirArray; } ?> When I run this though I get a bunch of errors like this The issue here is that the files in question don't reside in the directory tree so somehow we are escaping it. Can anyone provide some insight on this? 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.