Re: [PHP] Re: Reading from a file using fgets()
I see what you mean. But, personally, if the documentation didn't explicitly say anything about it, I'd assume that it's from top to bottom and that there's no option--of course, I could be wrong you know, there must be something hidden... - E Ok, file() is docuemted, but it doesn't say anything about whether or not it reads data sequentially from top to bottom or if there's an option to read bottom to top or anything in between. Dave On Thu, 2002-08-29 at 22:37, @ Edwin wrote: Or, is it? :) http://www.php.net/manual/en/function.file.php - E Interesting. It's not documented. On Thu, 2002-08-29 at 14:44, Dallas Thunder wrote: Well, this is exactly what function file() does. "David Christensen" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... When PHP reads from a file using fgets(), does it do it in order? Meaning, when reading STDIN from a file, does it read line1, then line2, line3, and so on until EOF? My purpose is to read each line of file and push it into an array. Thanks for your help, Dave _ $B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B http://career.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Properly installing curl in windows 2000
A.J. It seems that you have exact same problem as me. Everything seems correctly set up, the phpinfo shows; curl CURL support enabled CURL Information libcurl 7.9 (OpenSSL 0.9.6b) For the third day, I am trying to find out, but still I have not got any useful information from the PHP forum members. Rgs Steinar Kolnes -Opprinnelig melding- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]På vegne av [EMAIL PROTECTED] Sendt: August 30, 2002 5:56 AM Til: [EMAIL PROTECTED] Emne: Properly installing curl in windows 2000 I'm stuck completely. This is what I've done thus far... I went into the php.ini and set the extensions_dir to point to the correct path, and I enabled the extenions php_curl.dll. When I hit phpinfo to get info, it tells me that curl is enabled and it gives me the version. But I've been reading and many people say the following... To use PHP's CURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the include directory there should be a folder named curl which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the lib directory How do I actually do this? I have no idea as to what I need to do for the above, I do have curl extracted in a directory and the include folder does contain curl in it contains the curl.h and easy.h. and the lib directory contains the libcurl.a file as well, Now how do I compile PHP --with-curl[=DIR]? I need the step by step instructions, I'm very new at this and have really no experience in programming at all so take it easy on me. A.J. --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
[PHP] open blocks in one include and close it in another
Hi, is there an workaround to open blocks (e.g after an if condition) in the first include and close this block in another? with the curly brace i get parse errors. I want to do this: startblock.inc: ?php if ( !$iPageRight ) { echo p class=\fError\access denied!/p; } else { ? endblock.inc ?php } ? main.php ?php $iPageRight = TRUE; include (startblock.inc); echo p class=\fText\this is the content!/p; include (endblock.inc); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Properly installing curl in windows 2000
It seems that you have exact same problem as me. Everything seems correctly set up, the phpinfo shows; curl CURL support enabled CURL Information libcurl 7.9 (OpenSSL 0.9.6b) If you see this above then you have php installed with curl To use PHP's CURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the include directory there should be a folder named curl which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the lib directory This relates to the source code only. if you are installing php by compiling the source then you need to do this. if you're using the windows binary install package then you dont. and going by the previous emails that I've recieved this is what you are doing. The simplest way to test your install is to use this script ?php $ch = curl_init (http://www.google.com/;); curl_exec ($ch); curl_close ($ch); ? which will echo the google webpage as for the warning recieved Warning: fopen(php_homepage.txt, w) - Permission denied in D:\WWW\xxx.com\www_root\.php on line 4 this tells you that your web server does not have permission to create files in this directory. you'll need to play with the permissions for the directory you want to use. A few months back I personally found that I could not use the option CURLOPT_FILE when using the windows binary install of php. As I was in a rush I never found time to resolve the issue and shifted everything to a linux server. Wether this was caused by a bug in php/curl or something else I do not know. D. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Average Number For Math Functions
Ok I think your definently going in the right direction - when I put this into my series I seem to be getting this message for each result: Resource id #40 or some other number that in some way represents something? Any Clue? Here is my SQL: $rsum =mysql_query(select sum(rating) from ratings)or die (mysql_error()); John Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if you have a table called ratings and a field called score in it, then doing this will show you the sum of all the scores: select sum(score) from ratings; eg, if the scores were 5, 2, 5, 8, and 2 then this sql should return 22 (unless I added it wrong... :/ ) -Original Message- From: JohnP [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 3:10 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Average Number For Math Functions I am still very new to PHP so things are still a little foreign to me - what exactly is the SUM finction - I tried to locate one on both the PHP and MySQL site but found nothing! Thanks ~ John Volve [EMAIL PROTECTED] wrote in message 02d901c24fd5$aba46020$7800a8c0@idiom">news:02d901c24fd5$aba46020$7800a8c0@idiom... What database are you using? MySQL has a SUM function which automatically selects the total of a column. -VolVE - Original Message - From: JohnP [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 29, 2002 21:25 Subject: Re: [PHP] Average Number For Math Functions Ok so how do I sum up an entire column in my db? For example if one row is : 1 , the next is 2, and the next is 1 - I need to have a total of 4 and the be able to divide by the num_rows The problem I ma having is the inside row addition Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... just sum them up and divide by the count - making sure to deal with a count of zero -Original Message- From: JohnP [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 10:56 AM To: [EMAIL PROTECTED] Subject: [PHP] Average Number For Math Functions Ok I looked at all the math functions for PHP but saw no way of returning the average of a set of numbers - I plan on using this for a rating system - any help? -- John -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail problem
The script below works on my development web server which sits on our company LAN. When I transfer the script to our isp hosted webserver, the script does not work. I changed 192.168.10.9/iarnaweb/ to read localhost/ for the isp webserver version (I have also tried replacing localhost with the actual ip address). On my development server, the email is sent and the redirection happens but on the production server neither of these happens. Any ideas? ?PHP $toaddress = [EMAIL PROTECTED]; $subject = Enquiry via Web Site.; $mailcontent = Customer Name: .$name.\n .Position: .$position.\n .Company Name: .$company.\n .Address: .$address.\n .E-mail: .$email.\n .Tel No: .$telno.\n .Customer Comments: .$enquiry.\n; mail($toaddress, $subject, $mailcontent); header(Location: http://192.168.10.9/iarnaweb/contactack.html;); ? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GD Graphics Library
Does it have to be in the US? Henry René fournier [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... There are several functions in the GD library that I really, really want to be able to use on several sites that I develop/manage. Unfortunately, the ISP I use, FatCow, doesn't have GD, nor seems interested in adding it. Can anyone recommend a good, cheap ISP (like FatCow) that DOES have GD for PHP4? (Or better yet, do you have any suggestions as to how I might persuade FatCow to add it?? ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Useragent and file
Hi Im using file() to get the contents of a webpage. e.g // get a web page into an array $fcontents= file ($targeturl); However I dont know how to mimic a different useragent. Using LWP::UA (in perl) i can pretend to be iexplore6 running on win2k or anything i want.. Is there a way i can do this in PHP? By changing the useragent will this also resolve problems with javascript?, I'd like the target server to think that I can view/run it. Thanks heaps, Todd.
[PHP] Re: Mail problem
Hello, On 08/30/2002 04:46 AM, Mark Colvin wrote: The script below works on my development web server which sits on our company LAN. When I transfer the script to our isp hosted webserver, the script does not work. I changed 192.168.10.9/iarnaweb/ to read localhost/ for the isp webserver version (I have also tried replacing localhost with the actual ip address). On my development server, the email is sent and the redirection happens but on the production server neither of these happens. Any ideas? ?PHP $toaddress = [EMAIL PROTECTED]; $subject = Enquiry via Web Site.; $mailcontent = Customer Name: .$name.\n .Position: .$position.\n .Company Name: .$company.\n .Address: .$address.\n .E-mail: .$email.\n .Tel No: .$telno.\n .Customer Comments: .$enquiry.\n; mail($toaddress, $subject, $mailcontent); header(Location: http://192.168.10.9/iarnaweb/contactack.html;); ? The mail function mail fail for many reasons but you are not checking its return value. Possibly it is just PHP configuration issue on your server. Which platform do you use? Another point is that the Location: header is meant to be interpreted by the user browser, not your server. So, it should include the real server domain because localhost for each user is their own machine, not your server. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Mail problem
Manuel, My development platform is linux 7.2 and php4.0.6. The production server is also linux (I think 7.2) but the php version 4.1.1. On your second point, do you mean I should say something like this - header(Location: http://ccmltdcouk.site.securepod.com/test.php;) This is our temporary domain name. I hope this helps. The mail function mail fail for many reasons but you are not checking its return value. Possibly it is just PHP configuration issue on your server. Which platform do you use? Another point is that the Location: header is meant to be interpreted by the user browser, not your server. So, it should include the real server domain because localhost for each user is their own machine, not your server. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail()....
Is there a way to set the font on a plaintext email? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: How to handle multiple value checkboxes
name your checkboxes like so input type=checkbox name=mycheckbox[] value=1 on your result page you'll end up with an array of checked boxes. If the boxes are not checked they dont appear in the array. for quick and dirty debugging on your result page: ? print 'pre'; print_r($_POST['mycheckbox']); // returns your checkbox array print '/pre'; ? hope this helps :) :: Julien COQUET EMEA hp.com Common Services Cap Gemini Ernst Young Advanced Delivery and Integration -Original Message- From: Lon Lentz [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 29, 2002 11:07 PM To: Php-General@Lists. Php. Net Subject: How to handle multiple value checkboxes If I have a form with multiple checkboxes with different values but the same name, and someone selects a couple of them, how do I reference all of the values? Right now I am only getting the last one selected. __ Lon Lentz Applications Developer EXImpact.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail()....
Hi there. Not on a plaintext mail, this will be decided by the mail client. If your format the mail using html, then you will be able to format the font. Regards -Scott -Original Message- From: Brian McGarvie [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Mail() Is there a way to set the font on a plaintext email? -- 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] hide system output from header
i execute a system function which works great only prob is it breaks the header so what i need to know is how i can prevent the output from this and append it to a variable, i allready tried appending to variable but still outputted Regards Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hide system output from header
You can use exec($command, $result); which will throw any stdout output into $result Im not sure if it works with stderr as well, you will have to try it :) Todd. - Original Message - From: Mark [EMAIL PROTECTED] To: Sent: Friday, August 30, 2002 7:06 PM Subject: [PHP] hide system output from header i execute a system function which works great only prob is it breaks the header so what i need to know is how i can prevent the output from this and append it to a variable, i allready tried appending to variable but still outputted Regards Mark -- 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] Mail()....
on 30/08/02 6:57 PM, Scott Houseman ([EMAIL PROTECTED]) wrote: Not on a plaintext mail, this will be decided by the mail client. If your format the mail using html, then you will be able to format the font. ... but that still won't guarantee it'll work... the user will have to have the font on their system, just like regular HTML pages. To pre-empt your next question, how do I send HTML mail, check out the class by Manuel on phpclasses.org for sending HTML Mime email :) Justin Regards -Scott -Original Message- From: Brian McGarvie [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Mail() Is there a way to set the font on a plaintext email? -- 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] Re: Mail()....
It's a text-based newsletter... I have a solution i think... so it'll look the same... just need to verify that it *should* be the same... inserting the contents in html, but within a pre/pre? 2'nd, using the following headers, sends it as an attachment it seems... $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; TIA.. Brian McGarvie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there a way to set the font on a plaintext email? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP_AUTH_USER
anyone can help me what is the script for log out WWW-authenticate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail()....
If you need plaintext newsletter, you can not use HTML at all, even pretending that it is a plain-text. It will be screwed badly on the plaintext-only e-mail clients anyway. Stas - Original Message - From: Brian McGarvie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 10:27 AM Subject: [PHP] Re: Mail() It's a text-based newsletter... I have a solution i think... so it'll look the same... just need to verify that it *should* be the same... inserting the contents in html, but within a pre/pre? 2'nd, using the following headers, sends it as an attachment it seems... $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; TIA.. Brian McGarvie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there a way to set the font on a plaintext email? -- 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] PHP_AUTH_USER
I'm afraid you're going to have to be more specific than that my friend. - Original Message - From: Hendråwan Rinäldi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 7:43 PM Subject: [PHP] PHP_AUTH_USER anyone can help me what is the script for log out WWW-authenticate -- 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] .scr Attachments
Hi all, As I'm sure you are all aware (but this email is incase you are not), files with the extension .scr are executable on all windows platforms. Just now from someone on the list I have received two emails with .scr attachments. If you receive an attachment from this list, please check the extension type very carefully before opening it, it is most likely a virus. We dont want something like this attacking inboxes clogging up an already very full mail list, along with all your freinds/contacts if you do run it. Once again, I'm sure you guys are aware, but its better to be safe than sorry. There is a remote chance that it is not a virus, but i dont trust microsoft and i dont trust executable attachments. Cheers, Todd.
[PHP] Re: need help with a chat code problem
as each one I want to delete will be the smallest ID number (as it grows with each message added to it). I think you mean the lowest ID in the table and I suppose you're looking for a MySQL query. As of MySQL version 4 (currently in development) you can use delete from tablename where id in (select min( id ) from tablename);. I suppose you're not working with the development version of MySQL. For MySQL 3.x you will have to use two queries: - select min(id) from tablename - delete from tablename where id=min(id) Unfortunatly it's not possible to do delete from tablename where id=min(id), because the min-function is a so called group function. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Mail problem
I have some more information that may be relevant to my problem. I compared the phpinfo() from both servers and there is a difference. The sendmail_from variable in the php.ini on my server is set to [EMAIL PROTECTED] The same variable on my isp's ini file is set to 'no value'. Would this stop my emails from being sent and if so can I change this value from within my script or would it have to be directly amended in the php.ini file? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reg exp help
Hi! I need some help with a reg exp I'm building a little viewer for my http access logs, and what i'ld like to do is to clean it from alla hits from my own ip Take for example: 194.236.30.24 - - [30/Aug/2002:11:46:29 +0200] GET /bildgalleri/createjpg.php?url=/v044file=v044_27.jpg HTTP/1.1 200 8874 217.215.84.222 - - [30/Aug/2002:11:46:39 +0200] POST /weblogg.php HTTP/1.1 200 3149488 194.236.30.24 - - [30/Aug/2002:11:46:43 +0200] GET /bildgalleri/showpicture.php?url=%2Fv044file=v044_21.jpg HTTP/1.1 200 450 217.215.84.222 - - [30/Aug/2002:11:46:47 +0200] POST /weblogg.php HTTP/1.1 200 3149705 194.236.30.24 - - [30/Aug/2002:11:46:49 +0200] GET /bildgalleri/createjpg.php?url=/ v044file=v044_21.jpgquality=bettermax_side=big HTTP/1.1 200 69110 217.215.84.222 - - [30/Aug/2002:11:47:48 +0200] POST /weblogg.php HTTP/1.1 200 3149813 217.215.84.222 - - [30/Aug/2002:11:48:09 +0200] POST /weblogg.php HTTP/1.1 200 3149902 Here I'ld like to remove all lines that looks like 217.215.84.222 some text ending with line break How should the reg exp look? Many thanks, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with include
Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english.
Re: [PHP] problem with include
hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include
The same problem with require - Original Message - From: John Wards [EMAIL PROTECTED] To: skitum [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 1:02 PM Subject: Re: [PHP] problem with include hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- 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] a and validator problem
Hi all. I have a tag: a href=index2.php?pg=2 CV/a when I want to validate page (W3C online validator) , validator prints: Line 37, column 50: a href=index2.php?pg=2PHPSESSID=195c0283f8 ... ^Error: unknown entity PHPSESSID How can I solve this? (amp doesn't functioning, because after that is PHPSESSID added automatically by php) When I open the source file from MSIE there is no PHPSESSID parameter. So in properties of link. Maybe validator uses different way to connect to that site. Is there possibility to solve this? thanks a lot Peter Turcan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include
hmmbeyond my scope...but I did the following to test ?//file one.php echoone; include (two.php); ? ?//file two.php echotwo; include (three.php); ? ?//file three.php echothree; ? And it echoed onetwothree must be some setting on your system but what I don't knwo John - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 12:06 PM Subject: Re: [PHP] problem with include The same problem with require - Original Message - From: John Wards [EMAIL PROTECTED] To: skitum [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 1:02 PM Subject: Re: [PHP] problem with include hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Simple regexp
You can use the following pattern with preg_match: /([a-f0-9]+)((:[a-f0-9]+){7})/i I made an assumption that you are using the x:x:x:x:x:x:x:x address format. Anil On Wed, 28 Aug 2002, Adam Alkins wrote: Hi Folks, Seeking some guidance here. My regexp knowledge is pathetic. I want to do a simple validation of an ipv6 address. I just want to validate the entire string (not specific blocks) if it has the allowed charachters. I though ereg('[A-Fa-f0-9:]') would work, but it isn't. Anyone can help me with this? IPv6 addresses are just Hex with : characters, so I just need to validate that for the entire string. Thanks for your time. -- Adam Alkins http://www.rasadam.com -- -- +91 471 324341 (Office) +91 98473 22280 (Cell) Linuxense Information Systems Pvt. Ltd., Trivandrum, India http://www.linuxense.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail problem
The sendmail_from variable in the php.ini on my server is set to [EMAIL PROTECTED] The same variable on my isp's ini file is set to 'no value'. Would this stop my emails from being sent and if so can I change this value from within my script or would it have to be directly amended in the php.ini file? I don't think this would stop emails from being sent. There are two ways to change the From header: - Use the function ini_set(sendmail_from, email address ); - Use From: email address as the fourth argument to your mail call Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP_AUTH_USER
From: Hendråwan Rinäldi [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 5:44 AM Subject: [PHP] PHP_AUTH_USER anyone can help me what is the script for log out WWW-authenticate You can't log out of http authentication. Close the browser is it. Not very secure, eh. Use a session based login method if you need logout function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_AUTH_USER
You can't log out of http authentication. Close the browser is it. Not very secure, eh. Use a session based login method if you need logout function. Why not? Sending this to the client should do the job: header('WWW-Authenticate: Basic realm=My Realm'); header('HTTP/1.0 401 Unauthorized'); HTH, Stas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 'save as'
Running GNU/Debian Sid. Im Running into problems, Apache cant see the .php file (it brings up the save-as dialog everytime) I have this line enabled (see below) still no success AddType application/x-httpd-php .php installed php4 4.2.2-2, php4-mysql 4.2.2-2, phpnuke 5.6-3, apache 1.3.26-1.1. http://mdew.dyndns.org/httpd.conf http://mdew.dyndns.org/ yeah yeah im a n00b to php stuff, some pointers just to get this thing loadingrunning would be great. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP_AUTH_USER
From: Stas Maximov [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 8:02 AM To: Matt Schroebel Cc: PHP General Subject: Re: [PHP] PHP_AUTH_USER You can't log out of http authentication. Close the browser is it. Not very secure, eh. Use a session based login method if you need logout function. Why not? Sending this to the client should do the job: header('WWW-Authenticate: Basic realm=My Realm'); header('HTTP/1.0 401 Unauthorized'); That doesn't work for me, at least in IE 6. It pops up a new login window. If you hit cancel, the browser still sends the prior authorization header to the server on the next request. If you change the realm on one page, when you go back to the other page, the browser will still have the other realms authorization header. Thinking as I type, perhaps you mean to store the realm, and change it to something else when they logout? Such that one never sees the same realm twice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Reg exp help
Take for example: 194.236.30.24 - - [30/Aug/2002:11:46:29 +0200] GET /bildgalleri/createjpg.php?url=/v044file=v044_27.jpg HTTP/1.1 200 8874 217.215.84.222 - - [30/Aug/2002:11:46:39 +0200] POST /weblogg.php HTTP/1.1 200 3149488 [more loglines] Here I'ld like to remove all lines that looks like 217.215.84.222 some text ending with line break How should the reg exp look? Try this: preg_replace( /^217.215.84.222.*\n/m, , $log ) The second argument, currently empty, can be used as a replacement string. As we look at the regular expression /^217.215.84.222.*\n/m, from left to right: ^ Start of line if modifier /m is used (completely right) ip address, followed by a dot (.). This dot means any characters, followed by a asterisk (*). The asterisk is a 0 or more quantifier, which matched everything until the next statement (in this case the \n). You can also use $ instead of \n, only the newline will not be stripped. $ means end of line, while \n means newline. HTH, Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Mail problem
Still not resolved. I checked my local php.ini and the sendmail_path variable is commented out. If I do a phpinfo() on the same server, sendmail_path has a value of /usr/sbin/sendmail -t -i ? I don't know where it pick up this value from but I can send emails from this server. The production server that is situated with my isp also has the sendmail_path set to /usr/sbin/sendmail -t -i but this won't send emails. Both web servers are on linux 7.2 boxes. Am I correct in assuming that the SMTP and sendmail_from variables are only relevant for webservers on windows hosts and all I need to be concerned with is sendmail_path? I have searched various places for an answer as to why I can't mail from my production server without much success. This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] autocomplete list box
Hi I am wondering if it is possible to write/create/implement an autocomplete type list box, something that will basically work the same as when you have a normal textbox in a form and have autocomplete enabled in the browser, but not quite exactly, I want the textbox and the listbox to be combined and browser independant. Is this possible? Dependant/do-able with PHP or is it a Java/Browser feature? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to have a form keep values when user hits back button?
As others have probably told you, you can't rely on the back button and don't try to disable it, it's part of the user interface. The user really needs to live with the fact that if they leave the page, they will lose the data entered. However, there is a way to retain the data as they enter it. You can use Javascript to write the data to cookies as they enter it. This means setting traps on every field, checkboxes and radio button would have an onClick, data entry fields would have an onBlur (is that write?). So as they enter the data, it is save in local cookies. You would also want to add an onLoad trap on the page to check for and read the cookies if present to populate the fields. Most people aren't used to cookies management via Javascript, so it may be a little daunting at first. But this will work. If cookies javascript are enabled that is. On Thursday, August 29, 2002, at 05:22 AM, Jean-Christian Imbeault wrote: I have php page that creates an html form. When the user hits the submit button another php script is called to parse the form and display some output. However I find that if I hit the back button the form values get reset. How can I make it so that if I hit the back button the values I entered in the form will still be displayed? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP_AUTH_USER
Yes, Matt, you were right about tracking the authorized state with a session. I actually thought about same thing: keeping a variable somewhere which will help to decide whether to send those Authenticate headers or not - just didn't realize you meant the same thing. :) And a little excerpt from w3.org proving the point: HTTP Authentication has the addition problem that there is no mechanism available to the server to cause the browser to 'logout'; that is, to discard its stored credentials for the user. This presents a problem for any web application that may be used from a shared user agent. Requests for how to force 'logout' appear almost daily in the netnews html and cgi authoring groups, and are one of the most common support questions received by Agranat Systems from their customers developing embedded systems web interfaces. Cheers, Stas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail problem
Am I correct in assuming that the SMTP and sendmail_from variables are only relevant for webservers on windows hosts and all I need to be concerned with is sendmail_path? Yes, that is correct. Did you check for existence of /usr/sbin/sendmail? Sendmail often resides in /usr/lib/sendmail, so you could check that. Try file_exists, or open a pipe with popen. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Mail problem
I actually had to set the SMTP setting to localhost on our solaris boxes to get this to work. I discovered this because we have a few older machines without php.ini files altogether, and the default is to have this set (the older machines worked). Thanks Mark Bond -Original Message- From: Mark Colvin [mailto:[EMAIL PROTECTED]] Sent: 30 August 2002 13:40 To: 'Erwin' Cc: Php (E-mail) Subject: RE: [PHP] Re: Mail problem Still not resolved. I checked my local php.ini and the sendmail_path variable is commented out. If I do a phpinfo() on the same server, sendmail_path has a value of /usr/sbin/sendmail -t -i ? I don't know where it pick up this value from but I can send emails from this server. The production server that is situated with my isp also has the sendmail_path set to /usr/sbin/sendmail -t -i but this won't send emails. Both web servers are on linux 7.2 boxes. Am I correct in assuming that the SMTP and sendmail_from variables are only relevant for webservers on windows hosts and all I need to be concerned with is sendmail_path? I have searched various places for an answer as to why I can't mail from my production server without much success. This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- 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: Mail problem
Erwin, sendmail on my local server does indeed reside in /usr/lib/sendmail although phpinfo shows sendmail_path = /usr/sbin/sendmail -t -i it still sends the mail? Why is this the case and would you suggest anything to enable me to get my mail working with my isp. I do not have direct access to php.ini with my isp. Mark -Original Message- From: Erwin [mailto:[EMAIL PROTECTED]] Sent: 30 August 2002 14:27 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Mail problem Am I correct in assuming that the SMTP and sendmail_from variables are only relevant for webservers on windows hosts and all I need to be concerned with is sendmail_path? Yes, that is correct. Did you check for existence of /usr/sbin/sendmail? Sendmail often resides in /usr/lib/sendmail, so you could check that. Try file_exists, or open a pipe with popen. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: autocomplete list box
I am wondering if it is possible to write/create/implement an autocomplete type list box, something that will basically work the same as when you have a normal textbox in a form and have autocomplete enabled in the browser, but not quite exactly, I want the textbox and the listbox to be combined and browser independant. Is this possible? Dependant/do-able with PHP or is it a Java/Browser feature? If it was possible, it would be a Java/Browser thingy. It is not possible with normal HTML. You could try something with DHTML, but it will never come close to Microsofts implementation. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] autocomplete list box
On Friday 30 August 2002 20:54, Petre Agenbag wrote: Hi I am wondering if it is possible to write/create/implement an autocomplete type list box, something that will basically work the same as when you have a normal textbox in a form and have autocomplete enabled in the browser, but not quite exactly, I want the textbox and the listbox to be combined and browser independant. Is this possible? Dependant/do-able with PHP or is it a Java/Browser feature? $php = 'no'; $javascript = 'yes'; -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A journey of a thousand miles starts under one's feet. -- Lao Tsu */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Mail problem
I have this set on both boxes. Here are the settings - local box (which does send mail)isp box (does not send mail) sendmail_from melocalhost.com 'no value' sendmail_path /usr/sbin/sendmail -t -i/usr/sbin/sendmail -t -i SMTPlocalhost localhost I actually had to set the SMTP setting to localhost on our solaris boxes to get this to work. I discovered this because we have a few older machines without php.ini files altogether, and the default is to have this set (the older machines worked). This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT - .scr Attachments
On Friday 30 August 2002 18:11, Todd Pasley wrote: As I'm sure you are all aware (but this email is incase you are not), files with the extension .scr are executable on all windows platforms. If people are daft enough to be using M$ software AND they're daft enough to execute unsolicited executables then they deserve whatever they get. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Please come home with me ... I have Tylenol!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open_basedir
Hello! My ISP is using the open_basedir restriction which (I think) is stopping me from using the function fopen to read a document on a different server. I have been in contact with the ISP and they want to allow me to use the fopen function for my purposes, but they have this restriction so it wouldn't be possible to use other owners scripts within the ISP:s server. Is there anything they could do to keep a higher security level (open_basedir restriction) but still allow me to read documents on other servers. Do you have any suggestions or solutions, please write me a mail. Thank you!! « - » « Jens Winberg ([EMAIL PROTECTED])» « Vanha Hämeentie 86» « 20540 Turku » « FINLAND » « GSM: 044-5997730 » « - » -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a and validator problem
On Friday 30 August 2002 17:28, Peter Turcan wrote: Hi all. I have a tag: a href=index2.php?pg=2 CV/a when I want to validate page (W3C online validator) , validator prints: Line 37, column 50: a href=index2.php?pg=2PHPSESSID=195c0283f8 ... ^Error: unknown entity PHPSESSID How can I solve this? (amp doesn't functioning, because after that is PHPSESSID added automatically by php) When I open the source file from MSIE there is no PHPSESSID parameter. So in properties of link. Maybe validator uses different way to connect to that site. You've enabled session.use_trans_sid in php.ini Is there possibility to solve this? temporarily disable it. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* There is nothing stranger in a strange land than the stranger who comes to visit. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About html
Hy, I have one question about html. 1. I have a form with 8 textbox. How can I put the tab order? When I press tab I want to jump from first textbox to textbox number 4 not to number 2. Thanks for answer. kale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] About html
I have one question about html. 1. I have a form with 8 textbox. How can I put the tab order? When I press tab I want to jump from first textbox to textbox number 4 not to number 2. Well, this isn't an HTML list, but I know there is a way. Check out www.htmlhelp.com. Otherwise, Bravenet has an excellent Webmaster mailing list that sends out great tips every few weeks, and they covered this exact topic not too long ago. Check their archives at http://www.bravenet.com/reviews/archives/tips.php. It's in there somewhere. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] About html
Use the tabindex - td width=100 valign=topinput name=telno type=text size=60 maxlength=60 value= tabindex=1//td -Original Message- From: kale [mailto:[EMAIL PROTECTED]] Sent: 30 August 2002 08:45 To: [EMAIL PROTECTED] Subject: [PHP] About html Hy, I have one question about html. 1. I have a form with 8 textbox. How can I put the tab order? When I press tab I want to jump from first textbox to textbox number 4 not to number 2. Thanks for answer. kale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: autocomplete list box
Hi! Go to http://javascript.internet.com and look into the forms section. You´ll find what you need. Regards Alex Petre Agenbag writes: Hi I am wondering if it is possible to write/create/implement an autocomplete type list box, something that will basically work the same as when you have a normal textbox in a form and have autocomplete enabled in the browser, but not quite exactly, I want the textbox and the listbox to be combined and browser independant. Is this possible? Dependant/do-able with PHP or is it a Java/Browser feature? Thanks. -- 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] changing the include path
Hello All, Is it possible to change the include path when a script is runing without having to change the php.ini file? TIA Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Writing Files
How do you write files so that theyre chmoded 777 by default. the folders theyre written to are 0777 but the files aren't. so i cant delete or modify the files through PHP, i have to first chmod them with FTP, which takes ages. -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Online Film Production Directory *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: changing the include path
refer to: string ini_set ( string varname, string newvalue) Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, Is it possible to change the include path when a script is runing without having to change the php.ini file? TIA Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT - .scr Attachments
Hi If people are daft enough to be using M$ software AND they're daft enough to execute unsolicited executables then they deserve whatever they get. Yep I agree, although, I would prefer if people didnt then be email me again with already hundreds of emails a day... I dont need this as well. Im sure you can relate. Todd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing Files
On Friday 30 August 2002 20:53, Georgie Casey wrote: How do you write files so that theyre chmoded 777 by default. the folders theyre written to are 0777 but the files aren't. so i cant delete or modify the files through PHP, i have to first chmod them with FTP, which takes ages. umask() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* monitor resolution too high */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing Files
Georgie Casey wrote: How do you write files so that theyre chmoded 777 by default. the folders theyre written to are 0777 but the files aren't. so i cant delete or modify the files through PHP, i have to first chmod them with FTP, which takes ages. There are a number of things you may find useful to read about in PHP: chmod chown umask Also you might want to look into the sticky bit for directories. Someone feel like adding more about sticky bits... I'm pretty vague on them, just know when they're set (and I don't remember how to) that files written to the directory inherit group ownership. Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'save as'
mdew wrote: Running GNU/Debian Sid. Im Running into problems, Apache cant see the .php file (it brings up the save-as dialog everytime) I have this line enabled (see below) still no success AddType application/x-httpd-php .php And restarted Apache? Is there more than one httpd.conf or is it in the right place? To check this I'd put some rubbish into httpd.conf, restart Apache and check that it complains. If you have built is as an apache module then you will need the LoadModule line too. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with writing multiple records to a table
I have a form that asks customers which of 42 categories they are interested in. I have created three tables to handle the results. Everything writes to the pf_survey table with no problems and only the first checkbox selected writes to the cat_survey table. What am I missing? Is it something in my code or do I need to do something special to my cat_survey table? Thanks. pf_survey Survey_id,Ques,date etc cat_survey Survey_id, category_id Categories Category_id, category_name Here is the code ?php $protected=1; include header.php; $perm-check('admin'); $username = $auth-auth[uname]; $_POST['category_id']; if ($Submit) { $res=mysql_query(insert into pf_survey (customer_number,interest_pf,return_call,call_date,comments,submit_time, username) values ('$customer_number','$interest_pf','$return_call','$call_date','$comment s',now(),'$username'),$dbi); if (!$res) { print pCouldn't insert your record: .mysql_error()./p\n; } $pfsurvey_id=mysql_insert_id($dbi); $this-pfsurvey_id=$pfsurvey_id; $numcat = count($category); if ($numcat1){ $category_id=implode(,,$category); } elseif ($numcat==1){ $category_id=$category; } $cat=mysql_query(insert into cat_survey (pfsurvey_id, category_id) values ('$pfsurvey_id','$category_id'),$dbi); if (!$cat) { print pCouldn't insert your record: .mysql_error()./p\n; } print pLoaded your data correctly./p\n; print pa href=pf_survey.phpAdd another record./a/p\n; } else { ? form action=?php print $sess-self_url(); ? method=post ?php $sess-hidden_session(); ? div align=left pCustomer Number input type=text name=customer_number size=6 maxlength=6 (look on catalog for label with number)br br 1. Are you interested in Power Forward? Yes input type=checkbox name=interest_pf value=Y No input type=checkbox name=interest_pf value=N br 2. Would you like for us to call back? Yes input type=checkbox name=return_call value=Y No input type=checkbox name=return_call value=N Date to call back (yr-mm-dd) input type=date name=call_date maxlength=10 size=12 /p pIn which of the following categories are you interested?br table width=100% border=0 cellspacing=0 cellpadding=0 tr td Air Compressors input type=checkbox name=category[] value=1 br Air Tools input type=checkbox name=category[] value=2 br Animal Traps input type=checkbox name=category[] value=3 br Apparel-Work Clothing input type=checkbox name=category[] value=39 br Bending Brakes input type=checkbox name=category[] value=4 br Blades input type=checkbox name=category[] value=42 br Brick Tools input type=checkbox name=category[] value=38 br Business Supplies input type=checkbox name=category[] value=26 br Carpet amp; Drying input type=checkbox name=category[] value=5 br Concrete input type=checkbox name=category[] value=6 br Detail Shop input type=checkbox name=category[] value=41 br Drain Cleaners input type=checkbox name=category[] value=7 br Drilling amp; Boring input type=checkbox name=category[] value=8 br Dry Wall Tools input type=checkbox name=category[] value=9 /td tdEngines amp; Motors input type=checkbox name=category[] value=10 br Floor Maintenance Tools input type=checkbox name=category[] value=11 br Generators input type=checkbox name=category[] value=12 br Heaters input type=checkbox name=category[] value=13 br Lawn amp; Garden input type=checkbox name=category[] value=15 br Lighting input type=checkbox name=category[] value=40 br Magnetic Tools input type=checkbox name=category[] value=16 br Marine Propellers input type=checkbox name=category[] value=37 br Material Handling input type=checkbox name=category[] value=17
Re: [PHP] Re: Mail()....
Brian, Please be aware that many email clients will NOT read HTML. The human readers are then presented with raw HTML and get very ...?... upset about it! (that's why list postings are not supposed to be in HTML/rich text format) Regards, =dn It's a text-based newsletter... I have a solution i think... so it'll look the same... just need to verify that it *should* be the same... inserting the contents in html, but within a pre/pre? 2'nd, using the following headers, sends it as an attachment it seems... $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; TIA.. Brian McGarvie [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there a way to set the font on a plaintext email? -- 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] Where is my REMOTE_USER?
At 16:42 30/8/2002 +1200, David Robley wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Is this snippet from the docs possibly relevant? Chapter 17. HTTP authentication with PHP The HTTP Authentication hooks in PHP are only available when it is running as an Apache module and is hence not available in the CGI version. I think the HTTP Authentication hooks are something a little different but the problem might be related. My other settings actually worked well for a long time, then I upgraded Apache PHP and gone were the remote_user. Thank you for drawing my attention to the relevant passage. Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email formatting
This is a slightly off topic question. My apologies to any that this may aggravate. Is it safe to assume that email addresses are accepted by all servers case insensitive? So that if I have an email application accepting emails I can safely strtolower($email) the address and be sure that all servers recognize and accept [EMAIL PROTECTED] as they would [EMAIL PROTECTED]? === Ron Dyck WebbTech www.webbtech.net [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email formatting
Ron Dyck wrote on Fri, Aug 30, 2002 at 01:28:34PM -0400: Is it safe to assume that email addresses are accepted by all servers case insensitive? accepted, yes, perhaps, but per rfc2821 says: The local-part of a mailbox MUST BE treated as case sensitive. Therefore, SMTP implementations MUST take care to preserve the case of mailbox local-parts. Mailbox domains are not case sensitive. In particular, for some hosts the user smith is different from the user Smith. However, exploiting the case sensitivity of mailbox local-parts impedes interoperability and is discouraged. -- Tomasz Orzechowski [EMAIL PROTECTED] APK.net systems administration teamTO630 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server Setup Walkthrough?
Hi All, Relatively new to PHP and Apache. I've had some trouble setting up my own web server for learning on - I basically have no idea where to start in order to get them both working together. Does anyone have a link to a website (or the time to help me) that I could take a look at? I'd much appreciate it. Regs, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] eregi_replace() problems
Can anyone tell me why my emoticons arent appearing? Please? Note: $message is a variable set by a form. The field `pattern` is the string to search for, like :-), and `url` is the relative url to the emoticon. I just get the plain text, no replacement emoticon. Note: this bit is above the INSERT statement in the script. ?php $emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`); for ($t = 0; $t mysql_num_rows($emotes); $t ++) { $emotes_array = mysql_fetch_row($emotes); eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\ alt=\$emotes_array[0]\, $message); } ? - [EMAIL PROTECTED] http://www.cool-palace.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression question
Is there a regular expression that will remove 1, L, I, O, 0 and the lowercase equivilants from a varialbe? I am not horribly well versed in regular expressions...so I'm basically asking someone to help :) Say I have a string like this jeD1GLal I want to remove any of the chracters that be confusing ... Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] eregi_replace() problems
The parameters to the eregi_replace() are not passed by reference. You need to set a variable to capture the returning value. Read the manual.. http://www.php.net/manual/en/function.eregi-replace.php -Kevin - Original Message - From: Tony Harrison [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] eregi_replace() problems Can anyone tell me why my emoticons arent appearing? Please? Note: $message is a variable set by a form. The field `pattern` is the string to search for, like :-), and `url` is the relative url to the emoticon. I just get the plain text, no replacement emoticon. Note: this bit is above the INSERT statement in the script. ?php $emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`); for ($t = 0; $t mysql_num_rows($emotes); $t ++) { $emotes_array = mysql_fetch_row($emotes); eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\ alt=\$emotes_array[0]\, $message); } ? - [EMAIL PROTECTED] http://www.cool-palace.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] Ridding myself of HTML tags
I've got a lil problem with HTML tags. Here's the description. My site accepts HTML files by upload. A lot of these files are written in MS Word and then saved as HTML files from that. MS Word likes to put a bunch of garbage at the beginning of the file. Now, when users upload their HTML files, my script goes and striptags all of the unnecessary junk in there except it can't rid all this junk (HTML, XML, CSS, JavaScript) at the beginning of the HTML file. Some of these tags span multiple lines, and my script goes through line-by-line, so it won't identify these as tags. Is there a simpler fashion? I don't need the junk about style sheeting and stuff, because I have a style sheet that will take care of styling the files the way they should be. I don't want the extra tags, even though they're invisible to users when they web-view, because these are e-mailable files (for HTML mail, it's fine; for text mail, I need to strip it down and that's the problem). = Just in case, I've included the HTML code below: html xmlns:o=urn:schemas-microsoft-com:office:office xmlns:w=urn:schemas-microsoft-com:office:word xmlns=http://www.w3.org/TR/REC-html40; head meta http-equiv=Content-Type content=text/html; charset=windows-1252 meta name=ProgId content=Word.Document meta name=Generator content=Microsoft Word 10 meta name=Originator content=Microsoft Word 10 link rel=File-List href=NW100_files/filelist.xml titleTest test test/title !--[if gte mso 9]xml o:DocumentProperties o:AuthorLiam Gibbs/o:Author o:LastAuthorLiam Gibbs/o:LastAuthor o:Revision1/o:Revision o:TotalTime1/o:TotalTime o:Created2002-08-30T18:09:00Z/o:Created o:LastSaved2002-08-30T18:10:00Z/o:LastSaved o:Pages1/o:Pages o:Words13/o:Words o:Characters79/o:Characters o:CompanySXIA/o:Company o:Lines1/o:Lines o:Paragraphs1/o:Paragraphs o:CharactersWithSpaces91/o:CharactersWithSpaces o:Version10.3501/o:Version /o:DocumentProperties /xml![endif]--!--[if gte mso 9]xml w:WordDocument w:SpellingStateClean/w:SpellingState w:GrammarStateClean/w:GrammarState w:Compatibility w:BreakWrappedTables/ w:SnapToGridInCell/ w:WrapTextWithPunct/ w:UseAsianBreakRules/ /w:Compatibility w:BrowserLevelMicrosoftInternetExplorer4/w:BrowserLevel /w:WordDocument /xml![endif]-- style !-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:Times New Roman; mso-fareast-font-family:Times New Roman;} span.SpellE {mso-style-name:; mso-spl-e:yes;} page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} -- /style !--[if gte mso 10] style /* Style Definitions */ table.MsoNormalTable {mso-style-name:Table Normal; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:Times New Roman;} /style ![endif]-- /head body lang=EN-US style='tab-interval:36.0pt' div class=Section1 p class=MsoNormalTest span class=SpellEtest/span span class=SpellEtest/span/p p class=MsoNormal align=center style='text-align:center'span class=SpellEFdjfkasdjfkla/span/p p class=MsoNormal align=center style='text-align:center'span class=SpellEb style='mso-bidi-font-weight:normal'Fdjkslafjdklaf/b/span/p p class=MsoNormal style='text-align:justify'o:pnbsp;/o:p/p p class=MsoNormal style='text-align:justify'span class=SpellEFdasfdfasffasdfdaadfdfs/span/p p class=MsoNormal style='text-align:justify'span class=SpellEDfsdfs/span/p p class=MsoNormal style='text-align:justify'Hi/p p class=MsoNormal style='text-align:justify'o:pnbsp;/o:p/p p class=MsoNormal style='text-align:justify'span style='mso-tab-count:3' /spanspan class=SpellEJfdklas/span/p p class=MsoNormal style='text-align:justify'o:pnbsp;/o:p/p /div /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Server Setup Walkthrough?
Check the manual at www.php.net. There are installation instructions in it... On Sat, 31 Aug 2002, Kris wrote: Hi All, Relatively new to PHP and Apache. I've had some trouble setting up my own web server for learning on - I basically have no idea where to start in order to get them both working together. Does anyone have a link to a website (or the time to help me) that I could take a look at? I'd much appreciate it. Regs, Kris -- 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] Re: Regular expression question
$str = jeD1GLal; $str = ereg_replace([1LIO0lio], , $str); something like that... On Fri, 30 Aug 2002, Jeff Lewis wrote: Is there a regular expression that will remove 1, L, I, O, 0 and the lowercase equivilants from a varialbe? I am not horribly well versed in regular expressions...so I'm basically asking someone to help :) Say I have a string like this jeD1GLal I want to remove any of the chracters that be confusing ... Jeff -- 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] Simple one... Please look.
Greetings. Can someone please enlighten me on the best way to get information from a comma delimited file, to a variable? Example. A client updates a comma delimited list of names to a directory on a server, my script would need to read in the entire list and turn it into a variable. Once it is in a variable, I can use explode() to parse it into an array. But how would I read that document? fopen() Thanks in advance friends. -NorthBayShane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Simple one... Please look.
http://www.php.net/manual/en/function.file.php On Fri, 30 Aug 2002, Shane wrote: Greetings. Can someone please enlighten me on the best way to get information from a comma delimited file, to a variable? Example. A client updates a comma delimited list of names to a directory on a server, my script would need to read in the entire list and turn it into a variable. Once it is in a variable, I can use explode() to parse it into an array. But how would I read that document? fopen() Thanks in advance friends. -NorthBayShane -- 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] Writing Files
i write these files in a for-next loop, so at the start of each loop, i've to put an unmask command? - Original Message - From: Jason Wong [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 4:11 PM Subject: Re: [PHP] Writing Files On Friday 30 August 2002 20:53, Georgie Casey wrote: How do you write files so that theyre chmoded 777 by default. the folders theyre written to are 0777 but the files aren't. so i cant delete or modify the files through PHP, i have to first chmod them with FTP, which takes ages. umask() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* monitor resolution too high */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Useragent and file [SOLN]
Hi I found an alternative to using file to get web content. using fsockopen you can specify a useragent as per rfc-something which handles it all very very nicely. Its also nicer that what I was using to post and is looking more likely to store cookies/sessions... but ill get to that later :) thanks to anyone who thought about replying :) Maybe this discovering might help someone else also, hence my post. Later, Todd. -Original Message- From: Todd Pasley [mailto:[EMAIL PROTECTED]] Sent: Friday, 30 August 2002 6:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Useragent and file Hi Im using file() to get the contents of a webpage. e.g // get a web page into an array $fcontents= file ($targeturl); However I dont know how to mimic a different useragent. Using LWP::UA (in perl) i can pretend to be iexplore6 running on win2k or anything i want.. Is there a way i can do this in PHP? By changing the useragent will this also resolve problems with javascript?, I'd like the target server to think that I can view/run it. Thanks heaps, Todd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing Files
On Saturday 31 August 2002 02:16, Webmaster wrote: i write these files in a for-next loop, so at the start of each loop, i've to put an unmask command? If the manual is correct then the answer in no. Once per page would be enough. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Consequences, Schmonsequences, as long as I'm rich. -- Looney Tunes, Ali Baba Bunny (1957, Chuck Jones) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail/Confirmation Script delivery problems
After resolving other script problems, a new one has surfaced. The 'Guest Registration/Confirmation' script works as expected. It inserts a random id number, then fowards it to the guest's email address, and awaits confirmation (by clicking on the Confirmation URL). Postfix says that the mail has been sent: Aug 30 15:02:35 localhost postfix/qmgr[5366]: 879102004B0: from=[EMAIL PROTECTED], size=540, nrcpt=1 (queue active) Aug 30 15:02:38 localhost postfix/smtp[7684]: 879102004B0: to=[EMAIL PROTECTED], relay=webhart.net[66.46.201.121], delay=3, status=sent (250 OK) But checking the mailbox of '[EMAIL PROTECTED]' (and three others that I've sent it to) nothing shows up. Now, what's strange, it used to work perfecttly before I made minor changes to $message. I've scanned/debugged/scratched my head but I can't figure what's going wrong. The code that sent it out: ?php . . . $to = $_SESSION['smail']; // the guest's email address $subject = Please Confirm Your Registration; $message = blah, blah, blah https://localhost/all-confirm.php?unique_id={$_SESSION['unique_id']}; if(@mail($to, $subject, $message)) . ? If some kind soul can spot what I'm doing wrong here, I'd be very grateful. This is the last area before I attempt to go on-line. . . . sigh! (btw, I'm aware that the https is to 'localhost' since I've been debugging it at this end. It'll be changed once it goes live.) Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie question
How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. Thanks for your help, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Resource ID??
When trying to do this query: $rsum =mysql_query(SELECT SUM(rating) FROM ratings where threadid = $ratevar)or die (mysql_error()); This is the output: Resource id #15 or some other seemingly arbitrary Resource ID number? First of all what is a resource ID and second how do I get it to actually show what I am trying to get it to show! John
Re: [PHP] Mail/Confirmation Script delivery problems
On Saturday 31 August 2002 03:25, Andre Dubuc wrote: But checking the mailbox of '[EMAIL PROTECTED]' (and three others that I've sent it to) nothing shows up. Now, what's strange, it used to work perfecttly before I made minor changes to $message. I've scanned/debugged/scratched my head but I can't figure what's going wrong. What 'minor' changes did you make to $message? Does rolling back those changes make it work again? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Finality is death. Perfection is finality. Nothing is perfect. There are lumps in it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to have a form keep values when user hits back button?
A better, NON-CLIENT-SIDE way to do it, is you could have the page you're submitting to write the POST values to a session. So the top lines of your form handler page would be something like: ? session_start(); foreach($HTTP_POST_VARS as $key = $val) { if($val != '') { $HTTP_SESSION_VARS[$key] = $val; } } ? And on your form page, populate the VALUE fields of the form with conditional statements evaluating the session variables. Like so: INPUT TYPE=TEXT NAME=whatever VALUE= ? if(isset($HTTP_SESSION_VARS['whatever']) $HTTP_SESSION_VARS['whatever'] != '') { echo $HTTP_SESSION_VARS['whatever']; } ? SIZE=20 ...or a quick n dirty way (suppressing errors): INPUT TYPE=TEXT NAME=whatever VALUE=? echo @$HTTP_SESSION_VARS['whatever']; ? SIZE=20 For checkboxes, it's just a minor change: INPUT TYPE=CHECKBOX NAME=whatever1 ? if(isset($HTTP_SESSION_VARS['whatever1']) $HTTP_SESSION_VARS['whatever'] != '') { echo 'CHECKED'; } ? One caveat to consider: If the user returns to the form and changes checkbox values to the unchecked state, when the form is posted the variable will not be reposted with an empty value. Form checkboxes only post if they are checked, and then they evaluate to 'on' - if it is unchecked, there will be no $HTTP_POST_VARS value for that field. So in the above session writing code, before you set the session variables with the POSTed data, you should loop through all of the existing session vars, setting them to ''. Take care to exclude the variables that you are using to keep the user authenticated, or to store the other data that you will need site wide. Like this: ? session_start(); foreach($HTTP_SESSION_VARS as $key = $val) { // just an example of some session vars you might include $persistent_sitewide_session_vars = array ('loggedinstatus', 'userid', 'browser'); // well use a counter to make sure we're keeping track correctly $counter=sizeof($persistent_sitewide_session_vars); // Loop through each of your persistent // site-wide session vars foreach($persistent_sitewide_session_vars as $key_p = $val_p) { // if the current session var is one of // the session vars you need site wide, // set it to itself and exit loop if($HTTP_SESSION_VARS[$key] == $persistent_sitewide_session_vars[$key_p]) { $HTTP_SESSION_VARS[$key] = $val; break; } $counter--; } // if you know you looped through all the variables // and none of your persistent variables were found, // it's safe to reset the session var to a blank var if($counter == 0) { $HTTP_SESSION_VARS[$key] = ''; } } // NOW YOU CAN ADD YOUR CODE TO SET SESSION VARS // WITH THE POSTED FORM VARIABLES ? It's a bit bulky, but it does work like a charm. Remember to add start_session() to the top of the form page if it's not there already! Happy form hacking! Dave -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 6:12 AM To: Jean-Christian Imbeault Cc: [EMAIL PROTECTED] Subject: Re: [PHP] how to have a form keep values when user hits back button? As others have probably told you, you can't rely on the back button and don't try to disable it, it's part of the user interface. The user really needs to live with the fact that if they leave the page, they will lose the data entered. However, there is a way to retain the data as they enter it. You can use Javascript to write the data to cookies as they enter it. This means setting traps on every field, checkboxes and radio button would have an onClick, data entry fields would have an onBlur (is that write?). So as they enter the data, it is save in local cookies. You would also want to add an onLoad trap on the page to check for and read the cookies if present to populate the fields. Most people aren't used to cookies management via Javascript, so it may be a little daunting at first. But this will work. If cookies javascript are enabled that is. On Thursday, August 29, 2002, at 05:22 AM, Jean-Christian Imbeault wrote: I have php page that creates an html form. When the user hits the submit button another php script is called to parse the form and display some output. However I find that if I hit the back button the form values get reset. How can I make it so that if I hit the back button the values I entered in the form will still be displayed? Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP
Re: [PHP] Mail/Confirmation Script delivery problems
On Friday 30 August 2002 03:38 pm, you wrote: On Saturday 31 August 2002 03:25, Andre Dubuc wrote: But checking the mailbox of '[EMAIL PROTECTED]' (and three others that I've sent it to) nothing shows up. Now, what's strange, it used to work perfecttly before I made minor changes to $message. I've scanned/debugged/scratched my head but I can't figure what's going wrong. What 'minor' changes did you make to $message? Does rolling back those changes make it work again? I had just added another text sentence between blah, blah, blah' and 'https://'. And yes, I tried rollbacks to when it worked. Nope - nothing comes through. So, I dumped my Postfix setup, re-installed, and same problem. (And blush, blush : after the re-install I forgot to change the smtp server from 'localhost' to 'webhart.net' - but even after I fixed that, nothing comes through from this script.) I figure it might be my postfix config, but then again, I can mail via Kmail (ergo this email) so it's got to be the script -- but where?? Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question
On Saturday 31 August 2002 03:25, Brian Shannon Windsor wrote: Please do not be lazy and choose a proper descriptive text for your subject. Imagine the blandness and confusion and the utter uselessness if everybody used generic subjects such as Help, Quick question, This one is easy, What am I doing wrong?. Not to mention the fact that I usually (and I bet many others do as well) delete such messages straight away. How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. Without a better explanation of what you mean by go to the proper web page the best answer that can be given is: header(Location: http://www.doo.com/dah.php;) -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* That secret you've been guarding, isn't. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie question
include($thefile..html); http://www.php.net/manual/en/function.include.php header(Location: .$thefile); http://www.php.net/manual/en/function.header.php -Kevin - Original Message - From: Brian Shannon Windsor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 1:25 PM Subject: [PHP] newbie question How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. Thanks for your help, Brian -- 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] Mail/Confirmation Script delivery problems
On Saturday 31 August 2002 03:52, Andre Dubuc wrote: What 'minor' changes did you make to $message? Does rolling back those changes make it work again? I had just added another text sentence between blah, blah, blah' and 'https://'. And yes, I tried rollbacks to when it worked. Nope - nothing comes through. So we've established that it is very unlikely that your problem is caused by the 'minor' changes to $message? So, I dumped my Postfix setup, re-installed, and same problem. (And blush, blush : after the re-install I forgot to change the smtp server from 'localhost' to 'webhart.net' - but even after I fixed that, nothing comes through from this script.) I figure it might be my postfix config, but then again, I can mail via Kmail (ergo this email) so it's got to be the script -- but where?? What you can try is using error_log() to mail something -- yes RTFM if necessary. Presumably it uses the same mechanism as mail() to send mail. If that works then I think you can pretty much rule out postfix config problems and php.ini problems. Which then just leaves your code which you should post in full. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If something has not yet gone wrong then it would ultimately have been beneficial for it to go wrong. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail/Confirmation Script delivery problems
On Friday 30 August 2002 03:57 pm, you wrote: On Saturday 31 August 2002 03:52, Andre Dubuc wrote: What 'minor' changes did you make to $message? Does rolling back those changes make it work again? I had just added another text sentence between blah, blah, blah' and 'https://'. And yes, I tried rollbacks to when it worked. Nope - nothing comes through. So we've established that it is very unlikely that your problem is caused by the 'minor' changes to $message? So, I dumped my Postfix setup, re-installed, and same problem. (And blush, blush : after the re-install I forgot to change the smtp server from 'localhost' to 'webhart.net' - but even after I fixed that, nothing comes through from this script.) I figure it might be my postfix config, but then again, I can mail via Kmail (ergo this email) so it's got to be the script -- but where?? What you can try is using error_log() to mail something -- yes RTFM if necessary. Presumably it uses the same mechanism as mail() to send mail. If that works then I think you can pretty much rule out postfix config problems and php.ini problems. Which then just leaves your code which you should post in full. Hi Jason, Oh, I feel so stupid! I found the problem -- I hadn't specified the mail agent in Opera (the latest browser I was testing with). The reason why it worked before was that I had used Konqueror and Mozilla as test browsers. Sorry to waste your time. But thanks a heap for the excellent suggestions. (what made me check: the last time it worked was just before I had asked my IP to add filtermail to my last email account. He said it sounded like a browser problem with email sending. Thanks aagin (as he shuffles slowly to a corner, blushing profusely :) Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail problem
Hello, On 08/30/2002 05:26 AM, Mark Colvin wrote: My development platform is linux 7.2 and php4.0.6. The production server is also linux (I think 7.2) but the php version 4.1.1. If it is not sending a message, maybe the mail() function is not enabled because configure could not find sendmail program in the path. In that case you will need to recompile PHP with sendmail in the path of the user that runs configure. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail problem
Hello, On 08/30/2002 07:15 AM, Mark Colvin wrote: I have some more information that may be relevant to my problem. I compared the phpinfo() from both servers and there is a difference. The sendmail_from variable in the php.ini on my server is set to [EMAIL PROTECTED] The same variable on my isp's ini file is set to 'no value'. Would this stop my emails from being sent and if so can I change this value from within my script or would it have to be directly amended in the php.ini file? Maybe. You may have to define that variable in the ISP but that may not be your only problem. -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail()....
Hello, On 08/30/2002 05:44 AM, Brian McGarvie wrote: Is there a way to set the font on a plaintext email? You may try setting some styles like enclosing text for *bold* or /italic/ but changing font in plain text is not possible. Another thing you may want to do is to send a message in HTML with a plain text alternative for people that do not have a HTML capable browser. Look here for a class with an example how to do that: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie question
Just do this: Header(Location: $where_you_wanna_go\n\n); And make sure you do this before produce any HTML autput !! Hope this is helpful !! How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. Thanks for your help, Brian -- 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] Arrays misbehaving!
Can anyone explain why the following code operates the way it does in my comments? ?php $test = array ( 'a' = 'A', 'b' = 'B', 'c' = 'C'); if (array_key_exists(2, $test)) echo It works by key number!; // Does not work. if (array_key_exists('c', $test)) echo It works by key name!; // Works. print_r(array_keys($test));// outputs Array ( [0] = a [1] = b [2] = c ) ? Any ideas? According to the documentation, it seems like I should be able to access any key in the array by either name or number (which is what I want to do). -- Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using cURL
Can you telnet/SSH to the machine install CURL in your home directory? You shouldn't have to be root to do this. Or, are you trying to get CURL loaded into PHP? -- JR -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 2:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Using cURL Dear All, I'm using a shared server hosted by an ISP. I cannot get PHP recompiled with --with-curl. I've read the information about cURL but it appears that I need to be root in order to install it? I cannot do this. Does this mean that I cannot use cURL or CURL at all? If it doesn't what do I need to do so I can start using it? Henry -- 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] request what a user clicked
what is php's request object? like in ASP - Request(variable) Jeff UWG Student [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrade from 4.0.6 to 4.1.1
To upgrade from 4.0.6 to 4.1.1, do I have to fix any code? I think session code has to change but is there anything else? Thanks K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays misbehaving!
On Fri, 30 Aug 2002, Cameron Thorne wrote: Can anyone explain why the following code operates the way it does in my comments? Sure. ?php $test = array ( 'a' = 'A', 'b' = 'B', 'c' = 'C'); An associative array, $test. if (array_key_exists(2, $test)) echo It works by key number!; // Does not work. ... for subjective definitions of work. It works alright. Nothing prints because there isn't an array key '2' in $test. if (array_key_exists('c', $test)) echo It works by key name!; // Works. Of course. print_r(array_keys($test));// outputs Array ( [0] = a [1] = b [2] = c ) You've done two things with this statement. (1) Got all the keys from $test, then (2) printed out the keys in human readable format. print_r() is printing information about the array which was returned from the call to array_keys(). Examine the output from print_r($test) and check the documentation for print_r() array_keys() to get a glimpse into what might be the source of what's got you a bit confused. ? Any ideas? According to the documentation, it seems like I should be able to access any key in the array by either name or number (which is what I want to do). You can access array indicies by number for non-associative arrays: $test = array( A, B, C, D ); OR associative arrays that use numbers for keys: $test = array( 0 = A, 1 = B, 3 = C, 4 = D ); echo( $test[2] ); ... will work for either of those, but the indicies of your original $test: $test = array ( 'a' = 'A', 'b' = 'B', 'c' = 'C'); have to accessed with the appropriate key. hth, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays misbehaving!
That does help, yes. So basically there is no way to access associative arrays using numerical indices? I was hoping I could access by either name OR number, but apparently not. Thanks! -- Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Upgrade from 4.0.6 to 4.1.1
Hi, Note that its now 4.2.2 and all globals variables have changed. You must activate register global into your php.ini if you dont want to modify your scripts. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet K Soares [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] To upgrade from 4.0.6 to 4.1.1, do I have to fix any code? I think session code has to change but is there anything else? Thanks K. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session encode and session decode question
I'm trying to get the one variable I stored insite a session, the variable's name is $username I am trying to do it like this, but I think it's wrong: $PHPSESSID = session_encode(); $username = session_decode(); It tells me I have wrong parameters for session decode. What am I supposed to encode to get the variable from the session? - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resource ID??
John, This is the output: Resource id #15 or some other seemingly arbitrary Resource ID number? First of all what is a resource ID and second how do I get it to actually show what I am trying to get it to show! =When MySQL returns data to PHP, the information is put into a variable called a resource special data type. When you attempt to treat this as if it were a string data type, all that it 'reveals' is the ResouceID (as you have found). =Please return to the manual, re-read the MySQL_query entry, and then move on to the MySQL_fetch_... series of functions. These are designed to extract (most usually) a row of data at a time from the ResourceID/MySQL resultset and make it available to your PHP script - examples given in the annotated manual. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php