[PHP] Windows 2000 Permissions error
While trying to use dir() on a certain directory, I get the error Warning: OpenDir: Invalid argument (errno 22) in c:\inetpub\wwwroot\search\update.php on line 71. I'm aware this is most likely a permissions error, but I've already given SYSTEM, SELF, and SERVICE full control over the directory. I have to restrict access to a few users on our network for this directory so EVERYONE isn't an option. Anyone have any ideas as to what I need to set the permissions to? -Justin
RE: [PHP] Windows 2000 Permissions error
Well the code actually traverses a group of directories and errors on that directory (the only one I've changed the permissions to) so I'm pretty sure it's not the code. Here's a snippet of the traversing code.. ---code start--- function listDirs($startDir) { echo Checking $startDir...br; $d = dir($startDir); while($entry=$d-read()) { if (substr($entry,0,1)!=.) { if(filetype($startDir/$entry)==dir) listDirs($startDir/$entry); if(substr($entry,strlen($entry)-4) == .php) dbInsert($startDir/$entry); } } } listDirs(/inetpub/wwwroot); ---code finish--- This outputs all the directories.. ending with this ---paste start--- Checking /inetpub/wwwroot/info/superintendent... Checking /inetpub/wwwroot/info/transportation... Checking /inetpub/wwwroot/info/transportation/Trans... Warning: OpenDir: Invalid argument (errno 22) in c:\inetpub\wwwroot\search\update.php on line 71 Fatal error: Call to a member function on a non-object in c:\inetpub\wwwroot\search\update.php on line 72 ---paste finish--- After Checking /inetpub/wwwroot/info/transportation/Trans... I'm receiving the error. Since the Trans directory is the directory with the different permissions, I'm lead to believe it's a permissions issue. -Justin -Original Message- From: Frewuill Rodriguez [mailto:[EMAIL PROTECTED]] Sent: Friday, October 19, 2001 2:52 PM To: King, Justin Subject: Re: [PHP] Windows 2000 Permissions error check your path, may be some extra slash.. show the code when call dir() - Original Message - From: King, Justin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 19, 2001 3:40 PM Subject: [PHP] Windows 2000 Permissions error While trying to use dir() on a certain directory, I get the error Warning: OpenDir: Invalid argument (errno 22) in c:\inetpub\wwwroot\search\update.php on line 71. I'm aware this is most likely a permissions error, but I've already given SYSTEM, SELF, and SERVICE full control over the directory. I have to restrict access to a few users on our network for this directory so EVERYONE isn't an option. Anyone have any ideas as to what I need to set the permissions to? -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] randomly picking a variable from an array
The easiest way I can think of would be to get a random number based on the size of an array. If you're querying your database and filling an array with all images, just use the database's random routine instead. (I.E. SELECT quote,author from randomQuote ORDER by RAND() LIMIT 1 in mysql) If this isn't the case, something like this should work.. srand(time()); $random=rand(0,sizeof($myVar)-1); Hope I could be of some help... --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From: Joseph Bannon [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 2:08 PM To: PHP (E-mail) Subject: [PHP] randomly picking a variable from an array How do you randomly picking a variable from an array with PHP? Thanks, Joseph PS. Thanks to those who helped me with GD. If you go to my site, you'll see the new counter I created at the top of the page. http://www.collegesucks.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Content management
I'm actually doing the same thing for my district. We've developed a code system much like html, only not. Sounds stupid but it works. I mostly ripped off UBB code. For example: [b]bold[/b], [i]italics[/i] Then we give the people using it an instruction sheet. Since [ and ] don't require a shift people tend to like it better. If you wanted to go further you could use javascript have automatically put in the tag. --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From: Scott Parks [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 2:53 PM To: [EMAIL PROTECTED] Subject: [PHP] Content management Hi All- I am developing a web interface for a school that will allow them to mange the entire site, from users to the actual display elements. The trick has been, they must not have to know HTML to do the administration. The question: does anyone have some links or examples of this kind of system from a layout perspective, even functionality. I want to deliver something they can really use. Thanks, -Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] randomly picking a variable from an array
But that would make sense rasmus... and I don't like to make sense =)... if its an array filled from a database, randomizing on the database level would still be better though. --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 3:13 PM To: King, Justin Cc: Joseph Bannon; [EMAIL PROTECTED] Subject: RE: [PHP] randomly picking a variable from an array I'd say the easiest way would be to use array_rand() See http://php.net/array_rand -Rasmus On Fri, 7 Sep 2001, King, Justin wrote: The easiest way I can think of would be to get a random number based on the size of an array. If you're querying your database and filling an array with all images, just use the database's random routine instead. (I.E. SELECT quote,author from randomQuote ORDER by RAND() LIMIT 1 in mysql) If this isn't the case, something like this should work.. srand(time()); $random=rand(0,sizeof($myVar)-1); Hope I could be of some help... --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From: Joseph Bannon [mailto:[EMAIL PROTECTED]] Sent: Friday, September 07, 2001 2:08 PM To: PHP (E-mail) Subject: [PHP] randomly picking a variable from an array How do you randomly picking a variable from an array with PHP? Thanks, Joseph PS. Thanks to those who helped me with GD. If you go to my site, you'll see the new counter I created at the top of the page. http://www.collegesucks.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Hack on Server.
I know this post is old by the list standards, so I don't know if you've gotten help, check in your php.ini for these lines ; automatically add files before or after any PHP document auto_prepend_file = auto_append_file= Does the auto_prepend_file line have something? If so check that out cause he could just have echo Hacked by mE!!! bWAAHAHAHA; die(); Which would make all your php scripts useless. I know you said you reinstalled php but did you just use the same ini file? On a side note, I'd recommend getting a linux webserver or at least running the windows version of apache. IIS's security is flawed as I'm sure you've seen or already known. I realize sometimes thats not possible, my boss told me last week he wants our server to be IIS by the end of August. Sometimes management just makes bad decisions. -Justin -Original Message- From: Jean-Francois Jauvin [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 3:59 PM To: [EMAIL PROTECTED] Subject: [PHP] Hack on Server. Hi, my server with php on it has been hacked or something., what appened is every PHP pages displayed a certain message like Hacked by blah blah blah None of the HTML pages were affected, only the PHP ones but the scripts were not altered, I've shut down IIS, reinstalled PHP, and everything is back to normal... kinda strange. Did anyone had a similar problem... Thanks JF -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Form verification
I'm trying to come up with a general solution for validating data in forms as far as empty fields. I've considered doing javascript, but would prefer to do the method where the page shows the previous form, with notes near fields that need to be filled out properly. My problem is I am trying to come up with a solution that will work in several forms so I don't have to modify every form I create. Any suggestions plus example code would be greatly appreciated. Thanks -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP/mySQL Query....
I'm assuming you're trying to join them and show resumeID also with this SELECT r.resumeID,r.userID,u.location FROM resumes r,users u WHERE r.userID=u.userID; -Original Message- From: Jeff Lewis [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 12:45 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP/mySQL Query Ok, using PHP and mySQL have two tables that look something like this; Table 1 (users): userID location Table 2 (resumes): resumeID userID I am trying to form a query to pull all the locations and list them on the page. While I could only just select from the users one I do want to be able to pull up the resumes as well. What is the best query for this? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP/mySQL Query....
Whoops.. do SELECT DISTINCT -Justin -Original Message- From: Jeff Lewis [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:08 PM To: King, Justin; [EMAIL PROTECTED] Subject: Re: [PHP] PHP/mySQL Query Yes but for the first query all I want to do is list the locations and not multiple times Jeff - Original Message - From: King, Justin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:46 PM Subject: RE: [PHP] PHP/mySQL Query I'm assuming you're trying to join them and show resumeID also with this SELECT r.resumeID,r.userID,u.location FROM resumes r,users u WHERE r.userID=u.userID; -Original Message- From: Jeff Lewis [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 12:45 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP/mySQL Query Ok, using PHP and mySQL have two tables that look something like this; Table 1 (users): userID location Table 2 (resumes): resumeID userID I am trying to form a query to pull all the locations and list them on the page. While I could only just select from the users one I do want to be able to pull up the resumes as well. What is the best query for this? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] dynamically naming arrays
I guess I'm kind of not understanding what you're trying to do. Besides dynamically create an array. I'd think what you're trying would work though --Justin King, School District of Superior Web Coordinator (www.superior.k12.wi.us) -Original Message- From: Matthew Luchak [EMAIL PROTECTED] Sent: Thursday, May 17, 2001 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] dynamically naming arrays any hints on dynamically naming arrays? ie: $stuff= explode (!, $contents); //$stuff[3] is foo $stuff[3]=explode(,$stuff[4]); print_r($foo); Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Variable question, yet another
Alright... here's my situation for those that didn't read my string of messages yesterday.. (plus a bit more background information as to why I'm doing this) I'm writing an engine for a content managing system. Part of the system is a menu builder. I use 2 tables, (this is a mysql database) menu and menu_parts. They look like this Table menu ID : Integer; (auto increments, key) Name : Varchar[128]; Type : Integer; (unused now) Table menu_parts ID : Integer; Menu : Integer; (which menu this belongs to) Order : Tinyint; (all menu items have incremental numbers) Type : Tinyint; Data : Text; My code looks like this [code] $query=SELECT type,data FROM menu_parts WHERE menu='1' ORDER BY m_order; $result=mysql_query($query); if($myrow=mysql_fetch_array($result)) { do { if($myrow[type]==1) eval(echo \.$myrow[data].\;); elseif($myrow[type]==2) eval($myrow[data]); else echo $myrow[data]; } while($myrow=mysql_fetch_array($result)); } [/code] So depending on the menu_parts type, it will display the data field differently. If the type=0, it simple outputs the data field plain text. If the type=1, it adds echo to both sides and outputs data. If the type=2, it evaluates the code as is. The problem I'm having, is with type 1. The main reason for this type is say I want to send the user to a php script and pass parameters (I'm going to use []'s so those of you with html email readers don't parse it) [a href=myscript.php?username={$userdata[username]}]Goto MyScript.php[/a] So when the line hits type 1, it evals like this echo [a href=myscript.php?username={$userdata[username]}]Goto MyScript.php[/a]; Of course this yields an error because of the 's in the anchor tag. But if I add slashes the evaluated code will be echo [a href=\myscript.php?username={$userdata[\username\]}\]Goto MyScript.php[/a]; Which will cause the $userdata[username] variable to not process properly. I thought about making type one do echo ''; instead of echo ; but then if the user has a ' in their menu it won't function properly. I wish I could do this with regular expressions, but I'm not fluent with them (and also doubt I could succeed in my task if I did). I think I described my problem as thorough as I could have. Any help, comments, etc would be greatly appreciated. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Variable question
How can I evaluate a variable in a string? For example if I have a string defined as my user name is $user_data[username], how do I echo that string and have php evaluate $user_data[username]. Thanks in advance.. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable question
I think you're misunderstanding my question. I'm pulling $user_data[username] from a databse so the string my user name is $user_data[username] is exactly as the database hands it to me. I know how to simply concat information. -Justin -Original Message- From: Jack Dempsey [EMAIL PROTECTED] Sent: Monday, May 07, 2001 12:55 PM To: King, Justin; [EMAIL PROTECTED] Subject: RE: [PHP] Variable question you can do it a couple ways... echo my user name is . $user_data[username]; or echo my username is ${user_data[username]}; -Original Message- From: King, Justin [mailto:[EMAIL PROTECTED]] Sent: Monday, May 07, 2001 3:49 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable question How can I evaluate a variable in a string? For example if I have a string defined as my user name is $user_data[username], how do I echo that string and have php evaluate $user_data[username]. Thanks in advance.. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable question
Here let me flesh this out a bit more Consider the query SELECT datafield FROM myTable WHERE id=1; This would return My username is $userdata[username]; I want to then output what the database returns, and have php evaluate my variables. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable question
A simple eval($mysqldata) isn't going to do it though since the string is Your username is $userdata[username]; it'll just spit a parse error. I've already tried that -Justin -Original Message- From: Jack Dempsey [EMAIL PROTECTED] Sent: Monday, May 07, 2001 1:13 PM To: King, Justin; [EMAIL PROTECTED] Subject: RE: [PHP] Variable question ok, look into eval() -Original Message- From: King, Justin [mailto:[EMAIL PROTECTED]] Sent: Monday, May 07, 2001 4:07 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Variable question Here let me flesh this out a bit more Consider the query SELECT datafield FROM myTable WHERE id=1; This would return My username is $userdata[username]; I want to then output what the database returns, and have php evaluate my variables. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable question
I understand that, but that's what I'm trying to get around doing. -Justin -Original Message- From: CC Zona [EMAIL PROTECTED] Sent: Monday, May 07, 2001 1:24 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Variable question In article [EMAIL PROTECTED], [EMAIL PROTECTED] (King, Justin) wrote: A simple eval($mysqldata) isn't going to do it though since the string is Your username is $userdata[username]; it'll just spit a parse error. I've already tried that The code being eval'd has to be a valid PHP statement. So if you want to echo that string, then echo must be part of the eval'd code. Terminated with semi-colon, etc. eval(echo 'Your username is ' . $userdata['username'];); -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Variable question
I'm trying to get around having to do that, I don't know regular expressions so it makes it difficult :( -Justin -Original Message- From: John Vanderbeck [EMAIL PROTECTED] Sent: Monday, May 07, 2001 1:21 PM To: King, Justin; [EMAIL PROTECTED] Subject: RE: [PHP] Variable question How about manually parsing the string out to give you chunks, that can then be eval'd easy. - John Vanderbeck - Admin, GameDesign (http://gamedesign.incagold.com/) - GameDesign, the industry source for game design and development issues -Original Message- From: King, Justin [mailto:[EMAIL PROTECTED]] Sent: Monday, May 07, 2001 4:18 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Variable question A simple eval($mysqldata) isn't going to do it though since the string is Your username is $userdata[username]; it'll just spit a parse error. I've already tried that -Justin -Original Message- From: Jack Dempsey [EMAIL PROTECTED] Sent: Monday, May 07, 2001 1:13 PM To: King, Justin; [EMAIL PROTECTED] Subject: RE: [PHP] Variable question ok, look into eval() -Original Message- From: King, Justin [mailto:[EMAIL PROTECTED]] Sent: Monday, May 07, 2001 4:07 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Variable question Here let me flesh this out a bit more Consider the query SELECT datafield FROM myTable WHERE id=1; This would return My username is $userdata[username]; I want to then output what the database returns, and have php evaluate my variables. -Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]