tbare
Members-
Posts
198 -
Joined
-
Last visited
Everything posted by tbare
-
Trying to find the last working day of the month
tbare replied to Icebergness's topic in PHP Coding Help
haha... yeah... I'm American, and still don't appreciate the date format we use here... -
Trying to find the last working day of the month
tbare replied to Icebergness's topic in PHP Coding Help
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! -
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
-
Trying to find the last working day of the month
tbare replied to Icebergness's topic in PHP Coding Help
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)... -
Trying to find the last working day of the month
tbare replied to Icebergness's topic in PHP Coding Help
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. -
You'll still have to use the: if(isset($focu)) { echo $focu; } because you still need to check if it's set
-
Yeah -- it is a little less ugly, but i was going with what heshan's comfortable with
-
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...
-
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
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. -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
curl may work... but i honestly don't think it'd execute any faster than system, exec, or passthru.... -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
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. -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
nope - Windows 2k3 - no IPV6 -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
I've tried passthru and exec ... same result with both (as i would have expected...) thanks though. -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
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... :-/ -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
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... -
non-admin user taking ~7 seconds to run system("C:\...") command
tbare replied to tbare's topic in Microsoft IIS
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! -
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.
-
great! glad you got it working! Good luck on the rest of your project!
-
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
-
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
-
your second query has 2 WHERE statements... if you need to WHEREs, use WHERE a AND b...
-
fugix meant: <?php $i++; ?> , not $1++... simple typo
-
system(), exec() and passthru() taking > 10 seconds to execute
tbare replied to tbare's topic in PHP Coding Help
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... -
A rather simple request in regards to a dice system
tbare replied to Reizvoller's topic in PHP Coding Help
if($number > 100) { $number = $100; } would something like this do? -
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...