-
Posts
336 -
Joined
-
Last visited
Posts posted by benphp
-
-
On any non web programming related forum, I would straight up assume you were trying to cover porn tracks.
Funny. I almost posted the reason for it, because I know the reason why most people want to do this. No - I'm using it for testing, and I need to clear my cache a lot without having to go through a menu to do it. PIA.
-
This is pissing me off.
cd "C:\Documents and Settings\mylogin\Local Settings\Temporary Internet Files" del *.*
This doesn't work either:
cd C:\Docume~1\mylogin\LocalS~1\Tempor~1 del *.*
Nor do variations of it.
In fact, if I navigate here in DOS, and do a DIR, it doesn't show the files.
WTF?
-
I'm the owner. I'm using
<?php $fp = fopen($path.$_POST['signup'], 'w') or die("Sorry"); flock($fp, LOCK_EX); fwrite($fp, $string); flock($fp, LOCK_UN); fclose($fp); ?>
which works on my windows dev box, but then when I upload it to my Linux server, it doesn't. I have to set the directory to 777. 775 doesn't work - other security settings didn't work.
-
I have a script that creates a txt file but doesn't work unless I set the directory to 777. Is it safe to do that?
-
Thanks for the responses. It looks like I have some more work to do!
-
Here's a grid generator. You can pick it apart and use it to your needs.
<form action="" method="post"> <input type="text" name="cols" value="4" size="2" maxlength="2"> <input type="submit" value="Go" name="btnGo"> </form> <?php if (isset($_POST['btnGo']) && $_POST['cols'] > 0 && $_POST['cols'] != "") { $cols = $_POST['cols']; //number of columns to use } else { $cols = 4; //number of columns to use } print "\n<form action=\"\" method=\"post\">"; print "\n<input type=\"text\" name=\"cols\" value=\"$cols\" size=\"2\" maxlength=\"2\">"; print "\n<input type=\"submit\" value=\"Go\" name=\"btnGo\">"; print "\n</form> \n"; $anyOldArray = array("1. Nemo","2. Marlin","3. Coral","4. Dory","5. Phil","6. Bob","7. Bloat","8. Gurgle","9. Pearl","10. Bruce","11. Chum","12. Nigel","13. Gill","14. Jacque"); print "<table border=\"1\"> \n<tr>"; //print the table $colCount = 1; //counts the column number being printed, starting at 1 - you're going to have at least one column. $numElements = count($anyOldArray); //count number of elements in array $i = 0; //loop counter //This while loop does two things: it prints a cell when an element exists, and it starts a new row if //there are more elements and it has reached the end of a row. while($i < $numElements) { //Do this while loop counter is less than total array element count. //Find the last cell in the row. If $colCount==$cols then this is the last column in the row, so end it and start another //The $i < $numElements-1 means DON'T start another row, because there aren't any more elements. For example, //you don't want to start a new row when you have 4 columns and 8 elements. if(($colCount==$cols) && ($i < $numElements-1) ) { print "\n\t<td>$anyOldArray[$i] </td> \n</tr> \n<tr>"; $colCount = 1; //reset the column counter to 1, because you're starting a new row, so the first column is $colCount 1 } elseif($numElements > 0) { //if it isn't the last cell, just print a regular cell print "\n\t<td>$anyOldArray[$i] </td> "; $colCount++; //add to your $colCount, because you just printed another element in a column. } $i++; //increment your loop counter. } //The above loop will write only cells that have elements to display in them. So when you run out of elements, what then? //The following loop fills in the remaining cells when your elements run out - so you don't get a table shaped like an F. //While fill out the remaining cells with a space [ number of columns is greater than the current row count ] //$colCount is set by the above script and is stuck at the last column printed. So if you have 14 elements in 4 columns, and you're on your last //row, the last printed element was in column #2 while ($colCount <= $cols){ //keep printing cells until you reach the number of columns you want printed. print "\n\t<td> </td>"; $colCount++; //keeps incrementing the number of columns printed - picks up where the first WHILE statement left off. } print "\n</tr> \n</table> \n"; //close the row and table. ?>
-
ucwords($row['employee_name']);
-
"do you have a login script setup already?"
Yep - I'm using session vars to hold login info. I'm reading about chmod now and wondering if that might be the answer - but then, I wonder if it works on a non-unix box (windows).
-
I'm creating a file-sharing - web collaboration site, and I have all the files in an /upload/ directory. I want people who are logged in to be able to download http://www.mysite.com/upload/thedocument.doc for example, but if someone who isn't logged in tries to enter the url: http://www.mysite.com/upload/thedocument.doc it won't work.
Is there a way to do that?
-
Thanks. Do you know how to fix it?
-
var numerator = 186100488800821781.9216;
var denominator = 496;
var quot1 = (numerator / denominator);
document.form.quotient.value = quot1;
The result is:
375202598388753.6
but the real number (using a calculator) is
375202598388753.59258387096774194
It's been rounded off - without even using Math.Round. How do I get the actual number?
-
That's it. Thanks! What was I thinking.
-
You're right sorry.
I want it to display:
ID = 1;Animal = alligator
ID = 3;Animal = kangaroo
ID = 2;Animal = panda
ID = 0;Animal = zebra
That is, it sorts on the values but retains the indexes.
-
I've been all through that - usort, sort, asort, - none of them do what I'm trying to do.
-
This is probably simple for someone. I want to sort an array but maintain the array index (0, 1, 2, etc). Here's my example:
<?php $testy = array (); $testy[] = "zebra"; $testy[] = "alligator"; $testy[] = "panda"; $testy[] = "kangaroo"; asort($testy); for($K = 0; $K < sizeof($testy); $K++) { $id = $K; print "ID = ".$K.";"; print "Animal = ". $testy[$K]; print "<br />"; } ?>
This sorts the array, but my index gets jacked. It displays:
ID = 0;Animal = zebra
ID = 1;Animal = alligator
ID = 2;Animal = panda
ID = 3;Animal = kangaroo
I want it to display:
ID = 3;Animal = zebra
ID = 0;Animal = alligator
ID = 3;Animal = panda
ID = 2;Animal = kangaroo
Help!
-
I have a $key = "mykey" and a string I want to encrypt with the key strEncrypt = "mypassword".
I've looked for hours trying to find something that does this. Is there a function already developed? or is there an easy way to do this?
Thanks!
-
"Some people think they can just keep adding more and more features after you've begun development and agreed on a fixed price though"
This has been my experience, which is why I've recently moved to an hourly rate. With previous jobs, I was far too generous in allowing the client to modify as we went along - ultimately, it was hardly worth my time.
In the future, I'll go with a set price with solid requirements. Any modifications are extra and hourly. Trouble is, we often get into situations where new code is required due to unforeseen conflicts - and I end up coding-as-we-go.
Pricing is tricky. I wish I had a billing department.
-
Thanks! I'm beginning to think that minimums are a good way to go. I was charging per hour, but I think the clients would have been happier with at least some fixed amount, such as a minimum. Maybe I'll go with a minimum, then an hourly rate combo.
-
Thanks for the reply - how about a minimum?
-
Generally speaking? I have a client who has 600+ products and wants separate logins for retail/wholesale - which filters out prices. I'm guessing about 4 tables for the products and 2 for the login. He wants full custom design - his design.
Anyone have a ballpark for something like that?
-
Solved it:
SELECT DISTINCT resp.rid, users.first, users.last, users.email FROM users RIGHT JOIN resp ON users.uid = resp.uid WHERE 1 = (SELECT MAX(resp2.rcount) FROM resp AS resp2 WHERE resp2.uid = $temp) AND resp.uid = $temp ORDER BY users.last LIMIT 1
revraz - it wouldn't work because it would return people who have both 1 and 2. I want to exclude people with both 1 and 2 and just return people with 1.
-
Sorry to keep bugging you guys, but I've been working on this for hours and can't come up with a satisfactory statement. I'm trying to get a list of names of people in "users" that have an rcount of 1 ONLY. So I want to exclude people who have an rcount of 2 or 3. So selecting all with rcount = 1 isn't good enough. I need to select all with rcount = 1, but only 1.
Any ideas?
"resp"
+-----+------+------+------+-------+---------+-------+--------+ | rid | pid | qid | uid | score | ractive | shift | rcount | +-----+------+------+------+-------+---------+-------+--------+ | 1 | 1 | 1 | 215 | 1 | NULL | 4 | 1 | | 2 | 1 | 2 | 215 | 2 | NULL | 4 | 1 | | 3 | 1 | 3 | 215 | 1 | NULL | 4 | 2 | | 4 | 1 | 4 | 215 | 2 | NULL | 4 | 2 | | 5 | 1 | 31 | 216 | 2 | NULL | 4 | 1 | | 6 | 1 | 13 | 216 | 2 | NULL | 4 | 1 | | 7 | 1 | 5 | 216 | 3 | NULL | 4 | 2 | | 8 | 1 | 6 | 216 | 1 | NULL | 4 | 2 | | 9 | 1 | 7 | 217 | 1 | NULL | 4 | 1 | | 10 | 1 | 8 | 217 | 1 | NULL | 4 | 1 |
"users"
+-----+-------+----------+ | uid | first | last | +-----+-------+----------+ | 204 | Mark | Addama | | 205 | Kevin | Barker | | 206 | Bill | Barnwell | | 207 | James | Bataki | | 208 | Barry | Buer |
-
Excellent! THank you!
-
I have 2 tables, "users" and "resp".
users:
Last | First | uid
resp:
val1 | val2 | uid
I want to find out who in "users" does not have a record in "resp".
I've tried:
SELECT DISTINCT users.first, users.last FROM users RIGHT JOIN resp ON users.uid = resp.uid WHERE resp.uid IS NULL;
but it doesn't work of course. How do I do this?
Thanks!
How to delete Temporary Internet Files with a batch file?
in Miscellaneous
Posted
MadTechie,
Thanks for those - I might upgrade to IE7 just to get those to work - they won't work in IE6, apparently. I don't like IE7 though.