[PHP] validate international phone numbers
Hi, I am trying to validate international phone numbers before adding into a db. After a bit of research I came up with this regex: return (ereg('^[0-9]{1,3}\.[0-9]{1,6}\.[0-9]{1,8}$', $phone)); However, this tightens the numbers to something like this: 409.711.933838 Thats a problem, since some countries have complete other formats and some peopole place a + in front and a : instead of . or even just the number. Can anybody recommend a good regex to validate this? I am not to good at creating regex :-( Thanx for any help, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap-sort
imap-sort function doesn't search correctly for unicode strings, is there any unicode function with this functionality that support locale?? -- Vahid Ghafarpour. [EMAIL PROTECTED] http://vahid.ghafarpour.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] beginnind and end of the week
Your solution works only for Monday. For Tuesday output is below start -- 20041108 end - 20041114 I have no idea why ti doesn't wotk. On Mon, 1 Nov 2004 02:45:59 +, Curt Zirzow [EMAIL PROTECTED] wrote: * Thus wrote Jerry Swanson: I need to run a query using PHP/MYSQL. The query should be for a week. So if today is tuesday, the query should be from Monday to Sunday. How in in php I can know when the beginning and end of the week? ?php // in case the date unlikley changes $t = time(); // this weeks monday $m = strtotime('this monday', $t); // next weeks monday minus 1 second $s = strtotime('next monday', $t) - 1; echo date('r', $m), \n; echo date('r', $s), \n ? Now $m and $s contain the proper timestamps. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] validate international phone numbers
On Tuesday 02 November 2004 10:49, Merlin wrote: I am trying to validate international phone numbers before adding into a db. After a bit of research I came up with this regex: return (ereg('^[0-9]{1,3}\.[0-9]{1,6}\.[0-9]{1,8}$', $phone)); However, this tightens the numbers to something like this: 409.711.933838 Thats a problem, since some countries have complete other formats and some peopole place a + in front and a : instead of . or even just the number. Can anybody recommend a good regex to validate this? I am not to good at creating regex :-( Using a single regex which encompasses all formats of telephone numbers used throughout the world will result in something that is pretty much useless. I would just check that their entry consists only of digits, space, hyphen, plus sign and period. Otherwise create an individual check for each country in the world that you're interested in. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* No one so thoroughly appreciates the value of constructive criticism as the one who's giving it. -- Hal Chadwick */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] validate international phone numbers
-Original Message- From: Merlin [mailto:[EMAIL PROTECTED] Sent: 02 November 2004 10:49 To: [EMAIL PROTECTED] Subject: [PHP] validate international phone numbers Hi, I am trying to validate international phone numbers before adding into a db. After a bit of research I came up with this regex: return (ereg('^[0-9]{1,3}\.[0-9]{1,6}\.[0-9]{1,8}$', $phone)); However, this tightens the numbers to something like this: 409.711.933838 Thats a problem, since some countries have complete other formats and some peopole place a + in front and a : instead of . or even just the number. Can anybody recommend a good regex to validate this? I am not to good at creating regex :-( Thanx for any help, Merlin I know this is not exactly what you were asking, but, some time ago I did some phone number validation/formatting but not in PHP. IIRC I had a list of countries each of which had the relevant international dialling code recorded. The user of a form would select their country and enter a telephone number. The international dialling code would be added if not present or validated if '+' was present. Any leading 0 (after an int. code) would be removed. Beyond that I think all you can do is validate that a certain number of digits must have been entered as different people/countries use different formatting chars: space , . - : etc etc Another approach would be to request each component separately: int.code, area code, local number. This of course was all done within a function/class not a single statement. HTH Graham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] validate international phone numbers
Merlin wrote: Hi, I am trying to validate international phone numbers before adding into a db. After a bit of research I came up with this regex: return (ereg('^[0-9]{1,3}\.[0-9]{1,6}\.[0-9]{1,8}$', $phone)); However, this tightens the numbers to something like this: 409.711.933838 Thats a problem, since some countries have complete other formats and some peopole place a + in front and a : instead of . or even just the number. Can anybody recommend a good regex to validate this? I am not to good at creating regex :-( Strip out all non-numerical characters before you process. Sincerely, Joshua D. Drake Thanx for any help, Merlin -- Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC Postgresql support, programming shared hosting and dedicated hosting. +1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com PostgreSQL Replicator -- production quality replication for PostgreSQL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: GUI editor for php?
Vail, Warren wrote: I like htmlkit; (it's free) http://www.chami.com/html-kit/ Emacs, Quanta, Kate??? Warren Vail -Original Message- From: Eric Bolikowski [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:25 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: GUI editor for php? Andy B [EMAIL PROTECTED] skrev i melding news:[EMAIL PROTECTED] Hi. Is there any GUI editors out there for php? if so does anybody know of a good one that doesnt cost a ton of money?? There's a trial for Zend Studio at www.zend.com Eric -- Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC Postgresql support, programming shared hosting and dedicated hosting. +1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com PostgreSQL Replicator -- production quality replication for PostgreSQL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed on php/mysql
Well my page doesnt have any of the spoken about elements on it yet, because I am not clear as to go about it. The fields I speak of are things that need to be added extra to my page. Here is my pages code so far... ?php require('includes/application_top.php'); require('registration_globals.php'); require('includes/form_check.js.php'); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleMatchmakers - empowerment opportunities network/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link href=style.css rel=stylesheet type=text/css script language=JavaScript type=text/JavaScript !-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d .MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; ia.length; i++) if (a[i].indexOf(#)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } !-- Hide from old browsers function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) } // end hiding -- //-- /script /head body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 !-- header //-- ?php require('includes/header.php'); ? !-- header_eof //-- !-- body //-- table width=100% border=0 cellspacing=2 cellpadding=5 background=images/page_bg.gif tr td valign=toptable width=130 tr td width=120 align=right class=pagetitlebrregistrationimg src=images/register_image.gif/td /tr /table/td td table width=100% border=0 cellpadding=0 cellspacing=0 tr valign=top pbrbrbFill in all the fields below correct and accurately, then click Register Now./bbrbr /tr tr tdtable width=65% form title=register method=post onsubmit=return check_form(); ?php if (isset($submit) $submit == Register Now){ if (strlen($business_name) == 0) {} else if (strlen($business_owner) == 0) {} else if (strlen($street_address) == 0) {} else if (strlen($suburb) == 0) {} else if (strlen($city_town) == 0) {} else if (strlen($province_desc) == 0) {} $email_popup(); (the code i was trying to use to call popup window) } else { $insertquery = INSERT INTO business (BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID, StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID, IndustryOther, BusinessAge, AnnualTurnoverID, EmpowermentProfileID, BEEScoreCardID, PreferredLocationID, PreferredProductService, PreferredMatchPartner, PreferredAgeID, PreferredTurnoverID, PreferredEmpowermentProfileID, DateRegistered, MarketSourceID) VALUES ($business_name, $business_owner, $street_address, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',); echo Your registration has been submitted; } ? tr td class=formAreaTitle.: Business Contact Details/td /tr tr td class=main table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right class=contentBusiness Name:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_name/td /tr tr td width=45% align=right class=contentBusiness Owner:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_owner/td /tr tr td width=45% align=right class=contentStreet Address:/td td width=55%input class=content type=text size=35 maxlength=100 name=street_address/td /tr tr td width=45% align=right class=contentSuburb:/td td width=55%input class=content type=text size=35 maxlength=100 name=suburb/td /tr tr td width=45% align=right class=contentCity/Town:/td td width=55%input class=content type=text size=35 maxlength=100 name=city_town/td /tr tr td width=45% align=right class=contentProvince:/td td width=55% select class=content name=province_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_provinces;$x++) { echo('option value='.$rijprovinces[$x][ProvinceID].''); echo(''.$rijprovinces[$x][Description].'/option'); } ? /select /td /tr tr td width=45% align=right class=contentStreet Code:/td td width=55%input class=content type=text size=5 maxlength=4 name=street_code/td /tr tr td width=45% align=right class=contentPostal Address:/td td width=55%textarea rows=5 cols=35 class=content name=postal_address/textarea/td /tr tr td width=45% align=right class=contentPostal Code:/td td width=55%input class=content type=text size=5 maxlength=4 name=postal_code/td /tr tr td width=45% align=right class=contentWebsite Address:/td td width=55%input class=content type=text size=35 maxlength=50 name=website_address/td /tr /table /td /tr tr td class=formAreaTitle.: Business Information/td /tr tr td class=main width=60% table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right
[PHP] Development work
Hi, I work for a financial publishing company based on Haymarket in London. Our current development team are moving on so we are looking for a seasoned PHP developer to help add new functionality to our existing systems. We are looking for someone who has a good understanding of web server architecture (Apache) and has database skills MySQL and possibly postgres. (Knowledge of C++ and/or java would be a bonus). Our CMS system is written entirely in PHP and MySQL - except for a user upload facility which is written in C++. Examples of features within our CMS system include: template system, forums, galleries, user management, login scripts for products/pages/pdf's etc, XML upload, XML news feeds, full text search, job section, etc. We currently require a shopping cart facility linked to our CMS that we can then deploy across any of our sites. We would be interested in meeting with you and discussing a quote for that work. There may well be other projects in the future - we usually require around 30+ development days a year. If this is something that might interest you please contact me to arrange a meeting with myself and the Director of Online Operations Henry Perks. Kind regards, Chris Bartlett Webmaster Incisive Media www.incisivemedia.com Tel: 020 7484 9860
[PHP] filtering out array values
Hi there, I am retrieving some values out of the db and would only like to show those available inside a drop down field. Now I do have 2 arrays which fill the drop down field and one array with the values which should only show up. Example: $objects_available = array(3,5,7); $ob_options = array( 'all available', 'accomodations', 'internet access', 'tour operators', 'restaurants' , 'pubs', 'clubs', 'museums', 'secret spots', 'hotels at the airport'); $ob_values = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); Has anybody an idea how to filter just the ones out which are inside the objects available array? I am sure this is possible without any if statements, but just cant come up with a clear programming solution. Can anybody help with a good solution? Thank you in advance, merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GUI editor for php?
Andy B wrote: Hi. Is there any GUI editors out there for php? if so does anybody know of a good one that doesnt cost a ton of money?? I'd go with Eclipse (http://eclipse.org) with either PHP-Eclipse (http://phpeclipse.org) or Xored Trustudio (http://xored.com). They're all free of charge. The two latter are plugins for the Eclipse framework (the first). -- Daniel Schierbeck Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/registerr=6584 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filtering out array values
On Tuesday 02 November 2004 13:32, Merlin wrote: I am retrieving some values out of the db and would only like to show those available inside a drop down field. Now I do have 2 arrays which fill the drop down field and one array with the values which should only show up. Example: $objects_available = array(3,5,7); $ob_options = array( 'all available', 'accomodations', 'internet access', 'tour operators', 'restaurants' , 'pubs', 'clubs', 'museums', 'secret spots', 'hotels at the airport'); $ob_values = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); Has anybody an idea how to filter just the ones out which are inside the objects available array? I am sure this is possible without any if statements, but just cant come up with a clear programming solution. Assuming that '0' corresponds to 'all available', '1' to 'accomodations' etc, then: foreach ($objects_available as $key) { echo $ob_options[$key]; } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* There are three kinds of people: men, women, and unix. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5 and mysql 4.1 - Authentication
Hi there, I am sure there has been a discussion about this previously, I couldn't find much through google though . anyway. I know I must use mysqli, and that is also not the problem. The problem is with things like phpmyadmin and bxcms. I am not going through all the code to fix the mysql connections. Is there no way I can tell MySQL4.1.6 to accept http authentication? This seems to be the overall problem, because it foes not even find the right access password once a connection is establishes (using the OLD_PASSWORD() function). Thomas
[PHP] Scaling select lists
When working with select lists that grow over time, what are some solutions people have applied to the problem of massive select lists? This is pretty cumbersome for the users to navigate. They end up scrolling up and down and getting annoyed. Example: select name=Contacts[] multiple size=10 option name=Contacts[] value=474 selectedfred option name=Contacts[] value=475 selectedbob ... 800 more option lines /select I've considered going to dual select boxes like the one @ http://www.philwebb.com/code/list_box.asp Has anyone applied a solution that users appreciated to overcome massive select lists ? _ Chris Gregors We have the courage to innovate Potestatem Obscuri Lateris Nescis smime.p7s Description: S/MIME cryptographic signature
[PHP] text email new line
I'm sending text email. How I can make new line. \n seems to be not working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
* Patrick Donker [EMAIL PROTECTED] wrote: Hi folks, snip This is just a friendly reminder that if you are registered in the United States to VOTE on November 2, 2004 (TOMORROW) Need to know where you vote? Please see the attached file (it is an image) that contains some information Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on a national mailinglist only. well, surely its spam ... BUT: i personally think its okay to talk about such offtopics when they're so generally important. On 9/11 we got the longest thread in the german PHP list we ever had ... The current election is probably as important as 9/11, becaus US citizens have to decide whether they still want an administration which blocked any attemt to prevent the attack on WTC and misused the losses to make US ready for imperialistic wars - as well as their ancestors did with Pearl Habour - and attacks one country after another, brings destruction, dead an poverty to millions of people. The american citizens have to decide whether they still want an administration which delcared the European countries as supporters of terrorism, negated almost every important international contract (i.e. Kyoto protocol), impersonates aggressiv religious fundamentalism, threatened to invade in Den Haag, sends US people to death. They also have to decide if they still want an administration which is responsible for the destruction of the public health insurance, is responsible for extremly high prices and costs of living, loss of thousands over thousands of jobs, decay of public education and strong growing poverty. I personally don't really see any major difference between the chimp and /bin/.laden ... for me both are fanatic religous killers. So my credo is: Bush for prison, Kerry for president! I really, really hope that the US people make a good decicion for peace, cultural respect and democracy. But I'm not too optimistic that Kerry has an good chance, as long as US are lacking of fair elections - in regions where Diebel voting machines are used, the chimp will win. The chimp won the last election by election fraud and I'm really afraid that this will happen again. Is this the American way of democary ?! cu -- - Enrico Weigelt== metux IT service phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: [EMAIL PROTECTED] cellphone: +49 174 7066481 - -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops -- - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compile my code
Hi to all one question: There is one way to compile my script into intermediate code like jsp? thanks MM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
On Tue, 2 Nov 2004 11:12:49 -0500, Jerry Swanson [EMAIL PROTECTED] wrote: I'm sending text email. How I can make new line. \n seems to be not working. Use \r\n instead of just \n. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: [users@httpd] November 2, 2004 WOT
[snip] BUT: i personally think its okay to talk about such offtopics when they're so generally important. [/snip] You are just inviting a flame war...so don't do it. This is a PHP list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
Hello Jerry, Tuesday, November 2, 2004, 4:12:49 PM, you wrote: JS I'm sending text email. How I can make new line. JS \n seems to be not working. \n in a text (not HTML) email will do the trick most of the time, sometimes I see \r\n, but \n works for me nicely. Are you sure it's quoted properly? instead of ''? Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
Use \r\n Some pop server doesn't support other special characters. Sebastiano Alle 17:12, martedì 2 novembre 2004, Jerry Swanson ha scritto: I'm sending text email. How I can make new line. \n seems to be not working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
Enrico Weigelt wrote: snip So my credo is: Bush for prison, Kerry for president! My credo is keep politics off this mailing list. Wanna discuss politics, go to the Fedora mailing list; They've seemed to welcome it with open arms. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed on php/mysql
Hmmm...I'm not sure I'm following you. You just want to know how to deal with multiple drop down lists? Or do you want to be able to check and make sure all the mandatory selections have been chosen? -dg http://www.rexruff.com On Nov 2, 2004, at 4:58 AM, Garth Hapgood - Strickland wrote: Well my page doesnt have any of the spoken about elements on it yet, because I am not clear as to go about it. The fields I speak of are things that need to be added extra to my page. Here is my pages code so far... ?php require('includes/application_top.php'); require('registration_globals.php'); require('includes/form_check.js.php'); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleMatchmakers - empowerment opportunities network/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link href=style.css rel=stylesheet type=text/css script language=JavaScript type=text/JavaScript !-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d .MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; ia.length; i++) if (a[i].indexOf(#)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } !-- Hide from old browsers function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) } // end hiding -- //-- /script /head body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 !-- header //-- ?php require('includes/header.php'); ? !-- header_eof //-- !-- body //-- table width=100% border=0 cellspacing=2 cellpadding=5 background=images/page_bg.gif tr td valign=toptable width=130 tr td width=120 align=right class=pagetitlebrregistrationimg src=images/register_image.gif/td /tr /table/td td table width=100% border=0 cellpadding=0 cellspacing=0 tr valign=top pbrbrbFill in all the fields below correct and accurately, then click Register Now./bbrbr /tr tr tdtable width=65% form title=register method=post onsubmit=return check_form(); ?php if (isset($submit) $submit == Register Now){ if (strlen($business_name) == 0) {} else if (strlen($business_owner) == 0) {} else if (strlen($street_address) == 0) {} else if (strlen($suburb) == 0) {} else if (strlen($city_town) == 0) {} else if (strlen($province_desc) == 0) {} $email_popup(); (the code i was trying to use to call popup window) } else { $insertquery = INSERT INTO business (BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID, StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID, IndustryOther, BusinessAge, AnnualTurnoverID, EmpowermentProfileID, BEEScoreCardID, PreferredLocationID, PreferredProductService, PreferredMatchPartner, PreferredAgeID, PreferredTurnoverID, PreferredEmpowermentProfileID, DateRegistered, MarketSourceID) VALUES ($business_name, $business_owner, $street_address, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',); echo Your registration has been submitted; } ? tr td class=formAreaTitle.: Business Contact Details/td /tr tr td class=main table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right class=contentBusiness Name:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_name/td /tr tr td width=45% align=right class=contentBusiness Owner:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_owner/td /tr tr td width=45% align=right class=contentStreet Address:/td td width=55%input class=content type=text size=35 maxlength=100 name=street_address/td /tr tr td width=45% align=right class=contentSuburb:/td td width=55%input class=content type=text size=35 maxlength=100 name=suburb/td /tr tr td width=45% align=right class=contentCity/Town:/td td width=55%input class=content type=text size=35 maxlength=100 name=city_town/td /tr tr td width=45% align=right class=contentProvince:/td td width=55% select class=content name=province_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_provinces;$x++) { echo('option value='.$rijprovinces[$x][ProvinceID].''); echo(''.$rijprovinces[$x][Description].'/option'); } ? /select /td /tr tr td width=45% align=right class=contentStreet Code:/td td width=55%input class=content type=text size=5 maxlength=4 name=street_code/td /tr tr td width=45% align=right class=contentPostal Address:/td td width=55%textarea rows=5 cols=35 class=content name=postal_address/textarea/td /tr tr td width=45% align=right class=contentPostal Code:/td td width=55%input class=content type=text size=5 maxlength=4 name=postal_code/td /tr tr td width=45% align=right class=contentWebsite Address:/td td
Re: [PHP] Re: [users@httpd] November 2, 2004
* Thus wrote Enrico Weigelt: * Patrick Donker [EMAIL PROTECTED] wrote: Hi folks, snip This is just a friendly reminder that if you are registered in the United States to VOTE on November 2, 2004 (TOMORROW) Need to know where you vote? Please see the attached file (it is an image) that contains some information Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on a national mailinglist only. well, surely its spam ... BUT: i personally think its okay to talk about such offtopics when they're so generally important. The problem is the message was posted to like 9 mailing lists, his personal friends etc... no matter if the message was ontopic, you simply dont do that. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
On Tue, 2 Nov 2004 16:25:56 +, Richard Davey [EMAIL PROTECTED] wrote: Hello Jerry, JS I'm sending text email. How I can make new line. JS \n seems to be not working. \n in a text (not HTML) email will do the trick most of the time, sometimes I see \r\n, but \n works for me nicely. Are you sure it's quoted properly? instead of ''? The RFC 2822 for Internet Message Format states clearly that MUST be \r\n using only \n is not standard and you cannot expet all servers to accept it as a valid separator. Just want to take your attention to this paragraph from RFC 2822: Messages are divided into lines of characters. A line is a series of characters that is delimited with the TWO characters carriage-return and line-feed; that is, the carriage-return (CR) character (ASCII value 13) followed inmediatly by the line-feed (LF) character (ASCII value 10). Also take in consideration that a message line cannot have more that 998 characters (plus CRLF) ... The RFC 2821 says: The apperance of CR or LF characters in text has long history of causing problems in mail implementations and applications that use the mail system as a tool. SMTP client implementattions MUST NOT transmit these characters except when they are intended as line terminators and then MUST transmit them only as CRLF sequence. I hope this will help in composing mail messages and my recommendation is to *follow the standard* and send messages always by using CRLF as a line delimiter. Only doing that way, you will ensure your messages are accepted by any server. More information: RFC 2822 - http://www.faqs.org/rfcs/rfc2822.html. RFC 2821 - http://www.faqs.org/rfcs/rfc2821.html. Best regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] VOTE TODAY
I can't wait for the replies... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
#1. $headers .= Content-Type: text/plain; #2. $headers .= Content-Type: text/html; charset=iso-8859-1\r\n; If I use #1 header I don't need \n\r just create extra space on the email. Why \n\r doesn't work for #2 ? TH On Tue, 2 Nov 2004 17:23:41 +0100, Sebastiano Cascione [EMAIL PROTECTED] wrote: Use \r\n Some pop server doesn't support other special characters. Sebastiano Alle 17:12, martedì 2 novembre 2004, Jerry Swanson ha scritto: I'm sending text email. How I can make new line. \n seems to be not working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
On Tue, 2 Nov 2004 17:57:02 +0100, Enrico Weigelt [EMAIL PROTECTED] wrote: BUT: i personally think its okay to talk about such offtopics when they're so generally important. Perhaps is so important to US citizens, but not to much people outside the US ... and I think this is not a list about US politics, this is an international technical list about PHP with people from lots of countries that have nothing to do with US elections. In my opinion this is not the place where anybody can talk about their country's elections. Regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
was the presidential election coded in php? On Tue, 2 Nov 2004 17:34:58 +, Curt Zirzow [EMAIL PROTECTED] wrote: * Thus wrote Enrico Weigelt: * Patrick Donker [EMAIL PROTECTED] wrote: Hi folks, snip This is just a friendly reminder that if you are registered in the United States to VOTE on November 2, 2004 (TOMORROW) Need to know where you vote? Please see the attached file (it is an image) that contains some information Do we care? Realy? Unlikely. Maybe you should send your 'useful' info on a national mailinglist only. well, surely its spam ... BUT: i personally think its okay to talk about such offtopics when they're so generally important. The problem is the message was posted to like 9 mailing lists, his personal friends etc... no matter if the message was ontopic, you simply dont do that. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- R. Carson -BEGIN GEEK CODE BLOCK- Version: 3.1 GIT d s+:+ a- C$ ULL+++$ P+ L$ !E- W N+ !o K-? !w--- !O !M !V PS+ PE+ Y+ PGP+ !t !5 !X R+ !tv b++ !DI !D G++ e+ h r+++ y --END GEEK CODE BLOCK-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
I can't wait for the replies... Here's a reply: Don't vote for Bush. - Grant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
People have different political opinions, and different religions...discussing them in a forum or a list just starts arguments,flaming and does not make sense. People receive this list's mailings for php.thats it. To the original person who started this thread (I deleted the original so I cant reply to you directly), shoot yourself in the head and not only us but both the candidates should thank you and maybe you'll get 70 virgins in the next life. This list gets enough traffic as is and a crapload of repeat questions/questions that are easily solved by looking in google or the manual (aka RTFM questions) and we don't need to add politics to it, I also ask the rest of the list to forgive me for this totally OT reply.if any of you still want to act like an idiot and start flaming medo it offlist at this address so it wont bother anyone else and I can read your email, add your name to the jackass list and delete the mail. Thanks, Ryan On 11/2/2004 5:51:04 PM, John Nichel ([EMAIL PROTECTED]) wrote: Enrico Weigelt wrote: snip So my credo is: Bush for prison, Kerry for president! My credo is keep politics off this mailing list. Wanna discuss politics, go to the Fedora mailing list; They've seemed to welcome it with open arms. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
ApexEleven wrote: I can't wait for the replies... cat $you /dev/null -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
On 11/2/2004 6:34:43 PM, ApexEleven ([EMAIL PROTECTED]) wrote: I can't wait for the replies... Heres one, I vote you drive yourself and your family as fast as possible on the freeway then close your eyes and wave both your hands in the air while counting from 1000 to 1, be sure to keep the accelerator to the floor. -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
Jordi Canals wrote: On Tue, 2 Nov 2004 17:57:02 +0100, Enrico Weigelt [EMAIL PROTECTED] wrote: BUT: i personally think its okay to talk about such offtopics when they're so generally important. Perhaps is so important to US citizens, but not to much people outside the US ... That's fully wrong indeed. Politics of the U.S. government, as the unique wordlwide power, has a lot of influence in the rest of the world. and I think this is not a list about US politics, this is an international technical list about PHP with people from lots of countries that have nothing to do with US elections. In my opinion this is not the place where anybody can talk about their country's elections. Probably you're right about the offtopic, but you're still following it... Regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
On Tue, 2004-11-02 at 10:50 -0700, Grant wrote: I can't wait for the replies... Here's a reply: Don't vote for Bush. - Grant I'm Canadian, please stop wasting my bandwidth. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: [users@httpd] November 2, 2004
[snip] This list gets enough traffic as is and a crapload of repeat questions/questions that are easily solved by looking in google or the manual (aka RTFM questions) and we don't need to add politics to it [/snip] And further to this point, people who reply to off-topic posts only further congest the list and push the problem further. I know it might seem hypocritical of me to state this, since this is in itself a reply to an off-topic post, but I do so in hopes that everyone on this list will follow my lead and NOT reply to any more of these plebian rantings about other countries' (or, if you're an American citizen, your country's) elections (or other blatantly OT posts, for that matter). If nobody replies to these stupid posts, then they will just go away. It's like the Simpsons' Halloween Special piece where all the advertising billboard characters come alive and run amuck in Springfield, and the marketing company that created them tells Lisa that people must stop paying attention to them to make them go away. If people don't look at them, they will go away. Simple as that. If you nobody replies to OT posts, they will go away. Once again the Simpsons' shows us the way... Just my $0.02 (CDN). P. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error Code Airhead
I'm sure I'm missing something really obvious here but can't see it. There is a form where one of two promotional codes can be entered. I check for the these codes and give the user an error message if they enter the wrong code. First one doesn't work, second one does with only one code. //always gives error message even if one of the two codes entered: if ($Promotion_Sub == 'Checked' ($code != 'D04E' || $code != 'Y04KG')) { echo html head titleError/title /head body bgcolor=\#FF\ text=\#00\ link=\#ff\ vlink=\#660099\ h3Error/h3 pSorry, that code is invalid./p - //works: if ($Promotion_Sub == 'Checked' $code != 'D04E') { Thanks Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] filtering out array values
Jason Wong wrote: On Tuesday 02 November 2004 13:32, Merlin wrote: I am retrieving some values out of the db and would only like to show those available inside a drop down field. Now I do have 2 arrays which fill the drop down field and one array with the values which should only show up. Example: $objects_available = array(3,5,7); $ob_options = array( 'all available', 'accomodations', 'internet access', 'tour operators', 'restaurants' , 'pubs', 'clubs', 'museums', 'secret spots', 'hotels at the airport'); $ob_values = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); Has anybody an idea how to filter just the ones out which are inside the objects available array? I am sure this is possible without any if statements, but just cant come up with a clear programming solution. Assuming that '0' corresponds to 'all available', '1' to 'accomodations' etc, then: foreach ($objects_available as $key) { echo $ob_options[$key]; } This did not work. Here is how I solved it: $key = array_search($ob_values[$h], $object); if ($key !== false) printf (option value = \%s\%s%s/option\n, $ob_values[$h],$isselected,$ob_options[$h]); Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
I can't wait for the replies... Here's a reply: Don't vote for Bush. - Grant I'm Canadian, please stop wasting my bandwidth. I'm South African (and bandwidth is very expensive), please don't waiste mine either *G* -- Chris. * ** This email has been scanned by Cenergy Networks for viruses and ** ** spam. As part of our ongoing drive to ensure reliable and ** ** secure communications, Cenergy Networks guarantees this message ** ** to be clean of any viruses or spam. Should you not be satisfied** ** with the content of this email, please let us know by emailing ** ** us at [EMAIL PROTECTED] ** * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Code Airhead
On Tue, 02 Nov 2004 12:17:45 -0600, Jeff Oien [EMAIL PROTECTED] wrote: if ($Promotion_Sub == 'Checked' ($code != 'D04E' || $code != 'Y04KG')) { ($code != 'D04E' || $code != 'Y04KG') Since $code cannot equal two different values at once, this will always evaluate to true. Maybe you meant instead of ||. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Error Code Airhead
[snip] I'm sure I'm missing something really obvious here but can't see it. There is a form where one of two promotional codes can be entered. I check for the these codes and give the user an error message if they enter the wrong code. First one doesn't work, second one does with only one code. //always gives error message even if one of the two codes entered: if ($Promotion_Sub == 'Checked' ($code != 'D04E' || $code != 'Y04KG')) { echo html head titleError/title /head body bgcolor=\#FF\ text=\#00\ link=\#ff\ vlink=\#660099\ h3Error/h3 pSorry, that code is invalid./p - //works: if ($Promotion_Sub == 'Checked' $code != 'D04E') { [/snip] I'm not really sure how to answer this! How does this relate to the US election? Isn't this an election list? HA HA HA HA, just kidding ;o) You need to check that the code entered doesn't match both valid codes. Try this instead: If ($Promotion_Sub == 'Checked' $code != 'D04E' $code != 'Y04KG') { Do error stuff } With the code you have above, it will always give the error message because you're checking to see if $code is not equal to the first value, OR if it is not equal to the second value. So with that, the code supplied might well match the first ('D04E') but since that obviously doesn't match the second, it's going to throw the error. HTH, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] authentication question
I need to require username/password access in two distinct ways. At one level, I need to protect all files except .php files within a directory structure. I can do this with htaccess using the FilesMatch directive. I also need to serve up database driven content via username/password at another. I'm doing this via sessions and php. I want the same username and password to work for both. I don't know how to restrict access to the non-php files with php. Is there a way? If not, is there a way that the username/password info stored in the session var can be used in conjunction with the htaccess file so if the user has already logged in via the session system, they don't have to then enter the same data again via http authentication? Kelly Meeks Right Angle, Inc. PO Box 356 Northampton, MA 01060 413-586-4694 ext. 11
Re: [PHP] Error Code Airhead
-- Original message -- From: Jeff Oien [EMAIL PROTECTED] //always gives error message even if one of the two codes entered: if ($Promotion_Sub == 'Checked' ($code != 'D04E' || $code != 'Y04KG')) { If $code is D04K then it is not Y04KG making the statement true since it is an or. I think either ($code != 'D04E' $code != 'Y04KG') or !($code == 'D04E' || $code == 'Y04KG') are what you are looking for. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authentication question
On Tue, 2 Nov 2004 13:48:30 -0500, Kelly Meeks [EMAIL PROTECTED] wrote: I need to require username/password access in two distinct ways. PHP Generic Access Control Lists http://phpgacl.sourceforge.net/ -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] VOTE TODAY
John Nichel wrote: ApexEleven wrote: I can't wait for the replies... cat $you /dev/null Or the slightly more destructive variant: cat /dev/null $you :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is wrong with next code
Have anyone answers on the strange behaviour discussed in the thread ? I has noted specially: It works OK in PHP 4.3.6 or when line $db2 = 0; had been commented in all described versions of PHP. So next example works perfect: - error_reporting(E_ALL); $db1 = mysql_connect ('localhost', 'test', '1'); $db2 = mysql_connect ('localhost', 'test', '1'); mysql_close($db2); $result = mysql_query('SELECT 1+1', $db1); if ($result) { $row = mysql_fetch_row($result); echo Result: {$row[0]}\n; } - [EMAIL PROTECTED]:~/src/PHP# php -q mysql_connect3.php Result: 2 On Thu, 28 Oct 2004 23:08:39 -0400 John Holmes [EMAIL PROTECTED] wrote: Vladimir Shiray wrote: - Warning: mysql_query(): 4 is not a valid MySQL-Link resource in ... $result = mysql_query('SELECT 1+1', $db1); - [snip] $db1 = mysql_connect ('localhost', 'test', '1'); $db2 = mysql_connect ('localhost', 'test', '1'); mysql_close($db2); If you connect with the same parameters, PHP will just reuse the previous connection. So you only have one connection and closing either one will result in the connection being lost, hence the invalid link resource message. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals _ www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
Michael Sims wrote: John Nichel wrote: ApexEleven wrote: I can't wait for the replies... cat $you /dev/null Or the slightly more destructive variant: cat /dev/null $you :) Holy divide-by-zero Batman! ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array help
Hi, I have an variable that contains an array like this: [0] = Array( [0] = Array([0] = {3 3}) [1] = Array([0] = 3) ) [1] = Array( [0] = Array([0] = {3 3}) [1] = Array([0] = 3) ) [2] = Array( [0] = Array( [0] = {textlinks 0_15} [1] = {textlinks 16_30} ) [1] = Array( [0] = 0_15 [1] = 16_30 ) ) As you can see the third one (array [2] )for some reason is coming out as a double dimension array, is there any way to make it too into a single dimension and have just one key/value like the first 2 arrays? eg: the third one becomes [2] = Array( [0] = Array([0] = {textlinks 0_15}) [1] = Array([0] = 0_15) ) and a fouth is created like so [3] = Array( [0] = Array([0] = {textlinks 16_30}) [1] = Array([0] = 16_30) ) Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing a list in the Header
I need to pass a list (preferably an Array) in the header. Can this be done, and if so, what is the best method? Also, how do I extract the info on the page that receives the info? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing a list in the Header
to transfer array through header the best way is using serialize()/unserialize() or explode()/implode() functions see manual for more info. -afan Todd Cary wrote: I need to pass a list (preferably an Array) in the header. Can this be done, and if so, what is the best method? Also, how do I extract the info on the page that receives the info? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array help
[snip] [2] = Array( [0] = Array( [0] = {textlinks 0_15} [1] = {textlinks 16_30} ) [1] = Array( [0] = 0_15 [1] = 16_30 ) ) As you can see the third one (array [2] )for some reason is coming out as a double dimension array, is there any way to make it too into a single dimension and have just one key/value like the first 2 arrays? [/snip] Yes. Of course the question is, how are you builing this array? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text email new line
It is working without \r\n. Just using regular spaces/new lines in the text message. On Tue, 2 Nov 2004 18:34:00 +0100, Jordi Canals [EMAIL PROTECTED] wrote: On Tue, 2 Nov 2004 16:25:56 +, Richard Davey [EMAIL PROTECTED] wrote: Hello Jerry, JS I'm sending text email. How I can make new line. JS \n seems to be not working. \n in a text (not HTML) email will do the trick most of the time, sometimes I see \r\n, but \n works for me nicely. Are you sure it's quoted properly? instead of ''? The RFC 2822 for Internet Message Format states clearly that MUST be \r\n using only \n is not standard and you cannot expet all servers to accept it as a valid separator. Just want to take your attention to this paragraph from RFC 2822: Messages are divided into lines of characters. A line is a series of characters that is delimited with the TWO characters carriage-return and line-feed; that is, the carriage-return (CR) character (ASCII value 13) followed inmediatly by the line-feed (LF) character (ASCII value 10). Also take in consideration that a message line cannot have more that 998 characters (plus CRLF) ... The RFC 2821 says: The apperance of CR or LF characters in text has long history of causing problems in mail implementations and applications that use the mail system as a tool. SMTP client implementattions MUST NOT transmit these characters except when they are intended as line terminators and then MUST transmit them only as CRLF sequence. I hope this will help in composing mail messages and my recommendation is to *follow the standard* and send messages always by using CRLF as a line delimiter. Only doing that way, you will ensure your messages are accepted by any server. More information: RFC 2822 - http://www.faqs.org/rfcs/rfc2822.html. RFC 2821 - http://www.faqs.org/rfcs/rfc2821.html. Best regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing marked rows in a table
I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing marked rows in a table
[snip] I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? [/snip] Loop through the results of the checkbox array which should be associated with a value from the database and do your selection based on the associated data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing a list in the Header
Not sure why you need to pass it in the header as apposed to the body, since html provides the following; - snip form action=postpgm.php method=post input type=hidden name=arrayvalue[0] value=value0 input type=hidden name=arrayvalue[1] value=value1 input type=hidden name=arrayvalue[2] value=value2 - snip And in the form postpgm.php $receivedarray = $_POST[arrayvalue]; // $receivearray will be an array type with all the values above. If I were doing this, I would have chosen PHP sessions to pass this information since then it can't be modified by the user, and the array content doesn't need to make the round trip to the browser and back (I have to pay for my bandwidth). http://www.php.net/manual/en/ref.session.php Only arrays I've seen in the header are JavaScript Arrays, and you'd have to do something special in JavaScript to get them back. Hope this helps, Warren Vail -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 1:04 PM To: [EMAIL PROTECTED] Subject: [PHP] Passing a list in the Header I need to pass a list (preferably an Array) in the header. Can this be done, and if so, what is the best method? Also, how do I extract the info on the page that receives the info? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing marked rows in a table
On Tue, 02 Nov 2004 13:38:03 -0800, Todd Cary [EMAIL PROTECTED] wrote: I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? Have a look at how the form data is coming across, you should see the answer right away: echo 'pre'; print_r($_POST); echo '/pre'; -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing marked rows in a table
[snip] I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? [/snip] If the elements all live within the same form, you can add [] to the end of the name/id attribute, and then all checkboxes with the same name will be accessible in an array. So checkboxname[] will show up as $_POST['checkboxname'] on the receiving end. This is the best way, and most appropriate to this list since it is all PHP. HOWEVER, if the checkboxes are all contained in different forms (each form in a row with its own processing options), then you will need to assign a common name to each element (I usually call mine performMultiple), and then using Javascript loop through all elements on the page, checking for the proper name, and if found then adding the value to a comma-delimited list, the value of which will be set to a hidden input field before the form is submitted. HTH. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing marked rows in a table
Assuming you have an artificial key for your table (like an auto increment column), I would place the key field to the table on your form in the value of the checkbox; input type=checkbox name=recsel[] value=$rowid When the form is returned to your post php script it will only receive those checkboxes that are checked and they will come loaded in an array (because of the way the name is described, containing the [] characters); $selarray = $_POST[recsel]; If(is_array($selarray)) $query = select * from datatable where tblkey in (.implode(, ,$selarray).) ; Else echo nothing selected; // even an array containing one occurrence is sufficient. I believe all this is correct. Good luck, Warren Vail -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 1:38 PM To: [EMAIL PROTECTED] Subject: [PHP] Passing marked rows in a table I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing marked rows in a table
[snip] If the elements all live within the same form, you can add [] to the end of the name/id attribute, and then all checkboxes with the same name will be accessible in an array. So checkboxname[] will show up as $_POST['checkboxname'] on the receiving end. [/snip] Can I do $MyArray = $_POST['checkboxname']; And then access each array element for ($i = 0; $i (count($MyAray)); $i++) echo $MyArray[$i]; Todd Pablo Gosse wrote: [snip] I create a list of records from a DB and each has a check box. What is the best way to select those that were checked after the form is submitted? [/snip] If the elements all live within the same form, you can add [] to the end of the name/id attribute, and then all checkboxes with the same name will be accessible in an array. So checkboxname[] will show up as $_POST['checkboxname'] on the receiving end. This is the best way, and most appropriate to this list since it is all PHP. HOWEVER, if the checkboxes are all contained in different forms (each form in a row with its own processing options), then you will need to assign a common name to each element (I usually call mine performMultiple), and then using Javascript loop through all elements on the page, checking for the proper name, and if found then adding the value to a comma-delimited list, the value of which will be set to a hidden input field before the form is submitted. HTH. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Authentification related to browser window
Greetings My problem is pretty simple. User enters the site, logins, and after that he hits ctrl+n or something, to open a new window from same browser. Can I make him to login again in the new window but to keep him logged in the old one? Now i'm using sessions, but i realise that the cookies set by them are related to browser, so every window use them. I hope you will understand what i mean. Cheers, Cristi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Authentification related to browser window
I'm not sure which session parameter controls it, but my sites are setup so that opening a new browser window will start a new session, and if your pages require something in the session saying the user is logged on, he will be forced to logon in the new session, since the variable will not be there. I believe the parameter is the same one that tells it to terminate a session when closing the browser. To make this work, EVERY single page looks for this special session variable, and if not found in the session array it redirects the visitor to the signon page. This means that if his session times out, he will also be sent to the signon page, next time he tries to change pages. With two separate session id's, one for each browser instance, the two browsers operate pretty much independently, each using their own session data. Warren Vail -Original Message- From: Cristi Barladeanu [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 2:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Authentification related to browser window Greetings My problem is pretty simple. User enters the site, logins, and after that he hits ctrl+n or something, to open a new window from same browser. Can I make him to login again in the new window but to keep him logged in the old one? Now i'm using sessions, but i realise that the cookies set by them are related to browser, so every window use them. I hope you will understand what i mean. Cheers, Cristi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] postgres-embedded images via php. two issues...
i am storing images in a postgres database and i have set up a little php file to retrieve them in such a way that i can do: echo img src='gif.php?name=$picname'; ...from another php file. it's working great, BUT i've noticed two things that bother me: [1] if someone wants to download an image, they can, but it will be downloaded as gif.php instead of whatever.gif. even though renaming the file solves the problem, users will be confused by this. [2] (and i think this may be related to the first problem) is that in at least one of my browsers (camino/osx) the images are ALWAYS pulled directly from the server. they are never cached by the browser. i suppose all browsers may be behaving this way, but in camino, it is blatantly and visually obvious as you watch the gif being slowly downloaded/displayed over a slow connection. anyone know what to do for either of these? concerning [2], i'm thinking maybe i can implant the local browser cache _manually_ instead of depending on the browser to do it for me? if so, how would i go about doing that? thanks. - philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentification related to browser window
See from my point of view, You made one file as first.php as alogin page and then in second.php check that the user is authorised or not. and set the value as $_session['user'] And one more file as check.php in which you check that session is set or not. like (isset($_SESSION['user]) if it not true then redirect the page to first.php as header(firs.php). And now add this check.php in all the page as a include file at the starting of your page. So it will check the session first of all then it will go to next page. Thnx.. Ankur Dave PHP Developer,INDIA Quoting Cristi Barladeanu [EMAIL PROTECTED]: Greetings My problem is pretty simple. User enters the site, logins, and after that he hits ctrl+n or something, to open a new window from same browser. Can I make him to login again in the new window but to keep him logged in the old one? Now i'm using sessions, but i realise that the cookies set by them are related to browser, so every window use them. I hope you will understand what i mean. Cheers, Cristi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentification related to browser window
Vail, Warren wrote: I'm not sure which session parameter controls it, but my sites are setup so that opening a new browser window will start a new session, and if your pages require something in the session saying the user is logged on, he will be forced to logon in the new session, since the variable will not be there. I believe the parameter is the same one that tells it to terminate a session when closing the browser. To make this work, EVERY single page looks for this special session variable, and if not found in the session array it redirects the visitor to the signon page. This means that if his session times out, he will also be sent to the signon page, next time he tries to change pages. With two separate session id's, one for each browser instance, the two browsers operate pretty much independently, each using their own session data. Can you post some code? To the best of my knowledge it is not possible to differentiate between browser windows. If new window is opened, it is still the same browser for the server, the original session is restored and your special session variable will be there. To answer the original question - no it's not possible. It would need support in the browser. Marek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentification related to browser window
To answer the original question - no it's not possible. It would need support in the browser. Sorry, I thought you were talking about HTTP authentification. With session you can pass session identifier in URL only, and disable the use of cookies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing marked rows in a table
[snip] Pablo Gosse wrote: [snip] If the elements all live within the same form, you can add [] to the end of the name/id attribute, and then all checkboxes with the same name will be accessible in an array. So checkboxname[] will show up as $_POST['checkboxname'] on the receiving end. [/snip] Todd Cary wrote: Can I do $MyArray = $_POST['checkboxname']; And then access each array element for ($i = 0; $i (count($MyAray)); $i++) echo $MyArray[$i]; Todd [/snip] Yes, that should work fine. But remember the caveat that all elements using the [] notation must be in the same form. If you've got multiple forms on the page and expect to get all checkboxname values it will not happen using []. You'll need to use JS for that. Pablo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: VOTE TODAY
Apexeleven wrote: I can't wait for the replies... Vote? What vote? Just kidding... switch ($candidate) { case CANDIDATE_BUSH: echo 'Oh shit, 4 more years...'; break; case CANDIDATE_KERRY: echo 'Well, he\'s the lesser evil...'; break; case CANDIDATE_NADER: default: echo 'Didn\'t see *that* one coming, did you?'; } -- Daniel Schierbeck Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/registerr=6584 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
I am also Canadian, so don't waste my bandwidth either...Chris bandwidth is cheap in Canada! On Tue, 2 Nov 2004 20:38:02 +0200, Chris Knipe [EMAIL PROTECTED] wrote: I can't wait for the replies... Here's a reply: Don't vote for Bush. - Grant I'm Canadian, please stop wasting my bandwidth. I'm South African (and bandwidth is very expensive), please don't waiste mine either *G* -- Chris. * ** This email has been scanned by Cenergy Networks for viruses and ** ** spam. As part of our ongoing drive to ensure reliable and ** ** secure communications, Cenergy Networks guarantees this message ** ** to be clean of any viruses or spam. Should you not be satisfied** ** with the content of this email, please let us know by emailing ** ** us at [EMAIL PROTECTED] ** * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Michael Lauzon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: VOTE TODAY
switch ($the_choice) { case Daniel_Schierbeck_1: echo 'Didnt read previous thread and comes voiceing his political opinions like a jackass on a high traffic PHP mailing list which people from different countries other than the states receive'; break; case Daniel_Schierbeck_2: echo 'Just a moron'; break; default: echo 'both of the above'; } On 11/3/2004 12:25:43 AM, Daniel Schierbeck ([EMAIL PROTECTED]) wrote: Apexeleven wrote: I can't wait for the replies... Vote? What vote? Just kidding... switch ($candidate) { case CANDIDATE_BUSH: echo 'Oh shit, 4 more years... '; break; case CANDIDATE_KERRY: echo 'Well, he\'s the lesser evil...'; break; case CANDIDATE_NADER: default: echo 'Didn\'t see *that* one coming, did you?'; } -- Daniel Schierbeck Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/registerr=6584 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] postgres-embedded images via php. two issues...
On Tue, 2004-11-02 at 16:45 -0600, P. George wrote: i am storing images in a postgres database and i have set up a little php file to retrieve them in such a way that i can do: echo img src='gif.php?name=$picname'; ...from another php file. it's working great, BUT i've noticed two things that bother me: [1] if someone wants to download an image, they can, but it will be downloaded as gif.php instead of whatever.gif. even though renaming the file solves the problem, users will be confused by this. [2] (and i think this may be related to the first problem) is that in at least one of my browsers (camino/osx) the images are ALWAYS pulled directly from the server. they are never cached by the browser. i suppose all browsers may be behaving this way, but in camino, it is blatantly and visually obvious as you watch the gif being slowly downloaded/displayed over a slow connection. anyone know what to do for either of these? concerning [2], i'm thinking maybe i can implant the local browser cache _manually_ instead of depending on the browser to do it for me? if so, how would i go about doing that? thanks. - philip My guess is that your browser isn't set to cache .php file output. If it's caching images, you might need to trick it into thinking that it's an image. for example, look at the mod_rewrite rules at the bottom of this blog post. http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html I don't know if this *is* the issue, but it's my first guess. -Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] Scaling select lists
At 16:18 02-11-2004, Chris Gregors wrote: When working with select lists that grow over time, what are some solutions people have applied to the problem of massive select lists? This is pretty cumbersome for the users to navigate. They end up scrolling up and down and getting annoyed. Example: select name=Contacts[] multiple size=10 option name=Contacts[] value=474 selectedfred option name=Contacts[] value=475 selectedbob ... 800 more option lines /select I've considered going to dual select boxes like the one @ http://www.philwebb.com/code/list_box.asp Has anyone applied a solution that users appreciated to overcome massive select lists ? Yeah, don't use them. I use a search feature that allows users to select which fields, from 1 specific to all, and anything in between, to search in, and whether to use exact or partial (free text) search. Thus only the entries they actually want displayed come up, and they can then filter onward from that. I don't like using list/select boxes without first having the user pick what part of the information available they actually want. Firstly it's an unnessecary drain on the DB to pull data that is never used, secondly it's an annoyance to users to be forced to wade through endless amounts of options. My users prefer being able to narrow down what they want before being presented with it. It makes the system more flexible and more enjoyable to use. The more work there is in using it, the less it'll be used. And then its purpose is defeated. Rene -- Rene Brehmer aka Metalbunny If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile? http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
I'm Canadian, please stop wasting my bandwidth. As a Canadian, you wasted bandwidth by missing your chance to encourage us Gringos to vote Libertarian: http://www.self-gov.org/quiz.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] text email new line
Hello Jordi, Tuesday, November 2, 2004, 5:34:00 PM, you wrote: JC I hope this will help in composing mail messages and my recommendation JC is to *follow the standard* and send messages always by using CRLF as JC a line delimiter. Only doing that way, you will ensure your messages JC are accepted by any server. I'm not disagreeing with what you posted, because it's all true, but I would like to ask - can you actually name a popular mail server that rejects emails that use \n as a line delimiter (even if used by mistake), because I've haven't seen it happen for years. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] postgres-embedded images via php. two issues...
Hi, Wednesday, November 3, 2004, 8:45:17 AM, you wrote: PG i am storing images in a postgres database and i have set up a little PG php file to retrieve them in such a way that i can do: PG echo img src='gif.php?name=$picname'; PG ...from another php file. PG it's working great, BUT i've noticed two things that bother me: PG [1] if someone wants to download an image, they can, but it will be PG downloaded as gif.php instead of whatever.gif. even though PG renaming the file solves the problem, users will be confused by this. It does not matter what the extension is, it is the header that has more sway PG [2] (and i think this may be related to the first problem) is that in PG at least one of my browsers (camino/osx) the images are ALWAYS pulled PG directly from the server. they are never cached by the browser. i PG suppose all browsers may be behaving this way, but in camino, it is PG blatantly and visually obvious as you watch the gif being slowly PG downloaded/displayed over a slow connection. The browser wont cache url's that have the ? in them so change your info passing scheme to echo img src='gif.php/name=$picname'; then process the query string to extract the info You could even add a dummy value at the end like src='gif.php/name=$picname/type.gif to make it look like a gif' PG anyone know what to do for either of these? concerning [2], i'm PG thinking maybe i can implant the local browser cache _manually_ instead PG of depending on the browser to do it for me? if so, how would i go PG about doing that? PG thanks. PG - philip -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
On Tue, 2 Nov 2004 16:07:58 -0800, Brian Dunning [EMAIL PROTECTED] wrote: I'm Canadian, please stop wasting my bandwidth. And I'm European and don't mind about US elections. Please STOP this politics offtopics here. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] postgres-embedded images via php. two issues...
On Wed, 2004-11-03 at 10:20 +1000, Tom Rogers wrote: Hi, Wednesday, November 3, 2004, 8:45:17 AM, you wrote: PG i am storing images in a postgres database and i have set up a little PG php file to retrieve them in such a way that i can do: PG echo img src='gif.php?name=$picname'; PG ...from another php file. PG it's working great, BUT i've noticed two things that bother me: PG [1] if someone wants to download an image, they can, but it will be PG downloaded as gif.php instead of whatever.gif. even though PG renaming the file solves the problem, users will be confused by this. It does not matter what the extension is, it is the header that has more sway PG [2] (and i think this may be related to the first problem) is that in PG at least one of my browsers (camino/osx) the images are ALWAYS pulled PG directly from the server. they are never cached by the browser. i PG suppose all browsers may be behaving this way, but in camino, it is PG blatantly and visually obvious as you watch the gif being slowly PG downloaded/displayed over a slow connection. The browser wont cache url's that have the ? in them so change your info passing scheme to echo img src='gif.php/name=$picname'; then process the query string to extract the info You could even add a dummy value at the end like src='gif.php/name=$picname/type.gif to make it look like a gif' In my .htaccess file, I have placed the following : RewriteEngine On RewriteRule ^images/([0-9]+)$ image.php?id=$1 [L] RewriteRule ^images/(.*)$ image.php?filename=$1 [L] This allows either: http://localhost/images/5 or http://localhost/images/myimage.png to work. I prefer the filename as it looks cleaner and appears to be more standard. So, in a webpage, I can now add the following html code to show the image. img src=http://localhost/images/myimage.png; / -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] VOTE TODAY
At 18:50 02-11-2004, Grant wrote: I can't wait for the replies... Here's a reply: Don't vote for Bush. if (eregi('(george)?bush',$message[$this]-body)) { $message[$this]-destroy() } Rene -- Rene Brehmer aka Metalbunny If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile? http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] postgres-embedded images via php. two issues...
P. George wrote: i am storing images in a postgres database and i have set up a little php file to retrieve them in such a way that i can do: This topic came up a few days ago and the pros and cons of saving images in a data base was argued with very few pros been given. However the defining moment is when some one mailed a link to a zend article where a benchmark had been done comparing the two methods. Embedding in a database came up second. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VOTE TODAY
Hi to all I am from Great INDIA for indian politics it is very much nacessary the US election... so which ever person is select but he sholud be very loyal to all Ankur Dave INDIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [users@httpd] November 2, 2004
You forgot the members from the ~74 other countries subscribed to this list. We have absolutely no interest in American politics, and def did not signup to this list to participate in same. Just because my server is in Utah, doesn't mean I'm USAnian or really care about the next incompetent corruptee to become president. Flame away, but do it offlist. Rene At 18:50 02-11-2004, Ryan A wrote: People have different political opinions, and different religions...discussing them in a forum or a list just starts arguments,flaming and does not make sense. People receive this list's mailings for php.thats it. To the original person who started this thread (I deleted the original so I cant reply to you directly), shoot yourself in the head and not only us but both the candidates should thank you and maybe you'll get 70 virgins in the next life. This list gets enough traffic as is and a crapload of repeat questions/questions that are easily solved by looking in google or the manual (aka RTFM questions) and we don't need to add politics to it, I also ask the rest of the list to forgive me for this totally OT reply.if any of you still want to act like an idiot and start flaming medo it offlist at this address so it wont bother anyone else and I can read your email, add your name to the jackass list and delete the mail. Thanks, Ryan -- Rene Brehmer aka Metalbunny If your life was a dream, would you wake up from a nightmare, dripping of sweat, hoping it was over? Or would you wake up happy and pleased, ready to take on the day with a smile? http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GUI editor for php?
Well a gui editor? do u mean something like Visual Studio for windows application design? or just an IDE. if it's the latter I'd recommand u to check out Zend Studio or NuSphere. On Mon, 1 Nov 2004 17:19:33 -0500, Andy B [EMAIL PROTECTED] wrote: Hi. Is there any GUI editors out there for php? if so does anybody know of a good one that doesnt cost a ton of money?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- M.Saleh.E.G 97150-4779817 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] text email new line
Hi Richard, On Wed, 3 Nov 2004 00:19:59 +, Richard Davey [EMAIL PROTECTED] wrote: Hello Jordi, Tuesday, November 2, 2004, 5:34:00 PM, you wrote: JC I hope this will help in composing mail messages and my recommendation JC is to *follow the standard* and send messages always by using CRLF as JC a line delimiter. Only doing that way, you will ensure your messages JC are accepted by any server. I'm not disagreeing with what you posted, because it's all true, but I would like to ask - can you actually name a popular mail server that rejects emails that use \n as a line delimiter (even if used by mistake), because I've haven't seen it happen for years. Well, I don't know if this has changed, but less than one year ago Hotmail was one of them and dropped mail messages with LF as line separator. Some SMTP implementations on Windows also drops the messages. And, finally some clients don't wrap the message correctly when received and you have to scroll horizontally to read long lines. Take in attention the 2.3.7 section of the RFC 2821 wich says: SMTP client implementations MUST NOT transmit these characters (CR or LF) except when they are intended as line terminators and then MUST, transmit them only as a CRLF sequence. So, when we are sending a message from PHP, we are involved in an SMTP client implementation. Then, when composing the headers or the body for a message to be sent (i.e. using the mail() function) we have to follow the standards to ensure that the message will not be rejected by any server just because we sent it in a bad format. So, because we cannot ensure that all SMTP servers in the world will accept non-standard line terminators, my recommendation when sending mail, is to use the standard line terminator and compose headers and body with CRLF as a line terminator. Only that way you will be absolutelly sure that the mail will not be rejected because of line terminators. I think a good way to do it, is to define a CRLF constant: define('CRLF', \r\n); You could also ensure that the body is well formed forcing the line terminators to CRLF: $body = preg_replace(/(\r\n)|(\r)|(\n)/, \r\n, $body); Best regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing an object to functions
Version: PHP 4.3.9 I have a database connection class. I create an instance of this class, then pass it to a function. Within that function, I can use that object passed to the function. Within this function, I then call another function, and want to pass the object to the second function. This is where I am having problems. I cannot access this ocject from the second function. Here is an example of what I am trying to do: function test1($OBJ_db) { echo get_class($OBJ_db); //Echos lp_database test2($OBJ_db)' } function test2($OBJ_db) { $OBJ_db-query(SOME SQL STATEMENT); //Fatal error: Call to a member function on a non-object echo get_class($OBJ_db); //Echos nothing echo gettype($OBJ_db); //Echos NULL } $OBJ_database=new lp_database(); test1($OBJ_database); Anyone have any ideas why I can't pass the object from function test1 to function test2? Even if I do not pass by reference, I can access the object in function test1 but not in function test2. b. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] text email new line
On Wednesday 03 November 2004 00:19, Richard Davey wrote: I'm not disagreeing with what you posted, because it's all true, but I would like to ask - can you actually name a popular mail server that rejects emails that use \n as a line delimiter (even if used by mistake), because I've haven't seen it happen for years. If you're interested: http://homepages.tesco.net/~J.deBoynePollard/FGA/qmail-myths-dispelled.html the section entitled The myth about supporting bare LFs being a requirement -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* History allows us to see the obvious -- but unfortunately, not until it is too late. -- PRINCE RAPHAEL CORRINO */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Authentification related to browser window
Quoting Cristi Barladeanu [EMAIL PROTECTED]: Greetings My problem is pretty simple. User enters the site, logins, and after that he hits ctrl+n or something, to open a new window from same PHP can not track the events at the client side. I think it is not possible , But you may try the combination of javascript and php to do so Following function may be usefull session_regenerate_id(); See the manual for it. Zareef ahmed browser. Can I make him to login again in the new window but to keep him logged in the old one? Now i'm using sessions, but i realise that the cookies set by them are related to browser, so every window use them. I hope you will understand what i mean. Cheers, Cristi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Zareef Ahmed :: A PHP develoepr in Delhi ( India ) Homepage :: http://www.zasaifi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed on php/mysql {Scanned}
As you can see from my code, I do want to check if all mandatory fields are selected or filled in. As well as the issue of the communicationtyes. SO far I do not have fields or anything for the user to use, to select the different CommunicationTypes he wants. I am not sure how to go about this because, there is the issue that more than one Destination can be added for a single CommType. And the number of CommTypes is not fixed and could vary, so thats why Im not sure how much input fields etc to put on page. Does this make sense. Garth Hmmm...I'm not sure I'm following you. You just want to know how to deal with multiple drop down lists? Or do you want to be able to check and make sure all the mandatory selections have been chosen? -dg http://www.rexruff.com On Nov 2, 2004, at 4:58 AM, Garth Hapgood - Strickland wrote: Well my page doesnt have any of the spoken about elements on it yet, because I am not clear as to go about it. The fields I speak of are things that need to be added extra to my page. Here is my pages code so far... ?php require('includes/application_top.php'); require('registration_globals.php'); require('includes/form_check.js.php'); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleMatchmakers - empowerment opportunities network/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link href=style.css rel=stylesheet type=text/css script language=JavaScript type=text/JavaScript !-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d .MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; ia.length; i++) if (a[i].indexOf(#)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } !-- Hide from old browsers function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) } // end hiding -- //-- /script /head body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 !-- header //-- ?php require('includes/header.php'); ? !-- header_eof //-- !-- body //-- table width=100% border=0 cellspacing=2 cellpadding=5 background=images/page_bg.gif tr td valign=toptable width=130 tr td width=120 align=right class=pagetitlebrregistrationimg src=images/register_image.gif/td /tr /table/td td table width=100% border=0 cellpadding=0 cellspacing=0 tr valign=top pbrbrbFill in all the fields below correct and accurately, then click Register Now./bbrbr /tr tr tdtable width=65% form title=register method=post onsubmit=return check_form(); ?php if (isset($submit) $submit == Register Now){ if (strlen($business_name) == 0) {} else if (strlen($business_owner) == 0) {} else if (strlen($street_address) == 0) {} else if (strlen($suburb) == 0) {} else if (strlen($city_town) == 0) {} else if (strlen($province_desc) == 0) {} $email_popup(); (the code i was trying to use to call popup window) } else { $insertquery = INSERT INTO business (BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID, StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID, IndustryOther, BusinessAge, AnnualTurnoverID, EmpowermentProfileID, BEEScoreCardID, PreferredLocationID, PreferredProductService, PreferredMatchPartner, PreferredAgeID, PreferredTurnoverID, PreferredEmpowermentProfileID, DateRegistered, MarketSourceID) VALUES ($business_name, $business_owner, $street_address, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',); echo Your registration has been submitted; } ? tr td class=formAreaTitle.: Business Contact Details/td /tr tr td class=main table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right class=contentBusiness Name:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_name/td /tr tr td width=45% align=right class=contentBusiness Owner:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_owner/td /tr tr td width=45% align=right class=contentStreet Address:/td td width=55%input class=content type=text size=35 maxlength=100 name=street_address/td /tr tr td width=45% align=right class=contentSuburb:/td td width=55%input class=content type=text size=35 maxlength=100 name=suburb/td /tr tr td width=45% align=right class=contentCity/Town:/td td width=55%input class=content type=text size=35 maxlength=100 name=city_town/td /tr tr td width=45% align=right class=contentProvince:/td td width=55% select class=content name=province_desc id=selectoption
[PHP] PEAR Calendar
I would like to install PEAR Calendar module and did a [EMAIL PROTECTED] apps]# pear install Calendar but got these: No release with state equal to: 'stable' found for 'Calendar' Please advise. -- roger --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php