Re: [PHP] script/binary that tracks links through logs
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 other site would only have to link www.mysite.com and the script/program would do the rest. http://www.mrunix.net/webalizer/ - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php on linux..
I am a newbie. I'm trying to write a php script and put it on the linux server at school. index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. I did locate php to find the path where php is installed and i got /lusr/bin/php. index.html is working fine. So after i filled out the index.html form and press SUBMIT. It would print me to the action.php page only that action.php page would display itself. I have been trying to figure out this problem for quite some time and any help would be greatly appreciated. at first, i thought something is wrong with the action.php so i changed the form and index.html but without success. My website is at www.cs.utexas.edu/users/khoa . Thank you for all your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php on linux..
khoa vo wrote: I am a newbie. I'm trying to write a php script and put it on the linux server at school. index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. I did locate php to find the path where php is installed and i got /lusr/bin/php. index.html is working fine. So after i filled out the index.html form and press SUBMIT. It would print me to the action.php page only that action.php page would display itself. I have been trying to figure out this problem for quite some time and any help would be greatly appreciated. at first, i thought something is wrong with the action.php so i changed the form and index.html but without success. My website is at www.cs.utexas.edu/users/khoa . Thank you for all your help Maybe you need to reconfigure APACHE to recognize the .php mime type... if you dont't have that configured Apache would treat the PHP as text instead of script, thus displaying itself... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing the Time Zone in php.ini
Hello, I have a requirement to run two different sites that are in different time zones on the same machine. Does anyone know if this is possible to do by running two instances of php and making a change in the php.ini? Or do you have any other suggestions on how this can be done? Thank you. Regards, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST_QUERY STRING without letting php to parse it.
It is working But i can not always control php.ini on the host ..!!! and i tried ini_set(always_populate_raw_post_data , 1); but not working , and i had to chanhe in my local php.ini ... Please Advice Mike Migurski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST_RAW_DATA
It is working But i can not always control php.ini on the host ..!!! and i tried ini_set(always_populate_raw_post_data , 1); but not working , and i had to chanhe in my local php.ini ... Please Advice 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. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing the Time Zone in php.ini
Hi, Thursday, January 8, 2004, 6:33:45 PM, you wrote: AH Hello, AH I have a requirement to run two different sites that are in different time AH zones on the same machine. Does anyone know if this is possible to do by AH running two instances of php and making a change in the php.ini? Or do you AH have any other suggestions on how this can be done? AH Thank you. AH Regards, AH Andy I have an autoprepend file with this in it: if(isset($_SERVER['HTTP_HOST'])){ $host_address = ereg_replace('www.','',$_SERVER['HTTP_HOST']); switch($host_address){ case 'usdomain1.com': case 'usdomain2.com': putenv('TZ=America/New_York'); break; case 'usdomain3.org': putenv('TZ=America/Chicago'); break; case 'ukdomain.com': putenv('TZ=GB'); break; default: putenv('TZ=Australia/Brisbane'); break; } } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???
Chris Hayes wrote: It takes a lot more of users to tamper with POST data than with GET Not a lot more. Simply save the slightly modified form on a webserver you have access to (hidden field) -- or better create php code that generate the form OK, aunt Annie cant do that, but she wouldnt ever thougt about tampering with html forms ;-) check whether the referer is from your own site, that will also make it a lot harder. Be carefull, the refer(r)er is _not_ something reliable at all (I consider you can throw away many --20%?-- of them). 1. It can be faked (a little more difficult than simply creating custom html and using a std browser). 2. This can disallow clients from accessing your site. Because of some firewall, anonymiser, adaware-like tools, etc that remove the referer field, by example. More and more people do this to protect their privacy or for security reasons. I think this will become default behaviour in years to come. NB The referer is an OPTIONAL http field (see rfc2616) 3. It denies direct access to the page via bookmarks or typed-in uris (no referer generally sent in these cases) As many said, just dont rely on unchecked input data: check it with a 'white list' (use regex by example). See more info on the security chapter of php manual [1] and in the well-known www security FAQ [2] [1] PHP: Security - Manual http://www.php.net/manual/en/security.index.php [2] The World Wide Web Security FAQ by Lincoln D. Stein John N. Stewart http://www.w3.org/Security/Faq/www-security-faq.html Christophe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Turck mmcache is dead
http://sourceforge.net/forum/message.php?msg_id=2361065 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php on linux..
[snip] index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. [/snip] If you are using PHP with a browser page you do not need the bash line (#!/lusr/bin/php) in the page. Place a page on the server that has the following (no need for anything else) to see if PHP is on and working... ?php phpinfo(); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with while loop
Hello Richard, On 7 Jan 2004 at 21:02, Richard Kurth wrote: I can't seam to get this while loop to work properly. It should create a message that has the first two lines and then it will list all the domain that meat the criteria. $lines = The following are web sites that are at 95% usage or more of there web space\n; $lines = Site Name Used(MB) Free(MB) Allowed(MB) \n; Hmm, this has nothing to do with your question, but don't you need a concatenation operator (.) before the equal sign in the second line of code above? $result=mysql_query(SELECT * FROM domplans); while($row = mysql_fetch_array($result)){ $dom=$row[domname]; $total=$row[quota]; $result1=mysql_query(SELECT * FROM datasubused where domname = '$dom'); $proccess = mysql_fetch_array($result1); $totalused=$proccess[quotaused]; $totalfree=$total - $totalused; $percent = ceil(100*$totalused/$total); If($percent=95){ Why is if capitalized? Well, it doesn't affect the execution of the code, but it's bad practice. More importantly, why is the number 95 between quotes? You're comparing numbers, not strings. Granted, PHP will convert the string into a number for you, but that's bad practice again. $lines = $dom $totalused $totalfree $total \n; for( $i=0;$icount($lines);$i++) { Aha! Count lines?! What lines do you want counted? $lines is a string, not an array, so how can you possibly count the number of array elements contained in $lines? $message .=$lines[$i]; } } echo $message; } Perhaps what you really want is to create an array $lines with all the strings that you need and print them at the end. I'm not sure I understand your needs exactly, but wouldn't something like the code below work better for you? /*** CODE START ***/ $dbh = mysql_connect('host', 'username', 'password'); mysql_select_db('db', $dbh); $lines = The following are web sites that are at 95% usage or more of there web space\n; $lines .= Site Name Used(MB) Free(MB) Allowed(MB) \n; $result = mysql_query(SELECT * FROM domplans, $dbh); while( $row = mysql_fetch_array($result) ) { $dom=$row[domname]; $total=$row[quota]; $result1=mysql_query(SELECT * FROM datasubused where domname = '$dom'); $proccess = mysql_fetch_array($result1); $totalused=$proccess[quotaused]; $totalfree=$total - $totalused; $percent = ceil(100*$totalused/$total); $lines = array(); if($percent = 95) { $lines[] = $dom $totalused $totalfree $total \n; } } for( $i=0;$icount($lines);$i++) { $message .=$lines[$i]; } echo $message; /*** CODE END ***/ Hope this helps. Cheers, Erik
Re: [PHP] POST_QUERY STRING without letting php to parse it.
Hi, According to my understanding HTTP_RAW_POST data is populated only if PHP engine did not recognize the encoding of the post data. Since it recognizes www-url-encoded and multipart/form-data pretty well you are not likely to get much use out of it. However you can easily gain access to raw incoming post data in perl. Let me know if you want a sample script i will send it off list. best regards raditha nabil wrote: It is working But i can not always control php.ini on the host ..!!! and i tried ini_set(always_populate_raw_post_data , 1); but not working , and i had to chanhe in my local php.ini ... Please Advice Mike Migurski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting data into columns vertically
Where is your data stored? if you are using a DB surely using order by would less painfull? all the best dareal hamsta wrote: [ Please copy me off list. ] Say I have 7 items of data and I wish to sort them into 3 columns in a HTML table. The items are unevenly sized, so rather than print them out in rows - resulting in lots of wasteful whitespace - I would like to output them in vertical order. However if I use the modulus operator to check for when to break into a new column... foreach ($items as $item) { $counter++; if ( ($counter % $columns) == 0) { print /tdtd; } } ...the output will be something like this... +---+---+---+ | Item1 | Item4 | Item7 | | Item2 | Item5 | | | Item3 | Item6 | | +---+ ...when what I'm really looking for is this... +---+---+---+ | Item1 | Item4 | Item6 | | Item2 | Item5 | Item7 | | Item3 | | | +---+ Obviously if the number of items and columns are static, I have no problem, but how do I get a layout that appeals to people and not computers if they're dynamic? This has me befuddled, I'm wondering is there an algorithm for doing it or is it effectively a Turing Test. Thanks, adam ?php $s=array(74,65,112,104,112,72,32,59,45,41); for($i=0;$icount($s);$i++){echo'#'.$s[$i].';';} ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error redirect function
I have a message board script that requires certain parameters like message_id, thread_id, etc. The whole thing works fine, I'd like to have a generic error page to default to in the case that someone fools with the parameters above - for example, setting the thread id to 400 when there are only 300 threads. Right now, it just generates the mysql error message, which doesn't look nice. I know you can use the die() function after the mysql_query function to display some text in the case of an error, but I want to go a little further by redirecting to an error page. How would I go about doing this? Any help would be greatly appreciated. - Doug http://www.phreshdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Error redirect function
if () // Ok { } else{ Header(Location: ./error.php?iErrorType=1); die(); } Doug Parker wrote: I have a message board script that requires certain parameters like message_id, thread_id, etc. The whole thing works fine, I'd like to have a generic error page to default to in the case that someone fools with the parameters above - for example, setting the thread id to 400 when there are only 300 threads. Right now, it just generates the mysql error message, which doesn't look nice. I know you can use the die() function after the mysql_query function to display some text in the case of an error, but I want to go a little further by redirecting to an error page. How would I go about doing this? Any help would be greatly appreciated. - Doug http://www.phreshdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Error redirect function
Don't forget to use the '@' before the mysql function so it doesn't show errors... Example: [EMAIL PROTECTED](..); -Original Message- From: Gal [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 8 de Janeiro de 2004 14:11 To: [EMAIL PROTECTED] Subject: [PHP] Re: Error redirect function if () // Ok { } else{ Header(Location: ./error.php?iErrorType=1); die(); } Doug Parker wrote: I have a message board script that requires certain parameters like message_id, thread_id, etc. The whole thing works fine, I'd like to have a generic error page to default to in the case that someone fools with the parameters above - for example, setting the thread id to 400 when there are only 300 threads. Right now, it just generates the mysql error message, which doesn't look nice. I know you can use the die() function after the mysql_query function to display some text in the case of an error, but I want to go a little further by redirecting to an error page. How would I go about doing this? Any help would be greatly appreciated. - Doug http://www.phreshdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + Progress
I would like to know if someone has already built an application where PHP access a Progress database. I'm not into Progress, so I've been experiencin' some issues on it's configuration with PHP, since PHP has no built-in Progress connectivity (as MySQL, Sybase...). I got some stuff about it on http://www.geocities.com/ncsoft/, but I gotta know if someone had worked with this kind of enviroment before. Best regards []'s Nilo Desenvolvedor WEB A B I L I T Y Soluções interativas +55 21 38526657 www.ability.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing the Time Zone in php.ini
On Thu, 2004-01-08 at 03:33, Andy Higgins wrote: Hello, I have a requirement to run two different sites that are in different time zones on the same machine. Does anyone know if this is possible to do by running two instances of php and making a change in the php.ini? Or do you have any other suggestions on how this can be done? Use putenv() to change on a case-by-case basis -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org signature.asc Description: This is a digitally signed message part
Re: [PHP] Image Resizing with GD
On Thu, 2004-01-08 at 00:20, Peter Vertes wrote: Hello List, I've tried googling but couldn't come up with anything useful so I'm turning to the list. Could anyone send me a link to a tutorial on how to resize images with GD ? Thanks in advance... FYI: Personally, I've found passing stuff off to Image Magick works better. -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org signature.asc Description: This is a digitally signed message part
[PHP] PHP code documentation tool
Hello I recently got a fairly big project in PHP. Before starting I would like to clear some doubts. What is the best way to document such projects? How you developers document your project? For .NET etc. there are many documentation tools like doc-o-matic etc. Do we need to document the code based on rules for such software...or you create your own PHP script to extract comments? Is there any tool like doc-o-matic for PHP or anybody developing something like that? Karam __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP code documentation tool
Hello Karam, Thursday, January 8, 2004, 3:41:36 PM, you wrote: KC Is there any tool like doc-o-matic for PHP or anybody KC developing something like that? http://www.phpdoc.de/ -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP code documentation tool
[snip] What is the best way to document such projects? How you developers document your project? [/snip] GIYF http://phpdocu.sourceforge.net/ http://www.epersonae.com/snapping/archives/000390.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP code documentation tool
I prefer phpDocumentor http://phpdocu.sourceforge.net/ --- Vincent Jansen -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: donderdag 8 januari 2004 16:44 To: Karam Chand Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP code documentation tool Hello Karam, Thursday, January 8, 2004, 3:41:36 PM, you wrote: KC Is there any tool like doc-o-matic for PHP or anybody developing KC something like that? http://www.phpdoc.de/ -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Error redirect function
--- Gal [EMAIL PROTECTED] wrote: Header(Location: ./error.php?iErrorType=1); Always use an absolute URL for the Location header. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: getenv of document_name in php
$_SERVER['SCRIPT_NAME'] or $_SERVER['PHP_SELF'] -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Louie Miranda [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What is the getenv of document_name in php? -- - Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Not working?
I think I must be missing something but this command isn't renaming the file specified... Pointers, tips appreciated! system(rename('/path/to/new.sh', '/path/to/old.$today')); /to directory has permissions set to current user and is also owned by the current user (test_user)... I can write files into the directory and delete files form the directory using the 'unlink()' command but the rename function I am having problems with. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not working?
Jas wrote: I think I must be missing something but this command isn't renaming the file specified... Pointers, tips appreciated! system(rename('/path/to/new.sh', '/path/to/old.$today')); /to directory has permissions set to current user and is also owned by the current user (test_user)... I can write files into the directory and delete files form the directory using the 'unlink()' command but the rename function I am having problems with. Jas remove the from around the rename function: You have this: system(rename('/path/to/new.sh', '/path/to/old.$today')); Try this: system(rename('/path/to/new.sh', '/path/to/old.$today')); HTH, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not working?
Hi jason, Quoting Jas [EMAIL PROTECTED]: system(rename('/path/to/new.sh', '/path/to/old.$today')); I don't think this is correct syntax. Either use the php rename function like rename('/path/to/new.sh', '/path/to/old.$today'); or if you want to use system then use system (rename '/path/to/new.sh' '/path/to/old.$today'); HTH R'twick This message was sent using IMP, the Internet Messaging Program. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not working?
Roger Spears wrote: Try this: system(rename('/path/to/new.sh', '/path/to/old.$today')); Actually, it should be this: rename('/path/to/new.sh', '/path/to/old.$today'); -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Not working?
You can't use variables inside single quotes, either. This: '/path/to/old.$today' ought to be: /path/to/old.$today -- Matt Grimm Jas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think I must be missing something but this command isn't renaming the file specified... Pointers, tips appreciated! system(rename('/path/to/new.sh', '/path/to/old.$today')); /to directory has permissions set to current user and is also owned by the current user (test_user)... I can write files into the directory and delete files form the directory using the 'unlink()' command but the rename function I am having problems with. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5 overload()
Hallo, I;ve just installed php5 and found that overload() function does not work. Actually it does not exist...I get this error : Fatal error: Call to undefined function overload() in /usr/share/pear/DB/DataObject.php on line 2889 Any ideas ? 10x -- Alex Crivat WWW: http://axu.rdsnet.ro GPG: http://axu.rdsnet.ro/pgp.txt e-Mail: [EMAIL PROTECTED] Open source - Millions of opened minds can't be wrong signature.asc Description: This is a digitally signed message part
php-general Digest 8 Jan 2004 19:57:13 -0000 Issue 2519
php-general Digest 8 Jan 2004 19:57:13 - Issue 2519 Topics (messages 174034 through 174064): Re: script/binary that tracks links through logs 174034 by: Mike Migurski php on linux.. 174035 by: khoa vo 174036 by: Miguel J. Jiménez 174043 by: Jay Blanchard Changing the Time Zone in php.ini 174037 by: Andy Higgins 174040 by: Tom Rogers 174051 by: Brian V Bonini Re: POST_QUERY STRING without letting php to parse it. 174038 by: nabil 174045 by: Raditha Dissanayake Re: POST_RAW_DATA 174039 by: nabil Re: Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox??? 174041 by: Christophe Chisogne Turck mmcache is dead 174042 by: zooming.gamebox.net Re: Problem with while loop 174044 by: memoimyself.yahoo.com.br Re: Sorting data into columns vertically 174046 by: Raditha Dissanayake Error redirect function 174047 by: Doug Parker 174048 by: Gal 174049 by: Humberto Silva 174057 by: Chris Shiflett PHP + Progress 174050 by: Nilo Re: Image Resizing with GD 174052 by: Brian V Bonini PHP code documentation tool 174053 by: Karam Chand 174054 by: Richard Davey 174055 by: Matt Matijevich 174056 by: Vincent Jansen Re: getenv of document_name in php 174058 by: Matt Grimm Not working? 174059 by: Jas 174060 by: Roger Spears 174061 by: R'twick Niceorgaw 174062 by: Justin Patrin 174063 by: Matt Grimm php5 overload() 174064 by: Alex Crivat Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- 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 other site would only have to link www.mysite.com and the script/program would do the rest. http://www.mrunix.net/webalizer/ - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html ---End Message--- ---BeginMessage--- I am a newbie. I'm trying to write a php script and put it on the linux server at school. index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. I did locate php to find the path where php is installed and i got /lusr/bin/php. index.html is working fine. So after i filled out the index.html form and press SUBMIT. It would print me to the action.php page only that action.php page would display itself. I have been trying to figure out this problem for quite some time and any help would be greatly appreciated. at first, i thought something is wrong with the action.php so i changed the form and index.html but without success. My website is at www.cs.utexas.edu/users/khoa . Thank you for all your help ---End Message--- ---BeginMessage--- khoa vo wrote: I am a newbie. I'm trying to write a php script and put it on the linux server at school. index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. I did locate php to find the path where php is installed and i got /lusr/bin/php. index.html is working fine. So after i filled out the index.html form and press SUBMIT. It would print me to the action.php page only that action.php page would display itself. I have been trying to figure out this problem for quite some time and any help would be greatly appreciated. at first, i thought something is wrong with the action.php so i changed the form and index.html but without success. My website is at www.cs.utexas.edu/users/khoa . Thank you for all your help Maybe you need to reconfigure APACHE to recognize the .php mime type... if you dont't have that configured Apache would treat the PHP as text instead of script, thus displaying itself... ---End Message--- ---BeginMessage--- [snip] index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. [/snip] If you are using PHP with a browser page you do not need the bash line (#!/lusr/bin/php) in the page. Place a page on the server that has the following (no need for anything else) to see if PHP is on
[PHP] open_basedir clarification
If my server has an open_basedir restriction in place for my home directory, I understand that to mean I can only open files in the same directory as whatever script is currently running. Is that correct? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php on linux..
Hello Khoa, On 8 Jan 2004 at 0:13, khoa vo wrote: index.html-- form action=action.php method=POST Your name: input type=text name=name / input type=submit /form That's fine, but that's not what you have up on your web space. Your form is pointing to action.html, not action.php. action.php-- #!/lusr/bin/php Hi ?php echo $_POST[name]; ?. Ok, you don't need the first line (#!/lusr/bin/php), because this is a script for the web and will be processed by the web server. But you do need to save the file action.php with the .php suffix. I've just checked your online pages and your form is being sent to action.html, not action.php, so the PHP code is not being processed, because your web server doesn't look for PHP code in HTML files. I had a look at the source of your action.html file and it's like this: html Hi. Your name is ?php phpinfo(); echo $_POST[name]; ?. /html The phpinfo() function is going to print a long list of information about PHP on the server, so you might want to remove that. So, to recap, you need to change the action attribute in your index.html file to action.php, and then rename the file action.html to action.php (and maybe remove the phpinfo() function while you're at it). That should do the trick. Good luck, Erik
[PHP] Content-type vs session_start()
I have a problem with html headers using sessions. I guess it has to do with the Content-type line. My ISP uses PHP 4.3.4 with register_globals = On (although I want this to work with Off too). My program (test3.cgi, test3.php) simply logs the number of times I have accessed a web site. As a php file it works as supposed to only that there's no Content-type line. As a .cgi file the script has to have the Content-type line in order to be executed. With Content-type BEFORE session_start(), $_SESSION doesn't seem to be set. Alternatively, with Content-type AFTER session_start(), I get Warning: session_start(): Cannot send session cookie - headers already sent by... Do you have any ideas what I should do to make both .php and .cgi versions work? -- Børge Here's test3.cgi: == #! /usr/local/bin/php ?php print 'Content-type: text/html' . \n\n; session_start(); print 'html' . \n; print 'body' . \n; print 'This is the test3.cgi filebr' . \n; if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } print 'This is your visit number ' . $_SESSION['count'] . \n; print '/body' . \n; print '/html' . \n; ? == And test3.php: == ?php session_start(); // print 'Content-type: text/html' . \n\n; // only in .cgi version! print 'html' . \n; print 'body' . \n; print 'This is the test3.php filebr' . \n; if (!isset($_SESSION['count'])) { $_SESSION['count'] = 0; } else { $_SESSION['count']++; } print 'This is your visit number ' . $_SESSION['count'] . \n; print '/body' . \n; print '/html' . \n; ? == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-type vs session_start()
On Thu, 2004-01-08 at 14:14, Brge Strand wrote: [snip] Do you have any ideas what I should do to make both .php and .cgi versions work? Here's test3.cgi: == #! /usr/local/bin/php ?php print 'Content-type: text/html' . \n\n; session_start(); Have you tried putting session_start() before the first print? - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-type vs session_start()
--- Børge Strand [EMAIL PROTECTED] wrote: I have a problem with html headers using sessions. I think you mean HTTP headers. I guess it has to do with the Content-type line. Yes, and you seem to have a fundamental misunderstanding between using PHP as an Apache module versus using PHP as a CGI interpreter. I will try to explain using your code: Here's test3.cgi: == #! /usr/local/bin/php ?php print 'Content-type: text/html' . \n\n; When you are running as a CGI, you can set the Content-Type header in this way. However, as soon as you send two sequential newlines, you are indicating the end of the headers and the beginning of the content. session_start(); So, when you have this on the next line, PHP cannot set the Set-Cookie header that it is likely trying to set (in addition to whatever cache-related headers it may be setting, depending on your configuration). This is because you have already indicated the end of the headers in your previous line. This is the danger in writing your own headers in this way; you become responsible for adhering to the proper format of things. And test3.php: == ?php session_start(); // print 'Content-type: text/html' . \n\n; // only in .cgi version! While it's not necessary to specify Conetnt-Type here, you can do so using the header() function: header('Content-Type: text/html'); Anything that you print or echo is going to be considered as part of the content, not part of the headers. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post vars not by form
HI, Anyone can help , how to post variables from server side .. as from php page to other without HTML form and submistion ??? i want post method , to post my vars to another php on another server , then i have to read the body that will be printed by fopen ... so i can not use Location: example : i wwant to post to www.example.com?var=1var2=2 and then read the the body from that link .. as 1 or 0 .. Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upload and RENAME picture
Hello, thanks to ya'll I've gotten a picture uploaded... but now what I can't figure out how to do is rename it. I want to rename it something like $id.extension... right now it is just showing up in the directory as the original file... any ideas? thanks matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload and RENAME picture
[snip] any ideas? [/snip] Have you tried move_uploaded_file? http://www.php.net/move_uploaded_file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post vars not by form
[snip] Anyone can help , how to post variables from server side .. as from php page to other without HTML form and submistion ??? [/snip] I have never used it but I think http://pear.php.net/package/HTTP_Client is what you want to look at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] post vars not by form
--- Matt Matijevich [EMAIL PROTECTED] wrote: [snip] Anyone can help , how to post variables from server side .. as from php page to other without HTML form and submistion ??? [/snip] I have never used it but I think http://pear.php.net/package/HTTP_Client is what you want to look at You can also do it manually, if you like. Here is an example: http://shiflett.org/hacks/php/http_post Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help parsing text file?
I'm very new to PHP. I want to display /var/log/lastlog with php on a webpage, but I need some help. How do I do that? Looking at the docs it looks like file() would work, but I couldn't get it to display the file. Carlton.
[PHP] Please help with mail function
Hello all, I have a big problem with the mail function in a php script. If I run this script with root access, the mail function is working. If I try to run it like http://www.i-s-u.nl/test.php it won't work. What is happening, what can I do??? Below the little script: ? mail([EMAIL PROTECTED], onderwerp, test test test, [EMAIL PROTECTED]); ? Thanks, Rolf
Re: [PHP] Help parsing text file?
On Thu, 2004-01-08 at 16:27, Carlton L. Whitmore wrote: I'm very new to PHP. I want to display /var/log/lastlog with php on a webpage, but I need some help. How do I do that? Looking at the docs it looks like file() would work, but I couldn't get it to display the file. I would guess that this is because the user that your web server is running as (usually www or nobody or apache; you can find out by looking in your httpd.conf file) does not have read access to that file. Out of curiosity, why do you want to read that file? I would suggest creating a cron job that runs the lastlog command and writes the results to a file that is readable by the user that the web server is running as. If you want the information to be more up to date, you could make that user a 'sudoer' and run the lastlog command via shell_exec(). I would be cautious about giving that kind of privileges though. - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: post vars not by form
Nabil wrote: HI, Anyone can help , how to post variables from server side .. as from php page to other without HTML form and submistion ??? i want post method , to post my vars to another php on another server , then i have to read the body that will be printed by fopen ... so i can not use Location: example : i wwant to post to www.example.com?var=1var2=2 and then read the the body from that link .. as 1 or 0 .. Regards You can use PEAR's HTTP_Request class to post vars to a site (and a lot more). You could also use HTTP_Client if you need things like cookie management. http://pear.php.net/package/HTTP_Request http://pear.php.net/package/HTTP_Client -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Buffalo'ed, stumped, confused...
Good evening. I'm trying to read using $_POST, 4 radio buttons named miles. I tried reading the selected value with $_POST['miles[0]'], etc. with no success. I've even tried using foreach to read the selected radio button with no success. Help!! I'm totally stumped with this one. I thought the value was passed back as an array but maybe I'm wrong... Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Buffalo'ed, stumped, confused...
Hello Robin, Friday, January 9, 2004, 12:31:16 AM, you wrote: RK I'm trying to read using $_POST, 4 radio buttons named miles. I tried RK reading the selected value with $_POST['miles[0]'], etc. with no success. Radio buttons can only have 1 eventual outcome (hence the whole point of them) and you can access it with: $_POST['miles'][0] Checkboxes are different and will require [] added to the form field name. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Buffalo'ed, stumped, confused...
Robin Kopetzky wrote: I'm trying to read using $_POST, 4 radio buttons named miles. I tried reading the selected value with $_POST['miles[0]'], etc. with no success. I've even tried using foreach to read the selected radio button with no success. It's just $_POST['miles']. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] open_basedir clarification
Can anyone clarify this for me? Is open_basedir recursive or restricted to the exact paths specified? -- Matt Grimm Matt Grimm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If my server has an open_basedir restriction in place for my home directory, I understand that to mean I can only open files in the same directory as whatever script is currently running. Is that correct? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 overload()
Alex Crivat wrote: Hallo, I;ve just installed php5 and found that overload() function does not work. Actually it does not exist...I get this error : Fatal error: Call to undefined function overload() in /usr/share/pear/DB/DataObject.php on line 2889 Any ideas ? 10x overload is the standard behavior in php5, there's no need to call the function. The developers could keep the function for backward compatibility. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: upload and RENAME picture
use funciton rename http://si2.php.net/manual/en/function.rename.php rename($old,$new) or die(can't do that!); Matt Hedges [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, thanks to ya'll I've gotten a picture uploaded... but now what I can't figure out how to do is rename it. I want to rename it something like $id.extension... right now it is just showing up in the directory as the original file... any ideas? thanks matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php_hostconnect()
I currently have websites with two ISP's. I am getting a lot of warnings throughout a .php script on one server - such as: php_hostconnect() I have used the _same_ .php script exactly on my other ISP's server and I don't get any warnings. In addition, I have tested this script locally on Apache server without any errors. The site where I do not get warnnings has php 4.1.1 installed - wheras the other site where I get php_hostcoonect() warnings is php 4.2.3 Any help will be greatly appreciated. Thank you. Tony Ritter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help parsing text file?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I'm very new to PHP. I want to display /var/log/lastlog with php on a webpage, but I need some help. How do I do that? Looking at the docs it looks like file() would work, but I couldn't get it to display the file. Carlton. lastlog isn't actually a text file. You'ld need to use the lastlog program to parse it for you and then output the result. Having said that, I wonder if you are really looking for the output of last (driven from wtmp) which will give you a complete login history, rather than the info available from lastlog? Cheers -- Quod subigo farinam A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] detecting flash in php
is there anyway of detecting flash? in php -- - Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] detecting flash in php
Louie Miranda wrote: is there anyway of detecting flash? in php Detecting whether the user has Flash enabled, you mean? No. PHP is server-side. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: detecting flash in php
On Fri, Jan 09, 2004 at 01:11:38PM +0800, Louie Miranda wrote: is there anyway of detecting flash? in php Not really. But you're not completely out in the cold. Note that PHP runs on the server, so any test you do has to be offloaded to the client side. Use Javascript for this. Use MING to build your Flash content. :) script type=text/javascript language=JavaScript!-- FlashMode = 0; if (navigator.plugins navigator.plugins.length 0) { if (navigator.plugins[Shockwave Flash]) { var plugin_version = 0; var words = navigator.plugins[Shockwave Flash].description.split( ); for (var i = 0; i words.length; ++i) { if (isNaN(parseInt(words[i]))) continue; plugin_version = words[i]; } if (plugin_version = 5) { var plugin = navigator.plugins[Shockwave Flash]; var numTypes = plugin.length; for (j = 0; j numTypes; j++) { mimetype = plugin[j]; if (mimetype) { if (mimetype.enabledPlugin (mimetype.suffixes.indexOf(swf) != -1)) FlashMode = 1; // Mac wierdness if (navigator.mimeTypes[application/x-shockwave-flash] == null) FlashMode = 0; } } } } } if (FlashMode == 1) { // do your flash stuff... For example: document.write('object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0;\n'); document.write('param name=movie value=http://yourdomain.ca/foo.swf;param name=quality value=highparam name=BGCOLOR value=#EEparam name=salign value=tlparam name=menu value=0\n'); document.write('embed src=http://yourdomain.ca/foo.swf; quality=high pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash; type=application/x-shockwave-flash/embed\n'); document.write('/object\n'); } else { document.write(pSorry, this page requires Flash.); } // --/script noscriptSorry, this page requires JavaScript/noscript -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini config on 4.3.4
Hi I use windows Xp,apache,php 4.3.4.I can recieve variable from form by $_POST[''] (Short Term).But i can not recieve variable from form by $HTTP_POST_VARS[''] (Long Term).Include other recieve variable ( GET,SESSION,COOKIE). How to customize config? Matrix -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini config on 4.3.4
Turbo wrote: I use windows Xp,apache,php 4.3.4.I can recieve variable from form by $_POST[''] (Short Term).But i can not recieve variable from form by $HTTP_POST_VARS[''] (Long Term).Include other recieve variable ( GET,SESSION,COOKIE). Yes you can. Let me use my crystal ball and guess that you're using $HTTP_POST_VARS inside of a function or class method. Because of variable scope, it's not available there unless you pass the values to the function/method or make it global. If that's not it... you need to explain more. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php