RE: [PHP] Fopen and streams

2004-01-29 Thread Mike Migurski
>Secondly, where is a good place to read on the standards and formats used >by these different schemes. In the fsockopen() func, I made some writes >to 'GET / ' and 'HTTP 1.1' etc... After reading the script, I understand >what these imply, but not the importance, also, what other commmands are >a

Re: [PHP] naming a directory after a user-submitted string

2004-01-28 Thread Mike Migurski
>Here's another question, possibly easier. Possibly even bone-headed. > >What kind of checking/filtering/changing do I need to do on a >user-submitted string before I can feel comfortable using it to name a >new directory in the web root on Linux/Apache? Anybody have a quick >Regular Expression t

Re: [PHP] Googlebot

2004-01-27 Thread Mike Migurski
Is Googlebot (or any other bot) able to follow links that are php? > >As others have already pointed out to you, what better place to find >information about google than google? That, or your server logs - googlebot is great about identifying itself. RTFM's aside, a little understanding of ho

Re: [PHP] Unix-Apache: running apache as different user

2004-01-27 Thread Mike Migurski
>I have PHP installed on Apache and Unix with several vhosts so each vhost >has its own user account on Unix. Now when accessing a webpage, Apache >runs with user httpd.. but I want it to run as the user of the vhost >account.. How can I do that? http://httpd.apache.org/docs/suexec.html -

Re: [PHP] Problem: Failed to write session data (lack of resources?)

2004-01-25 Thread Mike Migurski
>open(/tmp/sess_ce957a6f5c094441fbf7197aa683dec1, O_RDWR) failed: No space >left on device (28) in Unknown on line 0 > >can anyone explain what can i do with this? this always happen, btw, on >some of my php pages i always have sessions. Sounds like you're out of room on whatever drive /tmp is map

RE: [PHP] what PHP really needs

2004-01-24 Thread Mike Migurski
>Let the db server handle query/cache consistency ... why put yet another >server in the way that will have to be triggered by the underlying db to >clear ITS cache? Very true, but tests I've done in the past with PostgreSQL and MySQL-driven PHP sites show that adding a simple static file cache (f

Re: [PHP] what PHP really needs

2004-01-23 Thread Mike Migurski
>>> There's 1 really important thing missing in PHP as I see it, and it's >>> the ability to keep variables in memory for as long as the programmer >>> choose. If this was possible there could be some truly great >>> optimizations done. Some things are very slow to create but very fast >>> to work

Re: [PHP] strpos

2004-01-21 Thread Mike Migurski
>When I use the function bellow, and there is no occournce of the control >word, strpos shoul return false, but instead i returns 1, which is not >the intention. Does anybody here have an idea about what I am doing >wring??? You're adding the one: >$position = strpos($this->fileContent, "\\".$wor

Re: [PHP] Flash .swf outside webroot: width and height problems

2004-01-20 Thread Mike Migurski
>But I guess you can't write the tag and just do a VALUE="show.php?id=xy" etc. and have the show.php output the header... Sure you can, as long as show.php outputs a valid flash file and the correct content-type. As far as the browser is concerned, it's the same as any other flash file. -

Re: [PHP] Thumbnails in database

2004-01-17 Thread Mike Migurski
>Why create thumnails? You can resize the images on >the fly when needed. It's generally good practice to trade CPU for disk space, where possible. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno

Re: [PHP] sorting multi-dimensional arrays

2004-01-16 Thread Mike Migurski
>I've read the manual several times on sorting multi-dimensional arrays, >but I can't seem to wrap my mind around what I need to do to accomplish >my goal. > >//this is what I'm doing: (stepping through a result set, and putting it >into a multi-dimensional array. > >while ($row = mysql_fetch_array

Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Mike Migurski
>i hope someone can help me out... i have to replace > > >with > > >any ideas? thank you! PCRE style: '//' replaced by ''. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP

Re: [PHP] md5() and string-length?

2004-01-09 Thread Mike Migurski
>mhm, I think there was a missunderstanding ;) >I want to know, how long the input-string could be (so that the encoded >strings, that you get, are unique) In theory, you are limited by the fact that the MD5 message digest is 128 bits long, so collisions are /possible/, but not /probable/. In prac

