Re: [PHP] Advantages of php
On Sat, 17 Nov 2001, Jason G. wrote: You could check the list archives... This question flys by every week or two... Thanks, but browsing is one thing I am still to get used to :) I like things in my mail box. Adrian -Jason Garber IonZoft.com At 01:41 PM 11/17/2001 +0530, Adrian D'Costa wrote: Hi, Is there somewhere on the PHP site that give a list of advantages, speed, etc in comparsion with other similar programs. I have a client that is in ASP and would like to move to PHP and need this info. Thanks Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Advantages of php
Hi, Is there somewhere on the PHP site that give a list of advantages, speed, etc in comparsion with other similar programs. I have a client that is in ASP and would like to move to PHP and need this info. Thanks Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Fri, 2 Nov 2001, David Robley wrote: What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian To do the cgi compile, use all the configure values you need EXCEPT anything apache related. The compile will produce an executable called, strangely, php. Will it work with apache then? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] sending email to php script
On Thu, 1 Nov 2001, Jason Murray wrote: You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Mon, 29 Oct 2001, David Robley wrote: On Sat, 27 Oct 2001 03:23, JSheble wrote: A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? You say sendmail, so do it thusly: Edit /etc/aliases and add a line like phpmail: | /pathto/your/php/script and run newaliases to update your alias database. Actually, I am still trying to figure this out when I get time. What I did was: phpmail: | lynx -dump /pathto/your/php/script But the problem is nothing appears to be capture in the script. Or rather in what format does this mail arrive. I even tried to write it to a file but nothing is written. You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: images no appearing
My local gd version is 1.6.2 or higher, online check the link vvmm.net/phpinfo.php Adrian On Tue, 2 Oct 2001, Richard Lynch wrote: Older versions of GD will do GIF, but not JPEG, and vice versa... What versions of GD are on the two servers? -- WARNING [EMAIL PROTECTED] address is an endangered species -- Use [EMAIL PROTECTED] Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] Newsgroups: php.general To: php general list [EMAIL PROTECTED] Sent: Monday, September 24, 2001 12:05 AM Subject: images no appearing Hi, I wrote a php script to create a dynamic graph (image/jpeg). On my development system the image appears on my website it gives Image/Jpeg support not compiled. Below are the config settings: My system: Configure Command ^@ './configure' '--prefix=/usr' ^@'--with-config-file-path=/etc' '--disable-debug' ^@'--enable-pic' '--enable-inline-optimization' ^@'--enable-sockets' '--with-apxs=/usr/sbin/apxs' ^@'--disable-static' '--with-exec-dir=/usr/bin' ^@'--with-regex=system' '--with-gd' ^@'--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' ^@'--enable-debugger' '--enable-magic-quotes' ^@'--enable-safe-mode' '--enable-track-vars' ^@'--enable-ftp' '--with-mysql' '--with-xml' ^@'--enable-trans-sid' ^@'--with-readline=/usr/include/readline' My webserver the info can be got from vvmm.net/phpinfo.php. They my provider has given --with-jpeg-dir=/usr/lib still the image does not appear. Even in the gd section it does not give JPG Support enabled. Only give. Right now I have changed the program to work with gif. My question, why not Jpg?? Adrian -- 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] images no appearing
Hi, I wrote a php script to create a dynamic graph (image/jpeg). On my development system the image appears on my website it gives Image/Jpeg support not compiled. Below are the config settings: My system: Configure Command ^@ './configure' '--prefix=/usr' ^@'--with-config-file-path=/etc' '--disable-debug' ^@'--enable-pic' '--enable-inline-optimization' ^@'--enable-sockets' '--with-apxs=/usr/sbin/apxs' ^@'--disable-static' '--with-exec-dir=/usr/bin' ^@'--with-regex=system' '--with-gd' ^@'--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' ^@'--enable-debugger' '--enable-magic-quotes' ^@'--enable-safe-mode' '--enable-track-vars' ^@'--enable-ftp' '--with-mysql' '--with-xml' ^@'--enable-trans-sid' ^@'--with-readline=/usr/include/readline' My webserver the info can be got from vvmm.net/phpinfo.php. They my provider has given --with-jpeg-dir=/usr/lib still the image does not appear. Even in the gd section it does not give JPG Support enabled. Only give. Right now I have changed the program to work with gif. My question, why not Jpg?? Adrian -- 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] images no appearing
Hi, I wrote a php script to create a dynamic graph (image/jpeg). On my development system the image appears on my website it gives Image/Jpeg support not compiled. Below are the config settings: My system: Configure Command ^@ './configure' '--prefix=/usr' ^@'--with-config-file-path=/etc' '--disable-debug' ^@'--enable-pic' '--enable-inline-optimization' ^@'--enable-sockets' '--with-apxs=/usr/sbin/apxs' ^@'--disable-static' '--with-exec-dir=/usr/bin' ^@'--with-regex=system' '--with-gd' ^@'--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' ^@'--enable-debugger' '--enable-magic-quotes' ^@'--enable-safe-mode' '--enable-track-vars' ^@'--enable-ftp' '--with-mysql' '--with-xml' ^@'--enable-trans-sid' ^@'--with-readline=/usr/include/readline' My webserver the info can be got from vvmm.net/phpinfo.php. They my provider has given --with-jpeg-dir=/usr/lib still the image does not appear. Even in the gd section it does not give JPG Support enabled. Only give. Right now I have changed the program to work with gif. My question, why not Jpg?? Adrian -- 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] Undelivered Mail Returned to Sender (fwd)
-- Forwarded message -- Date: Mon, 24 Sep 2001 08:35:03 +0200 (CEST) From: Mail Delivery System [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Undelivered Mail Returned to Sender This is the Postfix program at host mail.aaz-netmarketing.com. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please send mail to postmaster If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program [EMAIL PROTECTED]: can't create user output file. Command output: procmail: Error while writing to /var/spool/mail/dtt Reporting-MTA: dns; mail.aaz-netmarketing.com Arrival-Date: Mon, 24 Sep 2001 08:35:03 +0200 (CEST) Final-Recipient: rfc822; [EMAIL PROTECTED] Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; can't create user output file. Command output: procmail: Error while writing to /var/spool/mail/dtt Hi, I wrote a php script to create a dynamic graph (image/jpeg). On my development system the image appears on my website it gives Image/Jpeg support not compiled. Below are the config settings: My system: Configure Command ^@ './configure' '--prefix=/usr' ^@'--with-config-file-path=/etc' '--disable-debug' ^@'--enable-pic' '--enable-inline-optimization' ^@'--enable-sockets' '--with-apxs=/usr/sbin/apxs' ^@'--disable-static' '--with-exec-dir=/usr/bin' ^@'--with-regex=system' '--with-gd' ^@'--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' ^@'--enable-debugger' '--enable-magic-quotes' ^@'--enable-safe-mode' '--enable-track-vars' ^@'--enable-ftp' '--with-mysql' '--with-xml' ^@'--enable-trans-sid' ^@'--with-readline=/usr/include/readline' My webserver the info can be got from vvmm.net/phpinfo.php. They my provider has given --with-jpeg-dir=/usr/lib still the image does not appear. Even in the gd section it does not give JPG Support enabled. Only give. Right now I have changed the program to work with gif. My question, why not Jpg?? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Why this error to this newsgroup?
This is the same error I get. The question is why the mails is going to: mail.aaz-netmarketing.com when it should be going to : pb1.pair.com Adrian On Sat, 22 Sep 2001, hvm wrote: Hi I have the same and I don't know if some one even get my questions, I never get a response. Maybe the questions are to difficult. Yours Hans. - Original Message - From: Gaylen Fraley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, September 22, 2001 6:34 PM Subject: [PHP] Why this error to this newsgroup? Every message that I post to news.php.net gets posted, but I receive this email: This is the Postfix program at host mail.aaz-netmarketing.com. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please send mail to postmaster If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program [EMAIL PROTECTED]: can't create user output file. Command output: procmail: Error while writing to /var/spool/mail/dtt -- This just started, I believe, this week. Is there some kind of an auto-responder that isn't working correctly? -- Gaylen [EMAIL PROTECTED] http://www.gaylenandmargie.com PHP KISGB v1.2 Guestbook http://www.gaylenandmargie.com/publicscripts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] some hyper links
Hi, I have two table: policies: id == auto increment, primary key policy topics id == auto increment, primary key topic polid == linked from policies In the policies table I have 72 records in the topics 325. What I am trying to do is to display all the 72 record for the policies table but only put a hyperlink for the ones that have records in the topics table. Any clues. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] R: viewer analysis
On Fri, 14 Sep 2001, GATop wrote: Is there more like that? Like what :) Adrian -- 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] viewer analysis
Hi, I trying to write a php program using mysql to dump the data to capture the following details: 1. From where the viewer is coming. Easy getting the remote address 2. Which file they are viewing. Ok think I can handle this. 3. How long they are on that particlular page? 4. Where did they go from there? 5. When did the leave the site? Can some one tell me how to do it or if someone has done it the link. I will not be using my system logs for this. It will be directly added from the page they visit into a mysql table. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] limiting rows and pages like google
Hi, Thanks. Instead of using next and previous I am giving the page number at the bottom of the page (see lastminute.vvmm.net/nextweek.php). The problem is that if there are, say 35 pages, the page numbers go off the screen. This is the snippet: if ($nopage=$limit) { echo (centertable border=\0\ width=\100%\ tr tdfont face=\Arial\ size=\1\Pagina/td); for($j=1; $j=($nopage); $j++) { //$next = $limit*($j-1); $xi = ($j-1); echo(tdfont face=\Arial\ size=\1\a href=\$PHP_SELF?npage=$xi\[$page[$j]]/a/font /td); } echo( /tr /table/center); } Adrian On Thu, 13 Sep 2001 [EMAIL PROTECTED] wrote: 2 queries is ok imho, but let the database do all the work ;) The first query should be a select count (*) QUERY for a count. The second query should be the actual QUERY. Eg something cut 'n' pasted from some code of mine (not nice, but hey ;) ) -- $db = mysql_connect($db_domain, $db_user,$db_password); mysql_select_db($db_databasename,$db); $sqlwhere = where CuisineID = $CuisineID ; $numresults=mysql_query( select count(*) from restaurants . $sqlwhere); $numrows=mysql_num_rows($numresults); // get results $sqlstring= select ID, Name,LanguageID from restaurants . $sqlwhere . limit $offset,$limit; $result=@mysql_query($sqlstring,$db); //Do stuff with $result... // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } for ($i=1;$i=$pages;$i++) { // loop thru $newoffset=$limit*($i-1); print a href=\$PHP_SELF?offset=$newoffset\$i/a nbsp; \n; } // check to see if last page if (!(($offset/$limit)==$pages) $pages!=1) { // not last page so give NEXT link $newoffset=$offset+$limit; print a href=\$PHP_SELF?offset=$newoffset\NEXT/ap\n; } -Original Message- From: Julian Wood [mailto:[EMAIL PROTECTED]] Sent: September 14, 2001 1:34 AM To: php general list Subject: Re: [PHP] limiting rows and pages like google It's not too hard to do the next/previous through all your results, as has been shown by several people. What is a little trickier, at least when using mysql and trying to take advantage of the limit clause, is how to display how many results you have (ie 1 to 10 of 107 results). If you use the limit, you can't get the total number of rows, without doing a second search sans limit. It's also harder to do the next link, because you don't necessarily know if there are any more rows (imagine you are displaying 10 rows at a time, you are on page 3 and there are 30 total rows). Conversely, if you do a single query without the limit, then you're doing a slower search (limiting a search is way faster), and I'm not sure of the implications of the full result set residing serverside - maybe higher memory requirements. So what do people do to take advantage of limit? Two queries or a single query? Any other solutions? Any more insights on how limit works? Julian On Wednesday, September 12, 2001, at 10:16 PM, Adrian D'Costa wrote: Hi, I am trying to find out the the best way to do the following: I have a script that select records from a table. The problem is that I need to limit the rows to 20. I know that I can use limit 20. But what I want to do is give the view a link to the next 20 till all the records are shown. What I don't know is how to maintain the search query and I want to use the same script. The logic would be to check if the script is called the first time, then the sql statement would be select travel.*, city.city from travel, city where travel.cityid=city.id limit 0,20. The second time or based on what has been selected on the page (1-20, 21-40, etc) add that to the sql statement. My question is how? Can someone guide me or give me some example. TIA Adrian -- 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] -- Julian Wood Programmer/Analyst University of Calgary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mail problem
On Thu, 13 Sep 2001, Peter Houchin Sun Rentals STR Manager wrote: php.ini mail related line: sendmail_path = sendmail -t -i ;for unix only, may supply arguments as well (default is 'sendmail -t -i') I suggest you put the full path in the sendmai path. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] limiting rows and pages like google -- again
On Thu, 13 Sep 2001, Helen wrote: The logic would be to check if the script is called the first time, then the sql statement would be select travel.*, city.city from travel, city where travel.cityid=city.id limit 0,20. The second time or based on what has been selected on the page (1-20, 21-40, etc) add that to the sql statement. My question is how Do you want to list all the pages of posts or just a link to the next 20 items? On the first page, 20 and links to the other items that when selected will display the list based on the selection. One thing to remember is that the ids will not be in squence. Thanks Adrian -- 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] limiting rows and pages like google
Hi, I am trying to find out the the best way to do the following: I have a script that select records from a table. The problem is that I need to limit the rows to 20. I know that I can use limit 20. But what I want to do is give the view a link to the next 20 till all the records are shown. What I don't know is how to maintain the search query and I want to use the same script. The logic would be to check if the script is called the first time, then the sql statement would be select travel.*, city.city from travel, city where travel.cityid=city.id limit 0,20. The second time or based on what has been selected on the page (1-20, 21-40, etc) add that to the sql statement. My question is how? Can someone guide me or give me some example. TIA Adrian -- 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] limiting rows and pages like google -- again
Hi, I am trying to find out the the best way to do the following: I have a script that select records from a table. The problem is that I need to limit the rows to 20. I know that I can use limit 20. But what I want to do is give the view a link to the next 20 till all the records are shown. What I don't know is how to maintain the search query and I want to use the same script. The logic would be to check if the script is called the first time, then the sql statement would be select travel.*, city.city from travel, city where travel.cityid=city.id limit 0,20. The second time or based on what has been selected on the page (1-20, 21-40, etc) add that to the sql statement. My question is how? Can someone guide me or give me some example. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: how do I?
On Thu, 6 Sep 2001, _lallous wrote: onMouseOver=info(?$xline=__LINE__; Dunno, should this be: onMouseOver=info('?$xline=__LINE__;.') instead? I mean I see no quotes surrounding the javascript string (that is generated from PHP). ok, that what a typo. As I said eariler. The script works fine if text in the table is a single line. If it is multiply lines then it does not display, but in the source code of the browser it is there, except /BR flashing. Adrian Adrian D'Costa [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I am trying to write a dynamic help module based on a mysql database. I am using Javascript and PHP to do this. This is part of my script (both java and php) script language=JavaScript !-- function info(theline) { w w=window.open(,test,screenx=10,screeny=10,width=350,height=80,,scrollba rs=no); w.document.open(); w.document.writeln(PRE); w.document.writeln(File Name: + thename); w.document.writeln(Description: + theline); w.document.writeln(/PRE); w.document.close(); } //-- /script p align=center/fonta href=offerte.html onMouseOver=info(?$xline=__LINE__; require(user.php); require(error.php); $newuser = new user(); $nerror= new error(); $xfile=explode(/, __FILE__); $num=sizeof($xfile); $fname=$xfile[$num-1]; // Sql Statement $searchStmt = select * from help where fnumber=$xline and fname='$fname'; //execute the statement for help if(!$result=mysql_query($searchStmt, $newuser-link)) { $xerror = $nerror-error1(202); print($xerror); exit(); }else{ $num=mysql_num_rows($result); if ($num==0) { $xerror = $nerror-error1(300); print($xerror); exit(); } else { $row=mysql_fetch_object($result); } } $xdetail = nl2br($row-hdetail); echo $xdetail; ?); This script works if I have a single line the hdetail field, but if I put multiply lines in the hdetail field nothing shows up. I added nl2br but nothing work, if you view the source in netscape it is there with the /br. I am sure I am doing something wrong, but where I don't know. Can some one correct me? TIA Adrian -- 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] how do I?
Hi, I am trying to write a dynamic help module based on a mysql database. I am using Javascript and PHP to do this. This is part of my script (both java and php) script language=JavaScript !-- function info(theline) { w w=window.open(,test,screenx=10,screeny=10,width=350,height=80,,scrollbars=no); w.document.open(); w.document.writeln(PRE); w.document.writeln(File Name: + thename); w.document.writeln(Description: + theline); w.document.writeln(/PRE); w.document.close(); } //-- /script p align=center/fonta href=offerte.html onMouseOver=info(?$xline=__LINE__; require(user.php); require(error.php); $newuser = new user(); $nerror= new error(); $xfile=explode(/, __FILE__); $num=sizeof($xfile); $fname=$xfile[$num-1]; // Sql Statement $searchStmt = select * from help where fnumber=$xline and fname='$fname'; //execute the statement for help if(!$result=mysql_query($searchStmt, $newuser-link)) { $xerror = $nerror-error1(202); print($xerror); exit(); }else{ $num=mysql_num_rows($result); if ($num==0) { $xerror = $nerror-error1(300); print($xerror); exit(); } else { $row=mysql_fetch_object($result); } } $xdetail = nl2br($row-hdetail); echo $xdetail; ?); This script works if I have a single line the hdetail field, but if I put multiply lines in the hdetail field nothing shows up. I added nl2br but nothing work, if you view the source in netscape it is there with the /br. I am sure I am doing something wrong, but where I don't know. Can some one correct me? TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: File Upload and NT...
Hi, I had this problem. If you say that even without the getimagesize() it is not being uploaded. Then try this. If you declared $the_image in the input type=file name=the_image try using $the_image_name. From the manual this is what I figured out and it works (on linux) In PHP, the following variables will be defined within the destination script upon a successful upload, assuming that register_globals is turned on in php.ini. If track_vars is turned on, they will also be available in PHP within the global array $HTTP_POST_VARS. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above: * $userfile - The temporary filename in which the uploaded file was stored on the server machine. * $userfile_name - The original name or path of the file on the sender's system. Adrian On Fri, 24 Aug 2001, Joseph Koenig wrote: Sorry, I know file uploads are asked about all the time... I'm having an odd problem on a WinNT system. When I try to do my upload, I test the file to see the type of it: $image_info = GetImageSize($the_image); However, that line gives me: Warning: getimagesize: Unable to open '/Joe1/Desktop%20Folder/device_eval.gif' for reading. in D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on line 22 At first I had thought this would be a permissions issue, but the file it can't open is the one being uploaded. If I echo the file being uploaded, i get: Image Name: /Joe1/Desktop%20Folder/device_eval.gif I swear I looked at the archive and I've done this plenty of times before (but on Unix). This project is being done on NT, which I'm fairly unfamiliar with though. Any help would be much appreciated. 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]
[PHP] Re: text wrap in table
Hi, I got the answer from one earlier mail. I used nl2br(). It does just what I want. Adrian On Fri, 24 Aug 2001, Adrian D'Costa wrote: Hi, I am creating a program for a newspaper to publish their article online. There is a form what allows them to cut and past from their editors (word, pagemaker, staroffice). The data is being entered correctly. The problem is when I try and get the data from the table the whole matter scrolls off the screen. I need it to be formatted as the client cut and pastes it (headings, paras, etc). Below is my table and part of my program. mysql desc newsarticles; +--+--+--+-+++ | Field| Type | Null | Key | Default| Extra | +--+--+--+-+++ | id | int(5) | | PRI | NULL | auto_increment | | nid | int(5) | | MUL | 0 || | headline | varchar(100) | | ||| | article | mediumtext | | ||| | date | date | | | -00-00 || | imgpath | varchar(200) | YES | | NULL || +--+--+--+-+++ html head title? echo $row-headline; ?/title /head body bgcolor=white h1 align=center? echo $row-headline; ?/h1 h3 align=center? echo $row-description; ?/h3 table width=600 border=1 tr td valign=top width=70%font face=Arial size=2 color=bluestrong? echo $sd .-. $sm .-. $sy; ?/strongbrpre? echo $row-article; ?/pre/font/td td valign=top width=30%img src=? echo $row-imgpath; ? ? echo $iwh[3]; ? /td /tr /table /body /html I use the pre/pre to display with the line breaks. If I take of the pre it does not wrap but does not give the breaks. To my thinking maybe while entering the data we should give break the lines physically. This is part of my entry form. tr tdfont face=Arial size=2HeadLine/font/td tdinput type=text name=headline size=30 /tr tr tdfont face=Arial size=2Article/font/td tdtextarea name=article cols=60 rows=10/textarea/td /tr tr tdfont face=Arial size=2Upload Image/font/td tdinput type=file name=userfile size=30 wrap=ON/td /tr tr align=center td colspan=2input type=submit value=Submit/td /tr How do I get the text not to wrap and to preserve the formatting given by the client. Adrian -- 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] text wrap in table
Hi, I am creating a program for a newspaper to publish their article online. There is a form what allows them to cut and past from their editors (word, pagemaker, staroffice). The data is being entered correctly. The problem is when I try and get the data from the table the whole matter scrolls off the screen. I need it to be formatted as the client cut and pastes it (headings, paras, etc). Below is my table and part of my program. mysql desc newsarticles; +--+--+--+-+++ | Field| Type | Null | Key | Default| Extra | +--+--+--+-+++ | id | int(5) | | PRI | NULL | auto_increment | | nid | int(5) | | MUL | 0 || | headline | varchar(100) | | ||| | article | mediumtext | | ||| | date | date | | | -00-00 || | imgpath | varchar(200) | YES | | NULL || +--+--+--+-+++ html head title? echo $row-headline; ?/title /head body bgcolor=white h1 align=center? echo $row-headline; ?/h1 h3 align=center? echo $row-description; ?/h3 table width=600 border=1 tr td valign=top width=70%font face=Arial size=2 color=bluestrong? echo $sd .-. $sm .-. $sy; ?/strongbrpre? echo $row-article; ?/pre/font/td td valign=top width=30%img src=? echo $row-imgpath; ? ? echo $iwh[3]; ? /td /tr /table /body /html I use the pre/pre to display with the line breaks. If I take of the pre it does not wrap but does not give the breaks. To my thinking maybe while entering the data we should give break the lines physically. This is part of my entry form. tr tdfont face=Arial size=2HeadLine/font/td tdinput type=text name=headline size=30 /tr tr tdfont face=Arial size=2Article/font/td tdtextarea name=article cols=60 rows=10/textarea/td /tr tr tdfont face=Arial size=2Upload Image/font/td tdinput type=file name=userfile size=30 wrap=ON/td /tr tr align=center td colspan=2input type=submit value=Submit/td /tr How do I get the text not to wrap and to preserve the formatting given by the client. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] user's ip
On Tue, 7 Aug 2001, Renze Munnik wrote: On Tue, Aug 07, 2001 at 03:55:25PM +0530, Adrian D'Costa wrote: Hi, I am trying to get the ip address of any user browsing a particular page. I tried $REMOTE_ADDR but that give me only the remote address. What would be the best way? Adrian Okay... Help me out here... You want to know someones IP-address and using $REMOTE_ADDR you get the IP-address of the user. What's the problem man?!?!?! Well man:), my script show only the website's ipaddress. Adrian -- 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] extracting data from html
Hi, This mail is very looong as I have included the code. What I need is to extract certian text from the html file and dump it into mysql table. This is what the html looks like (code below). The mysql part can wait now. I have given comment between each file. As of now the php is just printing the html table. Can someone tell me what next I have to do or some sample where I can study? TIA Adrian | some image not needed | Some text not needed |Text needed for all records in this table (2nd table | |Text |Text |Text |Text |Text |Text |Text |Text | |15/7 |23-28/8| |Txt|Txt|250|Txt|Txt | | | | |Txt|Txt|300|Txt|Txt | This is the html. The second row in the second table not needed. The third row of the second table having the dates will be required for all records. == HTML = TABLE WIDTH=753 BORDER=0 CELLPADDING=1 CELLSPACING=0 COL WIDTH=574 COL WIDTH=175 TR VALIGN=TOP TD WIDTH=574 HEIGHT=4 BGCOLOR=#ff PIMG SRC=sv6326328.gif NAME=Graphic1 ALIGN=BOTTOM WIDTH=378 HEIGHT=68 BORDER=0/P /TD TD WIDTH=175 BGCOLOR=#00 P ALIGN=CENTER STYLE=margin-bottom: 0inFONT FACE=Arial, sans-serifFONT SIZE=6 STYLE=font-size: 28ptUrgent/FONT/FONT/P P ALIGN=CENTERFONT FACE=Arial, sans-serifFONT SIZE=4BFax - Message/B/FONT/FONT/P /TD /TR /TABLE P STYLE=margin-bottom: 0inBR /P P ALIGN=CENTER STYLE=margin-bottom: 0in; border: 1.10pt double #00; padding: 0.01in FONT COLOR=#00FONT FACE=Arial, sans-serifFONT SIZE=5BOFFRES SPECIALES - 27.06.2001 - OFFRES SPECIALES /B/FONT/FONT/FONT /P P ALIGN=CENTER STYLE=margin-bottom: 0in; border: 1.10pt double #00; padding: 0.01in BFONT SIZE=3FONT FACE=Wingdingspara;para;para;/FONTFONT FACE=Arial, sans-serif Deacute;parts de Genegrave;ve /FONTFONT FACE=Wingdingspara;para;para;/FONT/FONT/B/P P STYLE=margin-bottom: 0inBR /P P STYLE=margin-bottom: 0in; line-height: 0.17inBFONT SIZE=3FONT FACE=Arial, sans-serif SOUS REacute;SERVE DE MODIFICATION DE PRIX !Page SDFIELD TYPE=PAGE SUBTYPE=RANDOM FORMAT=PAGE2/SDFIELD/6 /FONT/FONT/B /P /DIV P STYLE=margin-right: 0.1in; margin-bottom: 0inBR /P P STYLE=margin-right: 0.1in; margin-bottom: 0inBR /P TABLE WIDTH=748 BORDER=1 BORDERCOLOR=#00 CELLPADDING=1 CELLSPACING=0 RULES=GROUPS COL WIDTH=86 COL WIDTH=97 COL WIDTH=96 COL WIDTH=244 COL WIDTH=67 COL WIDTH=67 COL WIDTH=76 TBODY TR TD COLSPAN=7 WIDTH=744 HEIGHT=25 VALIGN=TOP PFONT SIZE=4SUBBIGrand Canarie (LPA) /I/Bsamedi de Genegrave;ve avec LX/SUB/FONT/P /TD /TR /TBODY TBODY TR VALIGN=TOP TD WIDTH=86 HEIGHT=18 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIBDeacute;parts juin/B/I/FONT/P /TD TD WIDTH=97 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIBDeacute;parts juillet/B/I/FONT/P /TD TD WIDTH=96 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIBDeacute;parts aoucirc;t/B/I/FONT/P /TD TD WIDTH=244 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIBCat./Logement/B/I/FONT/P /TD TD WIDTH=67 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIBCode htl./B/I/FONT/P /TD TD WIDTH=67 P STYLE=margin-top: 0.04inFONT FACE=Arial, sans-serifIB1 sem./B/I/FONT/P /TD
[PHP] what would return?
Hi, I have a php script that will send certain information to a mailing list. Upon arrival the customer will have seven records each with a unique id. On clicking the link a mail will be sent back with the subject having that unique id. On arriving at my mail server I pipe the mail thru a php program using lynx -dump http://localhost/filename.php /dev/null. My question is what will be returned to the filename.php. I need the unique id from the subject to do further processing? Any ideas. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mail priority
You can add it in the headers. In fact you can add any info as long as they abide by the RFC822. I took if from the function.mail.php /* additional header pieces for errors, From cc's, bcc's, etc */ $headers .= From: Birthday Reminder [EMAIL PROTECTED]\n; $headers .= X-Sender: [EMAIL PROTECTED]\n; $headers .= X-Mailer: PHP\n; // mailer $headers .= X-Priority: 1\n; // Urgent message! $headers .= Return-Path: [EMAIL PROTECTED]\n; // Return path for errors $headers .= cc:[EMAIL PROTECTED]\n; // CC to $headers .= bcc:[EMAIL PROTECTED], [EMAIL PROTECTED]\n; // BCCs to /* and now mail it */ mail($recipient, $subject, $message, $headers); Adrian On Wed, 25 Jul 2001, Jack wrote: Dear folks, I am doing the email using mail() command. I wonder if there is anyone can tell me how do I do the priority attached with the message so that the mail get sent out with different priority status. Any advice will be appreciated. Jack [EMAIL PROTECTED] Love your enemies, it will drive them nuts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php stand alone
I need both. Adrian On Tue, 24 Jul 2001, Tyler Longren wrote: when you configure php, don't specify a web server to use. ./configure --with-mysql would do the trick. ./configure --with-apxs=/path/to/apxs --with-mysql would not do the trick Tyler -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 7:14 AM To: php general list Subject: [PHP] php stand alone Hi, How do I compile php to work as a stand alone. Right now it is working thru the web but need to run it from a cron job. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php stand alone
Hi, Thanks. I will look at that **manual**. But your suggestion of running lynx is interesting. What I want to do is receive a mail to a account with a preset subject. On arriving at that account the php script will get the contents of the subject and preform other tasks. Will the Lynx do it? Adrian On Tue, 24 Jul 2001, Gunther E. Biernat wrote: How do I compile php to work as a stand alone. Right now it is working thru the web but need to run it from a cron job. Have a look at http://www.php.net/manual/en/install.commandline.php The easiest thing of course would be to just call lynx (or any other command line browser taht is able to do a HTTP request and exit (that's why the -dump)) within your cron table, e.g.: 0 23 * * * lynx -dump localhost/path/to/some/php/robot.php /dev/null mit freundlichen Gruessen / yours sincerely Gunther E. Biernat Web Application Engineer __ RealNetworks GmbH Tel.: +49-40-415204-24 Weidestraße 128 Fax.: +49-40-415204-11 22083 Hamburg Mail: [EMAIL PROTECTED] Germany URL : http://de.real.com __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php stand alone
This is on my intranet and is connected for a few minutes to pick up the mail. Adrian On Tue, 24 Jul 2001, scott [gts] wrote: but remember, if you put your cron/admin scripts into a directory on a publicly accessable webserver, you run the risk of having anonymous websurfers run your scripts at inopportune moments. -Original Message- From: Gunther E. Biernat [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24, 2001 8:32 AM To: Adrian D'Costa; php general list Subject: Re: [PHP] php stand alone How do I compile php to work as a stand alone. Right now it is working thru the web but need to run it from a cron job. Have a look at http://www.php.net/manual/en/install.commandline.php The easiest thing of course would be to just call lynx (or any other command line browser taht is able to do a HTTP request and exit (that's why the -dump)) within your cron table, e.g.: 0 23 * * * lynx -dump localhost/path/to/some/php/robot.php /dev/null mit freundlichen Gruessen / yours sincerely Gunther E. Biernat Web Application Engineer __ RealNetworks GmbH Tel.: +49-40-415204-24 Weidestraße 128 Fax.: +49-40-415204-11 22083 Hamburg Mail: [EMAIL PROTECTED] Germany URL : http://de.real.com __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php stand alone
Hi, How do I compile php to work as a stand alone. Right now it is working thru the web but need to run it from a cron job. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
Hi, It works now. I did a stupid mistake instead of putting --enable-sockets I put --with-sockets g Adrian On Sat, 21 Jul 2001, E. Peter K. Chan wrote: Hi Try going to the source directory ie where you unzipped the tarball for php. May as well upgrade to php4.0.6 - that could save you some problems now and later. Type in: # ./configure --help it says --with-readline[=DIR] so maybe you need to install readline first or point php to where it is? (FYI, I just installed 4.0.6 and it did not automatically install readline - I didn't include --with-readline in my options) if this doesn't help out then the only thing I can suggest is to start from scratch, but BACKUP first! See: http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/page1.html It's an excellent tutorial on setting up mysql, php,apache and even openssl. And it works. Peter - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: E. Peter K. Chan [EMAIL PROTECTED] Cc: php general list [EMAIL PROTECTED] Sent: Saturday, July 21, 2001 4:48 PM Subject: Re: [PHP] php 4.0.6 Hi Peter, I think the guru of php on the list can tell us what the problem is. I am going to compile 4.0.4pl2 and see if I get that error. In fact I am unable to access mysql now even though I have given --with-mysql. Any clues Adrian On Fri, 20 Jul 2001, E. Peter K. Chan wrote: Hi Adrian I just rebuilt my PHP to 4.0.6 and get a similar message with the bcmath functions. I don't have an answer for you at the moment. it may be the configure options selected. If you find out the answer please tell me and I'll do like wise. Peter - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: php general list [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 7:12 PM Subject: [PHP] php 4.0.6 Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mail with html
Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail with html
Hi Sandeep, Thanks for your mail but I was looking at something else. This is what I need. I have a table that I will be selecting certian records and mailing to clients that have signed up. The result should be in html and plain text. The plain text is working now but I want to put into a table format to look neater, below is a sample in text format. Any clues? Destinazione Periodo Vitofferte London 2001-07-31 Chf 385 Hammamet2001-07-28 Chf 999 Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: oh yeah, you might want to tidy up the code a bit... the email has put in line breaks. and replace [EMAIL PROTECTED] with your own email... the mail() command does all the work... the header command redirects the page.. you might want to change the address or remove it. /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:06 To: 'Adrian D'Costa'; php general list Subject: RE: [PHP] mail with html here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:09 To: php general list Subject: [PHP] mail with html Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mail with html
The question is how do I declare the html coding in the message part. Any samples Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: well all you need to do is use part of the script i sent you.. and in the header variable, uncomment the bit which says text/html and then you can send html email instead of text email... i'm assuming you've already written the script to sent plain text email. i thought you needed that. /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 12:26 To: Sandeep Hundal Cc: php general list Subject: RE: [PHP] mail with html Hi Sandeep, Thanks for your mail but I was looking at something else. This is what I need. I have a table that I will be selecting certian records and mailing to clients that have signed up. The result should be in html and plain text. The plain text is working now but I want to put into a table format to look neater, below is a sample in text format. Any clues? Destinazione Periodo Vitofferte London 2001-07-31 Chf 385 Hammamet2001-07-28 Chf 999 Adrian On Mon, 23 Jul 2001, Sandeep Hundal wrote: oh yeah, you might want to tidy up the code a bit... the email has put in line breaks. and replace [EMAIL PROTECTED] with your own email... the mail() command does all the work... the header command redirects the page.. you might want to change the address or remove it. /sunny -Original Message- From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:06 To: 'Adrian D'Costa'; php general list Subject: RE: [PHP] mail with html here's a script i wrote a while back. copied and pasted. - ? if ($submit) { $headers .= From: $myemail \n; $headers .= cc:$cc \n; $headers .= bcc:$bcc \n; // $headers .= Content-Type: text/html; charset=iso-8859-1\n; $message = stripslashes($contents); header(Location:http://www.wde.org/me/;); mail($to, $subject, $message, $headers); } else { echo html; $myemail1 = nothing [EMAIL PROTECTED]; echo brform action=\$php_self\ method=\post\ table cellpadding=15 cellspacing=0 width=100% bgcolor=#ff tr td align=rightstrong class=blackfrom which account :/strong/td tdselect name=\myemail\ option value=\$myemail1\[EMAIL PROTECTED] /select /td /tr tr td align=rightstrong class=blackemail to :/strong/td tdinput type=text name=\to\/td /tr tr td align=rightstrong class=blackcopy to :/strong/td tdinput type=text name=\cc\/td /tr tr td align=rightstrong class=blackblind copy to :/strong/td tdinput type=text name=\bcc\/td /tr tr td align=rightstrong class=blacksubject :/strong/td tdinput type=text name=\subject\/td /tr tr td valign=top align=rightstrong class=blackemail message :/strong/td tdtextarea cols=45 rows=15 name=\contents\ wrap=physical/textarea/td /tr tr tdnbsp;/td tdstrong class=blackinput type=submit name=submit value=\send this email\/strong/td /tr /table /form; } ? - that should work as a page in itself let me know if you have problems /sunny -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: 23 July 2001 11:09 To: php general list Subject: [PHP] mail with html Hi, I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something). I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials. TIA Adrian -- PHP General
Re: [PHP] php 4.0.6
Hi Rasmus, I did a phpinfo() and gives me the following output: PHP Version 4.0.6 System Linux pcs.pcsadvt.com 2.2.16-22 #1 Tue Aug 22 16:16:55 EDT 2000 i586 unknown Build Date Jul 20 2001 Configure Command './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--disable-static' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-track-vars' '--enable-ftp' '--with-mysql' '--with-xml' '--enable-trans-sid' '--with-sockets' '--with-readline' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /etc ZEND_DEBUG disabled Thread Safety disabled I did a make install and restarted my httpd. Lets forget the readline() what about sockets? Why does that not work? Adrian On Sat, 21 Jul 2001, Rasmus Lerdorf wrote: No idea. You haven't said whether you checked your phpinfo() output to see if you are actually running the latest version of PHP you just compiled. Perhaps you forgot a make install, perhaps you forgot to restart your httpd. Perhaps your configure didn't find libreadline. Any number of things could be wrong. You will have to do a little bit of digging on your own. -Rasmus Hi, I have now compiled php --with-readline and --with-sockets but I still get the call to undefined function socket() what could be wrong. Adrian On Thu, 19 Jul 2001, Rasmus Lerdorf wrote: Did you compile php using --with-readline ? On Thu, 19 Jul 2001, Adrian D'Costa wrote: Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
Hi, Thanks. I am more worried about the sockets. I installed it --enable-sockets. Adrian On Sat, 21 Jul 2001, E. Peter K. Chan wrote: Hi Try going to the source directory ie where you unzipped the tarball for php. May as well upgrade to php4.0.6 - that could save you some problems now and later. Type in: # ./configure --help it says --with-readline[=DIR] so maybe you need to install readline first or point php to where it is? (FYI, I just installed 4.0.6 and it did not automatically install readline - I didn't include --with-readline in my options) if this doesn't help out then the only thing I can suggest is to start from scratch, but BACKUP first! See: http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/page1.html It's an excellent tutorial on setting up mysql, php,apache and even openssl. And it works. Peter - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: E. Peter K. Chan [EMAIL PROTECTED] Cc: php general list [EMAIL PROTECTED] Sent: Saturday, July 21, 2001 4:48 PM Subject: Re: [PHP] php 4.0.6 Hi Peter, I think the guru of php on the list can tell us what the problem is. I am going to compile 4.0.4pl2 and see if I get that error. In fact I am unable to access mysql now even though I have given --with-mysql. Any clues Adrian On Fri, 20 Jul 2001, E. Peter K. Chan wrote: Hi Adrian I just rebuilt my PHP to 4.0.6 and get a similar message with the bcmath functions. I don't have an answer for you at the moment. it may be the configure options selected. If you find out the answer please tell me and I'll do like wise. Peter - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: php general list [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 7:12 PM Subject: [PHP] php 4.0.6 Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
Hi, I have now compiled php --with-readline and --with-sockets but I still get the call to undefined function socket() what could be wrong. Adrian On Thu, 19 Jul 2001, Rasmus Lerdorf wrote: Did you compile php using --with-readline ? On Thu, 19 Jul 2001, Adrian D'Costa wrote: Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
Hi Peter, I think the guru of php on the list can tell us what the problem is. I am going to compile 4.0.4pl2 and see if I get that error. In fact I am unable to access mysql now even though I have given --with-mysql. Any clues Adrian On Fri, 20 Jul 2001, E. Peter K. Chan wrote: Hi Adrian I just rebuilt my PHP to 4.0.6 and get a similar message with the bcmath functions. I don't have an answer for you at the moment. it may be the configure options selected. If you find out the answer please tell me and I'll do like wise. Peter - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: php general list [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 7:12 PM Subject: [PHP] php 4.0.6 Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
What would be the ideal setting to compile Adrian On Fri, 20 Jul 2001, E. Peter K. Chan wrote: Seems the library hasn't been compiled into your installation or need to change php.ini to point to the proper include folder. Try a search on google.com for call to undefined function. - Original Message - From: Adrian D'Costa [EMAIL PROTECTED] To: php general list [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 7:12 PM Subject: [PHP] php 4.0.6 Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php 4.0.6
No. Just what would be the optimum settings. I have the following ./configure --target=i386-redhat-linux --prefix=/usr --with-config-file-path=/etc --disable-debug --enable-pic --enable-inline-optimization --with-apxs=/usr/sbin/apxs --disable-static --with-exec-dir=/usr/bin --with-regex=system --with-gd --with-jpeg-dir=/usr --with-png --with-gdbm --enable-debugger --enable-magic-quotes --enable-safe-mode --enable-track-vars --enable-ftp --with-mysql --with-xml --enable-trans-sid --with-sockets now adding --with-readline. Is this ok? Adrian On Thu, 19 Jul 2001, Rasmus Lerdorf wrote: Did you compile php using --with-readline ? On Thu, 19 Jul 2001, Adrian D'Costa wrote: Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php 4.0.6
Hi, I am trying to use the socket or readline functions but get a message: call to undefined function readline(). Why? Is this not implemented in 4.0.6. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: REGEXP
This is wrong. It should be Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC I don't know why it is not reading the whole string. It seems to treat the *boundary* part as another line. It _is_ another line; it just happens to starts with whitespace. check RFC822. No doubt. If you have the whole message in a string (psuedo-code): Huh.. Then the below should work. But the stupid header breaks :) list ($h,$msg) =split(\n\n, $mailmsg); $h=str_replace(\t, , $h); // tab - space $h=str_replace(\n , , $h); // nlspace - space // i.e. continuation of prior line $hdrs=split(\n, $h); ... Regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: access pop3 without IMAP
Hi James, I past that stage but stuck with messages that are MultiPart/Mixed. I need to display the attachments and give the viewer to download or view if possible. Adrian On Sun, 15 Jul 2001, James Tan wrote: hi prachait saxena, I'm trying to build the same too... u can use the socket function to manupulate pop protocol at port 110 refer to the rfc link in the documentation for pop :) hope it helps... regards, James Prachait Saxena wrote: Hi, I want to check mail of a pop account. without using imap. Can any one know how to do that. kindly send it in details. bye -- Prachait Saxena Offical ( [EMAIL PROTECTED] ) Personal ( [EMAIL PROTECTED] ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: REGEXP
Hi James, Thanks for your mail. But I think the problem like somewhere else. I have the following: echo $buffer; There result : Content-Type: multipart/mixed; This is wrong. It should be Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC I don't know why it is not reading the whole string. It seems to treat the *boundary* part as another line. I read somewhere the perl compatiable regexp can read a multiply line treating CRLF as part of the line. Any pointers Adrian On Sun, 15 Jul 2001, James Tan wrote: hi,, u could try using explode function eg: arrayresult = explode(string, separator); cont = explode(thestring, \); echo cont[0] ; // result as Content-Type: multipart/mixed; boundary= echo cont[1]; //result as B42DA66C4EC07C9B572A58FC echo cont[2]; // array index 2 will be nothing.. null or hope it works.. regards, James Adrian D'Costa wrote: Hi, I am trying to capture the Header from a mail for my webmail using php and pop3. The header is something like this: Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC When I use preg_split(/[\d;]*/, $buffer), I get Content-Type: multipart/mixed; What I want is to return the whole line split by the ;. I usually try to avoid regexp (too lazy) but now I want to use it. The final result I would need is: B42DA66C4EC07C9B572A58FC so that I can search in the body of the message for the rest of the parts. Any pointers would be helpful. Adrian -- 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] REGEXP
Hi, I am trying to capture the Header from a mail for my webmail using php and pop3. The header is something like this: Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC When I use preg_split(/[\d;]*/, $buffer), I get Content-Type: multipart/mixed; What I want is to return the whole line split by the ;. I usually try to avoid regexp (too lazy) but now I want to use it. The final result I would need is: B42DA66C4EC07C9B572A58FC so that I can search in the body of the message for the rest of the parts. Any pointers would be helpful. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php/webmail question
Hi, I am writing a webmail in php using pop3 as the ones I downloaded do not do what I want. Assuming I am able to connect and get the list of messages and sizes. Now I have a couple of attachments on some mails. When I read the message it just displays the base64 encoded message (trying to build on rymo webmail rymo.sourceforge.net). I did the following: I check if the Content-Type is MULTIPART and got the BOUNDARY but don't know how to proceed from there on. How do I read the body of the message seperating each attachment and giving an option do download or view (something like squirrelmail). Any example would be great TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: RE: [PHP] webmail
Hi, On Mon, 9 Jul 2001 [EMAIL PROTECTED] wrote: In addition, here's a POP3 class from the PHP Classes Repository... Where :) I did not get anything. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: webmail
Hi, Thanks. I found it and installed it. Maybe I need to hack around it to add more functions such as address book and attachement like squirrelmail. Adrian On Mon, 9 Jul 2001, Bleue wrote: There is a really good simple pop email client called rymo. Im not sure where I found it, but it shouldn't be hard to find. It is a very good base to start with and will help you with the functions and stuff. If you cant find it, let me know and I will send you a copy. Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] webmail
On Mon, 9 Jul 2001, Max Pyziur wrote: Thanks, but my specs are PHP4 and POP3 Adrian The one which I use which matches your requirements (non-PHP, perl-module driven) is NS WebMail, one which I use and gives basic webmail capablities, though missing some desired functionality (sort on date, sender, or subject; default sort is reverse chrono). It's relatively easy to install. http://nikosoft.free.fr/nswm.htm For freshmeat's listing check here: http://freshmeat.net/search/?q=webmail TIA Adrian Max Pyziur BRAMA - Gateway Ukraine [EMAIL PROTECTED] http://www.brama.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] webmail
Hi, I am trying to write a web-based email client for my site (or are there any samples) using php4 and POP3. I have a book on professional PHP but that sample uses IMAP which is not installed on my system. Could anyone tell me where I can get some samples or how to proceed with this project. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] extract data from html
On Thu, 28 Jun 2001, CC Zona wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Adrian D'Costa) wrote: 1. Open the html file in read only mode 2. Start reading the html file till I encounter a td tag (I don't know how to do this) 3. Grab that data after the td tag (and then what?) See http://php.net/manual/en/function.fopen.php and http://php.net/manual/en/function.fgetss.php plus the chapter for whatever DBMS you want to drop the file contents into. Thanks. One thing just reading the manual without the idea of how the function works is of no use. Some examples would help. In fact I did use fopen, fgets, fgetss but the problems is that the html tag that I am looking is td. Now this is easy but if td width=25% or td colspan=7 would give a problem. Adrian -- 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] extract data from html
Hi, I keep receiving a lot of word documents the I need to extract and put into a mysql table. As of now, I do a cut and paste manually using a html from to a php script to dump it into the mysql table. Since the format is usually the same (most of the time) I am sure there should be another way to do this. I converted the word doc into a html file. Now the question is that I need to write a php script to open that file and read thru its contents. I am not that experienced in php but can understand the basics. The steps that I would take are : 1. Open the html file in read only mode 2. Start reading the html file till I encounter a td tag (I don't know how to do this) 3. Grab that data after the td tag (and then what?) 4. Repeat this process till encounter the /table tag. If anyone could give me the steps in hard code and any other alternative what I would be happy. A Sample of the word doc (too big to attach) +---+ COS Zurich +---+ JuneJulyAug Hotel Price ++---+---++-+ 28 2 8 Arion Fr.1349 Inc Village Fr.1099 ++---+---+---+--+ This is a table. Each table belongs to a different city. Each row has more than 2 hotels. What would be the best solution? TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Lists are back up
Hi Rasmus, I was home sick with out this mailing list ;-) I found that this is the only list that can get quick responses (most of the times). I am glad it is up Adrian On Mon, 18 Jun 2001, Rasmus Lerdorf wrote: We have re-enabled the PHP mailing lists. They are now running from a temporary machine sitting on the floor of my spare bedroom. A more permanent home is in the works. -Rasmus
Re: [PHP] RE: why does it not work (fwd)
On 22 May 2001, Chris Searle wrote: Adrian == Adrian D'Costa [EMAIL PROTECTED] writes: Adrian // sql statement $searchStmt = select special.contid, Adrian special.cityid, special.curr1, special.catalogo, Adrian special.hf, special.curr2, special.vitofferta, special.fh, Adrian special.club, special.stars, city.city,RAND as r from Adrian special,city where DATE_SUB(special.periodo, INTERVAL 3 Adrian DAY) '$tdate' and city.id=special.cityid order by r limit Adrian 1 ; So far as I know - the RAND function was introduced in 3.23 - at least the order by RAND functionality. From the docs: In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER BY RAND() If I cut and past this in the online mysql it works. It display the records randomly, why not in php? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: One database, different forms
Hi, I ask a similar question but did not get a reply. I figured out a way. The only thing I do is use one form and four tables. I build the sql statement on the fly. From the from I have a hidden field that will be passed on to the php script. Based on that variable I select the table. You can see a sample of it on vvmm.net/search.php3 $searchstmt = select ; switch ($vsearch) { case z: // this exec only if no choice is selected. $searchStmt .= ; break; case c: // Select vvmmdb table. Catalog Choice $searchStmt .= city.city as destinazione, vvmmdb.days, vvmmdb.periodo, vvmmdb.vitofferta, vvmmdb.curr1 as curr2, vvmmdb.url, vvmmdb.stars, vvmmdb.club, vvmmdb.tcode from vvmmdb,city where ; // blah blah } // Check if destinazione has been entered if ($dest) { switch ($vsearch) { case z: $searchStmt .= ; break; case c: // Select vvmmdb table. Catalog Choice $searchStmt .= vvmmdb.cityid=$citycode and ; $csearchStmt .= vvmmdb.contid=$countrycode and ; break; // more case statements } I have a whole script about 800 lines. If you need it I will send it. In fact I sent this script earlier. I finally end it with: $stmt = substr($searchStmt, 0, strlen($searchStmt)-4); $stmt1 = substr($searchStmt1, 0, strlen($searchStmt1)-4); Since I do not know which options the viewer is selecting I use the above to remove the and at the end of the statement. It works for me. Adrian On Sun, 13 May 2001, midget2000x wrote: I am writing a PHP application that will operate on a MySQL database. There will be 4 types of forms (like catalog request, info request, etc.) calling the code which writes the data to the database. Since the variable names on the forms will equal the MySQL column names (as they should), I am wondering if there is a way for me to create my SQL statements on the fly so that only data passed is written. Otherwise I'll have to create 8 types of SQL statements...INSERT (if the record, keyed by e-mail address, doesn't exist), and UPDATE (if the record does exist) for all 4 forms. For example, on my add to mailing list form, only the e-mail address is collected. I'd like the PHP to recognize that only the 'email' field is passed and create the SQL statement that only writes the e-mail to the database. Any ideas greatly appreciated! Thanks, Rory -- --- providing the finest in midget technology -- 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] stumped
Hi, I need to find a solution to this. I am lost. To see what I talk about check vvmm.net/search.php3. I am using php 4 offline. Based on whatever the viewer select I get the below script to build the select statements accordingly. Everything is working fine now. I want to add another feature where, if the viewer search for a particular city that has no record I need to display all the cities for that country selected as alternative choices. The problem is trying to re-build the select statements. I have reduced the checking as the script is too long, but checking the link earlier mentioned would give an idea. Each table has a countryid (contid) and cityid (cityid). Here is the code, a pls do give me a clue:) TIA Adrian $tdate = date(Y . - . m . - . d); // build search query if ($vsearch == c || $vsearch == v || $vsearch == l) { $searchStmt = select ; } // get the correct table switch ($vsearch) { case z: // this exec only if no choice is selected. $searchStmt .= ; break; case c: // Select vvmmdb table. Catalog Choice $searchStmt .= city.city as destinazione, vvmmdb.days, vvmmdb.periodo, vvmmdb.vitofferta, vvmmdb.curr1 as curr2, vvmmdb.url, vvmmdb.stars, vvmmdb.club, vvmmdb.tcode from vvmmdb,city where ; // DisplayErrMsg(Catalog Data); // exit(); break; case v: // Select special table. Vitofferta $searchStmt .= city.city as destinazione, special.periodo, special.date2, special.catalogo, special.hf, special.curr2, special.vitofferta,special.fh, special.club, special.stars from special,city where ; break; case l: // Select travel table. Last Minute $searchStmt .= travel.tour_operator, city.city as destinazione, travel.nome_hotel, travel.periodo, travel.notti, travel.giorni, travel.trattamento, travel.curr2, travel.vitofferta,travel.club, travel.stars from travel,city where ; break; case a: // select all tables and query. $searchStmt .= select travel.tour_operator, city.city as destinazione, travel.nome_hotel, travel.periodo, travel.notti, travel.giorni, travel.trattamento, travel.curr2, travel.vitofferta,travel.club, travel.stars from travel,city where ; $searchStmt1 .= select city.city as destinazione, special.periodo, special.date2, special.catalogo, special.hf, special.curr2, special.vitofferta, special.fh,special.club,special.stars from special,city where ; $searchStmt2 .= select city.city as destinazione, vvmmdb.days, vvmmdb.periodo, vvmmdb.vitofferta, vvmmdb.curr1, vvmmdb.url, vvmmdb.stars, vvmmdb.club, vvmmdb.tcode from vvmmdb,city where ; break; default: DisplayErrMsg(Error); break; } // Check if destinazione has been entered if ($dest) { switch ($vsearch) { case z: $searchStmt .= ; break; case c: // Select vvmmdb table. Catalog Choice $searchStmt .= vvmmdb.cityid=$citycode and ; break; case v: // Select special table. Vitofferta $searchStmt .= special.cityid=$citycode and ; break; case l: // Select travel table. Last Minute (travel flight) $searchStmt .= travel.cityid=$citycode and ; break; case a: // select all tables and query. // Check if destinazione has been entered if ($dest) { switch ($vsearch) { case z: $searchStmt .= ; break; case c: // Select vvmmdb table. Catalog Choice $searchStmt .= vvmmdb.cityid=$citycode and ; break; case v: // Select special table. Vitofferta $searchStmt .= special.cityid=$citycode and ; break; case l: // Select travel table. Last Minute (travel flight) $searchStmt .= travel.cityid=$citycode and ; break; case a: // select all tables and query. // $searchStmt .= destinazione like '%$destinazione%' and ; // $searchStmt1 .= destinazione like '%$destinazione%' and ; $searchStmt .= travel.cityid=$citycode and ; $searchStmt1 .= special.cityid=$citycode and ; $searchStmt2 .= vvmmdb.cityid=$citycode and ; default: //DisplayErrMsg(Error); break; } } else { $searchStmt .= ; $searchStmt1 .= ; $searchStmt2 .= ; } = I removed the other code and gave the ending -== $stmt = substr($searchStmt, 0, strlen($searchStmt)-4); $stmt1 = substr($searchStmt1, 0, strlen($searchStmt1)-4); $stmt2 = substr($searchStmt2, 0, strlen($searchStmt2)-4); == === === -- PHP
[PHP] why does this happen
Hi, I am trying to write a php and javascript that will pick up data from a table and display and scroll it. I seem to have run out of ideas how to make the script work. I don't get any display on the screen. I use rand() limit 1 so only one row is selected. Can some one tell me where I went wrong? Adrian =cscroll.php === ? define(CS_FORM, 0); define(A-city, 0); define(A-curr1, 1); define(A-catalogo, 2); define(A-hf, 3); define(A-curr2, 4); define(A-vitofferta, 5); define(A-fh, 6); class cscroll { var $data; var $tcity; var $tcurr1; var $tcatalogo; var $thf; var $tcurr2; var $tvitofferta; var $tfh; function cscroll($data) { /* **copy parameters into properties */ $this-data = $data; foreach($data as $row) { //create list of unique choices for first selector $this-tcity[($row[A-City])] = $row[A-City]; $this-tcurr1[($row[A-curr1])] = $row[A-curr1]; $this-tcatalogo[($row[A-catalogo])] = $row[A-catalogo]; $this-thf[($row[A-hf])] = $row[A-hf]; $this-tcurr2[($row[A-curr2])] = $row[A-curr2]; $this-tvitofferta[($row[A-vitofferta])] = $row[A-vitofferta]; $this-tfh[($row[A-fh])] = $row[A-fh]; } } } function initialize() { echo (form); echo(input name=message size=57 value=\$this-data[A-city]\); echo(/form); } scroll.php while($row = mysql_fetch_object($result)) { $tarray[] = array( A-city=$row-city, A-curr1=$row-curr1, A-catalogo=$row-catalogo, A-hf=$row-hf, A-curr2=$row-curr2, A-vitofferta=$row-vitofferta, A-fh=$row-fh, ); } //instantiate class $tscroll = new cscroll( $tarray); ? html head script language=JavaScript !-- // Text box marquee Modified by Prasad Mapatuna // CHANGE THESE TO ALTER THE SCROLL SPEED var timerID=null var run=false count = 10 // counter of cycles ScrollSpeed = 300; // milliseconds between scrolls ScrollChars = 1;// chars scrolled per time period function Stop() { if(run) clearRimeout(timerID) run=false } function Start() { Stop(); Marquee() } function Marquee() { var msg = document.forms[0].message.value; var tmp = msg.substring(0,ScrollChars); msg = msg.substring(ScrollChars) + tmp; document.forms[0].message.value = msg; if(count200) { timerID = setTimeout('Marquee()',ScrollSpeed); run= true; count++; } } !-- end -- /script title/title META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cache /head body bgcolor=white script type=text/javascript language=JavaScript ?php initialize(); ? ?php include(footer.php); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: columns
On Sat, 28 Apr 2001, Adrian D'Costa wrote: hi, I have listed the code below. I have the below table: | id | int(11) | | PRI | | auto_increment | | operator | varchar(30) | | | || | email| varchar(35) | YES | | || | url | varchar(50) | YES | | || I want the operator field to be listed out in four columns and each row to have alternate colours. I am able to get it to come out in four columns but not the color. Where am I wrong? ?php require(common.php); require 'functions.php'; $searchStmt = select * from toperator order by operator ; // connect to the db if (!($link = mysql_pconnect($db_server, $db_login, $db_passwd))){ DisplayErrMsg(sprintf(internal error %d:%s\n, mysql_errno(), mysql_error())); exit() ; } // Selct the db if (!mysql_select_db($db, $link)) { DisplayErrMsg(sprintf(Error in selecting %s db, $db)) ; DisplayErrMsg(sprintf(error:%d %s, mysql_error($link), mysql_error($link))) ; exit(); } // Execute the Statement if (!($result = mysql_query($searchStmt, $link))) { DisplayErrMsg(sprintf(Error in executing %s stmt, $searchStmt)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } $num = mysql_numrows($result); include(header.php); ? body bgcolor=white center table border=0 width=75% cellpadding=2 cellspacing=3 ?php $i=0; $t=0; $count=0; echo $cfgBgcolorOne; echo $cfgBgcolorTwo; $bgcolor = $cfgBgcolorOne; echo(tr bgcolor=$bgcolor); while($row=mysql_fetch_object($result)) { $i % 2 ? 0: $bgcolor = $cfgBgcolorTwo; $i++; if($count % 4==0) { echo(/tr); echo(tr bgcolor=$bgcolor); echo $bgcolor; } $count++; ? tdfont face=Arial size=2 color=00B?php echo $row-operator;?/B/font/td ?php if($count % 4==0) { echo(/tr); } } ? /table/center while($row=mysql_fetch_object($result)) { $i % 2 ? 0: $bgcolor = $cfgBgcolorTwo; $i++; if($count % 4==0) { echo(/tr); echo(tr bgcolor=$bgcolor); echo $bgcolor; } $count++; ? tdfont face=Arial size=2 color=00B?php echo $row-operator;?/B/font/td ?php if($count % 4==0) { echo(/tr); } } ? /table/center ?php include(footer.php); ? TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how do I do this
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks. This is what I was looking for. I will try and hack the example Adrian On Tue, 24 Apr 2001, Philip Olson wrote: I missed this thread but check out : http://zend.com/zend/tut/drop-down.php regards, philip On Tue, 24 Apr 2001, Adrian D'Costa wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 23 Apr 2001, Andreas Landmark wrote: country the corresponding cities should only be listed in the second dropdown box. Can some one guide me. Right below is my table structure. If you want to do this with pure php you'll need to reload the page after the user selects the country from the dropdownbox, to get the webbrowser to switch the cities in the city-dropdown w/o reloading you'll need to use javascript or similar evil measures... I want to do it in pure php, how do I do this. I tried it in javascripts but I could not get javascript to pass the results back to php. My knowledge is limited TIA Adrian -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.2 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE65R4X/f1mUNueu/oRAmMWAJ0fwyRUjYHehZVr2y6yp+7ZcD+HVACeOINX 1TUK0JkhUygsXC2uawoxikM= =2c/I -END PGP SIGNATURE- -- 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] -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.2 (GNU/Linux) Comment: For info see http://www.gnupg.org iD4DBQE65Sv4/f1mUNueu/oRAi3JAJit2Ny3NHZ7n6bFZZGMDqGewdHrAKDUuOc2 /X7LTzPXuVggiinSZ4TATA== =49Be -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Posting to a form
I had this problem when I saved the page as a .html rather than a .php Adrian On Mon, 23 Apr 2001, Wade wrote: I'm trying to do the following input type=text tabindex=17 name=Aname value= ? echo strtoupper($Aname); ? But when Aname is multiple words, such as Wade Williams, everything from the whitespace on gets cut off. Any ideas how to fix this? Thanks Wade -- 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] how do I do this
Hi, I have the following script. What I want is that when I select the country the corresponding cities should only be listed in the second dropdown box. Can some one guide me. Right below is my table structure. $searchStmt = select name from airlines group by name order by name ; #$searchStmt1 = select * from destinazione order by name ; $searchStmt1 = select * from country order by country; $searchStmt2 = select name from airport group by name order by name ; $searchStmt3 = select * from city order by city; // connect to the db if (!($link = mysql_pconnect($db_server, $db_login, $db_passwd))){ DisplayErrMsg(sprintf(internal error %d:%s\n, mysql_errno(), mysql_error())); exit() ; } // Selct the db if (!mysql_select_db($db, $link)) { DisplayErrMsg(sprintf(Error in selecting %s db, $db)) ; DisplayErrMsg(sprintf(error:%d %s, mysql_error($link), mysql_error($link))) ; exit(); } // Execute the Statement for compagnia_aerea if (!($result = mysql_query($searchStmt, $link))) { DisplayErrMsg(sprintf(Error in executing %s stmt, $searchStmt)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } // Execute the Statement for destinazione/Country if (!($result1 = mysql_query($searchStmt1, $link))) { DisplayErrMsg(sprintf(Error in executing %s stmt, $searchStmt1)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } // Execute the Statement for airports if (!($result2 = mysql_query($searchStmt2, $link))) { DisplayErrMsg(sprintf(Error in executing %s stmt, $searchStmt2)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } // Execute the Statement for city if (!($result3 = mysql_query($searchStmt3, $link))) { DisplayErrMsg(sprintf(Error in executing %s stmt, $searchStmt3)); DisplayErrMsg(sprintf(error:%d %s, mysql_errno($link), mysql_error($link))); exit(); } $num = mysql_numrows($result); include(header.php); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN body TEXT=#ff bgcolor=white h1 ALIGN=CENTERfont SIZE=5 FACE=ArialOFFERTE VOLI ENTRATA DATI/font/h1 form ACTION=flight.php METHOD=POST table WIDTH=100% BORDER=1 CELLPADDING=2 CELLSPACING=3 COL WIDTH=59* removed some lines to shorten the mail tr td WIDTH=22%font SIZE=2 FACE=ArialDESTINAZIONE/font/td td WIDTH=55%input type=radio name=ndest value=n checkedselect NAME=destinazione ?php $i=0; while($row1 = mysql_fetch_object($result1)) { // Display records for destinazione/Country echo(option value=$row1-contid $row1-country); } ? /select select name=city ?php while($row3 = mysql_fetch_object($result3)) { // Display records for city echo(option value=$row3-id$row3-city); } ? === Tables Structures == city | id| int(5) | | PRI | | auto_increment | | city | varchar(35) | | MUL | || | countryid | int(5) country | id | int(5) | | PRI | | auto_increment | | country | varchar(35) | | MUL | || | contid | int(5) flight | id| int(11) | | PRI | | auto_increment | compagnia_aerea | varchar(255) | YES | | | | contid| int(5) | | | 0 | | cityid| int(5) | | | 0 | | airport | varchar(40) | | | | | partenza | date | YES | | | | valido_fino | date | YES | | | | prezzo_pubblicato | varchar(255) | YES | | | | curr2 | char(3) | YES | | | | prezzo_offerta| varchar(255) The contid field in the country table holds unique ids for each country. The city.id holds unique ids for each city and is linked to the country table with the countryid. The flight.contid and flight.cityid holds values of the the country and city tables. TIA Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie Help!! Please Look!
use wordpad. Adrian On Wed, 18 Apr 2001, Tony Daniels wrote: I used notepad and it shows some weird symbols like darkened in squares. That is why I was wondering if there was a specific program. Is there any way to get rid of the squares? Thank for your help. Jason Murray wrote: I need to know if there is a program out there that I can use to edit the PHP files. I use CuteFTP to download the files from my server as I need to change some wording around from time to time. Does anyone know the correct procedure for downloading a php file with CuteFTP and then a program that I can use to edit the text I need to edit. Then also, the correct way to upload it back to the server using CuteFTP. Do I use Binary or ACII. PHP files (unless optimised by Zend or something) are just plain text files. You can use either Binary or ASCII mode to up/download them, and your text editor of choice (Notepad, PFM, HomeSite, or for the masochists, MS Word :)) to edit them and save them. 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] -- 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]