Jump to content

tbare

Members
  • Posts

    198
  • Joined

  • Last visited

Everything posted by tbare

  1. haha... yeah... I'm American, and still don't appreciate the date format we use here...
  2. in case you're still fighting it - here's what I came up with. $lastdateofthemonth = date("Y-m-t"); $lastworkingday = date('l', strtotime($lastdateofthemonth)); if($lastworkingday == "Saturday") { $newdate = strtotime ('-1 day', strtotime($lastdateofthemonth)); $lastworkingday = date ('Y-m-j', $newdate); } elseif($lastworkingday == "Sunday") { $newdate = strtotime ('-2 day', strtotime($lastdateofthemonth)); $lastworkingday = date ( 'Y-m-j' , $newdate ); } echo date('l', strtotime($lastworkingday))." ".$lastworkingday; That should get you what you're after... Good luck!
  3. like was stated, relevant code will help, but to append, you could always use .= $_SESSION['GORB']['message'] = ""; $_SESSION['GORB']['message'] .= "First name wrong<br/>"; $_SESSION['GORB']['message'] .= "Last name wrong<br/>"; EDIT: --but scootstah's answer below is better
  4. I'd also say be careful for holidays - if one falls on a friday, you'll have to figure for that, too (if you need to)...
  5. try changing it to $lastdateofthemonth = date("m/t/y"); That gets your code to return Saturday -- then you your If statements to get what you need.
  6. You'll still have to use the: if(isset($focu)) { echo $focu; } because you still need to check if it's set
  7. Yeah -- it is a little less ugly, but i was going with what heshan's comfortable with
  8. EDITING BECAUSE I Misread your column names... yeah -- basically, your IF statement is hitting one of the 3, not all 3, so, if it's "father", mname, and gname is not being set. what you can do rather than: <?php if($fname!=null){ ?> checked="checked" <?php }?> onclick="father()" /> is: <?php if(isset($fname)){ ?> checked="checked" <?php }?> onclick="father()" /> etc...
  9. yeah -- but i can specify a different anonymous user on a single file in IIS to be different than all of the other files for the site... (what you say? microsoft did a good thing?) I see where you're going with that, though.
  10. curl may work... but i honestly don't think it'd execute any faster than system, exec, or passthru....
  11. nice find! and that sucks... alright - what's your thought on setting a single file (that the user never sees - strictly running the exe, using ob_start and ob_end_flush, then using header() to forward to the results page) as admin ... i don't like it, but i don't see another option now.
  12. I've tried passthru and exec ... same result with both (as i would have expected...) thanks though.
  13. there's nothing to do while it's processing. the new info (added from the exe) has to be there to do what happens next... :-/
  14. unfortunately, that's not going to be too much help - the process in and of itself isn't supposed to take this long, and it's not when the domain administrator is executing the php script... only when another user is... Thanks for the thought though! i'm welcome to as many other thoughts as people can come up with...
  15. that's my thought, too... that's why i'm confused. there's one line of code that's causing the issue: system("C:\path\to\exe.exe ".$insertedID); where $insertedID is the id of info inserted into a DB. the exe is taking the insertedID as an argument, and pulling info from the DB, putting it into an excel file, and getting results, then putting the results in the db. after that, the php file forwards you to your results page. the odd thing is, if i run the exe from cmd using /runas, it's instantaneous... i'm stumped!
  16. as the title states, on my Windows Server 2003 machine w/ IIS 6, setting Anonymous Access to a non-admin user takes about 7 - 9 seconds to execute a script, whereas an admin account takes about 1.5 - 2 seconds. Is there a way around this? I really don't want to have (even the 1 file that executes the system() command) be accessed by my admin account, but 8 seconds is an unacceptable time to wait for the next page to load.
  17. great! glad you got it working! Good luck on the rest of your project!
  18. sorry i didn't reply back - long weekend - but not long enough to do too much on the computer. I'll look a bit more into it, and get back to ya today. (unless someone else chimes in, too). T
  19. Look into a LEFT JOIN. I'm not exactly sure what you're looking to do, but here's an example of a left join: SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2 ON table_name1.column_name=table_name2.column_name
  20. your second query has 2 WHERE statements... if you need to WHEREs, use WHERE a AND b...
  21. fugix meant: <?php $i++; ?> , not $1++... simple typo
  22. any ideas at all? I know it's not a permissions issue, because on my local test machine, i'm using my user account as the "anonymous" account...
  23. if($number > 100) { $number = $100; } would something like this do?
  24. Hey, all... Hoping someone can point me in the direction to get this script to execute a little quicker (looking for several seconds to be shaved). I've got a script that takes info from a form, dumps into a DB, then runs a shell command (custom app) that takes the info from the DB, puts it into a specific (and different for each client) spreadsheet, gets some other values, and puts those in the database. When i execute the command from a cmd prompt, it finishes in less than a second. However, when I run it from PHP, it takes anywhere from 9 - 15 seconds to get to the next page. I've watched it in task manager, and the file i'm running is open for "what appears to be" the entire length of time before the results page appears (although, i realize that technically it's not). why could it be taking so much longer from PHP than it does from the CLI? can you think of a way to get it to run quicker? I don't think it's a PHP coding issue, but more of a permissions issue, but I can't think of anything else to try at this point...
×
×
  • 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.