Re: [PHP] script/binary that tracks links through logs

2004-01-08 Thread Mike Migurski
>does anyone know of a program/script that tracks incoming links from site >that youve traded links with. but not a simple php script that requires >the other site to link to www.mysite.com/links_in/12/ but some software >that analyses apache access logs for the referer field. this would mean >the

Re: [PHP] POST_QUERY STRING without letting php to parse it.

2004-01-07 Thread Mike Migurski
>I want to get the POSTED data as it is without letting php to parse it. You may be thinking of $HTTP_RAW_POST_DATA. You should set the always_populate_raw_post_data config option someplace if you want to use it reliably, though. See "configuration directives" in the manual. -

Re: [PHP] PHP function for length of the array???

2004-01-06 Thread Mike Migurski
> Anyone know what is the php function for finding the length of the array? >I haven't found the answer at http://us3.php.net/manual/en/ref.array.php . You are aware that all the available array functions are listed about halfway down that page, right? --

Re: [PHP] Comparison PHP to Perl

2004-01-06 Thread Mike Migurski
>I am looking for a comparison of features supported by PHP vs those >supported by Perl. > >My gut tells me PHP is more robust, but we are trying to implement something >in a company that has long had a standard allowing Perl as a "sanctioned" >language, but current management does not want to figh

Re: [PHP] extract/replace the content of html pages

2004-01-02 Thread Mike Migurski
>I have a folder full of html pages that I need to extract the content >from. They all have and >comment tags surrounding the content. I need an easy way (not one at a >time) to extract that content and place it in a new template. > >Any ideas are appreciated. Im assuming it will have to be some

Re: [PHP] A simple instruction

2004-01-01 Thread Mike Migurski
>i have a file name with the path ex food/italy/pizza/margherita.php. how >can i obtain the name of the file in this case "margherita.php" i know >there is a function, but i don't remember it. basename(__FILE__) may work. - micha

Re: [PHP] How to use anchor with php post string to jump to a page???

2003-12-30 Thread Mike Migurski
>Here's a better example to what I meant from the last posting when I said >something about color=red#RowNum3. >--snip-- >As in example #3, PHP seem to be able to distingush the difference when >there is a pound symbol, or "#" in it and know that '#RowNum3' is not part >of the post string to the va

[PHP] "Secure programmer: Keep an eye on inputs"

2003-12-30 Thread Mike Migurski
This was posted to Slashdot not too long ago, and seems applicable to php-general given the frequent mentions of register_globals and usage of the get and post arrays. It's a detailed explanation of many common ways that software which is overly trusting of its input can be exploited, and underscor

Re: [PHP] looping problem?

