php-general Digest 7 Mar 2001 22:37:49 -0000 Issue 553 Topics (messages 42887 through 42958): Re: exec timing out, want to leave process running in bg 42887 by: Mukul Sabharwal Is it bug? 42888 by: Piotr Duszynski 42906 by: Chris Lee Re: Q: php4,cache,performance,mod_perl,zend cache, APC 42889 by: Zeev Suraski include() & require() 42890 by: cocos.hol.gr 42891 by: Derek Sivers 42907 by: Zeev Suraski Slideshow problem 42892 by: Fates 42893 by: Don Read 42894 by: Jason Stechschulte exec as another user 42895 by: Ivari Horm 42937 by: Henrik Hansen converting comma-ed numbers 42896 by: Dreamvale dates from db 42897 by: Matt Davis 42898 by: Jon Haworth 42900 by: Mark Roedel 42904 by: Eric Naujock Re: session_start 42899 by: Ernest E Vogelsinger Re: Error with ldap 42901 by: Alain ROMERO Re: PHP dll on NT - more reliable with Apache than IIS? 42902 by: Lance Koh 42946 by: Paulo Parola unsuscribe 42903 by: Emmerson Rafael Miranda Ramirez Re: Value of if(isset(X)) problem 42905 by: Tim Ward 42923 by: Johnson, Kirk Re: file access(mpeg) only for authenticated people 42908 by: Thorsten Gutermuth Re: How to sort a 2D array? 42909 by: Chris Lee Re: How to get oid after table insert? [postgresql] 42910 by: Joe Conway Re: Session not destroying properly 42911 by: Yasuo Ohgaki explode question 42912 by: Rol 42919 by: Jason Murray 42927 by: Chris Lee 42938 by: Rol Calling Java inside PHP 42913 by: Paulson, Joseph V. \"Jay\" parsing html / xml 42914 by: Nathaniel Hekman 42945 by: Angerer, Chad sending SMS messages via PHP 42915 by: Michael Smith 42928 by: Neil Kimber 42931 by: Henrik Hansen parsing html / xml (more) 42916 by: Nathaniel Hekman 42936 by: Matt McClanahan 42948 by: Nathaniel Hekman Session-based authentication and Netscape 6 problems 42917 by: Colin Viebrock Text and formating 42918 by: sono.selectcomm.ab.ca 42920 by: Hoover, Josh 42922 by: Paulson, Joseph V. \"Jay\" 42924 by: Brian V Bonini Dynamic Links.. 42921 by: Ashwin Kutty 42926 by: Chris Lee email with multiple records 42925 by: WreckRman2 42929 by: Chris Lee 42933 by: David Smith 42949 by: Miles Thompson new php release? 42930 by: Antonio S. Martins Jr. 42935 by: Henrik Hansen 42939 by: Antonio S. Martins Jr. 42942 by: Henrik Hansen brazillian developers 42932 by: Wagner Nunes Re: email with multiple records [code included] 42934 by: David Smith Interbase 42940 by: Chris 42941 by: Angerer, Chad 42944 by: Brett Bandy 42947 by: Wagner Nunes String concatenation problems 42943 by: ericnielsen.earthlink.net passing variables again 42950 by: george 42951 by: Miles Thompson 42957 by: george Remote Scripting 42952 by: Karl J. Stubsjoen 42955 by: Miles Thompson htaccess 42953 by: Jason Jacobs 42956 by: David Smith Re: session in php3 42954 by: Steve Edberg on the list yesterday regarding mysql time 42958 by: Jerry Lake 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] ----------------------------------------------------------------------
Oh yeah, we don't wanna get HUPed! --- Christian Reiniger <[EMAIL PROTECTED]> wrote: > On Wednesday 07 March 2001 06:37, you wrote: > > Hi, > > > > Well there are many ways to run a process in the > > background, my favorite way is detaching the > process > > or the program or process from within, so if it's > a c > > program pretty easy, but incase you dont have the > > source, then you can use this: > > > > exec("mp3123 -y -Z --all 1>/dev/null/ 2>&1 &"); > > better add "nohup" to that: > exec("nohup mp3123 -y -Z --all 1>/dev/null/ 2>&1 > &"); > > > well that simply puts the stdout and stderr in the > > same file /dev/null, and puts it into the > background. > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > What luck for the rulers that men do not think. > > - Adolf Hitler > > -- > 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/
I have smth like that in my code: $wyjscie.="blankietparttwo{}{$imie $nazwisko $ulica $kodpocztowy $miejscowosc}"; And I get error: Parse error: parse error, expecting `'}'' in zamowienia.inc on line 609 What's wrong? -- Piotr Duszynski http://www.softomat.com.pl http://filmomat.3miasto.pl http://www.3miasto.pl
its not a bug, the proper syntax for {} is this. echo "hello {$names[1234]} how are you ?"; change your code to this. $wyjscie.="blankietparttwo\{}\{$imie $nazwisko $ulica $kodpocztowy $miejscowosc}"; or $wyjscie.= 'blankietparttwo{}{'. "$imie $nazwisko $ulica $kodpocztowy $miejscowosc}"; '' vs "" is a big difference, single quotes do not parse the data in between them, therfore it is ok to use '' with {} -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Piotr Duszynski" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have smth like that in my code: $wyjscie.="blankietparttwo{}{$imie $nazwisko $ulica $kodpocztowy $miejscowosc}"; And I get error: Parse error: parse error, expecting `'}'' in zamowienia.inc on line 609 What's wrong? -- Piotr Duszynski http://www.softomat.com.pl http://filmomat.3miasto.pl http://www.3miasto.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 4.0 is extremely fast as it is, and is running at equivalent speed to mod_perl (your mileage may vary, but many people say it's faster, and I'm sure there are people for whom it's slower). However, it doesn't do post-compilation caching (and as a matter of fact, neither does mod_perl, other than a very specific and not all too usable mechanism of read-only, static shared compiled scripts). There's no doubt that you can deploy your web site without purchasing the Zend Cache, and on the other hand, there's no doubt that deploying it with the Zend Cache will result in much better performance (the Zend Cache is actually a bit of a misleading name, because it does all sorts of things other than just post-compilation caching). In most cases (almost all cases I've seen to date) - using the Zend Cache is the most cost effective alternative, compared to alternative solutions (i.e. hardware). It's really a question of what kind of performance you require, and whether PHP 4.0 as it comes out of the box is quick enough for you. Zeev At 01:07 7/3/2001, Joe Rice wrote: >Hi, > As you might gather from the subject, i'm trying to >make a decision. Before that i'm doing research >to find out what best fits. My question is; > > >From what i've read php4 does post-compilation caching, >is this right? If so, what is the point of Zend Cache or >APC (Alternative PHP Cache)? I know from experience that >mod_perl does copy and run from a compiled version of the >script into memory. From the description of Zend Cache and >APC they sound like the equivalent for php4. I guess what i'm >getting at is is php4 as fast as mod_perl or do i need something >like zend cache? also, is there anywhere with stated benchmarks >that i can see to compare? > > >Thanks, >joe > > > >-- >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] -- Zeev Suraski <[EMAIL PROTECTED]> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
Which is the main difference between include() and require() functions? Thanks Costis
>Which is the main difference between include() and >require() functions? "include" is optional you can put it inside an "IF" like this: if (0) { /* THIS WILL NOT SHOW... */ include "optional_file.php"; } but "require" happens every time, even if it is inside an "IF" that does not happen. if (0) { /* THIS WILL SHOW ANYWAY... */ require "optional_file.php"; } Me personally, I use "require" to include functions, libraries, classes that I NEED to run the page. Then I use "include" for optional things, based on "if". <? require "functions.inc"; if ($sunny_day) { include "sunny_day_message.txt"; } ?>
At 13:41 7/3/2001, Derek Sivers wrote: >>Which is the main difference between include() and >>require() functions? > > >"include" is optional >you can put it inside an "IF" >like this: > >if (0) > { > /* THIS WILL NOT SHOW... */ > include "optional_file.php"; > } > > >but "require" happens every time, >even if it is inside an "IF" that does not happen. > >if (0) > { > /* THIS WILL SHOW ANYWAY... */ > require "optional_file.php"; > } That's actually no longer true, in more recent versions of PHP (it used to be true). The only difference between include() and require() is that require() will bail out if it fails, whereas include() would not. Zeev
My problem is the images are displayed all at once instead of one at a time. So I get 10 images all on one page. How do I make it display one image at a time like a slideshow instead of all images on one web page? . The problem seems to be within my loop. I am using latest php4 version. // sloppy programming ahead // Begin Random Function // Anyone know of a better way to randomize? function random($max = 1) { static $startseed = 0; if (!$startseed) { $startseed = hexdec(uniqid(''))%getrandmax(); srand($startseed); } return ((rand()/getrandmax())*$max); } //end function if ($result) { /* Print these results to the screen in a nice format */ $i = 0; $number = 3; IF ($number == 0) : PRINT "<CENTER><P>There were no records matching your query</CENTER>"; PRINT "$abc"; ELSEIF ($number > 0) : //PRINT "<CENTER><P>Search Results Returned: $number</CENTER><BR><BR>"; WHILE ($i < $number): // Assign variables within lloop $bar =$numguest[0]; $foo = random($bar); // call random function to get a new random pic $record = mysql_result($result,$foo,"ID"); $cat = mysql_result($result,$foo,"category"); $name = mysql_result($result,$foo,"picture_name"); $rating = mysql_result($result,$foo,"rating"); // $name = mysql_result($result,$i,"name"); ?> <TR bgcolor="#000000" ><TH><small>Name:<? echo "$name"; ?> Record: <? echo "$record"; ?> Category: <? echo "$cat"; ?> Rating: <? ec ho "$rating"; ?>Total Records: <? echo $numguest[0]; ?> </small></TH></TR> <!-- <TR><TD> <? // echo "<img src=/graphics/uploads/$name width=$width height=$height><br>\n"; ?> </TD></TR> --> <TR bgcolor="#000000" ><TH>Random Number: <? echo "$foo"; ?> Record: <? echo "$record"; ?> Height= <? echo "$height"; ?> Width= <? echo "$width"; ?></TH></TR> </TR> <? $i++; ENDWHILE; //PRINT "</CENTER>"; ENDIF; } ?> </TABLE> <!-- End database -->
On 07-Mar-01 Fates wrote: > My problem is the images are displayed all at once instead of one at a > time. So I get 10 images all on one page. How do I make it display one > image at a time like a slideshow instead of all images on one web page? > . The problem seems to be within my loop. I am using latest php4 > version. <snip> You are confused on how HTTP works. http://www.acts.eku.edu/web/FASTWEB/HTMLOUCH.HTM (scroll down a couple of paragraphs) Regards, -- Don Read [EMAIL PROTECTED] -- If you are going to sin, sin against God, not the bureaucracy. God will forgive you but the bureaucrats won't.
On Wed, Mar 07, 2001 at 04:46:49AM -0700, Fates wrote: > My problem is the images are displayed all at once instead of one at a > time. So I get 10 images all on one page. How do I make it display one > image at a time like a slideshow instead of all images on one web page? > . The problem seems to be within my loop. I am using latest php4 > version. It looks to me like you are trying to do something server side that needs to be done client side. Rotating images on a single webpage normally requires something like, java, javascript?, or flash. -- Jason Stechschulte [EMAIL PROTECTED] -- Actually, it also looks like we should optimize (13,2,42,8,'hike') into a pp_padav copy as well. -- Larry Wall in <[EMAIL PROTECTED]>
Hi, This may be a stupid question but how can I execute programs as another user under php? I'm using Linux with Apache 1.3.12 and PHP 4. Thank you in advance. Ivari
> Hi, > > This may be a stupid question but how can I execute programs as another > user under php? > I'm using Linux with Apache 1.3.12 and PHP 4. The only way i can figure out would be by using the sudo command without a password (don't do that with root), do a 'man sudo' on your linux box -- Henrik Hansen
Hi, Anyone got any functions that converts string with comma separated thousands (eg 8,982) to integer/float? Thanks.
I am calling on a number of fields from my db one of which is a date. When the date displays it is in the following format YYYY-MM-DD 00:00:00 I Want it to only display the date and not the time like this YYYY-MM-DD Is it possible to remove the time when calling on it from the db can anyone help? Thanks Matt.
If it's stored as a unix timestamp you can format it any way you like. [www.php.net/date] If it's stored as a string in the YYYY-MM-DD hh:mm:ss format, you can use substr(0,10) [www.php.net/substr] to get the first 10 characters and only display those. HTH Jon -----Original Message----- From: Matt Davis [mailto:[EMAIL PROTECTED]] Sent: 07 March 2001 13:35 To: Php Mailing List Subject: [PHP] dates from db I am calling on a number of fields from my db one of which is a date. When the date displays it is in the following format YYYY-MM-DD 00:00:00 I Want it to only display the date and not the time like this YYYY-MM-DD Is it possible to remove the time when calling on it from the db can anyone help? Thanks Matt. -- 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' **********************************************************************
> -----Original Message----- > From: Matt Davis [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 07, 2001 7:35 AM > To: Php Mailing List > Subject: [PHP] dates from db > > > I am calling on a number of fields from my db one of which is > a date. When the date displays it is in the following format > > YYYY-MM-DD 00:00:00 > > I Want it to only display the date and not the time like this > > YYYY-MM-DD > > Is it possible to remove the time when calling on it from the db Check the documentation for the database engine you're using. MySQL, for example, has a date_format() function that you can use in your query to specify what information you'd like displayed from a date/time field, and how you'd like it presented. --- Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University || -- Henry Kissinger
My own solution to this is a bit more complex but it seems to work with both of the databases I work with. MySQL and Postgress. for example I would use 'select *,unix_timestamp(cr_date) as my_cr_date from table where ref_index=2345;' Then when I go to output it I can use the unix date command such as '$string=date("l dS of F Y h:i:s A",db->f(my_cr_date)); My reference to db->f(my_cr_date) is my phplib methof of reading the data. You may use your own method. Doing it this way you can get your own method of displaying dates or times in almost any way you want. And you don;t have to count on your database supporting it. >>> "Mark Roedel" <[EMAIL PROTECTED]> 03/07/01 09:08AM >>> > -----Original Message----- > From: Matt Davis [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 07, 2001 7:35 AM > To: Php Mailing List > Subject: [PHP] dates from db > > > I am calling on a number of fields from my db one of which is > a date. When the date displays it is in the following format > > YYYY-MM-DD 00:00:00 > > I Want it to only display the date and not the time like this > > YYYY-MM-DD > > Is it possible to remove the time when calling on it from the db Check the documentation for the database engine you're using. MySQL, for example, has a date_format() function that you can use in your query to specify what information you'd like displayed from a date/time field, and how you'd like it presented. --- Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University || -- Henry Kissinger -- 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]
At 22:05 07.03.2001, Jacky@lilst said: --------------------[snip]-------------------- >People >very basic question here, I wanna assign username onto session after the >login succeed, I use: > >session_start(); >session_register("username"); >$UserNameSession="username"; --------------------[snip]-------------------- session_start(); session_register($UserNameSession); if (!isset($UserNameSession)) $UserNameSession="username"; --------------------[snip]-------------------- I got problem of how to assign session value in php3. As far as I know, all syntax in manual talks about php4 syntax only. How am I going to do that? --------------------[snip]-------------------- do nothing, PHP will assign the value for you. ...ebird >O Ernest E. Vogelsinger (\) http://www.1-at-web.at/ ^ ICQ# 13394035
I copy 'msvcrtd.dll' in winnt\system32 and php3 works fine, but not php4 HELP !!!!! Alain ROMERO a écrit : > PHP 4.0.2 on Win32 > or PHP 3 on Win32 > extension=php_ldap.dll is on in the php.ini file > > I get 'Unable to load php_ldap.dll' (PHP4) when I call a php file ? > I get 'Call to an unsupported function ldap_connect()' (PHP3) ? > > Help please ? > > -- > 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]
did you copy this file "php4ts.dll" into your winnt/system32 folder? i believe you need that in order for the isapi to work --lance ----- Original Message ----- From: "Greig, Euan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 07, 2001 5:44 PM Subject: [PHP] PHP dll on NT - more reliable with Apache than IIS? I have been having problems using the PHP 4 ISAPI module with IIS 4 on NT4 (The most common problem is HTTP 500 internal server error which disappears if page is refreshed). This is apparently not too surprising given the current status of the ISAPI module. So I have switched to using CGI, which seems absolutely fine, but is noticeably slower. I was wondering if it is worth trying the Apache module. Will it be more reliable? And are there any notable gotchas to watch out for in installing this combination? Euan Greig Technical Consultant BRANN DATA [EMAIL PROTECTED] 01285 645997 ************************************************************************** Any opinions expressed in this email are those of the individual and not necessarily the Company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. ************************************************************************** -- 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]
We have started using PHP on NT over Apache, but since our ISP used IIS we switched to it. Anyway, we just started having real problems after our application got really big, so that I cannot really compare Apache x IIS on NT very well (our errors started happening on IIS if I recall correctly). And you are right, CGI version is much more stable: our application has even crashed IIS on our ISP (and thus all other clients websites as well went down...) when running PHP as ISAPI. We asked the ISP to configure PHP as CGI for our virtual host only, did the same test and got an error but all the sites still were running fine, ours as well. I believe you should do some tests over apache, it is really easy to install. And relating to IIS, CGI is definetly more stable. You could anyway consider moving to Linux or UNIX. The developers of PHP seem also to be much more prolific in relation to this world, for obious reasons... But in my opinion, as a commercial product in a production environment I would say that PHP over Windows is definetly not the better choice. Paulo ----- Original Message ----- From: Greig, Euan <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 07, 2001 6:44 AM Subject: [PHP] PHP dll on NT - more reliable with Apache than IIS? > I have been having problems using the PHP 4 ISAPI module with IIS 4 on NT4 (The most common problem is HTTP 500 internal server error which disappears if page is refreshed). This is apparently not too surprising given the current status of the ISAPI module. So I have switched to using CGI, which seems absolutely fine, but is noticeably slower. > > I was wondering if it is worth trying the Apache module. Will it be more reliable? And are there any notable gotchas to watch out for in installing this combination? > > Euan Greig > Technical Consultant > BRANN DATA > [EMAIL PROTECTED] > 01285 645997 > > > > > > ************************************************************************** > Any opinions expressed in this email are those of the individual and > not necessarily the Company. This email and any files transmitted with > it, including replies and forwarded copies (which may contain alterations) > subsequently transmitted from the Company, are confidential and solely for > the use of the intended recipient. If you are not the intended recipient > or the person responsible for delivering to the intended recipient, be > advised that you have received this email in error and that any use is > strictly prohibited. > > ************************************************************************** > > -- > 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 want unsuscribe me please
I think you'll find that cmdFinish is only passed through if the form is submitted by pressing the button. Hitting return on any other field will submit the form without sending cmdFinish. It might be sfare to check if one of your text fields is set. Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Martin Skjöldebrand [mailto:[EMAIL PROTECTED]] > Sent: 07 March 2001 05:34 > To: [EMAIL PROTECTED] > Subject: Value of if(isset(X)) problem > > > Sorry bout the length .... I'm a newbie to PHP/MySQL so bare > with me ... > Here's a snippet of an app I'm hacking. I have a form that > should update a > client form. the cl_XXXX are taken from a database table and > works nicely. > The point of this that they should possibly be replaced by > txtXXX and put > back in the table. > > As far as I can tell this _should_ work but it doesn't. I > suspect that > cmdFinish is never set if (isset($cmdFinish)) isn't true .... > > Any suggestions? > > 8< ------------- code -------------------------->8 > > <tr> > <td width="50%" valign=center align=right>Computer ID: > </td> > <td width="50%"> > <input type=text name="txtCompID" size=10 value = "<?echo > $cl_compID?>"> > </td> > </tr> > <tr> > <td width="50%" valign=center align=right> > <font size=3>Email:</font> > </td> > <td width="50%"> > <input type=text name="txtEmail" size=20 value = "<?echo > $cl_email?>"> > </td> > </tr> > </table> > <p align=center> > <center> > <input type="submit" value="Modify client" name="cmdFinish"> > </td> > </center> > </tr> > </table> > </center> > </div> > </form> > > <?php //OK we can commit our changes ... > if (isset($cmdFinish)) { > $query = "UPDATE client SET "; > $query .= "cl_login ='$txtLogin', "; > $query .= "cl_firstname ='$txtFirstname', "; > $query .= "cl_secondname ='$txtSecondname', "; > $query .= "cl_phone = '$txtPhone', "; > $query .= "cl_type = '$txtType', "; > $query .= "cl_dept = '$txtDept', "; > $query .= "cl_compID = '$txtCompID', "; > $query .= "cl_email = '$txtEmail' "; > $query .= "WHERE cl_login = '$lstModifyClient';"; > $mysql_result = mysql_query($query, $mysql_link); > print "<CENTER><BR><BR>\n"; > print "$txtLogin has been successfully modified!<BR><BR></CENTER>\n"; > exit; > } > > ?> > > <? } > else { > print "<CENTER><BR><BR><B>The Client: </B>$lstModifyClient has "; > print "<b>not</b> been modified<BR></CENTER>\n"; > } > } > > ?> >
Tim, I just tried this in IE 5.0, and the submit button name-value pair was posted along with the other form variables, even though I submitted the form by hitting return on another field. Is the behavior you described specific to a certain browser version? Kirk -----Original Message----- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 7:48 AM To: 'Martin Skjöldebrand'; [EMAIL PROTECTED] Subject: [PHP] RE: Value of if(isset(X)) problem I think you'll find that cmdFinish is only passed through if the form is submitted by pressing the button. Hitting return on any other field will submit the form without sending cmdFinish. > -----Original Message----- > From: Martin Skjöldebrand [mailto:[EMAIL PROTECTED]] > Sent: 07 March 2001 05:34 > To: [EMAIL PROTECTED] > Subject: Value of if(isset(X)) problem > <input type="submit" value="Modify client" name="cmdFinish">
hi! I'm having some trouble with this. If i use an ftp address out of some reason I'm unable to read the file(although I get a handle).(ftp server supports passive mode) And if I use http(without authorisation) the browser still asks if I want to save it.(even if I use video/mpeg as Content-Type) and still displays the name of my php script instead of the mpeg when asking what I want to do. If I choose save it then displays the right filename. Thanks Thorsten Mukul Sabharwal <[EMAIL PROTECTED]> schrieb in im Newsbeitrag: [EMAIL PROTECTED] > Hey, > > Well sure there is: > > $fp = fopen($filename, 'r') or die('damn'); > $read = fread($fp, filesize($filename)) or > die('damn'); > $filestr = basename($filename); > > header("Content-Disposition: attachment; > filename=$filestr"); > header("Content-Type: application/octet-stream"); > > echo $read; > exit; > > Neat And Clean! > > Your authentication can be done above that piece of > code, you then open the file, read it through send the > filename download as $filestr, and the contents > $read. > > Simple!
this will work <?php $array[0]['name'] = 'Chris'; $array[0]['phone'] = '3771095'; $array[0]['year'] = '1978'; $array[0]['addres'] = 'Kamloops, BC'; $array[1]['name'] = 'Breanne'; $array[1]['phone'] = '3766350'; $array[1]['year'] = '1977'; $array[1]['addres'] = 'Kamloops, BC'; $array[2]['name'] = 'Dusty'; $array[2]['phone'] = '5541120'; $array[2]['year'] = '1982'; $array[2]['addres'] = 'Kamloops, BC'; // sort by ? foreach ($array as $pos => $val) $tmp_array[$pos] = $val['year']; asort($tmp_array); // display however you want foreach ($tmp_array as $pos => $val) echo $array[$pos]['name'] ."<br>\n"; ?> -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""Zenith"" <[EMAIL PROTECTED]> wrote in message 9844ps$qi2$[EMAIL PROTECTED]">news:9844ps$qi2$[EMAIL PROTECTED]... IF: $2D[] = array ( 'name'=>"Jacky", 'year'=>"2001", 'tel'=>"982736", 'gender'=>"Male" ); $2D[] = array ( 'name'=>"Jessica", 'year'=>"1999", 'tel'=>"349291", 'gender'=>"Felmale" ); How can I sort the array by 'name' or 'year', or other key efficiently? -- 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 am working on a site using PHP (obviously) and PostgreSQL. I am > currently using the oid as a key on a table. I would like to return the > user to the same record after INSERTing it, but I cannot figure out how > to get the oid of the record after doing an INSERT. Ideally, I would > like something like: > > So, how do I insert a new record into the database, and get the oid of > the record I just inserted? > See http://www.php.net/manual/en/function.pg-getlastoid.php Hope this helps, Joe
I'm using PostgreSQL for session storage. I forgot to unset session vars occasionally, so I wrote a little script to view sessions and its contents. If you are using DB for session, how about write a little script to view session? It will be very helpful to debug session related problems. If you are using file as session storage, you can view session files to view contents of sessions. Anyway, you have $HTTP_SESSION_VARS, right? You might need to unset the array also, since track-vars will be always enabled with PHP4. I thought session_unregister(), unregister and unset() from globals($GLOBAL) and $HTTP_SESSION_VARS. (I don't register globals, so I'm not sure about this. Anyone?) > Thanks for the suggestion, I tried that and it still doesn't seem to be > working. > Here's what i've got so far on my page (index.php). > > <?PHP > if(session_is_registered("CUserName")) > { > session_destroy(); > unset($CUserName); > header("Location: $PHP_SELF"); By the way, Location header requires absolute URI. Most browser works with relative URI, though. Regards, --- Yasuo Ohgaki > } > else > { > session_register("CUserName"); > $CUserNameSession="CUserName"; > } > //SNIP > ?> > > Hope you can see something I don't. Thanks, > Mike > > On Tue, 6 Mar 2001, trogers wrote: > > > > > Hi > > You will need to kill the session data on the exit of your failed login not > > on entry to the login page as the data will already be overwritten by the > > previous session value. > > I use > > unset($name); > > unset($password); > > ... > > > > Tom > > > > > > At 04:24 PM 6/03/01 +0900, Yasuo Ohgaki wrote: > > >Do you use custom session handlers? > > >Try session_unset() also. It may help. > > > > > >Regards, > > >Yasuo Ohgaki > > > > > > > > > > Got a problem with sessions. > > > > > > > > On my index page, there's a place for people to login. Well, when I test > > > > with two different user names (ie: mike and jlo) it reverts to the first > > > > one when login fails. For example: > > > > I enter in the username "myuen" and a wrong password. I get my > > > > "Password/Username invalid" message which is what I want. > > > > > > > > The page refreshes, the username slot already has myuen in it from the > > > > last entry, I erase it, enter in a new username "jlo" and the correct > > > > password and it will not log me in. > > > > > > > > I know once you attempt to login, it saves the username as a session > > > > variable. On my index.php page, I have a script that checks if a session > > > > exists (particularly the Username), if it exists, destroy it otherwise, > > > > continue on. Obviously it's not destroying it once we enter in a wrong > > > > username and try to login again. > > > > > > > > Any ideas on how to fix this? > > > > > > > > Here's my coding: > > > > <?PHP > > > > if(session_is_registered("CUserName")) > > > > session_destroy(); > > > > > > > > session_register("CUserName"); > > > > $CUserNameSession="CUserName"; > > > > > > > > //SNIP > > > > ?> > > > > > > > > >-- > > >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] > > > > > >
Hello all, I would like to check some names ( @ seperated strings) with this global $PHP_AUTH_USER I first do $arrLoginName = explode("@", $row->usr_loginName); How can I construct a loop which stops and returns true if a match is found? Any hints would be great. Many thanks Roland
Rol wrote: > > Hello all, > > I would like to check some names ( @ seperated strings) with this global >$PHP_AUTH_USER > > I first do > $arrLoginName = explode("@", $row->usr_loginName); > > How can I construct a loop which stops and returns true if a match is found? > > Any hints would be great. > > Many thanks > > Roland This will do it: $dim = sizeof($arrLoginName); for ($nr = 0; $nr < $dim; $nr++) { if (match) { return 1; } } Greetings, Jason -- Jason Murray Developer http://www.jwebmedia.com/ 1 877 525 jWEB
<?php function check() { $arrLoginName = explode("@", $row->usr_loginName); foreach($arrLoginName as $pos => $val) if (match) return 1; return ; } ?> is this what you mean? please post regarding. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""Rol"" <[EMAIL PROTECTED]> wrote in message 002301c0a726$615218e0$[EMAIL PROTECTED]">news:002301c0a726$615218e0$[EMAIL PROTECTED]... Hello all, I would like to check some names ( @ seperated strings) with this global $PHP_AUTH_USER I first do $arrLoginName = explode("@", $row->usr_loginName); How can I construct a loop which stops and returns true if a match is found? Any hints would be great. Many thanks Roland
Hello again, I'd better explain better. I have logon screen Header("WWW-Authenticate: Basic realm=\"whatever\""); where I would like the compare the user name $PHP_AUTH_USER with the one in my database All names like Mike or mike are @ seperated strings How can I check the names from this array $arrLoginName = explode("@", $row->usr_loginName) and return true if a name in the var $arrLoginName == $PHP_AUTH_USER How can I construct a loop which stops and returns true if a match is found? Any hints would be great. Many thanks Roland
Hello everyone- I was wondering if anyon has gotten PHP to call a Java class in a Unix enviroment? If so what are your settings in the php.ini file etc. Thanks for any help! Jay Paulson
I'd like to parse a html file in much the same way the xml parser works. Ie calling a method for every tag encountered and so on. The xml parsing methods don't seem to be forgiving enough for much of the html that's out there. For example, many html files have tags like this: <TABLE border=0> but xml_parse() will choke on it because there are no quotes around the "0". Also html tags are, in practice, case insensitive, so this is found in many html documents: <B>This is bold</b> but xml_parse() doesn't like it because it expects the opening and closing tags to be same-case. Are there other functions or libraries I'm not aware of that help in parsing html? Or some options in xml_parse to get by these problems? Thanks in advance. Nate
Try here to take care of problems.. http://www.w3.org/People/Raggett/tidy/ Chad -----Original Message----- From: Nathaniel Hekman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 10:57 AM To: '[EMAIL PROTECTED]' Subject: [PHP] parsing html / xml I'd like to parse a html file in much the same way the xml parser works. Ie calling a method for every tag encountered and so on. The xml parsing methods don't seem to be forgiving enough for much of the html that's out there. For example, many html files have tags like this: <TABLE border=0> but xml_parse() will choke on it because there are no quotes around the "0". Also html tags are, in practice, case insensitive, so this is found in many html documents: <B>This is bold</b> but xml_parse() doesn't like it because it expects the opening and closing tags to be same-case. Are there other functions or libraries I'm not aware of that help in parsing html? Or some options in xml_parse to get by these problems? Thanks in advance. Nate -- 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 can easily send standard email messages via PHP. Does anyone know how to send SMS messages? -- Michael A. Smith <[EMAIL PROTECTED]> Director of Data Systems, wcities.com ICQ: 35884415 :wq
Errrm, no easy solution. You should either find an SMS gateway connection that can receive formatted emails, convert them and post them (at a charge to you), or go the whole hog and get yourself a connection to an SMSC via http. I would suggest you pursue the first approach as the second is only viable if you're intending to set yourself up as an SMS business. As an example, check out http://www.cygnet.co.uk/sms/ I've never used this company, but they're the first one I clicked on after searching for EMAIL SMS GATEWAY Hope this helps, Neil -----Original Message----- From: Michael Smith [mailto:[EMAIL PROTECTED]] Sent: 07 March 2001 17:00 To: [EMAIL PROTECTED] Subject: [PHP] sending SMS messages via PHP I can easily send standard email messages via PHP. Does anyone know how to send SMS messages? -- Michael A. Smith <[EMAIL PROTECTED]> Director of Data Systems, wcities.com ICQ: 35884415 :wq -- 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 can easily send standard email messages via PHP. Does anyone know how to > send SMS messages? Send them as an email too, most tele companies have the possibility for that option (atleast here in denmark) -- Henrik Hansen
Here's another case that shows up often in html, but is illegal in xml, that I would need to parse: meta tags, <p> tags, <hr> tags, and other "singletons". <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> </HEAD> xml_parse would give an error, because the HEAD block is being closed with a still-open META "block". Nate -----Original Message----- From: Nathaniel Hekman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 9:57 AM To: '[EMAIL PROTECTED]' Subject: [PHP] parsing html / xml I'd like to parse a html file in much the same way the xml parser works. Ie calling a method for every tag encountered and so on. The xml parsing methods don't seem to be forgiving enough for much of the html that's out there. For example, many html files have tags like this: <TABLE border=0> but xml_parse() will choke on it because there are no quotes around the "0". Also html tags are, in practice, case insensitive, so this is found in many html documents: <B>This is bold</b> but xml_parse() doesn't like it because it expects the opening and closing tags to be same-case. Are there other functions or libraries I'm not aware of that help in parsing html? Or some options in xml_parse to get by these problems? Thanks in advance. Nate -- 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 Wed, Mar 07, 2001 at 10:07:37AM -0700, Nathaniel Hekman wrote: > Here's another case that shows up often in html, but is illegal in xml, that > I would need to parse: meta tags, <p> tags, <hr> tags, and other > "singletons". > > <HEAD> > <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> > </HEAD> > > xml_parse would give an error, because the HEAD block is being closed with a > still-open META "block". Within the context of parsing HTML as XML, there's not really much that can be done. I suppose you could pre-proces the HTML to make it XML-complaitn, but that's probably more trouble than I would go to. You're not going to find an XML parser that allows for most HTML, because if such a parser did exist, it would be a broken XML parser. :) The only kind of HTML you can reliably parse with XML parsers is the XHTML variety (Which is simply HTML4, made XML-compliant) Matt
Matt McClanahan wrote: [...] > You're not going to find an XML parser that allows for most HTML, > because if such a parser did exist, it would be a broken XML parser. :) [...] Fair enough, and that's as I expected. So that brings me to the second part of my question: is there any php library that allows parsing of html? Perhaps I'll have to write one myself. All I want really is something that parses a bunch of text and calls handlers whenever tags are encountered. Just like xml_parse, except I don't care if tags are out of order, I don't care about case, and I don't care if there is a close tag for every open. If anyone knows of a package that does this, please advise. If anyone else would be interested in this, let me know and I could post my code when I'm done (if I have to do this myself). Nate
Apologies in advance for the cross posting, but I imagine this issue affects several users here. I'm not on the general PHP mailing list, so please cc me off-list if you have any comments. So ... I just spent the last 2 days tracking down a bug in my own authentication class. Since my class was kinda based on PHPLIB, this may affect PHPLIB users too. What happens is that when I go to one of my protected pages, the server sends a "Location:" header to redirect to the login form. The login form then POSTS to the protected page again ... which includes the auth code, and either redirects to the login form again (for failed user/pass combos) or continues on for successful authentication. Basically, your standard session-based auth process. What seemed to be happening if I visited the site using Netscape 6, was that all the pages were being served by the server (logs verify this), but the browser wasn't "refreshing" with the new location. I say "refreshing", because if I did a view source, I could actually see the source to the protected page, and I was logged in (looking at the session files verified this). However, the browser still showed the login page. Unfortunately, I tried to condense my code into something very simple that reproduced the problem consistantly. Simple code, however, seemed to work. Anyway, to make a long story a bit shorter, a lot of searching on the web revealed a few similar bugs, so I tried adding the following to my Apache conf file, and all seems to be fixed: BrowserMatch "Mozilla/5" nokeepalive This seemed to have been a problem with Netscape 2.x browsers too. I can only guess that when doing a 302 redirect, i.e. Header("Location: ..."), if the page to which you are redirecting is too big, then Netscape 6.x seems to receive all the data but not refresh the browser window to display the new data. This is more of a NS6/Mozilla bug than anything else. Just thought it might affect anyone here using session-based authentication. -- Colin Viebrock Co-Founder, easyDNS Technologies Inc. http://www.easyDNS.com/
I have news webpage of sorts that pulls entries out of a mysql database. There is a form to submit news and it is automatically added to the new page upon submition. What I am wandering is when a individual submits news, the end result on my news page does not hold the same format it was put in. For example. IN the "add news form" they enter the info in like this: ---------------------------------------------------------------------- This is a test. How are you today. Laddi da, Laddi da ------------------------------------------------------------------------------ The output on the news page comes as: ------------------------------------------------------------------------ This is a test. How are you today.Laddi da, Laddi da ------------------------------------------------------------------------ Is there a way between php and mysql to ensure that format of the date is same going in and out? Thank you in advance:) Sono
You need to do a str_replace() on any fields that need to have breaks in them. Try something like this: echo str_replace ("\n", "<BR>", $fieldvariable) 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 > IN the "add news form" they enter the info in like this: > ---------------------------------------------------------------------- > This is a test. > > How are you today. > Laddi da, Laddi da > -------------------------------------------------------------- > ---------------- > > The output on the news page comes as: > -------------------------------------------------------------- > ---------- > This is a test. How are you today.Laddi da, Laddi da > -------------------------------------------------------------- > ---------- > > Is there a way between php and mysql to ensure that format of > the date is > same going in and out?
or you could just call the nl2br() function to do the same thing... Jay Paulson Developer, Web Technologies Viatel, Inc. -----Original Message----- From: Hoover, Josh [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 11:22 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] Text and formating You need to do a str_replace() on any fields that need to have breaks in them. Try something like this: echo str_replace ("\n", "<BR>", $fieldvariable) 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 > IN the "add news form" they enter the info in like this: > ---------------------------------------------------------------------- > This is a test. > > How are you today. > Laddi da, Laddi da > -------------------------------------------------------------- > ---------------- > > The output on the news page comes as: > -------------------------------------------------------------- > ---------- > This is a test. How are you today.Laddi da, Laddi da > -------------------------------------------------------------- > ---------- > > Is there a way between php and mysql to ensure that format of > the date is > same going in and out?
nl2br -- Inserts HTML line breaks before all newlines in a string http://php.net/manual/en/function.nl2br.php -Brian > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 07, 2001 12:09 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Text and formating > > > > I have news webpage of sorts that pulls entries out of a mysql database. > > There is a form to submit news and it is automatically added to the new > page upon submition. > > What I am wandering is when a individual submits news, the end result on > my news page does not hold the same format it was put in. For > example. > > IN the "add news form" they enter the info in like this: > ---------------------------------------------------------------------- > This is a test. > > How are you today. > Laddi da, Laddi da > ------------------------------------------------------------------ > ------------ > > The output on the news page comes as: > ------------------------------------------------------------------------ > This is a test. How are you today.Laddi da, Laddi da > ------------------------------------------------------------------------ > > Is there a way between php and mysql to ensure that format of the date is > same going in and out? > > Thank you in advance:) > Sono > > > > > -- > 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 want ease the authentication process of the users on my network.. Now, here is the problem.. I have a php script that re-directs to another company's page.. In that page, there is a link to go forward, but that link has a session id in it, that is dynamically generated when the page is called.. What I need is the contents of that link, is there any way to grab it? What I need is the contents of that dynamic link since it has a session id.. So, for example.. test.php -> othercompany.html -> dynamic link from other company.html Thanks..
you mean you want the url ? $HTTP_REFERER This variaable is set by the client's browser though, this means it may not be set at all, or could be forged. you will have to check against this. I dont think this is what you mean though, email me I'll see what I can do. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] "Ashwin Kutty" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I want ease the authentication process of the users on my network.. Now, here is the problem.. I have a php script that re-directs to another company's page.. In that page, there is a link to go forward, but that link has a session id in it, that is dynamically generated when the page is called.. What I need is the contents of that link, is there any way to grab it? What I need is the contents of that dynamic link since it has a session id.. So, for example.. test.php -> othercompany.html -> dynamic link from other company.html 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]
I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: --------------------- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 ---- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2
suppy a code snippit and I would have a huge advantage here, but I'll swing in the dark on this ok. your looping all this in a for/while/foreach loop right. your generating the body like this ? foreach($people as $pos => $val) { $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } right ? change it to this. foreach($people as $pos => $val) { $email_body = ''; $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } now good change im out to lunch here, but sithout a code snippit im grabing here. please post regarding, thank you. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""WreckRman2"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: --------------------- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 ---- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 -- 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]
Thanks, I should have drop a code snippet in there... My problem was the .= -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] email with multiple records suppy a code snippit and I would have a huge advantage here, but I'll swing in the dark on this ok. your looping all this in a for/while/foreach loop right. your generating the body like this ? foreach($people as $pos => $val) { $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } right ? change it to this. foreach($people as $pos => $val) { $email_body = ''; $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } now good change im out to lunch here, but sithout a code snippit im grabing here. please post regarding, thank you. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""WreckRman2"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: --------------------- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 ---- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 -- 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]
Embarrassing, isn't it? Do you have a loop building messages, with something like $msgbody .= $data_to_send THat little " . " caught me. I was emailing usernames and passwords -- fortunately it was an obvious error. Miles At 01:22 PM 3/7/01 -0500, WreckRman2 wrote: >I wrote a small script like a email list only when I run it with 3 emails. >The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd >and 1st. Why is it doing this? > > David Smith > >Number 3 record gets email with: >--------------------- > >Hi [EMAIL PROTECTED], > >Your email is [EMAIL PROTECTED] > > Bye, WreckRman2 > >--- > >Hi [EMAIL PROTECTED], > >Your email is [EMAIL PROTECTED] > > Bye, WreckRman2 > >---- > >Hi [EMAIL PROTECTED], > >Your email is [EMAIL PROTECTED] > > Bye, WreckRman2 > > >-- >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'm using PHP-4.0.4pl1, and I'm trying to using the odbc_error/odbc_erromsg functions, but this are only availabe on the CVS tree! Before I set up a cvs client download the fonts and try to compile it, I'm willing to know if there is a new version soon to be released? Or if the above odbc functions are working in the CVS tree? thanks in advance, Antonio. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Antonio S. Martins Jr. - System Analist | "Only The Shadow Knows | | WorldNet Internet Maringa - PR - Brasil | what evil lurks in the | | E-Mail: [EMAIL PROTECTED] | Heart of Men!" | | [EMAIL PROTECTED] | !!! Linux User: 52392 !!! | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This e-mail message is 100% Microsoft free! /"\ \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL / \
> Hi, > > I'm using PHP-4.0.4pl1, and I'm trying to using the > odbc_error/odbc_erromsg functions, but this are only availabe on the CVS > tree! Before I set up a cvs client download the fonts and try to compile > it, I'm willing to know if there is a new version soon to be released? Or > if the above odbc functions are working in the CVS tree? take a look at www.php4win.de fro bleeding edge versions of the php dist (also including many more precompiled modules) -- Henrik Hansen
On Wed, 7 Mar 2001, Henrik Hansen wrote: > > I'm using PHP-4.0.4pl1, and I'm trying to use the > > odbc_error/odbc_erromsg functions, but this are only availabe on the CVS > > tree! Before I set up a cvs client download the fonts and try to compile > > it, I'm willing to know if there is a new version soon to be released? Or > > if the above odbc functions are working in the CVS tree? > > take a look at www.php4win.de fro bleeding edge versions of the php dist > (also including many more precompiled modules) Thanks for the URL Henrik, but I'm finding a linux dist :) My odbc functions are used on a linux box to access DB2/AIX :) thanks for the atention Antonio. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Antonio S. Martins Jr. - System Analist | "Only The Shadow Knows | | WorldNet Internet Maringa - PR - Brasil | what evil lurks in the | | E-Mail: [EMAIL PROTECTED] | Heart of Men!" | | [EMAIL PROTECTED] | !!! Linux User: 52392 !!! | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This e-mail message is 100% Microsoft free! /"\ \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL / \
> Thanks for the URL Henrik, but I'm finding a linux dist :) My odbc > functions are used on a linux box to access DB2/AIX :) sorry, well for linux do this: compile compile compile :) -- Henrik
this message is preferencially for brazillian developers: Procuro programador php de nível intermediário a avançado para parceria de elaboração de projeto de médio a grande porte. Requisitos: - morar em Porto Alegre/RS ou grande POA; - conhecimentos de nível médio a avançado em php 3 ou 4+, mysql e/ou interbase. - disponibilidade e flexibilidade de horário Por favor, reply para esta msg somente se atender TODOS os requisitos acima. Obrigado. Wagner. ______________________________ Wagner Nunes [EMAIL PROTECTED]
Ok here is my code... I have another question too. How can I include in the email a variable placed in the textarea of the form. Example: Hi your email is $email. and it would add the variable in each email and not show $email as plain text. Also open to any code suggestions as I am still new to php. <?php $connection = mysql_connect ("localhost", "root", "*****"); if ($connection == false){ echo mysql_errno().": ".mysql_error()."<BR>"; exit; } mysql_select_db("indywebdesign",$connection); if ($submit) { $sql = "SELECT * FROM email"; $result = mysql_query($sql); while ($myrow = mysql_fetch_array($result)) { $email = $myrow["email"]; $recipient = "$email <$email>"; $subject = "$subject"; $message = "$message"; $headers = "From: David Smith <[EMAIL PROTECTED]>\n"; mail($recipient, $subject, $message, $headers); echo "Message Sent to $email!<BR>"; } } else { ?> <form method="post" action="<?php echo $PHP_SELF?>"> <INPUT TYPE="text" NAME="subject"> <TEXTAREA NAME="message" ROWS="5" COLS="30"></TEXTAREA> <input type="Submit" name="submit" value="Edit Information"> </form> <?php } ?> -----Original Message----- From: David Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 1:49 PM To: Chris Lee; [EMAIL PROTECTED] Subject: RE: [PHP] email with multiple records Thanks, I should have drop a code snippet in there... My problem was the .= -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] email with multiple records suppy a code snippit and I would have a huge advantage here, but I'll swing in the dark on this ok. your looping all this in a for/while/foreach loop right. your generating the body like this ? foreach($people as $pos => $val) { $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } right ? change it to this. foreach($people as $pos => $val) { $email_body = ''; $email_body .= 'name is '. $people[$pos]['name'] ."\n"; $email_body .= 'email is '. $people[$pos]['email'] ."\n"; $email_body .= 'phone is '. $people[$pos]['phone'] ."\n"; mail($email_to, $email_body, $email_from); } now good change im out to lunch here, but sithout a code snippit im grabing here. please post regarding, thank you. -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 [EMAIL PROTECTED] ""WreckRman2"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script like a email list only when I run it with 3 emails. The first record gets his info, 2nd get his plus first, 3rd get his plus 2nd and 1st. Why is it doing this? David Smith Number 3 record gets email with: --------------------- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 --- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 ---- Hi [EMAIL PROTECTED], Your email is [EMAIL PROTECTED] Bye, WreckRman2 -- 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]
Hi, Has anyone here dealt with the new Interbase 6.0 License? The web site says it is a free download for development, but I can't find any info about commercial use, and their sales office doesn't seem to know either, and they haven't called back yet. Anyone know what the commercial license is? Is it still free? Thanks, Chris
Both the binary and source distros are available on the website. I beleive Interbase has gone open source. http://www.borland.com/interbase/ Chad -----Original Message----- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 1:23 PM To: php Subject: [PHP] Interbase Hi, Has anyone here dealt with the new Interbase 6.0 License? The web site says it is a free download for development, but I can't find any info about commercial use, and their sales office doesn't seem to know either, and they haven't called back yet. Anyone know what the commercial license is? Is it still free? Thanks, Chris
you might try www.ibphoenix.com as they have more info (than the Borland site) regarding InterBase. Brett ""Chris"" <[EMAIL PROTECTED]> wrote in message 03fd01c0a73c$15183c00$01c8c8c8@ibcserver">news:03fd01c0a73c$15183c00$01c8c8c8@ibcserver... Hi, Has anyone here dealt with the new Interbase 6.0 License? The web site says it is a free download for development, but I can't find any info about commercial use, and their sales office doesn't seem to know either, and they haven't called back yet. Anyone know what the commercial license is? Is it still free? Thanks, Chris
Chad is right. Interbase 6.0 is already a free DB software. go to www.borland.com e get it freely. []'s ______________________________ Wagner Nunes [EMAIL PROTECTED] > ----- Original Message ----- > From: "Angerer, Chad" <[EMAIL PROTECTED]> > To: "'Chris'" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]> > Sent: Wednesday, March 07, 2001 4:28 PM > Subject: RE: [PHP] Interbase > > > > Both the binary and source distros are available on the website. I > beleive > > Interbase has gone open source. > > > > http://www.borland.com/interbase/ > > > > Chad > > > > -----Original Message----- > > From: Chris [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 07, 2001 1:23 PM > > To: php > > Subject: [PHP] Interbase > > > > > > Hi, > > Has anyone here dealt with the new Interbase 6.0 License? > > The web site says it is a free download for development, but I can't find > > any info about commercial use, and their sales office doesn't seem to know > > either, and they haven't called back yet. > > > > Anyone know what the commercial license is? Is it still free? > > > > Thanks, > > 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] > > >
I posted a related question yesterday with no response. I've done some more investigating and think I can lay some of the blame on the string concatentation operation. If anyone can tell me what might be causing this behavoir I would greatly appreciate it. the following code shows the rough form of what I am doing.... for ($i=0;$i<100;$i++) { $returnVal = "\t<TR>\n"; $returnVal .= "\t\t<TD><FORM><INPUT TYPE=\"HIDDEN\" NAME=\"name\" VALUE=\"$i\">\n"; $returnVal .= "\t\t\t<INPUT TYPE=\"SUBMIT\" VALUE=\"Do it\"> </FORM> </TD>\n"; <snip -- other similar cells being created> $returnVal .= "\t</TR>"; $returnValArray[$i]=$returnVal; } return $returnValArray; --- Problem description: Some rows are corrupted. The type of corruption that occur are a) an incomplete row is in $returnVal before assignment to the array, the incomplete row is always stopped partway through the addition of a string, ie "ABC"."DEF"->"ABCD" sometimes b) a doubled row. The initial $returnVal assignment is skipped causing two iterations throuhg the for loop to build up on the returnVal variable. c) unknown. in some cases, after the assignment of $returnVal to $returnValArray[$i] the array version will be corrupted while the originl is not. What is happening here? As mentioned this problem only materializes on an older machine (P133 with 64MB ram) not on the development machine (PIII700 with 128MB). The productio server runs AOLServer while the development server runs Apache. Eric Nielsen -------------------------------------------------------------------- Mail2Web - Check your email from the web at http://www.mail2web.com/ .
I am trying to write a script which allows you to build a PHP mailto form online, but I am stuck if you go to www.wisemonkeydesign.co.uk/wise/mailto.htm after step 3 when you have to create, ho do I pass the HTML code and names of the fiels into the next page. for instance the user has choosen three fields and a text area and if you look at the source on step three <input type="text" name="???????"> <input type="text" name="???????"> <input type="text" name="???????"> <textarea name="?????" cols="??" rows="??"></textarea> how do I transfer that code into the form.It would be easy enough if there was a set number of fields. TIA george
Try using an array, such as name[], with NO SUBSCRIPT, to store the chosen items. That will be passed as a form variable and can be stepped through on the next page where you can parse step through the array and create the form. You could probably do this all in the same form, setting variables which will control the generation of HTML, thereby controlling the display. Miles Thompson At 08:43 PM 3/7/01 +0000, george wrote: >I am trying to write a script which allows you to build a PHP mailto form >online, but I am stuck > > if you go to www.wisemonkeydesign.co.uk/wise/mailto.htm >after step 3 when you have to create, >ho do I pass the HTML code and names of the fiels into the next page. > for instance the user has choosen three fields and a text area >and if you look at the source on step three > <input type="text" name="???????"> ><input type="text" name="???????"> ><input type="text" name="???????"> ><textarea name="?????" cols="??" rows="??"></textarea> > >how do I transfer that code into the form.It would be easy enough if there >was a set number of fields. > > >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]
not really sure I understand, but what I want to do is take the HTML generated in step 3 and place it between the <form> tags in the last page where the code is displayed ie <td>Title</td><td> mr</strong><input type=radio name=title value=mr checked> mrs</strong><input type=radio name=title value=mrs> Miss</strong><input type=radio name=title value=miss><br></td></tr><td>name</td><td><input type=text name=name></td></tr><tr><td>address</td><td><input type=text name=address></td></tr><td>address2</td><td><input type=text name=address2></td></tr><td valign="top">message</td><td><textarea name="message" cols= rows=></textarea></td></tr> that is the code from step 3 how do I get that to display on the next page. TIA george
Hello, I'm interested in the technology "Remote Scripting". Basically, I would like to deliver "real-time" information to a browser without having to reload the page. Is anyone familiar with this? Thanks, Karl
Karl, Check the archives, if you haven't done so already. I think this was already discussed in the last week of February, although not under the same heading as yours. Miles At 02:05 PM 3/7/01 -0700, Karl J. Stubsjoen wrote: >Hello, > >I'm interested in the technology "Remote Scripting". Basically, I would >like to deliver "real-time" information to a browser without having to >reload the page. > >Is anyone familiar with this? > >Thanks, > >Karl > > >-- >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]
Hey folks. I have another htaccess question. I have an entire folder set up to require authentication. It's in an htaccess file, not in each page. I was sure that the variable that's passed from the authentication dialog was $PHP_AUTH_USER, but it's not working when I use that in a query. Anyone got ideas? I'd paste my code, but when that wasn't working, I changed it back to hardcoded values. :) Jason
Try this: <? echo ($HTTP_SERVER_VARS["PHP_AUTH_USER"]); ?> -----Original Message----- From: Jason Jacobs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 4:09 PM To: [EMAIL PROTECTED] Subject: [PHP] htaccess Hey folks. I have another htaccess question. I have an entire folder set up to require authentication. It's in an htaccess file, not in each page. I was sure that the variable that's passed from the authentication dialog was $PHP_AUTH_USER, but it's not working when I use that in a query. Anyone got ideas? I'd paste my code, but when that wasn't working, I changed it back to hardcoded values. :) Jason -- 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]
At 3:28 PM -0600 3/7/01, Jacky wrote: >Hi people >I got problem of how to assign session value in php3. As far as I >know, all syntax in manual talks about php4 syntax only. How am I >going to do that? >best In PHP3, you'll have to create your own session functions, or use a library like PHPLIB (phplib.netuse.de). -steve >Jack >[EMAIL PROTECTED] >"There is nothing more rewarding than reaching the goal you set for yourself" -- +--- "They've got a cherry pie there, that'll kill ya" ------------------+ | Steve Edberg University of California, Davis | | [EMAIL PROTECTED] Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | +-------------------------------------- FBI Special Agent Dale Cooper ---+
I know this was on the list yesterday, but I for some reason erased it. I have an online form that I would like to have record the time submitted and recorded into a MySQL date field, how the hell do I use the date and mktime functions to make the date compatible with the MySQL 0000-00-00 format? Jerry Lake - [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: george [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 1:51 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] passing variables again not really sure I understand, but what I want to do is take the HTML generated in step 3 and place it between the <form> tags in the last page where the code is displayed ie <td>Title</td><td> mr</strong><input type=radio name=title value=mr checked> mrs</strong><input type=radio name=title value=mrs> Miss</strong><input type=radio name=title value=miss><br></td></tr><td>name</td><td><input type=text name=name></td></tr><tr><td>address</td><td><input type=text name=address></td></tr><td>address2</td><td><input type=text name=address2></td></tr><td valign="top">message</td><td><textarea name="message" cols= rows=></textarea></td></tr> that is the code from step 3 how do I get that to display on the next page. 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]