php-general Digest 6 Mar 2001 21:50:45 -0000 Issue 551 Topics (messages 42730 through 42814): Re: PHP LDAP & SSL 42730 by: Stig Venaas 42732 by: Matthieu Le Corre 42733 by: Stig Venaas 42735 by: Matthieu Le Corre 42736 by: Stig Venaas 42764 by: Matthieu Le Corre mysql_connect or mysql_pconnect or DEATH ??? 42731 by: Marian Vasile bug tracking software 42734 by: Peter Van Dijck 42755 by: Rick St Jean blank spaces??? 42737 by: Miguel Loureiro 42758 by: Chris Lee HELP!!! Upload files!!!! 42738 by: Bruno Freire dymanic forms 42739 by: george 42740 by: Lucas Persona 42749 by: george 42757 by: Rick St Jean Install Problems 42741 by: Dan Mahoney, System Admin no-resubmit on reload/refresh 42742 by: Bruin, Bolke de 42743 by: Jon Haworth 42748 by: Bruin, Bolke de 42751 by: Jørg V. Bryne ?param=value&#anchorname 42744 by: Matthias Krehl 42746 by: Matthias Krehl Re: Get text between <a href=""> </a> 42745 by: Christian Reiniger Re: speeding a site with lots of includes 42747 by: Christian Reiniger Re: Sites Using PHP - For a presentation 42750 by: Christian Reiniger here's a tricky one (well for me) 42752 by: george 42754 by: Boget, Chris 42776 by: george PHP & mySQL primer? 42753 by: John Vanderbeck 42765 by: Adrian Murphy Rounding to strange results 42756 by: Martin E. Koss 42760 by: Johnson, Kirk 42761 by: Rick St Jean Re: Not Allowing REload or REfresh with this script? 42759 by: Chris Lee How to tell if client has cookies turned off? 42762 by: kevin1 42763 by: Kurth Bemis 42772 by: Chris Adams 42778 by: Rick St Jean 42783 by: Rick St Jean using php generate html file? 42766 by: Fai 42771 by: Miles Thompson Auto Prepend/Append 42767 by: Boget, Chris 42773 by: Chris Adams 42787 by: Boget, Chris 42790 by: Hoover, Josh 42791 by: Boget, Chris Re: Netscape problems with PHP 42768 by: Johnson, Kirk 42769 by: Billy Harvey time() 42770 by: Augusto Cesar Castoldi 42782 by: Philip Olson Set ODBC Timeout Value 42774 by: Karl J. Stubsjoen 42780 by: Andrew Hill time and date function 42775 by: Augusto Cesar Castoldi 42777 by: Nick Davies GD Image failure on WindowsNT - Unable to Open temporary File 42779 by: John E. Haag recursive problem 42781 by: Doug Brewer Re: Calling Perl from PHP -- Help -- 42784 by: Julian Wood removing and item out of a string 42785 by: Brian C. Doyle 42788 by: Rick St Jean 42792 by: Doug Brewer strtotime question 42786 by: Jason Murray Background processing / forking 42789 by: Natasha 42794 by: Mukul Sabharwal 42795 by: Anders Johannsen 42797 by: Mukul Sabharwal Redirect using PHP to a "new" browser window. 42793 by: John Huggins 42805 by: Nick Norton imap functions 42796 by: Chris Lee Newbie question about how to detect mime/type 42798 by: MRossland object->method() chaining 42799 by: The Doctor What [A bit OT but not] Anchors and Query strings 42800 by: Boget, Chris 42803 by: Phil Driscoll Please Help!!!! - Really BASIC stuff! 42801 by: Martin Hughes 42802 by: Jason Murray 42804 by: Philip Olson 42806 by: Phil Driscoll 42807 by: Rick St Jean 42811 by: Martin Hughes 42814 by: Nick Norton mailing list. 42808 by: Rick St Jean 42812 by: Rick St Jean 42813 by: Chris Lee Creating bw png images 42809 by: Alexandre Hautequest exec timing out, want to leave process running in bg 42810 by: pkshifted.slackin.com Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
On Tue, Mar 06, 2001 at 10:54:24AM +0100, Matthieu Le Corre wrote: > Hum the ldapsearch work fine !!! > with the command : ldapsearch -x -H "ldaps://xxxxx.xxxx.xx:636" > I have got a possitive response from server ! > and I don't use SASL ... I got some info from the other guy. He also used RH7 which includes SASL libraries, and he had crashes in both PHP and ldapsearch. Could you see if your ldapsearch crashes if you don't use -x parameter? -x tells it not to use SASL while there are no similar option from PHP. The other guy solved it by compiling OpenLDAP 2.0.7 himself without SASL support and using that with PHP. Stig
i don't use SASL so when i use ldapsearch without -x I get "ldap_sasl_interactive_bind_s: Unknown authentication method" but it doesnt crash ! when i use php ldap functions with ssl php doesn't crash but juste an Apache child crash ! so you think that if i compile openldap without SASL i will work ? i 'm really not sure because it's not that it doesn't work it's just crash ;( thank for all regards Le Mardi 6 Mars 2001 11:08, vous avez écrit : > On Tue, Mar 06, 2001 at 10:54:24AM +0100, Matthieu Le Corre wrote: > > Hum the ldapsearch work fine !!! > > with the command : ldapsearch -x -H "ldaps://xxxxx.xxxx.xx:636" > > I have got a possitive response from server ! > > and I don't use SASL ... > > I got some info from the other guy. He also used RH7 which includes > SASL libraries, and he had crashes in both PHP and ldapsearch. Could > you see if your ldapsearch crashes if you don't use -x parameter? -x > tells it not to use SASL while there are no similar option from PHP. > The other guy solved it by compiling OpenLDAP 2.0.7 himself without > SASL support and using that with PHP. > > Stig -- __________________________________________________ Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
On Tue, Mar 06, 2001 at 11:22:55AM +0100, Matthieu Le Corre wrote: > i don't use SASL > so when i use ldapsearch without -x > I get "ldap_sasl_interactive_bind_s: Unknown authentication method" > but it doesnt crash ! Okay, the other guy had a crash there. For me it works without -x and I don't use SASL either. > when i use php ldap functions with ssl > php doesn't crash but juste an Apache child crash ! > so you think that if i compile openldap without SASL i will work ? > i 'm really not sure because it's not that it doesn't work it's just crash ;( The Apache child probably crashes because of segfault or something in the LDAP code, but there could be other reasons. In theory you should get the same behavior with ldapsearch as from PHP. I'm not sure of anything, but what I would have done to debug it, is to use gdb either on the Apache process or on a stand-alone PHP. I prefer debugging with a stand-alon binary myself. Then run PHP with your script and see what happens. If you get a seg-fault or other crash, you can try to use gdb as I explained with ldapsearch to see where PHP crashes. Compiling PHP stand-alone is easy, do configure with just --with-ldap. You don't have to install it either, just run the resulting php binary. If it says something abous sasl where it crashes, I would try to compile OpenLDAP without SASL and then link PHP with the resulting libraries. If you try gdb on the PHP binary and get some message not related to sasl, or have problems using gdb, let me know. Stig -- Duct tape is like the force. It has a light side, and a dark side, and it holds the universe together ... -- Carl Zwanzig
Le Mardi 6 Mars 2001 11:35, vous avez écrit : > I'm not sure of anything, but what I would have done to debug it, is to > use gdb either on the Apache process or on a stand-alone PHP. I prefer > debugging with a stand-alon binary myself. Then run PHP with your script > and see what happens. If you get a seg-fault or other crash, you can try > to use gdb as I explained with ldapsearch to see where PHP crashes. > Compiling PHP stand-alone is easy, do configure with just --with-ldap. > You don't have to install it either, just run the resulting php binary. > If it says something abous sasl where it crashes, I would try to compile > OpenLDAP without SASL and then link PHP with the resulting libraries. > > If you try gdb on the PHP binary and get some message not related to sasl, > or have problems using gdb, let me know. hum you are right I've compiled PHP stand-alone and running the script and I get ---------------------------------------------- Program received signal SIGSEGV, Segmentation fault. 0x4003ba7b in ldap_int_sasl_external () from /usr/lib/libldap.so.2 (gdb) next Single stepping until exit from function ldap_int_sasl_external, which has no line number information. Program terminated with signal SIGSEGV, Segmentation fault. ----------------------------------------------- in fact it's ldaplib.so.2 that crash !! what a mess ... in fact it's the sasl function that crash i'll try to compil ldap without it ! it mays take a while ... thak for all regards -- __________________________________________________ Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
There's been some discussion on the OpenLDAP lists as well, and there seems to be a fix around. See http://www.openldap.org/its/index.cgi/Software%20Bugs?id=889 Stig
COOOOOOOOOOLLLLLL it work oki guys to work : apply the patch openldap source recompil openldap don't forget to copy librairie from /usr/local/lib to /usr/lib ! recompil php recompil apache and it works !!! it's beeen hard but it works !!! thank for all Le Mardi 6 Mars 2001 12:51, vous avez écrit : > There's been some discussion on the OpenLDAP lists as well, and there > seems to be a fix around. See > http://www.openldap.org/its/index.cgi/Software%20Bugs?id=889 > > Stig -- __________________________________________________ Matthieu LE CORRE SERVICE INFORMATIQUE Ecole Polytechnique de l'Université de Nantes (EPUN) Site de la Chantrerie Rue Christian Pauc BP 50609 44306 Nantes Cedex 3 02 40 68 32 23 __________________________________________________
I have a chat software working on www.jumatateata.ro The problem is that all the time I get mysql sessions opened and I don't understand. I used mysql_connect (at the beggining of every script) and mysql_close in the end. The ISP told me that still remain mysql sessions opened. Then I used mysql_pconnect and again, too many sessions opened. What makes everything hard is that I don't have telnet acces so this is my next question: How I can see mysql sessions opened just using a php script ? Can I ? (I'm asking this because I was thinking that I can write a php script to show me the sessions.=) Do you have any idea about this ? I'm really interested to find out... Thanx a lot... Marian Vasile IT Manager Schnecker van Wyk & Pearson www.investments.ro
I've looked into bug tracking software at hotscripts: mantis http://mantisbt.sourceforge.net/mantis/main_page.php3 is promising but has too many bugs itself still (I fixed three in the past 20 minutes of playing with it, it's still in beta, but I can't afford the estimated x days of debugging it right now). I need something stable to start working with straight away. And preferably something easy to use. Which one should I use? Peter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
Many people recommend bugzilla from netscape. Rick At 10:49 AM 3/6/01 +0000, Peter Van Dijck wrote: >I've looked into bug tracking software at hotscripts: mantis >http://mantisbt.sourceforge.net/mantis/main_page.php3 >is promising but has too many bugs itself still (I fixed three in the past >20 minutes of playing with it, it's still in beta, but I can't afford the >estimated x days of debugging it right now). >I need something stable to start working with straight away. And >preferably something easy to use. >Which one should I use? >Peter >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >http://liga1.com: building multiple language/culture websites > > >-- >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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
Hello all, is there any solution when working with variables that have blank spaces, because when read the variavel to a select, it only appears the first word (e.g. having: "aaa bbb ccc", it only appears "aaa"). T.Y.All Best Regards Miguel Loureiro <[EMAIL PROTECTED] >
code snipits allways help :) but a guess would be that your not putting the var in '' echo " <select name='somename'> <option value='$value'>$value </select> "; please email if this is not the problem. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""Miguel Loureiro"" <[EMAIL PROTECTED]> wrote in message 001d01c0a637$51eaac40$[EMAIL PROTECTED]">news:001d01c0a637$51eaac40$[EMAIL PROTECTED]... Hello all, is there any solution when working with variables that have blank spaces, because when read the variavel to a select, it only appears the first word (e.g. having: "aaa bbb ccc", it only appears "aaa"). T.Y.All Best Regards Miguel Loureiro <[EMAIL PROTECTED] >
Look the message: Warning: Rename failed (Invalid cross-device link) in /usr/local/etc/httpd/htdocs/intranet/upload.php on line 26 What i'm doing wrong??? My code: <html> <head> <script> function nomearq() { teste.nome.value=teste.arquivo.value; } </script> <body bgcolor="#FFFFE6"> <?php if ($arquivo!="") { $arq=""; $i=strlen($nome); while (substr($nome,$i,1)!="\\") { $arq2=$arq; $arq=substr($nome,$i,1); $arq.=$arq2; $i--; } chmod($arquivo, 0777 ); rename($arquivo,"/usr/local/etc/httpd/htdocs/intranet/uploads/comercial/cota cao/$arq");(line 26) $cont++; } else { $cont=0; } echo "Nº de arquivos enviados: $cont<br>"; ?> <FORM ENCTYPE="multipart/form-data" ACTION="upload.php?caminho=<?php echo $caminho;?>" METHOD=POST name="teste"> <INPUT TYPE="hidden" value="20971520"> Nome do Arquivo <INPUT NAME="arquivo" TYPE="file"> <INPUT TYPE="submit" VALUE="Enviar" onclick="nomearq()"> <INPUT TYPE="hidden" value="" name="nome"> </FORM> </body> </html>
I am trying to build a form which can be geberated dynamically by the user selecting the number of fields up to a max of 10. just now i am using if ($fields ==1){ echo "<input type=text name=test>"; } elseif ($fields ==2){ echo "<input type=text name=test>"; echo "<input type=text name=test>"; } elseif ($fields ==3){ echo "<input type=text name=test><br>"; echo "<input type=text name=test><br>"; echo "<input type=text name=test><br>"; } there must be a better way to do this TIA george
Hi George! george wrote: > I am trying to build a form which can be geberated dynamically > by the user selecting the number of fields up to a max of 10. > just now i am using > if ($fields ==1){ > echo "<input type=text name=test>"; > } > elseif ($fields ==2){ > echo "<input type=text name=test>"; > echo "<input type=text name=test>"; You could use a 'for' structure to do that...like: for ($i=0; $i < $fields; $i++) { echo "<input type=text name=test[" . $i . "]>"; } The 'echo' line is different from yours so u can get each text value after the POST action. See you, -- Lucas Persona
Thanks, works a treat george
Use a for loop with <? for ($i=1; $i <= $fields ;$i++) { print("<input type=text name=test>"); } ?> Or you can use a while loop with a counter... same thing. At 12:17 PM 3/6/01 +0000, you wrote: >I am trying to build a form which can be geberated dynamically >by the user selecting the number of fields up to a max of 10. > >just now i am using >if ($fields ==1){ > >echo "<input type=text name=test>"; >} > elseif ($fields ==2){ > >echo "<input type=text name=test>"; >echo "<input type=text name=test>"; >} > > elseif ($fields ==3){ >echo "<input type=text name=test><br>"; >echo "<input type=text name=test><br>"; >echo "<input type=text name=test><br>"; >} > >there must be a better way to do this > >TIA > >george > > > >-- >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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
The situation: Apache-SSL 1.3.14, SSL 0.9.6, built with --enable-module=all. (also, mod_throttle added in). The PHP: The very latest version, I've tried compiling WITH mysql, I've tried compiling WITHOUT mysql, I've even installed mysql JUST FOR THIS... No matter what I do... Floating point error (core dumped). I'm running freebsd 3.4 RELEASE. If anyone has any useful suggestions on how to resolve this, I'm open to hearing them. -Dan Mahoney -- "I'm sorry, that is bull$@%^, but they did not say 'Exsqueeze Me' A Long Time Ago in a Galaxy Far Far Away." -Richard Bozzello, on Jar Jar Binks --------Dan Mahoney-------- Techie, Sysadmin, WebGeek Gushi on efnet/undernet IRC ICQ: 13735144 AIM: LarpGM Web: http://prime.gushi.org finger [EMAIL PROTECTED] for pgp public key and tel# ---------------------------
I have a form which is submitted by a POST action. After submitting, the same page (updated though) returns with the form. (It's a messageboard) Now when someone refreshes/reloads the page they get the question if they want to resubmit the form. I don't want that. You get double posts this way. I know it is possible to check the input for any duplicates, but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 (hope the id works) does it differently and your browser does NOT if you wnat to resubmit, it just doesn't do it. Anyone knows how this works (HTTP header maybe?) cheerz Bolke
Javascript? (I know it's generally horrible, but it's good for this sort of thing) Stick this in your <head>...</head>: <script language="JavaScript" type="text/javascript"><!--Begin var submitcount=0; function jsCheck() { if (submitcount == 0) { submitcount++; return true; } else { alert("This request has already been submitted, please wait while it is processed."); return false; } } //End--></script> And call it from your form like this: <form name="myform" action="whatever" method="post" onSubmit="return jsCheck()"> Voila. HTH Jon -----Original Message----- From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]] Sent: 06 March 2001 12:53 To: [EMAIL PROTECTED] Subject: [PHP] no-resubmit on reload/refresh I have a form which is submitted by a POST action. After submitting, the same page (updated though) returns with the form. (It's a messageboard) Now when someone refreshes/reloads the page they get the question if they want to resubmit the form. I don't want that. You get double posts this way. I know it is possible to check the input for any duplicates, but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 (hope the id works) does it differently and your browser does NOT if you wnat to resubmit, it just doesn't do it. Anyone knows how this works (HTTP header maybe?) cheerz Bolke ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' **********************************************************************
That's not really what I want http://pub.alxnet.com/guestbook?id=2000000 (this one works) does it without. On my page I am using a child window to reload the parent window , so your solution can't be used unfortunately. Bolke -----Oorspronkelijk bericht----- Van: Jon Haworth [mailto:[EMAIL PROTECTED]] Verzonden: Tuesday, March 06, 2001 2:01 PM Aan: Bruin, Bolke de; [EMAIL PROTECTED] Onderwerp: RE: [PHP] no-resubmit on reload/refresh Javascript? (I know it's generally horrible, but it's good for this sort of thing) Stick this in your <head>...</head>: <script language="JavaScript" type="text/javascript"><!--Begin var submitcount=0; function jsCheck() { if (submitcount == 0) { submitcount++; return true; } else { alert("This request has already been submitted, please wait while it is processed."); return false; } } //End--></script> And call it from your form like this: <form name="myform" action="whatever" method="post" onSubmit="return jsCheck()"> Voila. HTH Jon -----Original Message----- From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]] Sent: 06 March 2001 12:53 To: [EMAIL PROTECTED] Subject: [PHP] no-resubmit on reload/refresh I have a form which is submitted by a POST action. After submitting, the same page (updated though) returns with the form. (It's a messageboard) Now when someone refreshes/reloads the page they get the question if they want to resubmit the form. I don't want that. You get double posts this way. I know it is possible to check the input for any duplicates, but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 (hope the id works) does it differently and your browser does NOT if you wnat to resubmit, it just doesn't do it. Anyone knows how this works (HTTP header maybe?) cheerz Bolke ********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ********************************************************************** -- 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]
Well, I've had the same problems with an "Send SMS" routine and it caused the message to get sent twice or more if the user refreshed. I fixed this by adding the following logic: If there are post-data, put this into a session variable (an array of key=>val) and reload the page. if there are no post-data put the session-variable array into the current scope again using a foreach loop, and then delete the session variable, so data won't be processed again. Works like a charm, and doesn't include javascript. Don't know if it's excactly right for you, so you might have to modify it a bit. (From memory only, might be typo's:) <snip> <? session_start(); session_register( pre_posted ); if (count( $HTTP_POST_VARS)>=1) { foreach( $HTTP_POST_VARS as $k=>$v ) { $pre_posted[$k] = $v; } header( "Location: $PHP_SELF" ); exit; } elseif ( is_array( $pre_posted )) { foreach( $pre_posted as $k=>$v ) { $$k = $v; } unset( $pre_posted ); } echo "<b>You posted: $Test</b><br>Want to refresh?"; ?> <form method=post> <input name='Test' value='test' size=20> <input type=submit> </form> </snip> ----- Original Message ----- From: "Bruin, Bolke de" <[EMAIL PROTECTED]> To: "'Jon Haworth'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, March 06, 2001 2:29 PM Subject: RE: [PHP] no-resubmit on reload/refresh > That's not really what I want > > http://pub.alxnet.com/guestbook?id=2000000 > > (this one works) > > does it without. > > On my page I am using a child window to reload the parent window > , so your solution can't be used unfortunately. > > Bolke > > -----Oorspronkelijk bericht----- > Van: Jon Haworth [mailto:[EMAIL PROTECTED]] > Verzonden: Tuesday, March 06, 2001 2:01 PM > Aan: Bruin, Bolke de; [EMAIL PROTECTED] > Onderwerp: RE: [PHP] no-resubmit on reload/refresh > > > Javascript? (I know it's generally horrible, but it's good for this sort of > thing) > > Stick this in your <head>...</head>: > > <script language="JavaScript" type="text/javascript"><!--Begin > var submitcount=0; > function jsCheck() { > if (submitcount == 0) { > submitcount++; > return true; > } else { > alert("This request has already been submitted, please wait > while it is processed."); > return false; > } > } > //End--></script> > > And call it from your form like this: > > <form name="myform" action="whatever" method="post" onSubmit="return > jsCheck()"> > > Voila. > > HTH > Jon > > > > -----Original Message----- > From: Bruin, Bolke de [mailto:[EMAIL PROTECTED]] > Sent: 06 March 2001 12:53 > To: [EMAIL PROTECTED] > Subject: [PHP] no-resubmit on reload/refresh > > > > I have a form which is submitted by a POST action. > > After submitting, the same page (updated though) returns > with the form. (It's a messageboard) > > Now when someone refreshes/reloads the page they get the > question if they want to resubmit the form. > I don't want that. You get double posts this way. > > I know it is possible to check the input for any duplicates, > but for example this guestbook http://pub.alxnet.com/guestbook?id=120611 > > (hope the id works) does it differently and your browser does > NOT if you wnat to resubmit, it just doesn't do it. > > Anyone knows how this works (HTTP header maybe?) > > cheerz > Bolke > > > ********************************************************************** > 'The information included in this Email is of a confidential nature and is > intended only for the addressee. If you are not the intended addressee, > any disclosure, copying or distribution by you is prohibited and may be > unlawful. Disclosure to any party other than the addressee, whether > inadvertent or otherwise is not intended to waive privilege or > confidentiality' > > ********************************************************************** > > -- > 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] >
I found this one. Perhaps it's interesting for someone. Maybe it's even a bug. Or maybe i ignored some specifications. However: This query: foo-script.php?param=value#anchorname will lead to 'value#anchorname' for $HTTP_GET_VARS['param'] Better is this one: foo-script.php?param=value&#anchorname which will lead to 'value' for $HTTP_GET_VARS['param'] bye Matthias Matthias Krehl [EMAIL PROTECTED]
ok, what i wanted to do was: 1. submit a variable ('param') to the following page and independently 2. on the following page jump to an anchor ('anchorname') of course, if you want to submit the variable: 'value#anchorname' to the following page the first approach ist the one and only bye Matthias Matthias Krehl [EMAIL PROTECTED] > -----Ursprüngliche Nachricht----- > Von: Jon Haworth [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 6. März 2001 14:17 > An: 'Matthias Krehl' > Betreff: RE: [PHP] ?param=value&#anchorname > > > But if you're trying to pass an anchor as part of a hyperlink which is > itself the contents of a variable, you DEFINITELY want to use the first, > right? > > I can't see when you'd need the second. What are you using it for? (What > happens to "#anchorname"?) > > Cheers > Jon > > -----Original Message----- > From: Matthias Krehl [mailto:[EMAIL PROTECTED]] > Sent: 06 March 2001 13:14 > To: [EMAIL PROTECTED] > Subject: [PHP] ?param=value&#anchorname > > > I found this one. Perhaps it's interesting for someone. Maybe it's even a > bug. Or maybe i ignored some specifications. However: > > This query: > > foo-script.php?param=value#anchorname > > will lead to 'value#anchorname' for $HTTP_GET_VARS['param'] > > Better is this one: > > foo-script.php?param=value&#anchorname > > which will lead to 'value' for $HTTP_GET_VARS['param'] > > bye Matthias > > > Matthias Krehl > [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] > > > > ********************************************************************** > 'The information included in this Email is of a confidential > nature and is > intended only for the addressee. If you are not the intended addressee, > any disclosure, copying or distribution by you is prohibited and may be > unlawful. Disclosure to any party other than the addressee, whether > inadvertent or otherwise is not intended to waive privilege or > confidentiality' > > **********************************************************************
On Monday 05 March 2001 23:09, you wrote: > I need some help with a program, I need to get every > instance of text between <a href =””> GET TEXT HERE > </a> and save the results in a variable. Does anyone > have some example code of how to do it along with how > to put the results into just one variable? Hmm, try preg_match_all ('/<a\s+href[^>]+>([^<]+)<\/a>/', $Subject, $Matches); $Matches [0] [1], $Matches [1] [1], $Matches [2] [1] etc will contain the text afterwards. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 36000000 hosts for known problems in 3 weeks
On Monday 05 March 2001 23:20, you wrote: > An app I am currently developing has grown a lot. It currently > handles aproximately 12 includes, more or less 13 thousand lines > of code. > > By doing some benchmarks, i realized that the bottleneck is the > include() payload. Are you sure it's the include() ? Or is it the parsing time for the 13k LOC (much more likely)? > How can I optimize a program like this one ? Have a look at zend optimizer or apc cache (apc.communityconnect.(com|org|net)) Another way would be to clean up your code (if you haven't already done this). Often this can drastically cut down on code size (a cleanup I did recently roughly halved code size) while improving clarity and maintainability -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 36000000 hosts for known problems in 3 weeks
On Monday 05 March 2001 23:44, you wrote: > I am looking for some big name sites using PHP. > I will be doing a presentation next month and would like to show a list > of sites that are using PHP. Well, sourceforge.net is pretty big (and complex). http://www.securityspace.com/s_survey/data/index.html might also provide some info, and with http://uptime.netcraft.com/up/graph you can look at some popular sites yourself -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) Pretty cool, the kind of power information technology puts in our hands these days. - Securityfocus on probing 36000000 hosts for known problems in 3 weeks
I am trying to let a user build a form, so on the first page they decide on the number of fields , when they submit that number it names them field1 2 3 etc,now I then want them to name the fields but the problem is because the number of fields varies how do I pass all the variables onto the next page if one time it could be 2 next time it could be 10 TIA George
> I am trying to let a user build a form, so on the first page they > decide on the number of fields , when they submit that number > it names them field1 2 3 etc,now I then want them to name the > fields but the problem is because the number of fields varies how > do I pass all the variables onto the next page if one time it could > be 2 next time it could be 10 On the first page, the field name that specifies the number of fields is "number_of_fields". On the second page that takes that value and works with it, you can do something like this: for( $i = 1; $i <= $number_of_fields; $i++ ) { $fieldName = "field$i"; echo "<input type=text name=\"$fieldName\" value=\"${$fieldName}\"><br>\n"; }echo "<input type=hidden name=\"number_of_fields\" value=\"$number_of_fields\">\n"; When processing your form to get the values, do essentially the same thing: for( $i = 1; $i <= $number_of_fields; $i++ ) { $fieldName = "field$i"; echo "The value entered for field $i is ${$fieldName}<br>\n"; } Through all your forms, just work with "$number_of_fields". Chris
Thanks Chris george
Hello all, I'm lookign at having to do a user registration setup, and I would imagine the best way to do that would be a databse. The server has mySQL setup on it, but I have no experience with it. Can anyone point me to some good basic primers? Soemthing that just creates a db that holds user names and passwords? - John Vanderbeck - Admin, GameDesign
first i'd set up phpmyadmin. http://www.phpwizard.net/projects/phpMyAdmin/ it' great and really easy to use for you mysqldb. once you've done that.there's a useful tutorial on webmonkey for what u need. http://hotwired.lycos.com/webmonkey/00/05/index2a.html?tw=programming g'luck ----- Original Message ----- From: John Vanderbeck <[EMAIL PROTECTED]> To: PHP User Group <[EMAIL PROTECTED]> Sent: Tuesday, March 06, 2001 2:10 PM Subject: [PHP] PHP & mySQL primer? > Hello all, > > I'm lookign at having to do a user registration setup, and I would imagine > the best way to do that would be a databse. The server has mySQL setup on > it, but I have no experience with it. > > Can anyone point me to some good basic primers? Soemthing that just creates > a db that holds user names and passwords? > > - John Vanderbeck > - Admin, GameDesign > > > -- > 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] >
Hi, I use a product database for 2 sites, one of which adds sales tax and rounds to the nearest .10 and on the other site there is no tax and also no rounding. I am unable to figure out why a price of 1000.00 is being displayed as 1.00 and any price over 1000 does the same thing. 100.00 works fine, as does all other prices, this is the same with and without rounding. Anything I should look for to solve this problem? Martin.
Is there a comma in one thousand, e.g., 1,000.00? round() will truncate everything to the right of a comma. Kirk -----Original Message----- From: Martin E. Koss [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 06, 2001 7:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Rounding to strange results Hi, I use a product database for 2 sites, one of which adds sales tax and rounds to the nearest .10 and on the other site there is no tax and also no rounding. I am unable to figure out why a price of 1000.00 is being displayed as 1.00 and any price over 1000 does the same thing. 100.00 works fine, as does all other prices, this is the same with and without rounding. Anything I should look for to solve this problem? Martin. -- 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]
You can write a function that get the %(mod) of 1000 then subtracts it from the number. Rick At 08:43 AM 3/6/01 -0700, Johnson, Kirk wrote: >Is there a comma in one thousand, e.g., 1,000.00? round() will truncate >everything to the right of a comma. > >Kirk > >-----Original Message----- >From: Martin E. Koss [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 06, 2001 7:45 AM >To: [EMAIL PROTECTED] >Subject: [PHP] Rounding to strange results > > >Hi, >I use a product database for 2 sites, one of which adds sales tax and rounds >to the nearest .10 and on the other site there is no tax and also no >rounding. > >I am unable to figure out why a price of 1000.00 is being displayed as 1.00 >and any price over 1000 does the same thing. 100.00 works fine, as does all >other prices, this is the same with and without rounding. > >Anything I should look for to solve this problem? > >Martin. > > >-- >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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
try this, your code example has some design flaws. <?php include_once('session.egn'); if (isset($HTTP_POST_VARS['submit'])) if ( isset($HTTP_SESSION_VARS['done']) AND $HTTP_SESSION_VARS['done'] == $PHP_SELF) { echo "a <br>\n"; echo "You can only press submit once <br>\n"; exit(); } else { echo "b <br>\n"; $done = $PHP_SELF; session_register('done'); } // do some code echo " <form method='post' action='$PHP_SELF'> <input type='hidden' name='submit' value ='1'> <input type='submit'> </form> "; ?> im not exactly sure on what if (issset($userfile)) { global $userfile; unset($userfile); } else { // do some code } this is supposed todo, what is the global there for? what does it do? please explain. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Dhaval Desai" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Well I need help with something. I have a form which has a ction to a file called actio.php Now When I hit the submit button. It goes to the file and it performs a certain action as seen below: action.php: is as follows: <?php if(isset($userfile)) { echo "$userfile is set"; global $userfile; unset ($userfile); } else { echo "Sorry buddy , Userfile is not set"; } ?> My main intentyion is to unset the variable so that When the page is REFRESHED or RELOADED. It should execute the else code block. I am trying to implement it on one of my websites where users can not refresh a particular a page. Thank You Dhaval Desai __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.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]
How can I tell reliably if someone has cookies turned off?
At 10:56 AM 3/6/2001, kevin1 wrote: try to set one...just a blank/empty one.....if it fails then cookies are off :-) ~kurth >How can I tell reliably if someone has cookies turned off? > > > >-- >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] >
On 6 Mar 2001 07:53:46 -0800, kevin1 <[EMAIL PROTECTED]> wrote: >How can I tell reliably if someone has cookies turned off? Set a cookie on your site (perhaps the homepage?) and use code like this: if (!empty($UserHasCookies)) { echo 'Whew - you do have cookies'; } The idea is to set your code to assume that cookie support is disabled unless it finds a cookie saying otherwise. That way it'll fail safely if someone either doesn't have a cookie or their browser discards the cookie halfway through. This may seem silly, but some people get *really* paranoid about cookies. Combined with the increasingly good cookie management in modern browsers and just about anything is possible - this is in fact the major shortcoming to code like the above - it's possible for someone to accept one cookie and deny another, so just being able to set a cookie once does not mean that you will be able to set another. Chris
Something else to consider is that if someone is kinda smart they can place the variable into the url. So, if it is important you may want to put a checksum or token in there. Rick At 08:52 AM 3/6/01 -0800, you wrote: >On 6 Mar 2001 07:53:46 -0800, kevin1 <[EMAIL PROTECTED]> wrote: > >How can I tell reliably if someone has cookies turned off? > >Set a cookie on your site (perhaps the homepage?) and use code like this: > > if (!empty($UserHasCookies)) { > echo 'Whew - you do have cookies'; > } > >The idea is to set your code to assume that cookie support is disabled unless >it finds a cookie saying otherwise. That way it'll fail safely if someone >either doesn't have a cookie or their browser discards the cookie halfway >through. This may seem silly, but some people get *really* paranoid about >cookies. Combined with the increasingly good cookie management in modern >browsers and just about anything is possible - this is in fact the major >shortcoming to code like the above - it's possible for someone to accept one >cookie and deny another, so just being able to set a cookie once does not mean >that you will be able to set another. > >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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
you can check the HTTP_COOKIE_VARS array after setting a cookie to see if anything is placed in there. Rick At 08:52 AM 3/6/01 -0800, Chris Adams wrote: >On 6 Mar 2001 07:53:46 -0800, kevin1 <[EMAIL PROTECTED]> wrote: > >How can I tell reliably if someone has cookies turned off? > >Set a cookie on your site (perhaps the homepage?) and use code like this: > > if (!empty($UserHasCookies)) { > echo 'Whew - you do have cookies'; > } > >The idea is to set your code to assume that cookie support is disabled unless >it finds a cookie saying otherwise. That way it'll fail safely if someone >either doesn't have a cookie or their browser discards the cookie halfway >through. This may seem silly, but some people get *really* paranoid about >cookies. Combined with the increasingly good cookie management in modern >browsers and just about anything is possible - this is in fact the major >shortcoming to code like the above - it's possible for someone to accept one >cookie and deny another, so just being able to set a cookie once does not mean >that you will be able to set another. > >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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
Does any body know how to use php to generate html file? That is when a user input for a webpage title, webpage background color or image in a php page, and then we can generate a html file which contains the properties of user's input such as background color.
Go to www.thickbook.com where Julie Meloni has a tutorial on form with custom error messages, or something similar. Anyway, it uses a form, buttons, input fields, and generation of custom error messages and re-display of the form. All the principles you need are there. Miles Thompson At 12:13 AM 3/7/01 +0800, Fai wrote: >Does any body know how to use php to generate html file? That is when a user >input for a webpage title, webpage background color or image in a php page, >and then we can generate a html file which contains the properties of user's >input such as background color. > > > >-- >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]
Based on what I read, I believe the answer to this question is "No", but am hoping for confirmation because someone might have been able to find a way to make this work. Is it possible to use the auto prepend/append directives to prepend/append particular files only to files with a particular extension? Say I have: prepend.php append.php and I want these files to only be prepended/appended to ".HTML" files and no other file type. Is this possible? Again, I think the answer is "no", but would like to see if anyone might have done something like this... Chris
On 6 Mar 2001 08:13:00 -0800, Boget, Chris <[EMAIL PROTECTED]> wrote: >Is it possible to use the auto prepend/append directives to >prepend/append particular files only to files with a particular >extension? I don't believe you can do this directly with PHP but you probably can with Apache: <Files *.html> php_value prepend_file "foo.php" </Files>
> >Is it possible to use the auto prepend/append directives to > >prepend/append particular files only to files with a particular > >extension? > I don't believe you can do this directly with PHP but you > probably can with > Apache: > <Files *.html> > php_value prepend_file "foo.php" > </Files> Where do you put this? We've tried everywhere, but's not picking up. Are you doing this? And it's working? Chris
Chris, Try putting <Files "*.html"> php_value auto_prepend_file "foo.php" </Files> in your httpd.conf file. Once you put this in the conf file for Apache, restart Apache and see if the changes take place. That should do what you want it to. Josh Hoover KnowledgeStorm, Inc. Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > > >Is it possible to use the auto prepend/append directives to > > >prepend/append particular files only to files with a particular > > >extension? > > I don't believe you can do this directly with PHP but you > > probably can with > > Apache: > > <Files *.html> > > php_value prepend_file "foo.php" > > </Files> > > Where do you put this? > We've tried everywhere, but's not picking up. Are you doing this? > And it's working?
> Try putting > <Files "*.html"> > php_value auto_prepend_file "foo.php" > </Files> > in your httpd.conf file. Once you put this in the conf file > for Apache, restart Apache and see if the changes take place. > That should do what you want it to. Unfortunately, no. Here is what we have in our httpd.conf file: <VirtualHost mydomain.com:80> Port 80 <Files "*.html"> php_value auto_prepend_file "prepend.php" </Files> DocumentRoot /this/is/the/path/to/mydomain.com ServerName mydomain.com </VirtualHost> We are running several different virtual hosts, but want this change applicable to this one only. Thanks for everyone's help thus far. Hopefully we can get this up and running. Chris
Robert, can you (or anyone else) describe further the problem with Netscape and $PHP_SELF? This sounds a little worrisome to me! TIA Kirk -----Original Message----- From: Robert Fischler, Ph.D. ABD [mailto:[EMAIL PROTECTED]] Sent: Friday, March 02, 2001 5:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Netscape problems with PHP I've been running into problems when testing PHP scripts on Netscape (when MSIE works fine). First problem (SOLVED) was that Netscape does something funny with the $PHP_SELF environmental variable, so I've learned to circumvent the problem by just hard-coding the page name instead of relying on the $PHP_SELF trick.
$PHP_SELF is set by the web server - not the browser. Problems in Netscape are almost always caused by incomplete syntax in the HTML code you've output. Netscape is more strict about this than IE. Billy > Robert, can you (or anyone else) describe further the problem with Netscape > and $PHP_SELF? This sounds a little worrisome to me! > > TIA > > Kirk > From: Robert Fischler, Ph.D. ABD [mailto:[EMAIL PROTECTED]] > > I've been running into problems when testing PHP scripts on Netscape (when > MSIE works fine). > > First problem (SOLVED) was that Netscape does something funny with the > $PHP_SELF environmental variable, so I've learned to circumvent the problem > by just hard-coding the page name instead of relying on the $PHP_SELF trick.
I'm trying to do a session with MySQL. how works the funtion time? I didn't undertood the manual. that number is a date, time, seconds?? What is it? regards, Augusto
Hi Augusto, This is a quick hack (nobody freak out please!) that will hopefully explain this question and your other recent thread. Without further ado, play with this : <?php $seconds = array ('day' => 60*60*24, 'week' => 60*60*24*7, 'month' => 60*60*24*30, 'year' => 60*60*24*365, 'decade' => 60*60*24*365*10); testTime($seconds); function testTime($times,$format='l dS of F Y h:i:s A') { echo 'Current time() : '. time(); echo '<h3>Future Times</h3><ul>'; foreach ($times as $type => $value) { echo '<li>'. $type . ' : ' . date($format,time()+$value); } echo '</ul>'; echo '<h3>Past Times</h3><ul>'; foreach ($times as $type => $value) { echo '<li>'. $type . ' : ' . date($format,time()-$value); } echo '</ul>'; } ?> If it doesn't make sense, just say so. But essentially, timestamps are very cool and important! Time() returns such a beast. It returns the number of seconds since this date, we call it the EPOCH (*bows*) : January 1 1970 00:00:00 GMT Read about it here : http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=epoch Regards, Philip Olson http://www.cornado.com/ On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote: > I'm trying to do a session with MySQL. > > how works the funtion time? I didn't undertood the manual. > > that number is a date, time, seconds?? What is it? > > regards, > > Augusto > > > -- > 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] >
Is there a way to set the timeout value for an ODBC connection, lets say for script trying to query a table which is locked? Right now, the default timeout value is well over1 minute, and I don't think I can change it anywhere else (meaning: I don't the the Network Administrator is going to change it). Thanks
Karl, ODBC drivers typically have a timeout configuration. Decreasing that may solve your problem. Best regards, Andrew --------------------------------------- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com On 3/6/01 12:00 PM, "Karl J. Stubsjoen" <[EMAIL PROTECTED]> wrote: > Is there a way to set the timeout value for an ODBC connection, lets say for > script trying to query a table which is locked? Right now, the default > timeout value is well over1 minute, and I don't think I can change it > anywhere else (meaning: I don't the the Network Administrator is going to > change it). > > Thanks >
Can I do any "subtraction" with times and/or dates on php or mysql? I have two times (HH:MM:SS). And I want to know if there is a diference of 5 min between the times. Is there any function that do this? Or I have to program this? regards, Augusto Cesar Castoldi
Just convert the time to unixtime and - 5*60 (5 mins). On Tue, 6 Mar 2001, Augusto Cesar Castoldi wrote: > > Can I do any "subtraction" with times and/or dates on php or mysql? > > I have two times (HH:MM:SS). And I want to know if there is a diference of > 5 min between the times. > > Is there any function that do this? Or I have to program this? > > regards, > > Augusto Cesar Castoldi > > >
Hi All, First, a general thanks for the helpfulness of everyone in the PHP community over the years. Question: I am using PHP under Windows for the first time, and I'm getting an error message when trying to create images (any kind) using GD. The error is: imagepng: unable to open temporary file in <b>c:\inetpub\wwwroot\jhaag\outreach\image_test.php</b> on line <b>11</b> Any ideas? Is this a configuration thing? Thanks. - John Haag O N E P O W E R F U L C L I C K All4one Search Machine http://www.all4one.com All4one Submission Machine http://www.all4one.com/all4submit (614) 575-9897
Hello, I've got a script that recurses to build a path name (it's more complex than that). The script uses static variables to do this. Based on certain conditions, the script might cause a redirect. I find that when the script redirects, the value of the static variable is not reset, and I get a doubled path. So instead of: $path == path/to/first/script I get $path == path/to/first/script/path/to/second/script I tried resetting $path based upon the whether or not a flag variable like $is_redirect is in existence, but all other variables seemed to be reset when the browser redirects...which is what you'd expect, except these static variables seem to keep their value. any ideas? TIA, Doug Brewer
I think you're looking for passthru (or perhaps system or exec). If your php is like this: <?php passthru ("/tmp/hello.pl yay") ?> and hello.pl is like this: #!/usr/bin/perl print 'Args:'.join(' ', @ARGV); Your web page will read: Args:yay You'll probably need to change the method of input (to use @ARGV instead of <>) on your Porter stemmer program to make it work properly. J -- Julian Wood Multimedia Developer University of Calgary on 3/5/01 11:53 PM, Matt Friedman at [EMAIL PROTECTED] wrote: > I'm stumped. I've searched all over and can't figure this one out. > > I have a perl script that waits for input on the command line. You type in a > string and it returns a string. > > I'd like to be able to this via php, since I can't rewrite the script in php, > since it's a little over my head. > > So, how do I open the perl script in php, send it some input and read the > output? > > Thanks, > Matt. >
Hello all, I need to remove a comma from inside of 2 quotes ie "1,234.56" I need to change that to "1234.56" Unfortunatly I can not do reg_replace(",","","1,234.56"); This is inside a csv file. Brian C. Doyle Coach Team Force Earthlink Technical Support [EMAIL PROTECTED]
I really suck with Regular expression but what if you did a replacement on 1, and replaced it with 1 2, and replaced it with 2 3, and replaced it with 3 Kind of a cheap workaround. ?? Rick At 01:07 PM 3/6/01 -0500, Brian C. Doyle wrote: >Hello all, > >I need to remove a comma from inside of 2 quotes ie "1,234.56" I need to >change that to "1234.56" >Unfortunatly I can not do reg_replace(",","","1,234.56"); >This is inside a csv file. > > > >Brian C. Doyle >Coach Team Force >Earthlink Technical Support >[EMAIL PROTECTED] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
what about preg_replace("(\d),(\d)", "$1$2",$your_string); to replace every occurence of a comma surrounded by digits? This works with 4.04, prior to that the "replace" string would by "\\1\\2". Doug | -----Original Message----- | From: Brian C. Doyle [mailto:[EMAIL PROTECTED]] | Sent: Tuesday, March 06, 2001 12:08 PM | To: [EMAIL PROTECTED] | Subject: [PHP] removing and item out of a string | | | Hello all, | | I need to remove a comma from inside of 2 quotes ie | "1,234.56" I need to | change that to "1234.56" | Unfortunatly I can not do reg_replace(",","","1,234.56"); | This is inside a csv file. | | | | Brian C. Doyle | Coach Team Force | Earthlink Technical Support | [EMAIL PROTECTED] |
Hi there, $ob->date is '2000/03/06'. $d = ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)', '\2/\3/\1', $ob->date); $d is now '03/06/2000'. $foo = getdate(strtotime($d)+86400); Here I have to add an entire day to the value of strtotime($d) to get the expected results for below. echo "<P>" . $foo["weekday"] . ", " . $d . "<blockquote>\n"; Without adding a day to strtotime() $foo["weekday"] is 'Monday'. Is there some kind of timezone stuff I am not accounting for? or is it something else? Thanks, Jason
hey, i wanted to know if there's a fork function in php, cause i don't see it in the manual. I basically wanna call a C program from PHP. Now the problem is that the C program will be running for longs periods like maybe half or even an hour. So i would basically want to just execute the program and return control to the script immediately so that the c program continues it's work. it's easy with forking. but i dont see it in php. thx. __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Hi Natasha, Well the probably easiest shitty way to do it is: exec("theprogram 1> /some/file 2>&1 &"); would exec()ute theprogram and will put it's output in /some/file and stderr's output also in the /some/file, and & at last signifies the backgroundness of the program. however as you mentioned C, the better way could fork it in C, and since i don't wanna get offtopic i won't mention it here. -:) HTH --- Natasha <[EMAIL PROTECTED]> wrote: > hey, > > i wanted to know if there's a fork function in php, > cause i don't see it in the manual. > > I basically wanna call a C program from PHP. > > Now the problem is that the C program will be > running > for longs periods like maybe half or even an hour. > So > i would basically want to just execute the program > and > return control to the script immediately so that the > c > program continues it's work. > > it's easy with forking. but i dont see it in php. > > thx. > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.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] > ===== To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
> Now the problem is that the C program will be running > for longs periods like maybe half or even an hour. So > i would basically want to just execute the program and > return control to the script immediately so that the c > program continues it's work. > > it's easy with forking. but i dont see it in php. It's quite easy with PHP as well, even though we do not have forking. Either use exec("nohup c-program") to detach the program, and return control back to the script, or execute it via a shutdown function. That way, the program gets executed after the script has finished. PEAR offers an abstraction for executing system commands. Look for CMD.php /A
Disclaimer: The following post contains C code for *nix! Viewer discretion recommended! Hi, I'm back, I couldn't resist you mentioning C, so as you did, big fault, the code that follows is probably much better than exec, as an stderr terminal will still be attached, but anyway: exec("yourprogramname"); this /should/ work, if it don't then the before exec i mentioned would work! #include <sys/types.h> #include <sys/time.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <signal.h> #include <unistd.h> void get_into_background(void) { pid_t pid; // all the familiar kitchenware! pid = fork(); if(pid != 0) exit(0); setsid(); // sets out process and group id as part of the session // but only if the process ain't a leader, hehe close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); // the program shouldn't acquire a terminal signal(SIGHUP, SIG_IGN); // incase we get HUP'd, ignore! pid = fork(); if(pid != 0) exit(0); chdir("/towhere"); umask(0); } void the_actual_exec(void) { char buffer[1024]; char *args[3]; args[0] = "ls"; args[1] = "-F"; args[2] = 0; execv("/bin/ls", args); // 0 terminated array perror("execv"); // as exec dont return nutting // going past exec is an ERROR } int main(int argc, char **argv) { get_into_background(); the_actual_exec(); return 0; } ===== To find out more about me : http://www.geocities.com/mimodit My bookmarks are available @ http://mukul.free.fr __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
List, I current use something like this to send some one who clicks on my links to the actual web page. $row = @mysql_fetch_array($result); $url = $row["url"]; $ID = $row["ID"]; header("Location: $url"); header(""); And then the hitcounter for that particular ID is incremented, thus the reason for this whole script. This works great. However, I would like the option to open up the target in a new window like when you specify "target="somewindowname" in the <a href... tag. How can I accomplish the same thing with the header or ... sigh ... can I not do this. John
If the only thing you plan on doing after incrementing your counter is going to the new page, why not put the target="_blank" in the <a> tag that points to your script. Then you'll do your counter script and redirect when you're already in a new window.
anyone have any code snippits or urls you could share on the imap functions? Ive got it to list all pop/imap/nttp folders on a server with a username/password, I can view pop/imap msgs, no attachemtns yet, and can not list nntp headers for some reason. the whole imap deal looks great but doesnt seem stable either, some imap functions if there are no folders or headers causes apache to seg fault. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED]
Hi all, I was wondering how I could detect if a file is an image (jpg or gif or png) file? I’m running this on an NT box, but I don’t want to rely on the file extension. Is there a way? Thanks for any help, --Mark
I'm currently working on the DB project from h*ll. Why? Because a lot of the tables of the normalized DB are mapped into objects and PHP's object support questionable at best. I've worked around the lack of multiple inheritance, and some of the other problems. But the inability to do something as simple as: object->MethodThatReturnsAnotherObject()->method() is very troublesome I cannot express how error prone it is to have to create tons of temporary variables. I can already hear people saying stuff like: "Why don't you use the attribute (or variable) directly?" Because in most cases MethodThatReturnsAnotherObject() does work before it hands me the object, and it's important to my project. If someone has a good example of an object framework around a normalized database, I'd love to see it. Otherwise, can someone tell me where in the flipping PHP4 code is this limitation coded? Dislaimer: I'm irrate. This problem has been grating against me for 4 weeks straight now. Ciao! -- Like punning, programming is a play on words. The Doctor What: Not that 'who' guy http://docwhat.gerf.org/ [EMAIL PROTECTED] KF6VNC
I need to set up a link that has both. However, IE/NS isn't liking this: www.mydomain.com/thispage.php#joe?thisvar=thatvalue I need to pass "thisvar" into thispage.php and use it to determine information to display. I also need to pass the anchor name "joe" so the page jumps down to that anchor. What am I doing wrong? Also, I need to parse the above to get information for something else. Is there any easier way to get "joe" out of the above than a regex? Chris
The # goes at the end of the URL after the query string stuff. Once there, it should be easy to strip off the joe by looking for the last # in the string (not that there will be more than 1!). Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Hi, Could someone please help me? If I have links on my page: <a href="side.php?page=audio">Link 1 Here</a> <a href="side.php?page=visual">Link 2 Here</a> And then side.php is the following: <html> </head> Blah.... </head> <body> <FILE CONTENTS GO HERE> </body> </html> Where the files to be included are: audio.txt and visual.txt respectively, what php code should I put in my side.php? (the extention of the files does not have to be .txt) This seems to be a basic thing EVERY website done with php achieves - HOW!!!!???? (I am NOT familiar with php!! - English please :0)) Many Thanks :0), Martin ============================================== Musical Director University of York Gilbert & Sullivan Society 177 Hull Road, York YO10 3JY 01904 427 537 / 07951 015 220 [EMAIL PROTECTED] http://www.mixermanic.co.uk ==============================================
Use include(). Like <? switch ($page) { case "audio" : include("audio.txt"); break; case "visual" : include("visual.txt"); break; } Greetings, Jason -- Jason Murray Developer http://www.jwebmedia.com/ 1 877 525 jWEB
Hi Martin, It's important to know that "Stuff" in the Url like this are just variables. For example : foo.php?fruit=apples&dog=snoopy&others=huh&more=yep Now with foo.php we can do this (a few exceptions) : echo "$dog would like to each some $fruit"; And in your case, you have $page so let's compare your $page variable and include files accordingly. We'll be using an if statement which can be read about here : http://www.php.net/manual/en/control-structures.php This will do the job : <?php if ($page == 'visual') { echo '<h3>Visual Stuff is Good!</h3>'; include 'visual.txt'; } elseif ($page == 'audio') { echo '<h3>Welcome to Musical Section!</h3>'; include 'audio.inc'; } else { echo '<h3>Welcome to my site!</h3>'; include 'default.php'; } ?> Yes there are other ways but this is the simplest and you should (and will!) learn to use if/elseif/else which will be useful in the future. Regards, Philip Olson http://www.cornado.com/
There are loads of different ways to spit out a text file. The easiest is readfile($Filename) which does exactly what you want, providing that the file already contains sanitised html (eg <br> instead of newlines etc. If not, you could use fread to get the file contents into a variable and then process them as you wish (eg with nl2br etc). No doubt, you will be told another hundred ways to do it as well :) Cheers PS Interesting postal address - I frequent the Beeswing pub on Hull Rd every Thursday evening with members of the old car club I'm in! -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
This will allow you to have more control over what pages get edited... but you can use something a little easier like... <? $filename= $page . ".php" include ("$filename"); ?> At 09:02 PM 3/6/01 +0000, you wrote: >Hi Martin, > >It's important to know that "Stuff" in the Url like this are just >variables. For example : > > foo.php?fruit=apples&dog=snoopy&others=huh&more=yep > >Now with foo.php we can do this (a few exceptions) : > > echo "$dog would like to each some $fruit"; > >And in your case, you have $page so let's compare your $page variable >and include files accordingly. We'll be using an if statement which can >be read about here : > > http://www.php.net/manual/en/control-structures.php > >This will do the job : > > <?php > > if ($page == 'visual') { > > echo '<h3>Visual Stuff is Good!</h3>'; > include 'visual.txt'; > > } elseif ($page == 'audio') { > > echo '<h3>Welcome to Musical Section!</h3>'; > include 'audio.inc'; > > } else { > > echo '<h3>Welcome to my site!</h3>'; > include 'default.php'; > > } > ?> > >Yes there are other ways but this is the simplest and you should (and >will!) learn to use if/elseif/else which will be useful in the future. > >Regards, > >Philip Olson >http://www.cornado.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] ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
My God!! You're all stars!!! (This is the **fastest** mailing list I've ever joined) If I have *loads* of links (not just audio & visual) is there a way to create a file to include them all? Basically - what I've got is a frameset with side & main frames (side is for nav, main is for... well, main stuff!) and all my links are in a .js file: ======================= var navAudio="side.php?page=audio" var mainAudio="main.php?page=audio" function openAudio(){ parent.main.location=mainAudio parent.parent.side.location=navAudio } ======================= and the link <a href="javascript:openAudio()">LINK</a> ..but with audio, visual, act 1, act 2, orchestra, cast, and loads of other "pages". Do I put: <? switch ($page) { case "audio" : include("side_audio.txt"); break; case "visual" : include("side_visual.txt"); break; case "cast" : include("side_cast.txt"); break; case "orchestra" : include("side_orchestra.txt"); break; } ?> etc. in every page? Or is there a way of doing the whole link thing and changing several frames with one link in php (just by the .php?page=foo action) I hope this makes sense!!! Thanks LOADS!!!!, Martin :0) ============================================== Musical Director University of York Gilbert & Sullivan Society 177 Hull Road, York YO10 3JY 01904 427 537 / 07951 015 220 [EMAIL PROTECTED] http://www.mixermanic.co.uk ==============================================
Just put the following instead of a long switch and keep your file naming conventions consistent include("side_$page.txt");
Does this mailing list run off PHP? Does anyone find it a pain to have to cut and paste the url of the list into the to bar again and again? I am using Eudora, and I am just wondering if it is me. What mail server are they using? qmail or sendmail? Rick ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
I am using 4 but there is no reply to in the headers. They should have it where you click reply and it replys to the list... not the person that wrote the email. That is what mine is doing. It may be that there are so many posts that this keeps the post numbers down. I was just wondering. Rick At 03:17 PM 3/6/01 -0600, Brig C. McCoy wrote: >At 04:19 PM 3/6/01 -0500, you wrote: > >Does this mailing list run off PHP? Does anyone find it a pain to have to > >cut and paste the url of the > >list into the to bar again and again? I am using Eudora, and I am just > >wondering if it is me. What > >mail server are they using? qmail or sendmail? >Which version of Eudora are you using? With the latest version, everything >that's a URL lights up as blue and connects to my browser when I click on it. > >...brig >-- >Brig C. McCoy Head, Systems Office >Linda Hall Library of Science, Engineering and Technology >5109 Cherry 816 926-8749 >Kansas City, MO 64110 ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################
use news.php.net it rocks. no huge bulk email in your box after a weekend. no funky re-pley, nice. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Rick St Jean" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am using 4 but there is no reply to in the headers. They should have it where you click reply and it replys to the list... not the person that wrote the email. That is what mine is doing. It may be that there are so many posts that this keeps the post numbers down. I was just wondering. Rick At 03:17 PM 3/6/01 -0600, Brig C. McCoy wrote: >At 04:19 PM 3/6/01 -0500, you wrote: > >Does this mailing list run off PHP? Does anyone find it a pain to have to > >cut and paste the url of the > >list into the to bar again and again? I am using Eudora, and I am just > >wondering if it is me. What > >mail server are they using? qmail or sendmail? >Which version of Eudora are you using? With the latest version, everything >that's a URL lights up as blue and connects to my browser when I click on it. > >...brig >-- >Brig C. McCoy Head, Systems Office >Linda Hall Library of Science, Engineering and Technology >5109 Cherry 816 926-8749 >Kansas City, MO 64110 ########################################################## # Rick St Jean, # [EMAIL PROTECTED] # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ########################################################## -- 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]
Hi all. To not use anymore gif, i switch my gd lib to 1.8, but i need to generate 2 colors png graphics, but i just got 16-bit images. Is there any place/function/variable i can set to achieve this? TIA. -- Alexandre Hautequest hquest at fesppr.br Fundação de Estudos Sociais do Paraná - http://www.fesppr.br/ Centro de Administração de Redes - CAR "Ninguém é melhor do que todos nós juntos." Equipe Zeus Competições ------------------------------------------------- Esta mensagem foi enviada pelo WebMail da FESP. Conheça a FESP: http://www.fesppr.br/
I'm trying to develop a front-end using php for mpg123 so that various members of my household don't need to access a shell to start/play music. I'm using something similiar to exec('$null'), w/ $null being equal to "mpg123 -y -Z --all >/dev/null/ &". The problem I'm having, is about 5 minutes after it starts, it dies, with no core dump or anything, the process just stops. I'm sure this is done so that a process won't run forever in the background (bonus/bug), but what if that's what I want? Is there any work around? This is using php4.0.4pl1 and FreeBSD 4.0 release with apache 1.3.12. Thanks in advance. PKnull