Jump to content

tet3828

Members
  • Posts

    107
  • Joined

  • Last visited

    Never

Everything posted by tet3828

  1. unsurpisingly no, I still don't get it. what is the while condition? should I so something like while (number of results in posted array > $count) { display results } if (!isset($_POST['test'])) { echo "<form action='filetest.php' method='POST'>"; $qry = "SELECT * FROM `staff`"; $result = mysql_query($qry) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $value = $row['eID']; echo "<input type='checkbox' value=$value name='staff[]'>"; echo "".$row['lName'].", ".$row['fName']."<br />"; } echo "<input type='submit' name='test' value='TEST'></form>"; } else { $count = 0; while(?) { $count++; $staff[$count]; } }
  2. I wrote this dummy script to practice passing multiple check box values through &_POST. However it is only passing the last value. How can I get it to pass however many values I check and not just the last? if (!isset($_POST['test'])) { echo "<form action='filetest.php' method='POST'>"; $qry = "SELECT * FROM `staff`"; $result = mysql_query($qry) or die(mysql_error()); while($row = mysql_fetch_array($result)) { $value = $row['eID']; echo "<input type='checkbox' value=$value name='$staff[]'>"; echo "".$row['lName'].", ".$row['fName']."<br />"; } echo "<input type='submit' name='test' value='TEST'></form>"; } else { array $returned = $_POST['staff']; echo $returned; }
  3. Here is the table I have set up. If anyone has a better approach please help. |Key Value|Date|License Number|Radition Saftey Officers|Physicists| obviously there will only be one key value and one date one license number per license. HOWEVER multiple radition saftey officers and phyisicist can be placed on one license. easy enough. my GUI will have check boxes with each doctors / physicists name on it so the can be added to the license as needed. do I add these values as a continious string? how can I edit those values in the future if I have 20 first and last names in a record?
  4. sorry refresh error. not a context issue. however I still can't figure out what mode to choose to allow all the xp machines to write to the new server folders??? ??? I thought ,0777 would do it but I guess not. and 7777 gives a premission error.
  5. while being a good noob and reading the php manual I came accross the handy mkDir function. I need ALL rights for EVERYONE so my xp stations can write to the folders on the ubuntu LAMP server. now in the PHP manual it says you can set the mode like so: mkdir ('TRAINING SESSIONS/'.$state.'/'.$clinic.'', 0777) I am getting the expecte '); error on this line help the helpless.
  6. I am having endless problems with this date validation stuff. I just want to make sure the date entered is not greater than the current date... $eYear = $_POST['eYear']; $eMonth = $_POST['eMonth']; $eDay = $_POST['eDay']; $curDate = time(); $dateEnd=strtotime("$eYear-$eDay-$eMonth"); if ( $dateStart > $curDate ) { // Show error} works pretty well BUT if I enter today's date it performs the //show error code which I think is odd because I Am stating if the entered date is Greater than the current date do this NOT if the entered date is equal to or greater than the current date do this help the confused!
  7. I was hoping the link would open the folder the same way it does when you go to My computer and navigate to the folder or when you go to the run menu and type the network location as a folder. its purpose it to open the folder on the server so users can drag and drop files into that folder. but its no huge deal. its not complicated to navigate manually.
  8. Thanks for the suggestion! I got it with this: echo "<a href='\\$ip\TRAINING SESSIONS\$state\$clinic'>Folder Link</a>"; but now its trying to access it as a page in my browser: http://10.0.11.171/10.0.11.171/TRAINING%20SESSIONS$state$clinic <---this is show in my address bar crap. I was hoping it would open the folder the way it does when I launch the folder from the run menu. Anyone have some clues on how to do this?
  9. I am trying to get my script to display and link using href tags to a folder on my server. it is a Linux based server being accessed by windows machines. when I type this into my run menu on my windows machine to access the folder: \\10.0.11.171\www\TRAINING SESSIONS\$variableDir\$variableDir works fine but when I put it in a href tag in my script the slashes and varibles confuse it: echo "<a href="'\\$ip\TRAINING SESSIONS\$variableDir\$variableDir'">Folder Link</a>"; this gives me the ole' encapsed string error. any suggestions? please and thanx! p.s.I love the fact that there is people in these forms 7am on a super bowl sunday
  10. thanks thus far. but how would I echo out only the third row?
  11. If someone would kindly take the time out to explain to me litterarly why the code below displays nothing... $row = mysql_fetch_array($result); echo "".$row['geoLoc']."<br>"; whereas this code shows my result ??? while($row = mysql_fetch_array($result)) { echo "".$row['geoLoc']."<br>"; } I'd be extremely thankful. Just trying to grasp all these concepts.
  12. Quick question. I was reading through some functions in the php manual I am intrested in using the mkdir function for a project I am working on. The manual says it returns true if it succeeded and a false if it failed. This may be basic and I've prob even done it with other functions but... how can I check the value it returned? so far I have: mkdir ("TRAINING SESSION"); so what do I do now? if mkdir == false {return error} ???
  13. I have really been struggling find a way to validate in a form weather the entered date is greater than the current date. here is my first attempt which failed wose than the wright brothers first attempt at flying. // establish entered date variables $eYear = $_POST['eYear']; $eDay = $_POST['eDay']; $eMonth = $_POST['eMonth']; // get current date turn it into variables $dateVar = getdate(); $cYear = $dateVar['year']; $cMonth = $dateVar['mon']; $cDay = $dateVar['mday']; // combine dates into a long string $dateCurrent = $cYear.''.$cMonth.''.$cDay; $dateEntered = $eYear.''.$eMonth.''.$eDay; if ($dateCurrent < $dateEntered) { // show error } any links to scripts or suggestions?
  14. I have a hidden filed and I would like to pass some values that have non breaking spaces in them. how can I do this without losing data after the first space in my string ? :-\
  15. can anyone point me to a script or give me some pointers on writing a script that will interface with a sheet feeding scanner. Ideally Scanned documents will fall into a created or existing folder on my server for what ever person is currently selected on my database. I have a hunch this may be possible because the scanner has a windows interface that recognises when a document has been placed on the scanner. :-\ it is a fujitsu scanner f14120c2
  16. Perhaps I have not explained myself well enough. I already have a few: elseif {} elseif {} those work just fine, but what I was wondering is if I can: elseif { if { }else { }} You guys are most likely on the right track I'd better check my brackets. You all would laugh your socks off if you saw my code.
  17. is it against the laws of PHP to nest a if/else within a "elseif { }" I keep getting Parse error: syntax error, unexpected T_ELSEIF
  18. the problem was the me forgetting to put ' ' around my dates. DOH!
  19. ??? Im stumped on this one. here is my date range query SELECT * FROM tSession WHERE date BETWEEN 2008-01-10 AND 2008-01-22 I have the date 2008-1-15 as an entry in my table and it is returning zero results. help please
  20. what is the deal with the "OR" in the IF statement? I tried this: if ($_POST['sYear'] or $_POST['sDay'] or $_POST['sMonth']== xxx) { do whatever } Why isn't this working? My translation of the above is IF xxx is passed for either of these 3 variables Do this... What my malfunction here? thanks in advance
  21. Strange. I don't know what the deal is. it is still coming back with an empty query. ???
  22. My query is not returning any results however I know the my table tSession contains the value I am querying. I think I've got this query all wrong or something. please help $lName = $_POST['lName']; $sql = "SELECT * FROM tSession WHERE `lName` =`$lName`"; $result = mysql_query($qry) or die(mysql_error()); echo "the query $fName"; while($row = mysql_fetch_array($result)) { echo "the query $fName yeielded no results. ".$row['note'].""; }
  23. I am simply trying to verify that two fields in my form are not empty. But apparently I am not doing something right. Check it: if (isset($_POST['field1']) == FALSE AND if isset($_POST['field2']) == FALSE ) { //Tell the user both fields are empty, you suck try again. }
  24. if ($error == 0) { actions to carry out if $error is equal to zero } else { actions to cary out if $error is equal to anything else }
  25. Great suggestion. I actually can almost dicipher what this code snippit is doing but I am getting a parse error Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in /var/www/result.php on line 53 from this line of code if(isset($_POST[$v] && strlen($_POST[$v]) > 0){ I tried adding and removing a few brackets and using a single & sign instead of a double... same error.
×
×
  • 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.