Re: [PHP] security
Has been around for quite a while and pretty much all the points are address right in the PHP documentation at http://php.net/security which is a much more informed source to study. The guy who wrote that scarlet report only had a very thin grasp of the concepts. -Rasmus On Fri, 26 Oct 2001, Joseph Blythe wrote: just stummbled across this great study by Shaun Clowes on php security, this is just the kind of information I have been looking for, thought others could also benefit from it. http://www.securereality.com.au/studyinscarlet.txt found during google search: PHP Security cheers, joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] tail a file
if you're using unix, there's the tail command: ?php $results = `tail -n 100 logfile.log`; echo pre$results/pre\n; ? -Original Message- From: Yamin Prabudy [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 4:08 PM To: [EMAIL PROTECTED] Subject: [PHP] tail a file Hi there I need help here I got a file say it's a logs file and keep update ever changes I need to tail this files and pharse it into web, so I can see this the update without login into server (jst thru web browser ) how can i do this Thanks for Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] security
ok thanks, think I fall in that category too, but doing my best to change it :) -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Friday, 26 October 2001 4:05 PM To: Joseph Blythe Cc: [EMAIL PROTECTED] Subject: Re: [PHP] security Has been around for quite a while and pretty much all the points are address right in the PHP documentation at http://php.net/security which is a much more informed source to study. The guy who wrote that scarlet report only had a very thin grasp of the concepts. -Rasmus On Fri, 26 Oct 2001, Joseph Blythe wrote: just stummbled across this great study by Shaun Clowes on php security, this is just the kind of information I have been looking for, thought others could also benefit from it. http://www.securereality.com.au/studyinscarlet.txt found during google search: PHP Security cheers, joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problem with a while loop
I am trying to get the data out of the while loop if I echo $email inside the } it gives me all of the data but if I echo it out side of the loop it only gives me one record even though I know there is more. How can I get this to work $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $email= $row[lname] . . lt; . $row[E_mail_1] . gt; . ;; } echo $email; -- Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] fsockopen and https
Hello All, I am new to this list and am sure most of you are tired of this subject appearing. Please forgive me as I am becoming tired of searching archives and the internet and I am hoping someone here can help me. I am using fsockopen to post data to a dll on a SSL server. I setup the socket data and successfully posted the data to port 80 but as soon as I switch to port 443 I received no errors or text. Yes I am trying to interface with an authorize.net compatible gateway and I know most of you will tell me the only way to do this is with cURL but I am finding that hard to believe. I recently had someone tell me PHP scripts over an HTTPS connection would not parse; this person said the code of the script would appear. I told him this was interesting as I have PHP scripts running under HTTPS connections without cURL. Anyway, back to the point; I am trying to talk with an IIS server and need to figure out what needs to be done to make this return the results properly. Am I missing something in my headers? All I am doing is connecting to the server and making a POST /gateway/transact.dll?var1=xyzvar2=abc etc. Here's the code used: $sgate = fsockopen($URL,80,$errno,$errstr,30); if(!$sgate) { die($errstr ($errno)br\n); } else { fputs($sgate, /gateway/transact.dll?$postSTR HTTP/1.0\n\n); while(!feof($sgate)) { $result.=fgets($sgate,1024); } } fclose($sgate); This portion works perfect until I change the port to 443; Please if it is possible to do this without cURL I would appreciate the help. Thanks, -John- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What is the best way to do this...
Let s say i have 5 pages on my site. I want some content to appear on each page so that when i want to change that content on all the pages i have only one place to modify. I used to write that content in a .txt file and having it read each time any of the 5 pages was loaded. So i had to modify the code only in the .txt file. It was working good but the code in the .txt file could not be PHP because it would not be processed when loaded by the other pages. There s probably a better way of doing it. Like a page can probably include another page that itself include another one. Any help would be great Thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL4
Hello, Just curious, before I get into the heat, but did anyone who already has installed MySQL 4 had any problems compiling PHP? Thanks in advance, Leon Mergen
Re: [PHP] What is the best way to do this...
On Fri, 26 Oct 2001 16:48, DeloX wrote: Let s say i have 5 pages on my site. I want some content to appear on each page so that when i want to change that content on all the pages i have only one place to modify. I used to write that content in a .txt file and having it read each time any of the 5 pages was loaded. So i had to modify the code only in the .txt file. It was working good but the code in the .txt file could not be PHP because it would not be processed when loaded by the other pages. There s probably a better way of doing it. Like a page can probably include another page that itself include another one. Any help would be great Thx You'll find in the docs about include/require that when a file is included, the parser drops back to 'text' mode; if you want the contents of an included file parsed you need to put ? ? tags in the file. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Funny off-topic messages are always on-topic. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What is the best way to do this...
Original message From: DeloX [EMAIL PROTECTED] Date: Fri, Oct 26, 2001 at 03:18:33AM -0400 Message-ID: [EMAIL PROTECTED] Subject: [PHP] What is the best way to do this... Let s say i have 5 pages on my site. I want some content to appear on each page so that when i want to change that content on all the pages i have only one place to modify. I used to write that content in a .txt file and having it read each time any of the 5 pages was loaded. So i had to modify the code only in the .txt file. It was working good but the code in the .txt file could not be PHP because it would not be processed when loaded by the other pages. There s probably a better way of doing it. Like a page can probably include another page that itself include another one. Any help would be great Thx /Original message Reply You can use a FRAMESET, depending on the layout of your page. Or you can use some templating stuff (check the archives, these have been discussed several times). But you can also take a look in reversing what you're doing. I mean; instead of trying to get the changing part out, you can also get the 'static' part out of you page. Then you can use that by calling require[_once] (header.php) or something like that. Or you could use the auto_prepend and auto_append. /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP, SWF and XML
I needto use php to open *.swf, and then send some xml code to it. anyone knows if this is possible, and if so, how to send code (via POST) to the *.swf after opening it? thnx Michiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] What is the best way to do this...
Personally I would look at a templating system, there are lots of them around. I have only used FastTemplates and Smarty I would reccommend the later. http://www.phpinsider.com/php/code/Smarty/ or have a look at for a few more: http://phpclasses.upperdesign.com/browse.html/class/1 Hope this helps, Joseph -Original Message- From: DeloX [mailto:[EMAIL PROTECTED]] Sent: Friday, 26 October 2001 4:49 PM To: [EMAIL PROTECTED] Subject: [PHP] What is the best way to do this... Let s say i have 5 pages on my site. I want some content to appear on each page so that when i want to change that content on all the pages i have only one place to modify. I used to write that content in a .txt file and having it read each time any of the 5 pages was loaded. So i had to modify the code only in the .txt file. It was working good but the code in the .txt file could not be PHP because it would not be processed when loaded by the other pages. There s probably a better way of doing it. Like a page can probably include another page that itself include another one. Any help would be great Thx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] problem with a while loop
What happens there is this: $email = 1. row; $email = 2. row; $email = 3. row; echo $email; You really need to put echo $email inside the loop or use '.=' to set up values to $email. Niklas -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED]] Sent: 26. lokakuuta 2001 10:11 To: php Subject: [PHP] problem with a while loop I am trying to get the data out of the while loop if I echo $email inside the } it gives me all of the data but if I echo it out side of the loop it only gives me one record even though I know there is more. How can I get this to work $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $email= $row[lname] . . lt; . $row[E_mail_1] . gt; . ;; } echo $email; -- Best regards, Richard mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem with a while loop
On Fri, 26 Oct 2001 16:40, Richard Kurth wrote: I am trying to get the data out of the while loop if I echo $email inside the } it gives me all of the data but if I echo it out side of the loop it only gives me one record even though I know there is more. How can I get this to work $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $email= $row[lname] . . lt; . $row[E_mail_1] . gt; . ;; } echo $email; You would probably want to append the values to $email in your loop, then. As it is, you are overwriting the value in $email each pass through the loop. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I'm fascinated by the way memory diffuses fact. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem with a while loop
Or you can do something like: $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result = mysql_db_query($dbName, $query); $numRows = mysql_num_rows($result); for ($i=0; $i$numRows; $i++) { $row = mysql_fetch_array($result); $email[] = $row[email]; } OR while ($row = mysql_fetch_array($result)) { $email[] = $row[email]; } This just puts all your emails into an array. You can do whatever you want within either loop and it'll do it to every element. It's pretty limitless, or like I did you can stick everything you want into an array to use later.. whatever your fancy :) The reason you only get one email when you echo it outside the loop is that mysql_fetch_array only grabs one row, so you loop through and if you echo inside the loop you'll see every row outputted, while outside the loop you'll only get the last row outputted. (not sure if outputted is a word :) Anyways so now that you understand it a little more, you can do whatever you want to each element in the row inside the loop... I hope that helps! Rick your while loop is working fine -- it's just that you're re-setting the value of $email every time it loops through. I'm not sure what you're trying to accomplish, but you might try something like: $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $email[$row['lname']] = $row[E_mail_1] } //untested code -- probably missing some quotes somewhere. that will give you an array with lname as the key and e_mail_1 as your value. You can then loop through it and format it however you want. hth --kurt On Friday 26 October 2001 00:10, Richard Kurth wrote: I am trying to get the data out of the while loop if I echo $email inside the } it gives me all of the data but if I echo it out side of the loop it only gives me one record even though I know there is more. How can I get this to work $query = SELECT * FROM members Where Company LIKE '%$search1%'; $result=mysql_db_query($dbName,$query); while ($row = mysql_fetch_array($result)) { $email= $row[lname] . . lt; . $row[E_mail_1] . gt; . ;; } echo $email; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP File not found
The only pages that are getting this error are the ones that php is mapped to parse (i.e. .html .php .phtml) if I go to a page that doesn't exist with a .htm or .cgi extension etc it works fine and I get the standard IIS 404 error page. But when it is a page that php processes thats when the CGI error returns. What are the [PHP-Win] mavens? THanks. Dl Neil [EMAIL PROTECTED] wrote in message 048001c15dab$d5c0fcf0$a516100a@jrbrown">news:048001c15dab$d5c0fcf0$a516100a@jrbrown... I have just set up PHP on my webserver (IIS 4 on NT4). I have set up the script mapping so that I can save php files as .html and php processes them. This works fine until someone goes to a page that doesn't exist - instead of getting the customised error 404 page (i.e. the page you requested cannot be found), php prints: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: And thats all I get. Does anyone know how to customise this page or set up a new one? Chris, That's an IIS function (not PHP). It's a pane accessible from the MMC. Perhaps the [PHP-Win] mavens could help? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Arrays
I'd like to create an array of available resources, and be able to check it every time. What I'd like to do is something like; $site = array( section1 = #, section2 = #, etc.. ) where section* is a STRING variable and # is an INT (if it's even possible to do that) Once I have this setup properly, I'm going to have a routine that extracts data from PATH_INFO, namely '$section' and '$page' which should then be checked against the array: - if $section exists in the array - if $page is less or equal to the INT value in that $section do something with $page (or just break out of the routine) - else default to 1 (and break out) - else default to something like main, or whatever, and set $page to 1 These values will then be used in a template to read in the proper files through ? include $section$page.inc; ? I don't know whether I can create an array of STR = INT values, and I don't know where to start with the function needed to traverse that array once I have information from PATH_INFO (of course, this is depending on PATH_INFO even passing along valid information) -- H | Life is the art of drawing without an eraser. - John Gardner + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 Director of Internet Operations / SysAdmin. 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Does unset() help performance?
On Friday 26 October 2001 03:42, Julio Nobrega wrote: If I unset variables/arrays/etc, that I will not use on my script anymore, should I expect a performance increase? No. unless these variables use up so much memory that the system starts swapping. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Error 032: Recursion error - see error 032 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] variable gets lost in function problem again...
Sorry all but I really need to figure this out. Here's a recap of my problem: I have an two dimensional array that is returned from code from an included file. I'm assigning parts of the array to variables ( $variable = $array[key][value]; ). This works fine and can be printed until I send it through a function eg. ( ereg_replace( , _, $variable); ). After this, $variable is blank. I don't think it's my code because substituting a text string for the array data (eg. $variable = this is some text;) works just fine. It has something to do with the assigning array data to a variable or perhaps that the data comes from an included file... This could be a bug in PHP? Does this sound familiar to anybody? I can't figure it out! Any help would be much appreciated. Thanks, Spunk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] splitting up search results, need som ideas. have done 1 2 3 4 5 6 7 8 9 10 11 12 stuff ..
hi everybody! have done a function that splits up the search results into multiple pages and are displayed using a scroll bar like this: 1 2 3 4 5 6 7 8 9 10 11 12 what i need (when the database grows) is a function that limits the scrollbar to only show like 10 pages at a time. i can't have a scrollbar that looks like 1 2 3 4 5 6 7 8 9 10 -- 1000 i hope you understand what i mean here. otherwise i will try to explain it to you now. imagine that the search returns 30 pages. when i'm looking at page 1-5 i see a scrollbar that looks like 1 2 3 4 5 6 7 8 9 10 . the higher page number i reach the scrollbar should change and show me like 8 9 10 11 12 13 14 15 16 17 18 19 20 21 . are you with me now? :) all ideas are very welcomed ! if you want to see the code for the scrollbar so far, just send me an email and i will send it to you. i hope anyone have a simple solution for this ! best regards, nicke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] GD Copying Images
I have 2 images, and I want to copy/reescale a block from image A to image B, when I do it (imagecopyresized) I get a gray square on image B, I think that the problem is palette colors, how can I copy palette from image A to image B? Thnx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Error management
How can I know the line and the file from where a function has called. I already know __FILE__ and __LINE__, but I don't want to transmit them in arguments. Exemple : --- toto.php --- 1 : include(test.inc) 2 : 3 : test(bidule); 4 : --- test.inc --- 1 : function test($text) 2 : { 3 : print $textBR; 4 : print __FILE__. - .__LINE__; 5 : } Output bidule test.inc - 4 What I want to print is : WANTED bidule toto.php - 3 How can I do this ? Thanks for your answers. _ Téléchargez MSN Explorer gratuitement à l'adresse http://explorer.msn.fr/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP File not found
The only pages that are getting this error are the ones that php is mapped to parse (i.e. .html .php .phtml) if I go to a page that doesn't exist with a .htm or .cgi extension etc it works fine and I get the standard IIS 404 error page. But when it is a page that php processes thats when the CGI error returns. =I'm working from (vague) memory and a good six months back when it was my first (and only) time to work with the IIS/PHP combination. Once I fired up Apache and figured out a few of its quirks, I saw little reason to run the heavier product - even on a WinNT/2000 machine. I can't even remember the IIS terminology... I seem to recall that there is a tab/frame somewhere within the MMC for setting up scripting languages/server side processing. In the flurry of detail there, does it set up a separate exception processing (eg Error 404/500 pages) handler for each script processor? That being the case, there would be no standard: 404 error page, but a series of error pages for each - and such a structure may indicate why you find a different behavior for HTML as PHP =... but I hear ominous creaks from the thin ice beneath me... What are the [PHP-Win] mavens? =We are conversing on the [PHP] discussion list. There is a companion list dedicated to the use of PHP under Windows called [PHP-Win]. =(from Cambridge International Dictionary of English) maven noun [C] AMERICAN INFORMAL a person with good knowledge or understanding of a subject He's a baseball maven who knows Hank Aaron's home run statistics by heart. (apologies for sullying your tender ears with such an Americanism) =As I say, I'm sure a 'practising Windows professional' would be able to assist you (more) competently, and I think that is where you'lll find (at least) one. =Regards, =dn THanks. Dl Neil [EMAIL PROTECTED] wrote in message 048001c15dab$d5c0fcf0$a516100a@jrbrown">news:048001c15dab$d5c0fcf0$a516100a@jrbrown... I have just set up PHP on my webserver (IIS 4 on NT4). I have set up the script mapping so that I can save php files as .html and php processes them. This works fine until someone goes to a page that doesn't exist - instead of getting the customised error 404 page (i.e. the page you requested cannot be found), php prints: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: And thats all I get. Does anyone know how to customise this page or set up a new one? Chris, That's an IIS function (not PHP). It's a pane accessible from the MMC. Perhaps the [PHP-Win] mavens could help? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Error management
How can I know the line and the file from where a function has called. I already know __FILE__ and __LINE__, but I don't want to transmit them in arguments. Exemple : --- toto.php --- 1 : include(test.inc) 2 : 3 : test(bidule); 4 : --- test.inc --- 1 : function test($text) 2 : { 3 : print $textBR; 4 : print __FILE__. - .__LINE__; 5 : } Output bidule test.inc - 4 What I want to print is : WANTED bidule toto.php - 3 How can I do this ? Thanks for your answers. _ Téléchargez MSN Explorer gratuitement à l'adresse http://explorer.msn.fr/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] variable gets lost in function problem again...
I have an two dimensional array that is returned from code from an included file. I'm assigning parts of the array to variables ( $variable = $array[key][value]; ). This works fine and can be printed until I send it through a function eg. ( ereg_replace( , _, $variable); ). After this, $variable is blank. I don't think it's my code because substituting a text string for the array data (eg. $variable = this is some text;) works just fine. It has something to do with the assigning array data to a variable or perhaps that the data comes from an included file... This could be a bug in PHP? Spunk Could you post some excerpted code please? You seem to have multiple issues: 1 communication between a 'mainline' and INCLUDEd code 2 communication between a 'mainline' and a function 3 working with scalars and arrays 4 working with text strings and ?text arrays - which may or may not be related/relevant Let's start with simple ideas: 0 put debug echo statements into the function (or everywhere) to track progress 1 if you take the processing code out of the INCLUDE file and put it in the 'mainline', does it then work as planned? 2 do you have an to indicate a pass by reference cf a pass by value (see manual)? 3 and 4 does the processing use tools/approach/functions that only work with scalars/arrays/strings? A process of elimination... Keep us posted, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GD Copying Images
On Friday 26 October 2001 05:03 am, you wrote: I have 2 images, and I want to copy/reescale a block from image A to image B, when I do it (imagecopyresized) I get a gray square on image B, I think that the problem is palette colors, how can I copy palette from image A to image B? Thnx GD sucks when it comes to image resizing. You can add some code to it prior to compiling to make it better or write a complex php function for it. Or, if you can install ImageMagick on your box and resize your imag through a exec() call. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GD Copying Images
Where can I get that code for PHP 4.0.6? I added to ./ext/gd/gd.c /* {{{ proto int imagecopyresizedbicubic(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) Copy and resize part of an image */ PHP_FUNCTION(imagecopyresizedbicubic) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; gdImagePtr im_dst, im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; int i, j; int r, g, b, c1,c2,c3,c4,color; float sX, sY; float scaleX,scaleY,scaleX2,scaleY2; GDLS_FETCH(); if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, DIM, SIM, DX, DY, SX, SY, DW, DH, SW, SH) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, Image, le_gd); ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, Image, le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); convert_to_long_ex(DW); convert_to_long_ex(DH); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); dstH = Z_LVAL_PP(DH); dstW = Z_LVAL_PP(DW); // kopiera paletten for( i=0; i256; i++ ) { gdImageColorAllocate( im_dst, im_src-red[i], im_src-green[i], im_src-blue[i] ); }; // gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); scaleX = (float)(srcW-1) / (float)dstW; scaleY = (float)(srcH-1) / (float)dstH; scaleX2 = scaleX/2.0f; scaleY2 = scaleY/2.0f; for( j=0; jdstH; j++ ) { for( i=0; idstW; i++ ) { sX = (float)i * scaleX; sY = (float)j * scaleY; c1 = gdImageGetPixel(im_src, (int)(sX), (int)(sY+scaleY2) ); c2 = gdImageGetPixel(im_src, (int)(sX), (int)(sY) ); c3 = gdImageGetPixel(im_src, (int)(sX+scaleX2), (int)(sY+scaleY2) ); c4 = gdImageGetPixel(im_src, (int)(sX+scaleX2), (int)(sY) ); r = (im_src-red[c1] + im_src-red[c2] + im_src-red[c3] + im_src-red[c4]) / 4; g = (im_src-green[c1] + im_src-green[c2] + im_src-green[c3] + im_src-green[c4]) / 4; b = (im_src-blue[c1] + im_src-blue[c2] + im_src-blue[c3] + im_src-blue[c4]) / 4; color=gdImageColorClosest(im_dst,r,g,b); gdImageSetPixel( im_dst, (i+dstX),(j+dstY), color ); }; }; RETURN_TRUE; } Then make; make install; and apachectl restart and I get non-defined function when I call ImageCopyRisedBicubic, any ideas? I prefer not to call a exec() to resize those images, if I can do it from GD directly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Arrays
On Fri, 26 Oct 2001 18:17, Ashley M. Kirchner wrote: I'd like to create an array of available resources, and be able to check it every time. What I'd like to do is something like; $site = array( section1 = #, section2 = #, etc.. ) where section* is a STRING variable and # is an INT (if it's even possible to do that) ?php // Suck 'em in $site = array ( section1 = 007, section2 = 11, section3 = 57.5, section4 = 12, section5 = 0.007, section6 = 15, section7 = 1007, section8 = 11007, section9 = 111007, section10 = 1 ); // Spit 'em out while ( list ( $key, $val ) = each ( $site ) ) { echo $key = $valbr; } ? Cheers, BAD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Debugging aids (after the style of: Error management)
Don't you like the side-benefits of this list, eg that someone comes up with a question that gets your thought processes running or suggests an idea you'd not otherwise come up with!? So further to the question: How can I know the line and the file from where a function has called. I already know __FILE__ and __LINE__, but I don't want to transmit them in arguments. is there a debugging facility in PHP which displays a 'map' of which functions have called which? So for example, a script crashes at line_56 in file_fred.php, which is what we've all come to know and love; but I'd like to know that it got there by the mainline calling FnOpen(), which called FnInitialise(), which in turn called FnUncleTomCobbleighAndAll(), where some incompetent happily three layers down tried to share out the spoils by dividing by zero (or whatever)... Looking in the manual I started with: Chapter 8. Constants Predefined constants A constant is a identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (the magic constants __FILE__ and __LINE__ are the only exception). A constant is case-sensitive by default. By convention constants are always uppercase. but if these two are the only magic constants then I'm out of luck there. So I meandered through the PHPINFO and environment variables, but nothing stood up and popped me in the eye. Anyone know better/have a bright idea? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] web automatization problem
Hi, This solution works in most browsers: table width=(image width) align=(left,right) trtd img (your image) /td/tr trtd (your text) /td/tr /table Regards, Sumarlidi Einar Dadason SED - Graphic Design -- Tel.4615501 GSM 8960376 E-mail [EMAIL PROTECTED] Website:www.sed.is -- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 26. október 2001 09:58 To: [EMAIL PROTECTED] Subject: [PHP] web automatization problem Hi ! I'm making a web site whitch should enable the user to add the news to the site. I'm doing this with the database, but I'm trrying to let them add the pictures with the text. I'd like to let hte user choose the position of the image, as well as the image position(left - center - right)... Is there a way to wrap text around the image ? Are there any suggestions on this topic ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: function names
Hello Mike, Thursday, October 25, 2001, 10:09:18 PM, you wrote: MF Actually your problem is with the function itself. In order for it to work MF you need to use the this keyword: MF class A { MF var $xxx; MF function print() { MF echo $this-xxx; MF } MF } MF You may also run into problems with calling the function print(), I don't MF know for sure. But the problem is that you were telling PHP to print a MF variable that was, technically, not even initialized. MF Mike Frazer Yes, of course there was echo $this-xxx, but it doesn't matter, seek deeper... Error occured on line where function print() is declared. MF Olexandr Vynnychenko [EMAIL PROTECTED] wrote in message MF [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello php-general, I have such code: class A { var $xxx; function print() { echo $xxx; } } And that's what I get: Parse error: parse error, expecting `T_STRING' in xxx.php on line nn Php doesn't let any function or class member have a name which is already used by another function (or only function from library), am I right? Or maybe print has special status. Maybe that's because print() is actually not a function? Can anyone tell me something about that, please? -- Best regards, Olexandr Vynnychenko mailto:[EMAIL PROTECTED] -- Best regards, Olexandrmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Write html to file
run the function stripslashes() on it this will get rid of the \ in front of the single and double quotes. I do not know how to help you with the non breaking space problem though. I have no clue why it would replace that... very strange.. Rick Hi I have a problem with writing html code to a file.Every time i write html to a file PHP replace every character into a \ character.Further more every nbsp; character will replace into a empty character. So what should i do to stop replacing this character ? Thank you very much! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] function names
Hello Steve, Thursday, October 25, 2001, 10:30:16 PM, you wrote: SC On Thursday, October 25, 2001, at 02:08 PM, Martín Marqués wrote: On Jue 25 Oct 2001 15:36, you wrote: Hello php-general, I have such code: class A { var $xxx; function print() { echo $xxx; $xxx is internal to the print function. Instead you need $this-xxx which will give you the value of the $xxx of the A class. } } And that's what I get: Parse error: parse error, expecting `T_STRING' in xxx.php on line nn Php doesn't let any function or class member have a name which is already used by another function (or only function from library), am I right? Or maybe print has special status. Maybe that's because print() is actually not a function? Can anyone tell me something about that, please? Th print function of PHP has nothing to do with this, just because print is internal to the A class, and has nothing with the PHPs internal print function. SC Hmm. I think you're wrong here. I made this test script: SC ?php SC class test { SC var $a; SC function test() { SC $this-a = hello; SC } SC function print() { // this is line 10 SC echo $this-a; SC } SC } SC $obj = new test; $obj-print(); ? SC Which gives this: SC Parse error: parse error, expecting `T_STRING' in SC /home/httpd/html/ucdamage/test.php on line 10 SC If I change the name of the print() method it works okay. SC -Steve I told you! :) I'm sure I was right when I said that was because print() is not actually a function, it's a language constructuin... -- Best regards, Olexandrmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Write html to file
There is option in PHP (php.ini file) magic_quotes_runtime set it Off.It shuold help You. Restart apache after. Krzysztof [EMAIL PROTECTED] wrote: Hi I have a problem with writing html code to a file.Every time i write html to a file PHP replace every character into a \ character.Further more every nbsp; character will replace into a empty character. So what should i do to stop replacing this character ? Thank you very much! Chris -- Oszczedzaj papier. Nie przestawaj notowac. Z zewnatrz poczta, w srodku takze notatnik. Twoja nowa poczta http://poczta.interia.pl/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: MySQL4
[EMAIL PROTECTED] (Leon Mergen) wrote: Hello, Just curious, before I get into the heat, but did anyone who already has installed MySQL 4 had any problems compiling PHP? read somewhere that as long as you use the built in mysql lib and not mysql4 it should work. -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Uploading and linking to images from a admin panel!
Hi Folks I can write to txt files, no problem! What is the easiest way to get my end user to upload images, is there a method to generate an online form that can handle the input of txt and images so that the images will get uploaded and then automatically linked to a template??? Hope someone can help Regards Chris [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] store file using socket/fopen
Hello list, Simple Enough Objective: store file remotely (wu-ftp); MinorSnag: PHP's ftp-functions unavailable at localhost; BelowWorkaround: works fine for deleting remote file; MajorSnag: how to STORE a file remotely using socket? ?php $ftp=fsockopen(ftp.server.com, 21, $errno, $errstr, 60); if (!$ftp) { echo Connection failed: $errstr ($errno); exit; } else { socket_set_blocking($ftp, true); echo fgets($ftp,255); fputs($ftp,USER ftp_username\r\n); echo fgets($ftp,255); fputs($ftp,PASS ftp_passw\r\n); echo fgets($ftp,255); fputs($ftp,DELE /home/httpd/html/test.htm\r\n); echo fgets($ftp,255); fputs($ftp,QUIT\r\n); echo fgets($ftp,255); fclose($ftp); } ? BTW: I also messed with fopen(ftp://user:pass@...;) but failed miserably (although it seemed possible before my mind wandered off). ANY HELP IS APPRECIATED (using socket, fopen, ...) -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Store file remotely using socket/fopen
Hello list, Simple Enough Objective: store file remotely (wu-ftp); MinorSnag: PHP's ftp-functions unavailable at localhost; BelowWorkaround: works fine for deleting remote file; MajorSnag: how to STORE a file remotely using socket? ?php $ftp=fsockopen(ftp.server.com, 21, $errno, $errstr, 60); if (!$ftp) { echo Connection failed: $errstr ($errno); exit; } else { socket_set_blocking($ftp, true); echo fgets($ftp,255); fputs($ftp,USER ftp_username\r\n); echo fgets($ftp,255); fputs($ftp,PASS ftp_passw\r\n); echo fgets($ftp,255); fputs($ftp,DELE /home/httpd/html/test.htm\r\n); echo fgets($ftp,255); fputs($ftp,QUIT\r\n); echo fgets($ftp,255); fclose($ftp); } ? BTW: I also messed with fopen(ftp://user:pass@...;) but failed miserably (although it seemed possible before my mind wandered off). ANY HELP IS APPRECIATED (using socket, fopen, ...) -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] String breaking up
I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Breaking a string
I was looking to take a string like Dan or Dan is great and return it like D a n or D a n i s g r e a t is it the str function that does that and if so does someone have an example? thanks = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String breaking up
Strings are arrays, so you can print out a string by doing something like this: $string = hey there!; for ($i=0; $icount($string); $i++) { echo strtoupper($string[$i]); } That's about all there is to it! :) Use the strtoupper() function if you mean to have everything uppercase like in your example. Rick I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String breaking up
To be more precise add the br at the end of the line between the for loop: Strings are arrays, so you can print out a string by doing something like this: $string = hey there!; for ($i=0; $icount($string); $i++) { echo strtoupper($string[$i]).'br'; } That's about all there is to it! :) Use the strtoupper() function if you mean to have everything uppercase like in your example. Rick I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] String breaking up
Strings are arrays, so you can print out a string by doing something like this: Yups, this is possible, but i think he wants to have a newline for each character, you can doe this excelent with a small addition to your example: $string = hey there!; for ($i=0; $icount($string); $i++) { echo strtoupper($string[$i]); } becomes: $string = hey there!; for ($i=0; $icount($string); $i++) { echo $string[$i]\n; // or br if you want to use HTML } Kees -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String breaking up
$string = hey there!; $out = ''; for ($i=0; $icount($string); $i++) { $out .= strtoupper($string[$i]) . \n; // or br if output is to browser } echo $out; Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Strings are arrays, so you can print out a string by doing something like this: $string = hey there!; for ($i=0; $icount($string); $i++) { echo strtoupper($string[$i]); } That's about all there is to it! :) Use the strtoupper() function if you mean to have everything uppercase like in your example. Rick I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: tail a file
to tail a file use the + flag when opening that log file, and write a simple PHP script that spits that file to you, ie: showlog.php ? readfile('logfile.txt'); ? Yamin Prabudy [EMAIL PROTECTED] wrote in message 003901c15de4$82f0cb70$fe2796ca@dusak">news:003901c15de4$82f0cb70$fe2796ca@dusak... Hi there I need help here I got a file say it's a logs file and keep update ever changes I need to tail this files and pharse it into web, so I can see this the update without login into server (jst thru web browser ) how can i do this Thanks for Help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP-ASP
In article 023601c15de3$c05d8bc0$[EMAIL PROTECTED], [EMAIL PROTECTED] says... Is the PHP code you provided below working, I need something like than and i wonder if i could use it. NOBBY Actually, right now I'm using some code stripped from the PHP-Nuke Weather add-on. But it gets its weather from msnbc and I'd rather get it from the feds cause they won't change their output. You must know the 4 letter ACCID value, you can get it from NOAA. I use KAUS for Austin, TX like this: http://myhost.com/weather.php?Default_accid=KAUS ? /* Code derived from the PHP-Nuke Weather Add-On */ $fontface = Arial; $fontcolor1 = #00; $fontsize1 = 2; $filehandle = fsockopen(www.msnbc.com, 80, $num_error, $str_error, 30); if(!$filehandle) { print Weather is is not available: $str_error ($num_error)\n; } else { fputs($filehandle,GET http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid= $Default_accid HTTP/1.0\n\n); // initialize variables $v_City= ; $v_SubDiv = ; $v_Country = ; $v_Region = ; $v_Temp= ; $v_CIcon = ; $v_WindS = ; $v_WindD = ; $v_Baro= ; $v_Humid = ; $v_Real= ; $v_UV = ; $v_Vis = ; $v_LastUp = ; $v_Fore= ; $v_Acid= ; while (!feof($filehandle)) { $grabline = fgets($filehandle, 4096); $grabline= trim($grabline) . \n; if (substr($grabline,7,4) == City) { $v_City= substr($grabline,15,20); } if (substr($grabline,7,6) == SubDiv) { $v_SubDiv = substr($grabline,17,20); } if (substr($grabline,7,7) == Country) { $v_Country = substr($grabline,18,20); } if (substr($grabline,7,6) == Region) { $v_Region = substr($grabline,17,20); } if (substr($grabline,7,4) == Temp) { $v_Temp= substr($grabline,15,20); } if (substr($grabline,7,5) == CIcon) { $v_CIcon = substr($grabline,16,20); } if (substr($grabline,7,5) == WindS) { $v_WindS = substr($grabline,16,20); } if (substr($grabline,7,5) == WindD) { $v_WindD = substr($grabline,16,20); } if (substr($grabline,7,4) == Baro) { $v_Baro= substr($grabline,15,20); } if (substr($grabline,7,5) == Humid) { $v_Humid = substr($grabline,16,20); } if (substr($grabline,7,4) == Real) { $v_Real= substr($grabline,15,20); } if (substr($grabline,7,2) == UV) { $v_UV= substr($grabline,13,20); } if (substr($grabline,7,3) == Vis) { $v_Vis = substr($grabline,14,20); } if (substr($grabline,7,5) == LastUp) { $v_LastUp = substr($grabline,16,20); } if (substr($grabline,7,4) == Fore) { $v_Fore= substr($grabline,15,200); } if (substr($grabline,7,4) == Acid) { $v_Acid= substr($grabline,15,20); } } $v_City= substr($v_City,0,strlen($v_City)-3); $v_SubDiv = substr($v_SubDiv,0,strlen($v_SubDiv)-3); $v_Country = substr($v_Country,0,strlen($v_Country)-3); $v_Region = substr($v_Region,0,strlen($v_Region)-3); $v_Temp= substr($v_Temp,0,strlen($v_Temp)-3); $v_CIcon = substr($v_CIcon,0,strlen($v_CIcon)-3); $v_WindS = substr($v_WindS,0,strlen($v_WindS)-3); $v_WindD = substr($v_WindD,0,strlen($v_WindD)-3); $v_Baro= substr($v_Baro,0,strlen($v_Baro)-3); $v_Humid = substr($v_Humid,0,strlen($v_Humid)-3); $v_Real= substr($v_Real,0,strlen($v_Real)-3); $v_UV = substr($v_UV,0,strlen($v_UV)-3); $v_Vis = substr($v_Vis,0,strlen($v_Vis)-3); $v_LastUp = substr($v_LastUp,0,strlen($v_LastUp)-3); $v_Fore= substr($v_Fore,0,strlen($v_Fore)-3); $v_Acid= substr($v_Acid,0,strlen($v_Acid)-3); } ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head title? $v_City ? Weather/title /head body table width=150 cellspacing=0 cellpadding=0 border=1 tr td colspan=5 name=cityst align=center font face=? $fontface ? color=? $fontcolor1 ? size=? $fontsize1 ?b?$v_City?, ?$v_SubDiv?/bfont /td /tr tr td colspan=3 name=temptextTemperature:/td td colspan=2 name=tempdata?$v_Temp ?deg;/td /tr tr td colspan=3 name=humidtextHumidity:/td td colspan=2 name=humiddata?$v_Humid ?%/td /tr tr td colspan=3 name=barotextBarometric Pressure:/td td colspan=2 name=barodata?$v_Baro ?/td /tr tr td name=windtextWind:/td td name=winddir?$v_WindD ?/td td name=attextat/td td name=windspd?$v_WindS ?/td td name=mphtxtmph/td /tr /table /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] splitting up search results, need som ideas. have done 1 2 3 4 5 6 7 8 9 10 11 12 stuff ..
Hi, I'm currently working on something like that. I had already done this but I need to find the file! I don't have time right now but I'll send you another email later :o) What do you think about using a form: input for max rows and drop-down for the 1 2 3... (for example: max rows=10; drop-down: 1, 11, 21, 31, ...) See you, Pascal -Original Message- From: Nicklas Bondesson To: [EMAIL PROTECTED] Sent: 26/10/01 10:55 Subject: [PHP] splitting up search results, need som ideas. have done 1 2 3 4 5 6 7 8 9 10 11 12 stuff .. hi everybody! have done a function that splits up the search results into multiple pages and are displayed using a scroll bar like this: 1 2 3 4 5 6 7 8 9 10 11 12 what i need (when the database grows) is a function that limits the scrollbar to only show like 10 pages at a time. i can't have a scrollbar that looks like 1 2 3 4 5 6 7 8 9 10 -- 1000 i hope you understand what i mean here. otherwise i will try to explain it to you now. imagine that the search returns 30 pages. when i'm looking at page 1-5 i see a scrollbar that looks like 1 2 3 4 5 6 7 8 9 10 . the higher page number i reach the scrollbar should change and show me like 8 9 10 11 12 13 14 15 16 17 18 19 20 21 . are you with me now? :) all ideas are very welcomed ! if you want to see the code for the scrollbar so far, just send me an email and i will send it to you. i hope anyone have a simple solution for this ! best regards, nicke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String breaking up
This only returns the first letter? --- _lallous [EMAIL PROTECTED] wrote: $string = hey there!; $out = ''; for ($i=0; $icount($string); $i++) { $out .= strtoupper($string[$i]) . \n; // or br if output is to browser } echo $out; Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Strings are arrays, so you can print out a string by doing something like this: $string = hey there!; for ($i=0; $icount($string); $i++) { echo strtoupper($string[$i]); } That's about all there is to it! :) Use the strtoupper() function if you mean to have everything uppercase like in your example. Rick I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] String breaking up
Original message From: Dan McCullough [EMAIL PROTECTED] Date: Fri, Oct 26, 2001 at 06:03:00AM -0700 Message-ID: [EMAIL PROTECTED] Subject: [PHP] String breaking up I was looking to take a string like Dan and return it like D A N is it the str function that does that = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] /Original message Reply Hi Dan, This is what you're looking for: $string = preg_replace (/(.)/e, strtoupper('\\1').\br\, $string); See the example below: ---[ PHP Example ]--- ?php $string = Dan is great; $string = preg_replace (/(.)/e, strtoupper('\\1').\br\, $string); print ($string); ? ---[ End of PHP Example ]--- Or is you don't want the upper case characters after all: $string = preg_replace (/(.)/, \\1br, $string); Again, see the example below: ---[ PHP Example ]--- ?php $string = Dan is great; $string = preg_replace (/(.)/, \\1br, $string); print ($string); ? ---[ End of PHP Example ]--- Good luck! /Reply -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php-mysql question
Hello, I am a recent return to the list. Wow has the traffic grown! This is awesome. I have a couple of questions and one may be a RTFM but I can't find the answer. #1) While I thought I was extremely familiar with the MYSQL functions available in PHP I found on e in a code snippet that I have not used before and can't find. It is simply MYSQL(dbname, querystring). On a *nix box with Apache it is returning a resource ID but on a w2k box with apache (or iss) it is returning nothing at all. It does execute the query however. Any ideas or any pointer as to where I can actually find this function would be appreciated! Thanks. #2) Does anyone know of a convention / conference which will have any PHP coverage in the North East? Thanks, Gerard Onorato -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Microsoft Access
Alex, You can access MS Access via ODBC, but you do need a Windows box (and Access) to serve the .mbd file. It's possible to connect from BSD to Windows using ODBC - OpenLink's Multi-Tier drivers can affect this connection for you, and can be downloaded for free. Let me know if you need any assistance. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 8:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Microsoft Access Hi Folks, Does any one here know how to access MS Access file in PHP? And is it possible to do it on a platform other than Window NT/2K, such as Linux or FreeBSD? Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Error: Can't redeclare already declared function (PHP 3.0.15)
I have a script (let's call it a.php3) that brings in another script b.php3 with the include or require call. In script b.php3 there is an include or require call to bring in script c.php3. Script a.php3 after making one and only one include (the include is not repeated anywhere in a.php3) then calls a function x which is defined in script b.php3. The first time the function is called it executes without any problems. The second time in which it is called, in exactly the same way, with the same parameters, it errors with the message Can't redeclare already declared function in c.php3 at line the last line of the first function declaration in c.php3 The function is not actually named in the error message. This is the code block in c.php3 which the error occurs: top of file ?php function getDirNames($sourceDir,$includeBase) { global $pathList; function findAllDirsInDir($sourceDir) { global $pathList; $dirHandle=opendir($sourceDir); while (($subDir=readdir($dirHandle))!=false) { if (is_dir($sourceDir./.$subDir)) { if ($subDir != . $subDir != ..) { $dirList[] = $sourceDir./.$subDir; $pathList[] = $sourceDir./.$subDir; } } } closedir($dirHandle); return $dirList; }; error occurs here function buildDirList($sourceDir,$recurse) { $subDirList=findAllDirsInDir($sourceDir); if (count($subDirList) != 0) $recurse=true; else $recurse=false; for($i=0; $icount($subDirList);$i++) { $currentSubDir=$subDirList[$i]; if ($recurse==true) buildDirList($currentSubDir,$recurse); } } buildDirList($sourceDir,true); if ($includeBase == TRUE) $pathList[] = $sourceDir; return $pathList; } There are no multiple calls to include or require: * a.php3 which is the script that calls the function several times to output data, contains only one call to include() that is not inside any kind of loop. It is called once just before the first function call. *b.php3 which is the script that is included by a.php3. It includes c.php3 ONCE ONLY, NOT IN A LOOP. *c.php3 which is the script in which the error is occurring. Debugging b.php3 shows that the error message is thrown when execution reaches the line in which the function from c.php3 is called. Therefore I surmise that the error message is ambiguous.
Re: [PHP] editor for working with php
Ray Todd Stevens wrote: I ahve been using go-live (4.0) to edit pages containing php scripts. this is not really working well. Is there a better way or a better editor to use for this? Try SciTE: http://www.scintilla.org/ -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php code to fax
I have finally uploaded a tar ball to the phpfax.sourceforge.net website. All the code is there, but it will take a good bit of work to get the whole thing working. Those who have shown interest in the project will probably just be interested in parts of the code for there own projects. If you have any questions, I'll do my best to help you out. Chris On Fri, 26 Oct 2001, Glenn Antoine wrote: Date: Fri, 26 Oct 2001 08:20:12 -0500 To: [EMAIL PROTECTED] From: Glenn Antoine [EMAIL PROTECTED] Subject: RE: [PHP] php code to fax Chris, I just wanted to touch base with you to see if you had received my email. I would be very interested in obtaining a copy of what you have to date. It seems that you have solved some of the very problems that I am dealing with. Again thanks for your help with this. Glenn -Original Message- From: Chris Carbaugh [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 1:59 PM To: Glenn Antoine; [EMAIL PROTECTED] Subject: Re: [PHP] php code to fax Check out phpfax.sourceforge.net This is a project I have pretty much abandoned, and never even posted the code. I have had some people interested in it though, and would like to give the code to the community, I just never found the time. Drop me a line if your interested, and I'll do my best to gather the code into a tarball and post it. Chris On Mon, 22 Oct 2001, Glenn Antoine wrote: Date: Mon, 22 Oct 2001 08:38:42 -0500 To: [EMAIL PROTECTED] From: Glenn Antoine [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Subject: [PHP] php code to fax I am working on a project that will require the ability to take input from a web interface and then fax the content out to some of the members. If anyone has had any experience with a similar project, I would greatly appreciate any assistance. Thanks in advance, Glenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] free php web hosting
Hi, can any body know about free php mysql free web hosting service provder ? i will be greatful if u let me know Kamran H. Hassan
Re: [PHP] Re: tail a file
better yet, just use backticks: ? echo `tail $filename` ? On Fri, 26 Oct 2001 16:13:31 +0200, _lallous wrote: to tail a file use the + flag when opening that log file, and write a simple PHP script that spits that file to you, ie: showlog.php ? readfile('logfile.txt'); ? Yamin Prabudy [EMAIL PROTECTED] wrote in message 003901c15de4$82f0cb70$fe2796ca@dusak">news:003901c15de4$82f0cb70$fe2796ca@dusak... Hi there I need help here I got a file say it's a logs file and keep update ever changes I need to tail this files and pharse it into web, so I can see this the update without login into server (jst thru web browser ) how can i do this Thanks for Help -- Mark, [EMAIL PROTECTED] on 10/26/2001 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What's the difference between mail() in PHP and sendmail?
What's the difference between mail() in PHP and sendmail? Thanks! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Arrays
Brad Hubbard wrote: ?php // Suck 'em in $site = array ( section1 = 007, section2 = 11, section3 = 57.5, section4 = 12, section10 = 1 ); Okay, this answer the first part of my question. How would I go about checking variables against that array? I need to know if the contents of a variable $section exists in the array, and if so, if the contents of the accompanying variable $page is not negative, and less or equal to the INT value of that $section. In a different language I can write something that will return the index of $section in the array, then I can use that index value to fetch the INT afterwards: $array = {{section1, 1},{section2,4},{section3,2}} if (idx = ($section in list_iassoc($array, 1))) = 1 being the first element // idx[1] = section# // idx[2] = INT if ($page 0 $page = $array[idx][2]) etc. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] free php web hosting
www.f2s.com sometimes it's a little slow but u have php+mysql - Original Message - From: Kamran H. Hassan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 26, 2001 11:20 AM Subject: [PHP] free php web hosting Hi, can any body know about free php mysql free web hosting service provder ? i will be greatful if u let me know Kamran H. Hassan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php/Oracle db connection
Toni, You need to enter a string of the syntax: DSN=[name of your dsn] Since nothing shows up with a ? I bet you haven't set your ODBCINI environment variables. Running the openlink.sh against the current shell should do this: . openlink.sh If you are doing it by hand, you need to set: ODBCINI (pointing to the odbc.ini) ODBCINSTINI (pointitng to the odbcinst.ini) LD_LIBARARY_PATH (pointing to the lib directory that contains the libiodbc.so file) DSNs need to be configured in the odbc.ini Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: toni baker [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 11:11 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] php/Oracle db connection When I run odbctest I get the following prompt: OpenLink ODBC Demonstration program This program shows an interactive SQL processor Enter ODBC connect string (? shows list): ? DSN| Description --- Enter ODBC connect string (? shows list): What ODBC connet string should I enter here? Thanks Toni. --- Andrew Hill [EMAIL PROTECTED] wrote: Toni, Note the Unknown host. Check your odbc.ini for the Host field of the DSN you are using. Ensure it's resolvable. Try an IP address instead maybe. Also, set the variables in the environment and see if your DSN works in odbctest without PHP in the mix. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: toni baker [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:56 PM To: [EMAIL PROTECTED] Subject: [PHP] php/Oracle db connection I have successfully compiled php with linked iODBC driver manager as an Apache shared module. However when trying to connect php to the Oracle database I get an error. The error and the sample connection code is below. Warning: SQL error: [OpenLink][ODBC]RPC: Unknown host, SQL state 08004 in SQLConnect in /home/httpd/html/ronsdev/putenv.php on line 9 can not connect to DSN: data1.tsl.state.tx.us ? putenv(LD_LIBRARY_PATH=/usr/local/src/odbcsdk/lib); putenv(ODBCINSTINI=/usr/local/src/bin/odbcinst.ini); putenv(ODBCINI=/usr/local/src/bin/odbc.ini); $dsn=data1.tsl.state.tx.us; $user=scott; $password=tiger; $sql=SELECT * FROM scott.emp; if($conn_id=odbc_connect($dsn,,)) { echo connected to DSN: $dsn; if($result=odbc_do($conn_id, $sql)) { echo executing '$sql'; echo Results: ; odbc_result_all($result); echo freeing result; odbc_free_result($result); } else { echo can not execute '$sql'; } echo closing connection $conn_id; odbc_close($conn_id); } else { echo can not connect to DSN: $dsn; } ? Can someone help with this? Thanks Toni __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Debugging aids (after the style of: Error management)
Sounds like getting a stack trace in various other languages. I know that Komodo and I think maybe a couple others has a built in debugger. It may (or may not) show you a stack trace/call trace display. -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 2:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Debugging aids (after the style of: Error management) Don't you like the side-benefits of this list, eg that someone comes up with a question that gets your thought processes running or suggests an idea you'd not otherwise come up with!? So further to the question: How can I know the line and the file from where a function has called. I already know __FILE__ and __LINE__, but I don't want to transmit them in arguments. is there a debugging facility in PHP which displays a 'map' of which functions have called which? So for example, a script crashes at line_56 in file_fred.php, which is what we've all come to know and love; but I'd like to know that it got there by the mainline calling FnOpen(), which called FnInitialise(), which in turn called FnUncleTomCobbleighAndAll(), where some incompetent happily three layers down tried to share out the spoils by dividing by zero (or whatever)... Looking in the manual I started with: Chapter 8. Constants Predefined constants A constant is a identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (the magic constants __FILE__ and __LINE__ are the only exception). A constant is case-sensitive by default. By convention constants are always uppercase. but if these two are the only magic constants then I'm out of luck there. So I meandered through the PHPINFO and environment variables, but nothing stood up and popped me in the eye. Anyone know better/have a bright idea? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What's the difference between mail() in PHP and sendmail?
Nothing, really. I believe PHP's mail() actually calls sendmail directly (or whatever you have configured in php.ini). Also Mike Web user wrote: What's the difference between mail() in PHP and sendmail? Thanks! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] editor for working with php
I've always been partial to TextPad, myself. http://www.textpad.com/ You gotta download the PHP4 Syntax Definition file for syntax hilighting. Mike Pavel Jartsev wrote: Ray Todd Stevens wrote: I ahve been using go-live (4.0) to edit pages containing php scripts. this is not really working well. Is there a better way or a better editor to use for this? Try SciTE: http://www.scintilla.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[4]: [PHP] function names
MM Check your code again. Without the this- I get the same error that you got. With this- I don't. I don't know what php you're using... Or maybe you haven't understood something. Try this code: ?php class A { function print()//line 4 { echo foo; } } ? And php will tell you Parse error: parse error, expecting `T_STRING' in Newprint.php on line 4 because (as I guess) print() is not a function, it's a language construction. So php simply doesn't let you have function named like language constructions like and, or, array, +, $ and so on. In this case it would be similar as if you wrote: ?php function array() { /* ... */ } // or function and() { /* ... */ } // or function $+() { /* ... */ } ? In all these cases php writes Parse error: ... -- Best regards, Olexandrmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Best [non-PHP] way to redirect a browser
This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best [non-PHP] way to redirect a browser
You might try META tags. Put this in the head section of your index.html file: meta http-equiv=refresh content=0; url=index.php If the user has JavaScript disabled, you're probably best off using a link and letting the user click through. You may also be able to adjust your Apache or IIS or whatever configuration to load index.php by default, and even eliminated index.html altogether. That's what I wound up doing, and I have experienced no problems. At 10:25 AM 10/26/2001, René Fournier wrote: This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best [non-PHP] way to redirect a browser
Before any of your HTML code, put in: header('Location: index.php'); If anything has been sent to the browser yet (through echo/print/etc, or through code outside of the ?php ? tags), though, you will get an error. Mike René Fournier wrote: This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best [non-PHP] way to redirect a browser
René Fournier wrote: And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). If you're using Apache, add 'index.php' to the DirectoryIndex option in httpd.conf. Then you can remove index.html all together -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best [non-PHP] way to redirect a browser
On Friday 26 October 2001 10:25, you wrote: What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: The most reliable, browser-safe, non-PHP way to redirect mail is to do it server-side. If you're using Apache, check out mod_rewrite -- it will do exactly what you're looking for. Otherwise, I believe IIS has similar facilities built into it. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[Fwd: [PHP] Best [non-PHP] way to redirect a browser]
Right. My bad. Heh, I have an excuse.. it's before noon here ;) Definitely go with the meta approach, then: Example: html head meta http-equiv=refresh content=0; url=index.php / /head body a href=index.phpClick here to enter the site/a /body /html Mike this wouldn't work from an index.html page unless html pages were set up to parse as php file... At 10:35 AM 10/26/2001 -0700, you wrote: Before any of your HTML code, put in: header('Location: index.php'); If anything has been sent to the browser yet (through echo/print/etc, or through code outside of the ?php ? tags), though, you will get an error. Mike René Fournier wrote: This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sending email to php script
A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] compile error
Hello, I am looking through the documentation and archives and have been unable to find anything about my problem, which is: Installing php-4.0.6 on alpha OSF1 v5.1 CONFIG LINE: ./configure --with-apache=../apache_1.3.22 --with-imap=/usr/local/src/imap-4.7 --with-mysql=/usr/local/mysql --with-gd=/usr/local/src/gd-1.8.4 --with-mm=/usr/local/src/mm ERROR: cc: Error: scanf.h, line 48: There is no definition for the inline function named scan_set_error_return in this compilation unit. (noinlfunc) inline void scan_set_error_return(int numVars,pval **return_value); ^ I cannot find any references to this type of error, so any help or ideas are greatly appreciated. I can also send out my config.log file to anyone if they want. Thanks in advance, thomas holton .. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Advanced. Trapped in architecture.
Hi there, I have a serious problem in my programming architecture. The architecture looks like fusebox (those of you familar with CF might now this a.) The point is, that I am sending html code at the beginning. Body tag and so on. Now there is the content. And inide this content there might be anywhere an if statement. This if statement should be able to redirect to another Page. I tryed this with the header location statement. Which workes fine as long as output buffer is on. Having output buffer on leads to extreme performance loss. During db access you see a blank screen for seconds. Here is the question: How do I redirect to another page in this case. JS might be a solution. But I really would like to avoid to be dependend on the activation of JS in such a elementery decision. So... how do you guys redirect to other pages? Might be a quick run for you guys, but I am totally stuck here. Thanx for any help Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Searchengine friendly URLs
Hi there, I heared that search engines are not following things after the question mark. Now I looked arround and noticed, that some sites yust have numbers behind the .php extension. How does this work? Can anybody make an example and list advantages and disadvantages? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Searchengine friendly URLs
Hello Andy, Its just a way of passing along variable information as you would do with a form except you attach the variable/args directly to the URL. For example if you have a script that list all records in a database, you may have a link for deleting records that would be attached to each record with identifying information. The link may look something like http://somedomain.com/processRecord.php?action=deleterecID=24 So when you click this link for the processRecord.php script you pass in the action=delete and recID=24 as variable information. So in your processRecords.php script you may have something like: ? if($action == 'delete'){ make a database query and delete record 24 ($recID) form table } else if(could have other actions){ } ? Hope this helps. -Merle Friday, October 26, 2001, 3:13:31 PM, you wrote: A Hi there, A I heared that search engines are not following things after the question A mark. Now I looked arround and noticed, that some sites yust have numbers A behind the .php extension. How does this work? Can anybody make an example A and list advantages and disadvantages? A Thanx, A Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] directory access
Hi, I have a simple authentication script. if ($username == abc) { readfile(abc/index.php); } else readfile(index.php); What I would like to know if there is some way that I can have the user checked against the user in directory /abc/.htaccess? I would like to have the script to jump into a directory if authenticates. Can this be done with a single authentication? TIA. Regards, Norman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fsockopen and https
As far as i know PHP can't handle SSL yet.. at least that was the situation a few versions ago. =( - Original Message - From: Brad Hubbard [EMAIL PROTECTED] To: John [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, October 26, 2001 5:54 AM Subject: Re: [PHP] fsockopen and https On Fri, 26 Oct 2001 17:18, John wrote: Hello All, I am new to this list and am sure most of you are tired of this subject appearing. Please forgive me as I am becoming tired of searching archives and the internet and I am hoping someone here can help me. I am using fsockopen to post data to a dll on a SSL server. I setup the socket data and successfully posted the data to port 80 but as soon as I switch to port 443 I received no errors or text. Does this help? I use this on web servers to test whether a transaction server is available or not. Only works on *nix of course (sorry Bill :-) ?php $ph = popen( /usr/bin/openssl s_client -connect secure.geicp.com:443 -quiet 2/dev/null EOM\nGET / HTTP/1.0\n\nEOM\n, r ); $response = fgets( $ph, 1024 ); if( stristr( $response, 200 OK ) ) { header( Location: https://a.secure.server.com; ); exit; } ? Cheers, BAD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Searchengine friendly URLs
Andy wrote: I heared that search engines are not following things after the question mark. Now I looked arround and noticed, that some sites yust have numbers behind the .php extension. How does this work? Can anybody make an example and list advantages and disadvantages? Search engines don't normally reach anything on a query string (whatever's after a ? ). So, if you're passing variables from one page to another, you can use a spider-friendly method by changing your URL from something like http://host/script?var1=1var2=2 to something like http://host/script/1/2. Then you can extract the variables through the $PATH_INFO variable. This was discussed a while back when I posted this same question. Look through the archives and search for subject topic Submitting variables via /'s... You may also want to read the following article: http://www.zend.com/zend/spotlight/searchengine.php -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Best [non-PHP] way to redirect a browser
Two ways: #1 - If you have server admin access, just add to the default page list index.php in your server config. #2 - Use a meta refresh: html head meta http-equiv=refresh content=0;URL=http://www.yourdomain.tld/path/to/your/script.php; /head /html Mike Frazer René fournier [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What's the difference between mail() in PHP and sendmail?
It can also use procmail, or any other SMTP-capable application you have installed. It is called from the php.ini file. Mike Frazer Nathan Cassano [EMAIL PROTECTED] wrote in message 392201c15e37$535ab3f0$2925ae3f@amos">news:392201c15e37$535ab3f0$2925ae3f@amos... Not a whole lot. The PHP mail function is just a nice fuzzy function wrapper to popen(sendmail). The gory details can be found at http://cvs.php.net/co.php/php4/ext/standard/mail.c?r=1.44. -Original Message- From: Web user [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 8:43 AM To: [EMAIL PROTECTED] Subject: [PHP] What's the difference between mail() in PHP and sendmail? What's the difference between mail() in PHP and sendmail? Thanks! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Searchengine friendly URLs
I found several problems with managing this. All links on the page CANNOT be relative (i.e. HREF=filename.php/var/var/var it must be HREF=/filename.php/var/var/var or with the full path. Otherwise your browser will try to attach the filename to the end of the long querystring you created. Unless someone on this list knows of a way around that. As for a form, say the resulting form of a searchbox. If you want the form to be a 'GET' form so people can see the querystring I created a file which made that happen. You POST to the form with a hidden variable in there containing the actual destination. The code is here: ? if (isset($frmaction)) { $qsarray = array(); //build querystring while (list($key, $val) = each($HTTP_POST_VARS)) { if ($key != frmaction) { if (is_array($val)) { while ($v = current($val)) { $qsarray[] = $key . / . rawurlencode($v); next($val); } } else { $qsarray[] = $key . / . rawurlencode($val); } } } $querystring = implode(/, $qsarray); header(Location: $frmaction/$querystring); } On 10/26/2001 2:37 PM this was written: Search engines don't normally reach anything on a query string (whatever's after a ? ). So, if you're passing variables from one page to another, you can use a spider-friendly method by changing your URL from something like http://host/script?var1=1var2=2 to something like http://host/script/1/2. Then you can extract the variables through the $PATH_INFO variable. This was discussed a while back when I posted this same question. Look through the archives and search for subject topic Submitting variables via /'s... You may also want to read the following article: http://www.zend.com/zend/spotlight/searchengine.php -- Thomas Deliduka IT Manager - New Eve Media The Solution To Your Internet Angst http://www.neweve.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Best [non-PHP] way to redirect a browser
Actually beyond that, for #1, if you server allows you to create .htaccess files, simply create a .htaccess file in your root directory, and put this in it: DirectoryIndex index.php Mike Mike Frazer wrote: Two ways: #1 - If you have server admin access, just add to the default page list index.php in your server config. #2 - Use a meta refresh: html head meta http-equiv=refresh content=0;URL=http://www.yourdomain.tld/path/to/your/script.php; /head /html Mike Frazer René fournier [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This is really I guess a non-PHP question, so please excuse... What is the most reliable, browser-safe way to redirect the browser from a default index.html to, say, index.php? The I'm doing it now is with the following javascript: script type=text/javascript language=Javascript document.location=index.php /script And it works, but I wanted to know if any of you are using a better [more compatible] way of redirecting the browser (say, if it doesn't have JavaScript (!?)). ...Rene --- Rene Fournier [EMAIL PROTECTED]
Re: [PHP] Advanced. Trapped in architecture.
I know in ASP it's as easy as doing: Response.Clear Response.Redirect But PHP doesn't seem to have that feature. My best suggestion would be to try and re-work your code so that the redirect can be detected *before* any html code is written to the browser. Mike Andy wrote: Hi there, I have a serious problem in my programming architecture. The architecture looks like fusebox (those of you familar with CF might now this a.) The point is, that I am sending html code at the beginning. Body tag and so on. Now there is the content. And inide this content there might be anywhere an if statement. This if statement should be able to redirect to another Page. I tryed this with the header location statement. Which workes fine as long as output buffer is on. Having output buffer on leads to extreme performance loss. During db access you see a blank screen for seconds. Here is the question: How do I redirect to another page in this case. JS might be a solution. But I really would like to avoid to be dependend on the activation of JS in such a elementery decision. So... how do you guys redirect to other pages? Might be a quick run for you guys, but I am totally stuck here. Thanx for any help Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Error: Can't redeclare already declared function (PHP 3.0.15)
I had the same type of problem. ( i think) I had one main page (say index.php) that had a bare bones html page. No functions or anything. Then i had separate pages that would be included only if i was using them (like, say, a category.php for displaying categories, then products.php for showing products.) I had a function called printlist(); that would create a drop down menu with categories/subcategories; this was in both category.php and products.php. Niether of those files were included at the same time though, and it'd give me the redeclare error... what i did was rename the function in each file (like for category.php, rename it to printlist1(); and then in products.php rename it to printlist2();... this is a quick fix). Let me know if this was any help :) -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Patrick Dunford [EMAIL PROTECTED] wrote in message 001501c15e27$1a738b80$bd84a7cb@patricks">news:001501c15e27$1a738b80$bd84a7cb@patricks... I have a script (let's call it a.php3) that brings in another script b.php3 with the include or require call. In script b.php3 there is an include or require call to bring in script c.php3. Script a.php3 after making one and only one include (the include is not repeated anywhere in a.php3) then calls a function x which is defined in script b.php3. The first time the function is called it executes without any problems. The second time in which it is called, in exactly the same way, with the same parameters, it errors with the message Can't redeclare already declared function in c.php3 at line the last line of the first function declaration in c.php3 The function is not actually named in the error message. This is the code block in c.php3 which the error occurs: top of file ?php function getDirNames($sourceDir,$includeBase) { global $pathList; function findAllDirsInDir($sourceDir) { global $pathList; $dirHandle=opendir($sourceDir); while (($subDir=readdir($dirHandle))!=false) { if (is_dir($sourceDir./.$subDir)) { if ($subDir != . $subDir != ..) { $dirList[] = $sourceDir./.$subDir; $pathList[] = $sourceDir./.$subDir; } } } closedir($dirHandle); return $dirList; }; error occurs here function buildDirList($sourceDir,$recurse) { $subDirList=findAllDirsInDir($sourceDir); if (count($subDirList) != 0) $recurse=true; else $recurse=false; for($i=0; $icount($subDirList);$i++) { $currentSubDir=$subDirList[$i]; if ($recurse==true) buildDirList($currentSubDir,$recurse); } } buildDirList($sourceDir,true); if ($includeBase == TRUE) $pathList[] = $sourceDir; return $pathList; } There are no multiple calls to include or require: * a.php3 which is the script that calls the function several times to output data, contains only one call to include() that is not inside any kind of loop. It is called once just before the first function call. *b.php3 which is the script that is included by a.php3. It includes c.php3 ONCE ONLY, NOT IN A LOOP. *c.php3 which is the script in which the error is occurring. Debugging b.php3 shows that the error message is thrown when execution reaches the line in which the function from c.php3 is called. Therefore I surmise that the error message is ambiguous. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] free php web hosting
www.f2s.com At 17:20 26/10/01, Kamran H. Hassan wrote: Hi, can any body know about free php mysql free web hosting service provder ? i will be greatful if u let me know Kamran H. Hassan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Array explicit keys verification
Hi, i'm trying to find elegant way to find if Array was declared with explicit keys or only as values. Like, I would like to make a function that knows if array argument was given with keys or only values, function that can distinguish between: func(array(value1,value2,value3)) and func(array(a=value1,b=value2,c=value3)) or func(array(1=value1,2=value2,3=value3)) Thank you :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Advanced. Trapped in architecture.
Response.Clear Response.Redirect Doesn't that imply that ASP buffers the output? The problem with redirecting the browser after you output data isn't a PHP issue, it's the HTTP spec. I think the best solution would be to turn on output buffering, then immediately flush the output buffer when you figure out that you aren't going to be redirecting the user. -Original Message- From: Mike Eheler [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 3:15 PM To: Andy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Advanced. Trapped in architecture. I know in ASP it's as easy as doing: Response.Clear Response.Redirect But PHP doesn't seem to have that feature. My best suggestion would be to try and re-work your code so that the redirect can be detected *before* any html code is written to the browser. Mike Andy wrote: Hi there, I have a serious problem in my programming architecture. The architecture looks like fusebox (those of you familar with CF might now this a.) The point is, that I am sending html code at the beginning. Body tag and so on. Now there is the content. And inide this content there might be anywhere an if statement. This if statement should be able to redirect to another Page. I tryed this with the header location statement. Which workes fine as long as output buffer is on. Having output buffer on leads to extreme performance loss. During db access you see a blank screen for seconds. Here is the question: How do I redirect to another page in this case. JS might be a solution. But I really would like to avoid to be dependend on the activation of JS in such a elementery decision. So... how do you guys redirect to other pages? Might be a quick run for you guys, but I am totally stuck here. Thanx for any help Cheers Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP redirects (was Re: [PHP] Advanced. Trapped in architecture.)
AFAIK, ASP does output buffering by default (meaning it doesn't send the code to the browser until the page is fully parsed and ready to send to the client) That's what allows it to response.redirects after headers have been generated. Cold Fusion is the same way. However, once the actual HTTP headers have been sent to the client, I don't believe it's possible to do a server-side redirect -- only client-side. Someone please correct me if Im wrong. So, PHP does have this feature if you have output buffering turned on. And not being able to do it without output buffering is more of a limitation of the HTTP protocol than it is a limitation of PHP. --kurt On Friday 26 October 2001 12:15, you wrote: I know in ASP it's as easy as doing: Response.Clear Response.Redirect But PHP doesn't seem to have that feature. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
On Thu, 25 Oct 2001 02:04:14 -0700 (PDT) impersonator of [EMAIL PROTECTED] (Rasmus Lerdorf) planted I saw in php.general: if(strpos(abcdef,abc)) { ... } and then be confused that the condition appeared not to be met. What they actually should have done was: if(strpos(abcdef,abc)!==false) { ... } Or better yet, i think: if(is_int(strpos(..))){..} coz this way it should not depend on php version (whereus === and !== do depend), i think:) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Include Precompiled C binaries
I was debating perl Vs. PHP with a friend, and he came up with this: Perl can include compiled C binaries without backprocessing them, which is a pretty useful trick. I don't know anything about this, so couldn't comment on it. Can PHP do this, or anything similar? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: is there a commandline php.exe interpreter?
Jim Lucas [EMAIL PROTECTED] wrote in message 022901c15dbd$76a34c20$[EMAIL PROTECTED]">news:022901c15dbd$76a34c20$[EMAIL PROTECTED]... try this ? system(php.exe filename, $output); echo $output; ? make sure you put the correct paths to the .exe and file otherwise it will think that it is realtive to where you are in the file system. Thanks Jim (and to DNeil and David). Short answer: I got it working ok Long answer: I guess I wasn't very clear... Let me explain... Up until now I have been creating php pages to run on our departmental php-enabled server. Now I want to run php locally on my NT system to generate *.html pages from those *.php pages (to include the *.html pages on a CD). I started to run php406_installer.exe on my system and it started asking questions about my server (upload and temporary directories). I figured the package was just for use with a server on my system so I cancelled the install. I had another go at it and told it no server and it installed fine. Then I had a look at the install directory. Wow!! It's just a couple of files - very compact. I thought it might be like a Perl install with tonnes of stuff. Anyway, I tried it out and it works just fine: php -q xxx.php xxx.html php -q yyy.php yyy.html So I can now generate the *.html files from *.php. Then I run a batch editor on them to replace links to *.php with links to corresponding *.html files. Thanks. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Informix Redback
Our company is looking into purchasing an application package that requires the use of the Informix (IBM) Redback application. We have been told that Redback objects can be used in php scripts but I was wondering if any of you have had experiece with it and if you have had any problems or difficulties using it. Thx in advance for any help you can give Larry Jeannette
[PHP] array_search()
I'm trying to figure out how am I supposed to write this snippet properly: if (($index = array_search($search, array_keys($pages))) !== false) { echo index: $index\n; } else { echo Not found\n; } When I search for something that I know exists, it returns the $index just fine. However, when I search for something that does not exist, it never tells me 'Not found', instead it just displays a blank index (it looks like $index = , not false). Should I be checking it against 'false', or against ? Using PHP 4.0.7-dev. -- W | I haven't lost my mind; it's backed up on tape somewhere. + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Daylight savings and timestamps
Hello fellow PHPer's, Daylight savings is soon upon most of us and I have some questions in regard to timestamps. My problem: So we put our clocks an hour back. I have database tables with plain integers that store timestamps. I like to do comparison operations with these timestamps. When daylight savings takes effect the pre-daylight savings timestamps are an hour ahead of the daylight saving timestamps and cause time operations to calculate incorrectly. What is the solution? Could I offset the new timestamps to ignore daylight savings, make all my timestamps none-daylight savings timestamps? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: free php web hosting
[EMAIL PROTECTED] (Kamran H. Hassan) wrote: Hi, can any body know about free php mysql free web hosting service provder ? http://alt-php-faq.org/links.html - under hosting -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] checkboxes
does anyone know the HTML event that knows when a checkbox has been checked and unchecked? So far I'm using onChange but that is not exactly what I need. I need to run one JS function when a checkbox is checked and another when it is unchecked. NE1? berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Store file remotely using socket/fopen
The command is STOR not STORE. Take a look at the FTP RFC- I think its 951, but im not 100%- just search for FTP RFC. On Friday 26 October 2001 05:42 am, you wrote: Hello list, Simple Enough Objective: store file remotely (wu-ftp); MinorSnag: PHP's ftp-functions unavailable at localhost; BelowWorkaround: works fine for deleting remote file; MajorSnag: how to STORE a file remotely using socket? ?php $ftp=fsockopen(ftp.server.com, 21, $errno, $errstr, 60); if (!$ftp) { echo Connection failed: $errstr ($errno); exit; } else { socket_set_blocking($ftp, true); echo fgets($ftp,255); fputs($ftp,USER ftp_username\r\n); echo fgets($ftp,255); fputs($ftp,PASS ftp_passw\r\n); echo fgets($ftp,255); fputs($ftp,DELE /home/httpd/html/test.htm\r\n); echo fgets($ftp,255); fputs($ftp,QUIT\r\n); echo fgets($ftp,255); fclose($ftp); } ? BTW: I also messed with fopen(ftp://user:pass@...;) but failed miserably (although it seemed possible before my mind wandered off). ANY HELP IS APPRECIATED (using socket, fopen, ...) -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] stripslashes() not striping slashes
Actually, After coding with PHP since the days me and bourbon shared a cube at Netvision while he developed php3 I think that's something I would know :) The funny issue is that only if I use double stripslashes does it work. e.g. $str = stripslashes($str); // This will NOT do the job. $str = stripslashes(stripslashes($str)); // This will do the job. This is the 1st time ever that I bumped into such a thing... any idea why? Any chance it has to do with the fact that I'm using HTML DIR=RTL ? berber -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 6:01 PM To: Boaz Yahav Cc: PHP General (E-mail) Subject: Re: [PHP] stripslashes() not striping slashes Anyone has an idea why stripslashes(); doesn't strip slashes? I have a form that when it's submitted with a ' sign ads slashes to the submit results. I'm taking the variable and sending it through stripslashes(); and yet the slashes remain. You are perhaps thinking it does in-place modification of the argument? ie. stripslashes($a); echo $a; That's not how it works. It returns the stripped string. ie. $a = stripslashes($a); echo $a; -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] checkboxes
onClick Kirk -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 3:03 PM To: PHP General (E-mail) Subject: [PHP] checkboxes does anyone know the HTML event that knows when a checkbox has been checked and unchecked? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] checkboxes
function jsFunc() { // then check the status of the checkbox if (checked) { run this } else { run this } } onClick=jsFunc() Jim Lucas - Original Message - From: Johnson, Kirk [EMAIL PROTECTED] To: PHP General (E-mail) [EMAIL PROTECTED] Sent: Friday, October 26, 2001 2:06 PM Subject: RE: [PHP] checkboxes onClick Kirk -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED]] Sent: Friday, October 26, 2001 3:03 PM To: PHP General (E-mail) Subject: [PHP] checkboxes does anyone know the HTML event that knows when a checkbox has been checked and unchecked? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help! ¡Ayuda!
I'm trying to read a record from a dbase data base so I've previously opened it successfully. The problem is that I call the function dbase_get_record, but it returns no records. The database is ok because I call the funcion dbase_numfields and dbase_numrecords and they give me correct information. Would you help me, please?. Here is the source code that fails. [EMAIL PROTECTED] Estoy intentando leer un registro de una base de datos dbase, por lo que antes la he abierto con éxito. el problema residen en que llamo a la función dbase_get_record, pero no me devuelve ningún registro. La base de datos está bien, porque llamo a la función dbase_numfields y dbase_numrecords y me dan información correcta. ¿Me podríais ayudar, por favor?. Ahí va el código fuente: [EMAIL PROTECTED] Source code- Código fuente: ? $based=articulo.dbf; if (($descriptor=dbase_open ($based, 0))==0){ printf (brError al abrir la base de datos); }else{ printf (brBase de datos abierta); $num_registros=dbase_numrecords($descriptor); $num_campos=dbase_numfields($descriptor); for ($i=1;$i=$num_registros;$i++){ $registro= dbase_get_record ($descriptor, $i); for ($j=0;$j$num_campos;$j++){ printf (brFila %d,Campo %d vale %S, $i, $j, $registro[$j]); } } dbase_close($descriptor); printf (brBase de datos cerrada); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]