2003-12-30 Thread Mike Migurski
>Problem with looping over a CSV file (3 results for each line)? > >Here is the script... >$row = 1; >$file = "fa.csv"; >$id = fopen("$file","r"); > while($data = fgetcsv($id,100,",")) { > $num = count($data); > $row++; > for($c = 0; $c < $num; $c++) { >echo "host $data[0] {\nhard

Re: [PHP] Problem with session variables on Mac

2003-12-25 Thread Mike Migurski
> $session_time = $current_time - $_SESSION('timestamp'); > echo "session time = $session_time seconds."; > >The output to the browser (Safari) is as follows: > >inside check IF >Time = 1072308706. > >Fatal error: Call to undefined function: array() in >/Library/

Re: [PHP] Unlinking files.

2003-12-23 Thread Mike Migurski
>How can I unlink files in a directory that are, for example older than 1 >hour? `find /path/to/dir -cmin +60 -type f -print0 | xargs -0 rm -f`; - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com

RE: [PHP] CVS on Windows

2003-12-16 Thread Mike Migurski
>> Tortoise is a popular CVS client for windows -- CVS commands are added >> to the contextual menu in [[whatever windows calls its Finder]]. All of >> your files are edited locally, using the editor of your choice. > >Does that mean you have to have Apache/PHP installed on your workstation? No, i

Re: [PHP] CVS on Windows

2003-12-15 Thread Mike Migurski
>I will be interfacing with a CVS server not hosted on a Windows machine >(it will be a bsd/*nix variant) and frankly I've never used it. What >client do all you Windows people use? Also, how does it wotk in >conjuction with your favorite editor? (Mine is HTML-Kit.) Is it necessary >to run some com

Re: [PHP] post an array into another site

2003-12-08 Thread Mike Migurski
>I have an array in php like this: > >$arr[0][0] = "Something"; >$arr[0][1] = "Hello"; >$arr[0][2] = "Hi"; > >It is possible to post this array to another site in a form? Or how can i do >this? It would help to serialize the array into a string, then pass it as a regular value in a GET or POST req

Re: [PHP] Curious about something....

2003-11-20 Thread Mike Migurski
>> Is there any particular advantage to having the default PHP install >> exclude a lot of useful modules such as mcrypt, cli, sockets, etc? > >Honestly, this has kind of been discussed this week in the "encoder" >thread. Where do you draw the line on what's useful or not and who does >the deciding

RE: [PHP] Javascript question

2003-11-20 Thread Mike Migurski
>Ah-hah! Jason hides under an email address that does not exist so one >cannot reply directly to him, only via the list. Does that not describe >the person well? Insofar as he is cautious about spam, sure. - michal migurski- cont

Re: [PHP] Remote computer name?

2003-11-20 Thread Mike Migurski
>> [Snippit used] >> $ipaddy = $_SERVER['REMOTE_ADDR']; >> $host = $_SERVER['HTTP_HOST']; // as of now it is getting the name of >> the server (i.e. localhost, 168.2.2.1) >> >> jas > >HTTP_HOST returns the name (or ip) of the machine on which php is >running. REMOTE_ADDR will return the ip of the

Re: [PHP] Using JavaScript variables in PHP

2003-11-20 Thread Mike Migurski
>How does one go about using a JavaScript variable with PHP code. I have >a function in JavaScript that takes a single input parameter (ID). I >want to use this ID variable as the value on the where clause of a >database query. > >Example: "select * from somedatabase where field=ID" > >Can this

Re: [PHP] Question about empty();

2003-11-18 Thread Mike Migurski
>This function I don't get at all, I hear all the time, "if you want to >practice smart coding then turn register globals off, and be sure you keep >query data out of your script that is not set or defined with something >expected". So why would there be a function that returns true or false, $var

Re: [PHP] SSH and php

2003-11-17 Thread Mike Migurski
>% Doing a quick search on google for "SSH commands" and "SSH help" returned >% quite a lot >% of crap that really didnt help me learn. > >>Good enough. What do you want to do? > >Basically stop/restart apache when i make changes to the httpd.conf file. >But then thinking of it I realize that if I

Re: [PHP] On OS X (10.2) where is php installed?

2003-11-07 Thread Mike Migurski
>Forgive me for the simplistic question, I'm not much of a Unix, Apache, >or PHP wiz. I'm running Mac OS X 10.2 on a 12" PB. I've installed PHP >4.3.0 from Marc Lynric's site (http://www.entropy.ch). However, I cannot >actually find the installation files on my laptop. > >My web server works. It se

RE: [PHP]{so far OT it boggles} BTML 2.0 released!!!

2003-11-07 Thread Mike Migurski
>> There is evolution and then there is etiquette. Top-posting is not on >> par with proving a theory (flat-earth v spherical-earth) or evolution >> of systems. In as much as it is proper etiquette to trim and >> bottom-post it is rude to be diametric, just as it is rude to fart on >> purpose at a

Re: [PHP] PHP Session passed to different sub domains

2003-11-06 Thread Mike Migurski
>Could someone tell me how to pass a session cookie to different sub >domains, without passing it in url. It's in the manaul... http://www.php.net/manual/en/function.setcookie.php "To make the cookie available on all subdomains of example.com then you'd set it to '.example

RE: [PHP] High bandwidth application tips

2003-11-05 Thread Mike Migurski
>Whow, is that way of a loop really faster? I mean .. It looks as if the >accept same thing happens > - $upperlimit is set > - $i counter is set > - for every loop $i is set one higher > - Also for every loop the expression ($i<$upperlimit) is evaluated. Not sure, but I jus

Re: [PHP] getting array slice of function output

2003-11-05 Thread Mike Migurski
>I have a line which strips the suffix (gif, GIF, TIFF, jpg, JPEG, etcetc >or I would just use basename() :-) from a string but it seems needlessly >drawn out: > > $file = preg_split('/\./',$dirfiles[0]) ; $file = $file[0] ; > >I would like to just assign the 0th element of the preg_split() output

Re: [PHP] Load Stress tool

2003-11-05 Thread Mike Migurski
>I am looking for suggestions on a tool to "load stress" a php >application. We want to make sure that the application/web server will be >able to handle the amount of users we expect. I have found a few but they >seem to be very expensive. Can anyone suggestion an "affordable" and user >friendly s

Re: [PHP] applying one function to all array elements

2003-11-02 Thread Mike Migurski
>Can someone show me a simple, clean way to apply one function (eg >stripslashes()) to every element in an array (eg $_POST)? > >I've been doing it with a foreach() loop, but there has to be a better >way. I've also seen http://www.php.net/array_walk, but couldn't >determine how/if it suited my ne

Re: [PHP] Object References Problem

2003-10-30 Thread Mike Migurski
>I don't pretend to fully understand PHP references, or the strange and >mysterious ways that they work in regards to PHP objects, but I can tell >you how to acheive the results you desire. Someone else will have to >explain it. :) >If someone sees that I'm leading Gareth astray here, feel free

RE: [PHP] removing all duplicate values from an array

2003-10-30 Thread Mike Migurski
>array( >'a' => 'one', >'b' => 'one', >'c' => 'zero', >'d' => 'two' >); > >through this and am having a hind time with then logic... Could you >explain how the output would be array('c' => 'zero', 'd' => 'two')?? I was being pretty sloppy with the code (should've posted pseudocode to begin with,

Re: [PHP] removing all duplicate values from an array

2003-10-30 Thread Mike Migurski
>>I'm looking for a function that does almost the same as array_unique() >> >>But it must also delete the other duplicate entry. > > >Untested pseudo-PHP follows - > > $encountered_elements = array(); > foreach($original_array as $key => $val) > if(in_array($val, $encounte

Re: [PHP] removing all duplicate values from an array

2003-10-30 Thread Mike Migurski
>I'm looking for a function that does almost the same as array_unique() > >But it must also delete the other duplicate entry. Untested pseudo-PHP follows - $encountered_elements = array(); foreach($original_array as $key => $val) if(in_array($val, $encountered_ele

Re: [PHP] Generate Thumbnail gif's

2003-10-29 Thread Mike Migurski
>Is there any pre-written code available on the net to generate thumbnail >images for a picture. I mean I send the path of the image and my PHP >Script should be able to generate a gif file of size 100x71 or something >like that. If your server has Imagemagick installed (it seems pretty common), t

Re: [PHP] Code optimization: single vs. double quotes?

2003-10-27 Thread Mike Migurski
>It's said that you shouldn't use tables for layout, but does people >accutually listen to that? And what instead? This is veering off-topic, but: - michal migurski- contact info

Re: [PHP] scrolling tables within a page

2003-10-25 Thread Mike Migurski
>My query output is about 20 to 30 records only. Instead of making the >visitors scroll the whole page, can I make a scrolling table with the >page such that the visitor scroll the results output table only? This isn't strictly a PHP question, but you may want to look into the HTML iframe element,

Re: [PHP] Age from birthdate?

2003-10-23 Thread Mike Migurski
>Lastly, where in the world did you get "pedant"? word for the day or >something? :-D Thats a real unusual word for normal everyday use, unless >you were trying to act pedant?? :- The correct adverbial form is "pedantically" ;) ---

Re: [PHP] Age from birthdate?

2003-10-22 Thread Mike Migurski
>> >I do wonder what the rule for those born on Feb 29'th. Do they >> >celebrate they're birthday before or after it on non leap years? >> > >> > >>Neither. They celebrate it on Feb 29th. So while we age every >> year, they only age once every four. Make sense? > >So their life expectancy i

Re: [PHP] PHP & JavaScript

2003-10-22 Thread Mike Migurski
>Have somebody any idea how I could do something like that? You're somewhat out of luck, as the chain of events in your typical HTTP transaction looks something like this... >[time]-> client request received from browser | +-

RE: [PHP] SQL security

2003-10-17 Thread Mike Migurski
>> If you're using MySQL, you can use mysql_real_escape_string(). If >> you're using another database, hopefully there is a similar function. > >Doesn't MySQL automatically protect against attacks like SQL injection? >Or maybe it's that it automatically applies addslashes()? I can't >remember exac

Re: [PHP] error reporting

2003-10-17 Thread Mike Migurski
>Heh yes umm i know this. But how i could i catch this before is spits out >to an ugly error page so i can send to a custom error page. Why would anyone but you ever see a parse error? It's the sort of thing you fix before setting up custom error handling. :) -

Re: [PHP] intercepting URLs in a "control-system"

2003-10-17 Thread Mike Migurski
>If you are using PHP as an Apachemodule you also have the option of using >a url like >http://example.com/index.php/test/test.html >Apache will see that test.html is not available and will travel down the >directory path til it gets to the index.php (which should exist BTW) and >call that script.

Re: [PHP] Who knows all the Header attributes.

2003-10-14 Thread Mike Migurski
>Could some one tell me where can I find the documentation for the >Hedear() function? > >The manual does not provide it but just some examples. Check the HTTP spec for a definitive listing: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14 -

Re: [PHP] Need advice, hopefully on topic.

2003-10-10 Thread Mike Migurski
>> If you've used it before, I can write more about how it can be used in >> specific circumstances. I never start a project without starting a >> repository someplace, and a combination of CVS and Make have really >> helped me out with a lot of projects. > >hmm.. i'm interested in seeing your appr

Re: [PHP] Need advice, hopefully on topic.

2003-10-10 Thread Mike Migurski
> I got this project, I'm writing it in PHP of course. What I would >like to do is create a simple an efficient way to work on it from a >couple different locations/workstations. I'm throwing around the idea of >a CVS repository, but am not sure if this is the best way. Does anyone >have s

Re: [PHP] Need secure login

2003-10-09 Thread Mike Migurski
>Thanks Justin, actually I was also thinking of the same, but just wanted >to confirm that it is really not a good idea. > >Was also wondering if there is any third party solution ?. A third-party solution to a bad idea? - michal

Re: Re[2]: [PHP] dynamic -> static

2003-10-09 Thread Mike Migurski
>Did a little more googling and found the answer. > >In Apache 2.0, by default is does not allow this type of URL. > >But I found a few article on it that explained that if I modified this > >in httpd.conf modify, or add, this line. > > AcceptPathInfo On > >Don't know what it does, but it fixes th

Re: Re[2]: [PHP] dynamic -> static

2003-10-09 Thread Mike Migurski
>: I have the following configuration. >: >: Redhat 8.0 >: Apache/2.0.40 (stock redhat install) >: PHP 4.2.2 (stock redhat install) >: >: What I get when I try and run this is an Object Not Found. > >If I was Apache, I would try to serve the file: > > /index.php/var1/val1/var2/val2/index.

Re[2]: [PHP] dynamic -> static

2003-10-08 Thread Mike Migurski
>As I wrote already this issue is mainly because of search engines >incompatibility with dynamic content sites (to be more exact - with urls >containing get parameters, in my case ex. index.shtml?lang=en&menu_id=23) > >Which of your described solution would you suggest for my situation ? > >Turck M

Re: [PHP] dynamic -> static

2003-10-08 Thread Mike Migurski
>Dear All, > >Does anybody have any solutions, which makes possible to produce static >pages of all dynamic cms once a day and can be easily integrated into >already made site? Why do you need to do this? Is it because of hosting restrictions, performance concerns, or portability/mirroring (which

Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
>my output is something like this: >UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3] root >2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate] root > >any idea? Yeah, see David Otton's response, or look at the HTML source of your output. -

Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
>I'm trying to have the output of the "ps -ef" command in Linux to my >browser. Can anyone help how to properly have the output in proper >format. I've used the passthru() function but the output is scrambled. What do you mean by 'scrambled'? The following works for me: echo '', `ps -ef`,

Re: [PHP] printf....

2003-10-01 Thread Mike Migurski
>Warning: printf(): too few arguments in >/home/sites/site8/web/index_test.php on line 34 > >I cannot for the life of me figure out what the problem is. I've looked >thru archives, examples, and pages of a book all about printf, and this >just doesn't add up to me.. Anyone see the problem? To pr

Re: [PHP] Central authentication for multiple sites

2003-09-29 Thread Mike Migurski
>Does anyone know of a way to authenticate a person on one site and have >that authentication carried through to multiple sites? > >Basically I'd like to have someone login on www.domain1.com and then have >their login be valid on www.domain2.com and www.domain3.com ... the >domain name is differen

Re: [PHP] Session info stored on server

2003-09-26 Thread Mike Migurski
>> Open sess_4f5d...0367 in any text editor and you will see your variable >> there. > >I can't. I'm unable to open or download or change the permissions. Is it >an array? A serialized array, yes. - michal migurski- contact info

Re: [PHP] How can I auto upload a file to the server?

2003-09-24 Thread Mike Migurski
>The only part i am having trouble with is making the remote script >automatically look into the local computer's hard drive and grab the .txt >file. >The problem with the code above is the path to the file does not show up >in the , and the user would still need to click on the >'submit button'

Re: [PHP] Running system commands

2003-09-23 Thread Mike Migurski
>I was wondering, if anyone can help me with running system commands from >within php. Actually I have a script which deletes users from my database >(which is of course MySQL), now I want to delete those users from system >level also, as they are authenticated users of my OS also. > >Now, the prob

Re: [PHP] Best way to approach object construction errors?

2003-09-18 Thread Mike Migurski
>I've created a class called university, it has a constructor which can >accept an id. If the id is sent during construction the constructor will >connect to a MySQL db to set all of the objects member variables to the >MySQl counterparts. > >I'd like to include some error notification so if I send

Re: [PHP] Session stealing, ..

2003-09-12 Thread Mike Migurski
>This all probably takes care about the problem with session id's in the >query string, which is known as referrer to the next website our visitor >visits. What I'm worrying and wondering about now are other users of the >server my site's at. They can most likely go into the /tmp folder and >just r

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Mike Migurski
>>>This is really funny i've been doing php for a good while now but what >>>is the reason to use the & symbol on the function ? >> >>returns by reference. > >ok i get it but why would i need it in my example ? I think it was a hypothetical thing on Brad's part ... one of the annoying things about

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Mike Migurski
>> $some_object =& create_object('some_object'); >> > >This is really funny i've been doing php for a good while now but what is >the reason to use the & symbol on the function ? returns by reference. - michal migurski- contact i

Re: [PHP] Escaping the " ' " character

2003-09-10 Thread Mike Migurski
>I need to print the following: > >onClick="MM_openBrWindow('http://www.gilardi.com/pdf/gwyt1poc.pdf','','')" > >and I am not sure how to escape the " ' " characters. with a slash. http://www.google.com/search?&q=php+single+quote+escape+site%3Aphp.net -

Re: [PHP] [SOLVED] Re: [PHP] Parse error?

2003-09-05 Thread Mike Migurski
>Ok, the reason I was getting this error seems to be related to Safari on >OS X. When I copy code segments in Safari and paste them in BBEdit they >generally looked ok, although there were extra spaces inserted in some >places. I then turned on show invisible characters and it made it even >more cl

Re: [PHP] Gripe

2003-09-03 Thread Mike Migurski
>Cuz the the way the PHP parser is written makes it impossible to discover >the error before it gets to the end of the file, and realizes that there >are no more braces to go around. > >It definitely sucks... almost as badly as a stray backtick. Try finding >that little bugger at 1600x1280... Thi

Re: [PHP] Recursive Object Troubles

2003-08-26 Thread Mike Migurski
>I am building a recursive Menu object. Inside each menu item there is an >array which should allow me to add submenu items and so on. I am having >trouble, though, with getting the submenus to stay. They are >disappearing as I go along. Without really going through your code (sorry) I would ha

Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Mike Migurski
>> Better to do this in an .htaccess file, so you don't incur PHP >> processing overhead on the entire server (if there are others using >> it). > >Apache suggests not using .htaccess files at all because they require a >recursive traversing of directories looking for .htaccess files, because >some

Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Mike Migurski
>> For example, on a file called info.html, i want to have some PHP >> code that actually gets executed. > >In your httpd.conf add the line > >AddType application/x-httpd-php html Better to do this in an .htaccess file, so you don't incur PHP processing overhead on the entire server (if there

Re: [PHP] user-defined superglobals?

2003-08-24 Thread Mike Migurski
>It would be nice to have a php-function like > >declare_superglobal($_MYFRAMEWORK); > >And then use $_MYFRAMEWORK like $_GET. You have a few options: if you are looking to set variables that are static and atomic, you can use environmental variables in an .htaccess file (getenv() to access them)

Re: [PHP] get current path

2003-08-17 Thread Mike Migurski
>The PHP site seems to be down right now ... so here's the question: Is >it possible for PHP to tell me the current path of a page? For example: >www.whatever.com/this/page.php - I'd like PHP to return /this/page.php >... is that possible and if so, how so? PHP site looks up to me, though I hav

Re: [PHP] indexing a folder

2003-08-17 Thread Mike Migurski
>> Thanks, but is this also possible for directories not on my server? Or >> can i just use these functions? > >Missed that bit, sorry. If the directory is not on your server, then you >need to go through FTP. or SSH, or HTTP, or one of the other innumerable ways to get information from one machin

Re: [PHP] [php] explode that :) !

2003-08-16 Thread Mike Migurski
>echo "Your score is: "; $score=split($P1OC1Q1,"ΒΆ"); echo >$score[0]."\n"; > >Do I have to go through all that to get score[0] ? I think reset(split()) should work for getting the first element. - michal migurski- contact info an

Re: [PHP] Function arguments

2003-08-15 Thread Mike Migurski
>What is the best way to pass the arguments so it is easy to maintain in >future if function behaviour changes by adding/removing one or more >arguments? > >Currently i am passing arguments in array. But i think it is not the >clean way to do it and another approach i am using is functionName(arg1,

Re: [PHP] host name

2003-08-14 Thread Mike Migurski
>I want to get the current domain name in to a PHP variable. print_r() the contents of $_SERVER to see all the information given to you by the webserver -- the host name will be in there. - michal migurski- contact info and pgp k

RE: [PHP] PHP Counter on HTML Page

2003-08-14 Thread Mike Migurski
>I've never used GD or ImageMagick before.. can you guide me to any >tutorial, script, reference.. something upon the same that can help me >out? Can you -please- do some of your own legwork once in a while? http://www.google.com/search?q=imagemagick+tutorial http://www.google.com/search?q=gd+php

Re: [PHP] php.ini configuration can we have two include_path inphp.in file

2003-08-14 Thread Mike Migurski
> I am not able to locate the file you are referring to. Please do >help me I am very much frustrated. .htaccess files are described here: http://httpd.apache.org/docs/configuring.html#htaccess - michal migurski- contact inf

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread Mike Migurski
>Here's a trick script. We know that some months have the last day >which is 30 while other is 31. As for February, it can be either 28 or >29. So, what's the trick in using the php to find out what is the last >day of the month if you want to checked it against the server's clock to >find o

Re: [PHP] how do I spoof a get request

2003-08-14 Thread Mike Migurski
>> But some web pages when I cut and paste the URLs don't work. Like when >> I search for something on Ebay. Could this be because of cookies? > >That's a good guess! Yet further proof that cookies suck, except the >ones made with flour, shortening and sugar, of course. Huh? seems like further

Re: [PHP] getting images?? Help!!

2003-08-14 Thread Mike Migurski
>I have created a little image manager. Mainly for personal usage but I >have a few friends that would like it as well. Anyway, the problem that >I've run into is that I can only select one file at a time using the form >attribute that I want to upload. Does anyone know of >a way to select mult

Re: [PHP] what is %s %d

2003-08-14 Thread Mike Migurski
>They are codes for date formatting. > >Specifically: >%s represents seconds with leading zeros. >%d represents day of the month with leading zeros They can also be codes for the printf family of functions: %s represents string %d represents number See http://php.net/sprintf

Re: [PHP] segmentation faults

2003-08-10 Thread Mike Migurski
>I have a large project underway which is (hopefully!) nearing completion, >running on the latest stable release, 4.3.2. However, strange things >have started happening... > >My main page sometimes causes Apache to seg fault at some point during >the execution (e.g. [Sun Aug 10 18:05:55 2003] [not

Re: [PHP] Simple cookie question

2003-08-09 Thread Mike Migurski
>There are two ways round your problem... > >1. Set your cookie right at the top of the script, so as your first line >have something like: if(isset($_POST['vote'])){ setcookie(); } > >2. Use output buffering, this will make PHP buffer all of your content >and not send it till you tell it to (o

Re: [PHP] chown / chgrp of a http owned file after upload

2003-08-07 Thread Mike Migurski
>I have written as part of my CMS, an image upload system, now when the >images are placed in the destination folder, they are owned by httpd.root >and I need to get them to be owned by siteuser.sitegroup. > >I have tried to chmod and chgrp it to siteuser.sitegroup but it gives >permission denied e

RE: [PHP] dev style guide

2003-08-07 Thread Mike Migurski
>At the risk of starting a flame/religious/holy war I find the One True >Brace style to have some inconsistency if it is as above. The 'function' >does not open the curly brace at the EOL, but the 'if' does. Yeah, that's pretty much the definition of the OTBS. :) I'm not sure why I find it so nat

RE: [PHP] Unzipping Files

2003-08-05 Thread Mike Migurski
>I am doing this for a client, and he doesn't have the ZZIPlib installed, >and would like to avoid it if possible. Any other ideas? It has been mentioned before: use exec, or the backtick operator, and the command-line tools: unzip, bunzip, gunzip, etc. --

Re: [PHP] dev style guide

2003-08-05 Thread Mike Migurski
>Is there a style guide for coding practices used when creating code to be >shared with the community? PEAR has some, http://pear.php.net/manual/en/standards.php I gave them a cursory glance, and they seem to be pretty solid -- in line with standards that I used for the past year or so after real

Re: [PHP] Purging old files from directories

2003-08-04 Thread Mike Migurski
>I need to write a script that will scan/read a given directory's contents >and delete files older than a certain date. Ideally, this will be a >script that runs via cron once a week and deletes all files it finds in >the directory older than 2 weeks from the current date. I do currently >have scri

Re: [PHP] Trouble getting $HTTP_RAW_POST_DATA

2003-08-01 Thread Mike Migurski
>$HTTP_RAW_POST_DATA is an array... >with echo you'll only get "array".. No, it's a string - just the raw bytes that were posted. >> Is register globals ON or OFF? Either way, maybe try >> $_SERVER['HTTP_RAW_POST_DATA']... Also, ensure that "always_populate_raw_post_data" is on, too - see: http:

Re: [PHP] debuging and getting mor information about failures

2003-07-29 Thread Mike Migurski
>These errors are usually caused by an extra or missing brace or >quote/apostrophe/backtick. The best way to find where this is happening >is to use another error. Alternatively, use a text editor that's syntax-aware. In bbedit for the mac, finishing a closure or double-clicking on one (parens, b

RE: [PHP] mysqldump

2003-07-25 Thread Mike Migurski
>Thanks for the replies guys but the main reason I'm doing this is >because most times I don't have access to the servers, or not enough >preveleges to install myadmin or any other tools. I wish we had our own >server but I'm trying for a solution where you can't upload any tools and >cannot access

  1   2   >