Re: [PHP] PHP Database Problems -- Code Snippets
On Thu, May 3, 2012 at 4:20 PM, Ethan Rosenberg eth...@earthlink.net wrote: At 06:47 PM 5/2/2012, Matijn Woudt wrote: On Wed, May 2, 2012 at 11:43 PM, Ethan Rosenberg eth...@earthlink.net wrote: Dear list - Sorry for the attachment.  Here are code snippets --- Ethan, I don't want to sound rude, but it appears to me you don't have any understanding of what you're doing. It might help if you understand what the code is doing... Let me explain. GET THE DATA FROM INTAKE3:   function handle_data()   {    global $cxn;    $query = select * from Intake3 where  1;    if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) $_Request does not exists, you're looking for $_REQUEST. And why are you mixing $_REQUEST and $_POST here?    {       if ($_REQUEST['Sex'] === 0)       {        $sex = 'Male';       }       else       {        $sex = 'Female';       }    }   } What is the point of the handle_data function above? It doesn't do anything.   $allowed_fields = array    (  'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] ,       'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex']  , 'Height' = $_POST['Height']  );   if(empty($allowed_fields))   {      echo ouch;   }   $query = select * from Intake3  where  1 ;   foreach ( $allowed_fields as $key = $val )   {    if ( (($val != '')) )   {    $query .= AND ($key  = '$val') ;   }    $result1 = mysqli_query($cxn, $query);   } First, this will allow SQL injections, because you insert the values directly from the browser. Second, you should move the last line ($result1=...), outside of the foreach loop, now you're executing the query multiple times. Third, you should check if $result1 === FALSE, in case the query fails   $num = mysqli_num_rows($result1);   if(($num = mysqli_num_rows($result1)) == 0) Doing the same thing twice?   { ?   br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php   exit();   } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING  centerbSearch Results/b/centerbr /   centertable border=4 cellpadding=5 cellspacing=55  rules=all  frame=box   tr class=\heading\   thSite/th   thMedical Record/th   thFirst Name/th   thLast Name/th   thPhone/td   thHeight/td   thSex/td   thHistory/td   /tr ?php    while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH))    {       print_r($_POST); Doesn't really make sense to print $_POST here..        global $MDRcheck;        $n1++;        echo br /n1 br /;echo $n1;       {        if (($n1 2) ($MDRcheck == $row1[1]))        {           echo 2==  ;           echo $MDRcheck;           echo td $row1[0] /td\n;           echo td $row1[1] /td\n;           echo td $row1[2] /td\n;           echo td $row1[3] /td\n;           echo td $row1[4] /td\n;           echo td $row1[5] /td\n;           echo td $row1[6] /td\n;           echo td $row1[7] /td\n;           echo /tr\n;        }        elseif (($n1 2) ($MDRcheck != $row1[1]))        {           echo 2!=  ;           echo $MDRcheck;          continue; continue doesn't do anything here.        }        elseif ($n1 == 2)        {           define( MDR ,  $row1[1]);           echo br /row1 br;echo $row1[1];           echo tr\n;           $_GLOBALS['mdr']= $row1[1];           $_POST['MedRec'] = $row1[1]; You're not supposed to set variables in $_POST...           $MDRold = $_GLOBALS['mdr']; It appears you want the old value of mdr, if so, then you should do this before you set it again 2 lines above..           echo td $row1[0] /td\n;           echo td $row1[1] /td\n;           echo td $row1[2] /td\n;           echo td $row1[3] /td\n;           echo td $row1[4] /td\n;           echo td $row1[5] /td\n;           echo td $row1[6] /td\n;           echo td $row1[7] /td\n;         Â
[PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
I am sending this again to see if more ideas for solution of this problem are available. Ethan === Dear list - Sorry for the attachment. Here are code snippets --- GET THE DATA FROM INTAKE3: function handle_data() { global $cxn; $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } } } $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } $num = mysqli_num_rows($result1); if(($num = mysqli_num_rows($result1)) == 0) { ? br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php exit(); } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING centerbSearch Results/b/centerbr / centertable border=4 cellpadding=5 cellspacing=55 rules=all frame=box tr class=\heading\ thSite/th thMedical Record/th thFirst Name/th thLast Name/th thPhone/td thHeight/td thSex/td thHistory/td /tr ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) { echo 2== ; echo $MDRcheck; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } elseif (($n1 2) ($MDRcheck != $row1[1])) { echo 2!= ; echo $MDRcheck; continue; } elseif ($n1 == 2) { define( MDR , $row1[1]); echo br /row1 br;echo $row1[1]; echo tr\n; $_GLOBALS['mdr']= $row1[1]; $_POST['MedRec'] = $row1[1]; $MDRold = $_GLOBALS['mdr']; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } } } ? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); $result2 = mysqli_query($cxn, $query2); $num = mysqli_num_rows($result2); global $finished; $finished = 0; while($row2 = mysqli_fetch_array($result2, MYSQLI_BOTH)) { global $finished; echo tr\n; echo td $row2[0] /td\n; echo td $row2[1] /td\n; echo td $row2[2] /td\n; echo td $row2[3] /td\n; echo td $row2[4] /td\n; echo td $row2[5] /td\n; echo td $row2[6] /td\n; echo /tr\n; } echo /table; ENTER MORE DATA: function More_Data() { $decision = 5; ? Do you Wish to Enter More Data? form method=post action= centerinput type=radio name=decision value=1 /Yes input type=radio name=decision value=0 /No/centerbr / centerinput type=submit value=Enter more Data //center input type=hidden name=next_step value=step10 / /form ?php } //end function More_Data switch ( @$_POST[next_step] ) { case step10: { if (!isset($_POST['decision'])) { $_POST['decision'] = 5; } if ($_POST['decision'] == 0) { exit(); } if ($_POST['decision'] == 1) { ; echo form method=\post\ action=\\; echo input type=\hidden\ name=\next_step\ value=\step4\ /; echo enterbr /; echo Medical Record: nbspinput
Re: [PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
I don't think posting the same voluminous code is going to generate any better responses. The suggestion to start over and make your insert/retrieve queries fool proof before starting to write some logic into your code was a very good one. Why don't you work on that so that any requests for help can focus on just that instead of the 100+ lines of code you are posting? Reading some documentation on sql and some html/php relationships would be VERY beneficial to your long-term success as a programmer as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
Nor will posting to multiple lists.(Sorry to the rest of you - didn't realize it until now.) Jim Giner jim.gi...@albanyhandball.com wrote in message news:c6.f8.38082.efae3...@pb1.pair.com... I don't think posting the same voluminous code is going to generate any better responses. The suggestion to start over and make your insert/retrieve queries fool proof before starting to write some logic into your code was a very good one. Why don't you work on that so that any requests for help can focus on just that instead of the 100+ lines of code you are posting? Reading some documentation on sql and some html/php relationships would be VERY beneficial to your long-term success as a programmer as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
Ethan, before you get frustrated or feel abandoned, let me *sincerely* try to help: Here is honestly what I am utterly convinced you need to do to get any where in the medium/long run: Break everything down into very small steps. Making web apps is just building a whole lot of layers/collections of very small simple things. Nothing is out of your grasp.. it only appears mysterious or complicated because you are not familiar with the terms/code structures and have not spent enough time with the little things to recognize them like english speakers do when reading written english. So what you do to get out of the woods (and it works every time), regardless of the problem, is just focus on one small thing at a time. START OVER. Throw out all the code, especially everything you borrowed from other sources. Write everything yourself, from scratch. Just print hello to a web page. Then add in the ability to do ONE more thing that you need... like reading from a db, or writing to a db... and then processing/manipulating things, as you need. Test everything every time you add even ONE little feature. Then as soon as something breaks, you know instantly where the issue lays.. and focus on solving why that one little thing is broken. If re-reading the docs about whatever code structures you used at that point (of your newly-added broken feature) does not clear it up for you, then post just that ONE little issue to this list.. asking why that one thing is behaving that way. Like this (using this tedious but effective method) , you will get your code into shape so it works, you will not alienate yourself from the help you need (by posting volumes of broken code with no evidence that you are actually trying to learn), and best of all - you will, step by step, come to master all this stuff! Everyone loves to help answer/clear up one little thing, but no one has time to digest a whole broken page/app and tell you where all the issues are. Even if they did have the time and inclination, they would lose it after the very first time they saw you take what they gave you and come back 3 weeks later with evidence that you never learned anything from the last episode. Believe me you will always have people climbing over each other to help you, if you can just break down your problems into such small portions that you will be able to realize you have the smarts to answer them yourself. ;-) There is a very lively, effective and popular coders community (and Q/A tool set) here: http://stackoverflow.com/ ..where you get almost instant help to any coding question.. because there are so many people who really care to give quality help, because they get recognized for their contributions. But if you try to use the tools at stackoverflow.com then you will find there, in that very professional atmosphere, that (to get anywhere) you HAVE to ask questions that are distilled down to something very specific and answerable in a specific/factual kind of way, as opposed to question that bring up more fuzzy-boundaried topics, like questions of preference or style, or questions that show an utter lack of homework/effort on the part of the asker which require more than a couple specific facts to answer. You can train here or on stackoverflow.com, but anywhere you go, you will find the same situation, that you have to use baby steps (as necessary) - for your own learning, and to get any decent help. -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] [PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
Ethan, You have been given advise and break down on your code. Have you taken the advise given? Which part of the code isn't working? Not which chunk, but break it down and show which part BR, Gav -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: 04 May 2012 15:10 To: php-db-lists.php.net; php-general@lists.php.net Subject: [PHP-DB] [PHP] PHP Database Problems -- Code Snippets - Any more Ideas? I am sending this again to see if more ideas for solution of this problem are available. Ethan === Dear list - Sorry for the attachment. Here are code snippets --- GET THE DATA FROM INTAKE3: function handle_data() { global $cxn; $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } } } $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } $num = mysqli_num_rows($result1); if(($num = mysqli_num_rows($result1)) == 0) { ? br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php exit(); } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING centerbSearch Results/b/centerbr / centertable border=4 cellpadding=5 cellspacing=55 rules=all frame=box tr class=\heading\ thSite/th thMedical Record/th thFirst Name/th thLast Name/th thPhone/td thHeight/td thSex/td thHistory/td /tr ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) { echo 2== ; echo $MDRcheck; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } elseif (($n1 2) ($MDRcheck != $row1[1])) { echo 2!= ; echo $MDRcheck; continue; } elseif ($n1 == 2) { define( MDR , $row1[1]); echo br /row1 br;echo $row1[1]; echo tr\n; $_GLOBALS['mdr']= $row1[1]; $_POST['MedRec'] = $row1[1]; $MDRold = $_GLOBALS['mdr']; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } } } ? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); $result2 = mysqli_query($cxn, $query2); $num = mysqli_num_rows($result2); global $finished; $finished = 0; while($row2 = mysqli_fetch_array($result2, MYSQLI_BOTH)) { global $finished; echo tr\n; echo td $row2[0] /td\n; echo td $row2[1] /td\n; echo td $row2[2] /td\n; echo td $row2[3] /td\n; echo td $row2[4] /td\n; echo td $row2[5] /td\n; echo td $row2[6] /td\n; echo /tr\n; } echo /table; ENTER MORE DATA: function More_Data() { $decision = 5; ? Do you Wish to Enter More Data? form method=post action= centerinput type=radio name=decision value=1 /Yes input type=radio name=decision value=0 /No/centerbr / centerinput type=submit value=Enter more Data //center input type=hidden name=next_step value=step10 / /form ?php } //end
Re: [PHP] PHP Database Problems -- Code Snippets - Any more Ideas?
Am 04.05.2012 16:09, schrieb Ethan Rosenberg: function handle_data() { global $cxn; What does this function? It neither takes any parameters nor returns any value. And it does not write back anything to its global $cxn. So it is quite useless and can be deleted. $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) there is no variable $_Request, it is $_REQUEST. Why do you test on $_REQUEST and compare it with trimmed $_POST? { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } Why do you set a variable that is never used? $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; Why the hell do you put unverified data into an sql query? DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING What fails? I do not have access to your database, so I can not run your code to see what fails. ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) What is $MDRcheck and what does this comparision mean? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); Quotes around mdr missing $result2 = mysqli_query($cxn, $query2); $num = mysqli_num_rows($result2); global $finished; $finished = 0; while($row2 = mysqli_fetch_array($result2, MYSQLI_BOTH)) { global $finished; No need to global that twice. And why ndo you use global and $_GLOBALS? STick to one or better skip it anyways. Globals are not to be used! switch ( @$_POST[next_step] ) Remove all @ from your code or you won't see any errors on this. Do proper checking and do NOT suppress errors or warnings. echo form method=\post\ action=\\; echo input type=\hidden\ name=\next_step\ value=\step4\ /; echo enterbr /; echo Medical Record: nbspinput type=\text\ name=\MedRec\ value=\ $_GLOBALS[mdr]\ /; Quotes. $Weight = $_POST['Weight']; $Notes = $_POST['Notes']; $sql2 = INSERT INTO Visit3(Indx, Site, MedRec, Notes, Weight, BMI, Date) VALUES(null, '$Site', '$MDRold', '$Notes', Do NOT NEVER put data that is user input unchecked into a query. ? ? Double closing tag? echo td $_GLOBALS[mdr] /td\n; Quotes. $flag = 1; What's this? You really really should seperate your code from HTML. Please truncate your apache and php error log. Add error_reporting(E_ALL); ini_set('display_errors', 'On'); at the top of every php file right after ?php onto a new line. Remove all @ from your lines and execute your script another time and see what errors are appear into your browser and your logfiles. Post them and the codelines for these errors on the list. -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz smime.p7s Description: S/MIME Kryptografische Unterschrift
Re: [PHP] PHP Database Problems -- Code Snippets
At 06:47 PM 5/2/2012, Matijn Woudt wrote: On Wed, May 2, 2012 at 11:43 PM, Ethan Rosenberg eth...@earthlink.net wrote: Dear list - Sorry for the attachment.  Here are code snippets --- Ethan, I don't want to sound rude, but it appears to me you don't have any understanding of what you're doing. It might help if you understand what the code is doing... Let me explain. GET THE DATA FROM INTAKE3:   function handle_data()   {    global $cxn;    $query = select * from Intake3 where  1;    if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) $_Request does not exists, you're looking for $_REQUEST. And why are you mixing $_REQUEST and $_POST here?    {       if ($_REQUEST['Sex'] === 0)       {        $sex = 'Male';       }       else       {        $sex = 'Female';       }    }   } What is the point of the handle_data function above? It doesn't do anything.   $allowed_fields = array    (  'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] ,       'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex']  , 'Height' = $_POST['Height']  );   if(empty($allowed_fields))   {      echo ouch;   }   $query = select * from Intake3  where  1 ;   foreach ( $allowed_fields as $key = $val )   {    if ( (($val != '')) )   {    $query .= AND ($key  = '$val') ;   }    $result1 = mysqli_query($cxn, $query);   } First, this will allow SQL injections, because you insert the values directly from the browser. Second, you should move the last line ($result1=...), outside of the foreach loop, now you're executing the query multiple times. Third, you should check if $result1 === FALSE, in case the query fails   $num = mysqli_num_rows($result1);   if(($num = mysqli_num_rows($result1)) == 0) Doing the same thing twice?   { ?   br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php   exit();   } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING  centerbSearch Results/b/centerbr /   centertable border=4 cellpadding=5 cellspacing=55  rules=all  frame=box   tr class=\heading\   thSite/th   thMedical Record/th   thFirst Name/th   thLast Name/th   thPhone/td   thHeight/td   thSex/td   thHistory/td   /tr ?php    while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH))    {       print_r($_POST); Doesn't really make sense to print $_POST here..        global $MDRcheck;        $n1++;        echo br /n1 br /;echo $n1;       {        if (($n1 2) ($MDRcheck == $row1[1]))        {           echo 2==  ;           echo $MDRcheck;           echo td $row1[0] /td\n;           echo td $row1[1] /td\n;           echo td $row1[2] /td\n;           echo td $row1[3] /td\n;           echo td $row1[4] /td\n;           echo td $row1[5] /td\n;           echo td $row1[6] /td\n;           echo td $row1[7] /td\n;           echo /tr\n;        }        elseif (($n1 2) ($MDRcheck != $row1[1]))        {           echo 2!=  ;           echo $MDRcheck;          continue; continue doesn't do anything here.        }        elseif ($n1 == 2)        {           define( MDR ,  $row1[1]);           echo br /row1 br;echo $row1[1];           echo tr\n;           $_GLOBALS['mdr']= $row1[1];           $_POST['MedRec'] = $row1[1]; You're not supposed to set variables in $_POST...           $MDRold = $_GLOBALS['mdr']; It appears you want the old value of mdr, if so, then you should do this before you set it again 2 lines above..           echo td $row1[0] /td\n;           echo td $row1[1] /td\n;           echo td $row1[2] /td\n;           echo td $row1[3] /td\n;           echo td $row1[4] /td\n;           echo td $row1[5] /td\n;           echo td $row1[6] /td\n;           echo td $row1[7] /td\n;           echo /tr\n;   Â
[PHP] PHP Database Problems
have a database mysql describe Intake3; ++-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | ++-+--+-+-+---+ 8 rows in set (0.00 sec) mysql describe Visit3; ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | Indx | int(4) | NO | PRI | NULL| auto_increment | | Site | varchar(6) | YES | | NULL|| | MedRec | int(6) | YES | | NULL|| | Notes | text | YES | | NULL|| | Weight | int(4) | YES | | NULL|| | BMI| decimal(3,1) | YES | | NULL|| | Date | date | YES | | NULL|| ++--+--+-+-++ and a program to enter and extract data. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] Let us say that I wish to deal with Medical Record 1: This it data from Intake3: Site Medical Record First Name Last Name Phone Height Sex History AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments w/o success This is data from Visit3: Index Site Medical Record Notes Weight BMI Date 2322 AA 1 Second Visit. 170 27.4 2010-01-20 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6 2010-02-01 I then request to enter additional data: Site Medical Record First Name Last Name Phone Height Sex History AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his friends that he is obese. Normal BMI = 23. Index Site Medical Record Notes Weight BMI Date Notice that it is entered into record 10003 The data is First Try Index Site Medical Record Notes Weight BMI Date 2590 AA 10003 First Try 189 31.4 02 May 2012 Help and advice, please. Thanks. Ethan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] PHP Database Problems
Ethan, Some coding you are using would be helpful (as far as i am aware attachments are not support on the mailing list's) Gav -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: 02 May 2012 19:54 To: php-db-lists.php.net; php-general@lists.php.net Subject: [PHP-DB] PHP Database Problems have a database mysql describe Intake3; ++-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | ++-+--+-+-+---+ 8 rows in set (0.00 sec) mysql describe Visit3; ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | Indx | int(4) | NO | PRI | NULL| auto_increment | | Site | varchar(6) | YES | | NULL|| | MedRec | int(6) | YES | | NULL|| | Notes | text | YES | | NULL|| | Weight | int(4) | YES | | NULL|| | BMI| decimal(3,1) | YES | | NULL|| | Date | date | YES | | NULL|| ++--+--+-+-++ and a program to enter and extract data. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] Let us say that I wish to deal with Medical Record 1: This it data from Intake3: Site Medical Record First Name Last Name Phone Height Sex History AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments w/o success This is data from Visit3: Index Site Medical Record Notes Weight BMI Date 2322 AA 1 Second Visit. 170 27.4 2010-01-20 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6 2010-02-01 I then request to enter additional data: Site Medical Record First Name Last Name Phone Height Sex History AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his friends that he is obese. Normal BMI = 23. Index Site Medical Record Notes Weight BMI Date Notice that it is entered into record 10003 The data is First Try Index Site Medical Record Notes Weight BMI Date 2590 AA 10003 First Try 189 31.4 02 May 2012 Help and advice, please. Thanks. Ethan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Database Problems
I do believe attachments are allowed. Looking back, I see that there have been messages sent to the list that had odt, php, and ini attachments On 05/02/2012 12:12 PM, Gavin Chalkley wrote: Ethan, Some coding you are using would be helpful (as far as i am aware attachments are not support on the mailing list's) Gav -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: 02 May 2012 19:54 To: php-db-lists.php.net; php-general@lists.php.net Subject: [PHP-DB] PHP Database Problems have a database mysql describe Intake3; ++-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | ++-+--+-+-+---+ 8 rows in set (0.00 sec) mysql describe Visit3; ++--+--+-+-++ | Field | Type | Null | Key | Default | Extra | ++--+--+-+-++ | Indx | int(4) | NO | PRI | NULL| auto_increment | | Site | varchar(6) | YES | | NULL|| | MedRec | int(6) | YES | | NULL|| | Notes | text | YES | | NULL|| | Weight | int(4) | YES | | NULL|| | BMI| decimal(3,1) | YES | | NULL|| | Date | date | YES | | NULL|| ++--+--+-+-++ and a program to enter and extract data. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] Let us say that I wish to deal with Medical Record 1: This it data from Intake3: Site Medical Record First Name Last Name Phone Height Sex History AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments w/o success This is data from Visit3: Index Site Medical Record Notes Weight BMI Date 2322 AA 1 Second Visit. 170 27.4 2010-01-20 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6 2010-02-01 I then request to enter additional data: Site Medical Record First Name Last Name Phone Height Sex History AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his friends that he is obese. Normal BMI = 23. Index Site Medical Record Notes Weight BMI Date Notice that it is entered into record 10003 The data is First Try Index Site Medical Record Notes Weight BMI Date 2590 AA 10003 First Try 189 31.4 02 May 2012 Help and advice, please. Thanks. Ethan -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Database Problems
Dear Ethan, It would be useful to see what code you are using. The syntax is: UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value The data that you are required to enter is for Intake3. I am assuming that the only change is the History and/or Phone that you need to update since the Site, MedRec, Fname, Lname, Height and Sex should remain the same. Therefore I imagine the code should be something like mysql_query(UPDATE Intake3 SET History='Has been convinced by his friends that he is obese. Normal BMI = 23', Phone='325 563-4178' WHERE MedRec='1' LIMIT 1); Having said that I notice that you have two primary keys in Intake3. Not aware that a table can carry two. Terry On 2 May 2012 19:53, Ethan Rosenberg eth...@earthlink.net wrote: have a database mysql describe Intake3; ++-+--**+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--**+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | ++-+--**+-+-+---+ 8 rows in set (0.00 sec) mysql describe Visit3; ++--+-**-+-+-+**+ | Field | Type | Null | Key | Default | Extra | ++--+-**-+-+-+**+ | Indx | int(4) | NO | PRI | NULL| auto_increment | | Site | varchar(6) | YES | | NULL|| | MedRec | int(6) | YES | | NULL|| | Notes | text | YES | | NULL|| | Weight | int(4) | YES | | NULL|| | BMI| decimal(3,1) | YES | | NULL|| | Date | date | YES | | NULL|| ++--+-**-+-+-+**+ and a program to enter and extract data. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] Let us say that I wish to deal with Medical Record 1: This it data from Intake3: Site Medical Record First Name Last Name Phone Height Sex History AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments w/o success This is data from Visit3: Index Site Medical Record Notes Weight BMI Date 2322 AA 1 Second Visit. 170 27.4 2010-01-20 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6 2010-02-01 I then request to enter additional data: Site Medical Record First Name Last Name Phone Height Sex History AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his friends that he is obese. Normal BMI = 23. Index Site Medical Record Notes Weight BMI Date Notice that it is entered into record 10003 The data is First Try Index Site Medical Record Notes Weight BMI Date 2590 AA 10003 First Try 189 31.4 02 May 2012 Help and advice, please. Thanks. Ethan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- *Terry Ally* Twitter.com/terryally Facebook.com/terryally ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ To print or not to print this email is the environmentally-searching question! Which has the highest ecological cost? A sheet of paper or constantly switching on your computer and connecting to the Internet to read your email?
[PHP] PHP Database Problems -- Code Snippets
Dear list - Sorry for the attachment. Here are code snippets --- GET THE DATA FROM INTAKE3: function handle_data() { global $cxn; $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } } } $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } $num = mysqli_num_rows($result1); if(($num = mysqli_num_rows($result1)) == 0) { ? br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php exit(); } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING centerbSearch Results/b/centerbr / centertable border=4 cellpadding=5 cellspacing=55 rules=all frame=box tr class=\heading\ thSite/th thMedical Record/th thFirst Name/th thLast Name/th thPhone/td thHeight/td thSex/td thHistory/td /tr ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) { echo 2== ; echo $MDRcheck; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } elseif (($n1 2) ($MDRcheck != $row1[1])) { echo 2!= ; echo $MDRcheck; continue; } elseif ($n1 == 2) { define( MDR , $row1[1]); echo br /row1 br;echo $row1[1]; echo tr\n; $_GLOBALS['mdr']= $row1[1]; $_POST['MedRec'] = $row1[1]; $MDRold = $_GLOBALS['mdr']; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } } } ? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); $result2 = mysqli_query($cxn, $query2); $num = mysqli_num_rows($result2); global $finished; $finished = 0; while($row2 = mysqli_fetch_array($result2, MYSQLI_BOTH)) { global $finished; echo tr\n; echo td $row2[0] /td\n; echo td $row2[1] /td\n; echo td $row2[2] /td\n; echo td $row2[3] /td\n; echo td $row2[4] /td\n; echo td $row2[5] /td\n; echo td $row2[6] /td\n; echo /tr\n; } echo /table; ENTER MORE DATA: function More_Data() { $decision = 5; ? Do you Wish to Enter More Data? form method=post action= centerinput type=radio name=decision value=1 /Yes input type=radio name=decision value=0 /No/centerbr / centerinput type=submit value=Enter more Data //center input type=hidden name=next_step value=step10 / /form ?php } //end function More_Data switch ( @$_POST[next_step] ) { case step10: { if (!isset($_POST['decision'])) { $_POST['decision'] = 5; } if ($_POST['decision'] == 0) { exit(); } if ($_POST['decision'] == 1) { ; echo form method=\post\ action=\\; echo input type=\hidden\ name=\next_step\ value=\step4\ /; echo enterbr /; echo Medical Record: nbspinput type=\text\ name=\MedRec\ value=\ $_GLOBALS[mdr]\ /; echo nbspnbsp Weight: input type=\decimal\
[PHP] Re: [PHP-DB] PHP Database Problems -- Code Snippets
I noticed the use of SQL concatenation like: $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } and like $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); This is a SQL Injection security risk. There is a lot of material on the web about this, e.g https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet I cannot strongly enough suggest you rewrite the app to mitigate against this issue. Also, set error_reporting = E_ALL E_STRICT in your php.ini file to help you identify some of your other code issues. Chris -- christopher.jo...@oracle.com http://twitter.com/#!/ghrd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Database Problems -- Code Snippets
On Wed, May 2, 2012 at 11:43 PM, Ethan Rosenberg eth...@earthlink.net wrote: Dear list - Sorry for the attachment. Here are code snippets --- Ethan, I don't want to sound rude, but it appears to me you don't have any understanding of what you're doing. It might help if you understand what the code is doing... Let me explain. GET THE DATA FROM INTAKE3: function handle_data() { global $cxn; $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) $_Request does not exists, you're looking for $_REQUEST. And why are you mixing $_REQUEST and $_POST here? { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } } } What is the point of the handle_data function above? It doesn't do anything. $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } First, this will allow SQL injections, because you insert the values directly from the browser. Second, you should move the last line ($result1=...), outside of the foreach loop, now you're executing the query multiple times. Third, you should check if $result1 === FALSE, in case the query fails $num = mysqli_num_rows($result1); if(($num = mysqli_num_rows($result1)) == 0) Doing the same thing twice? { ? br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php exit(); } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING centerbSearch Results/b/centerbr / centertable border=4 cellpadding=5 cellspacing=55 rules=all frame=box tr class=\heading\ thSite/th thMedical Record/th thFirst Name/th thLast Name/th thPhone/td thHeight/td thSex/td thHistory/td /tr ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); Doesn't really make sense to print $_POST here.. global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) { echo 2== ; echo $MDRcheck; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } elseif (($n1 2) ($MDRcheck != $row1[1])) { echo 2!= ; echo $MDRcheck; continue; continue doesn't do anything here. } elseif ($n1 == 2) { define( MDR , $row1[1]); echo br /row1 br;echo $row1[1]; echo tr\n; $_GLOBALS['mdr']= $row1[1]; $_POST['MedRec'] = $row1[1]; You're not supposed to set variables in $_POST... $MDRold = $_GLOBALS['mdr']; It appears you want the old value of mdr, if so, then you should do this before you set it again 2 lines above.. echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } } } ? You say this routine is probably the one that is failing.. but what is going wrong? And how the heck are we supposed to know what this function should do? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); You're using mdr as a constant here, this will generate a warning, but sadly enough it works. $result2 = mysqli_query($cxn, $query2); You should check if $result2 === FALSE, in case the query fails. $num = mysqli_num_rows($result2); You're counting the rows here, but you don't do anything with the result? Snip the rest of this crappy
Re: [PHP] PHP Database Problems
But I don't see any attachments in this message. On Thu, May 3, 2012 at 2:28 AM, Jim Lucas li...@cmsws.com wrote: I do believe attachments are allowed. Looking back, I see that there have been messages sent to the list that had odt, php, and ini attachments On 05/02/2012 12:12 PM, Gavin Chalkley wrote: Ethan, Some coding you are using would be helpful (as far as i am aware attachments are not support on the mailing list's) Gav -Original Message- From: Ethan Rosenberg [mailto:eth...@earthlink.net] Sent: 02 May 2012 19:54 To: php-db-lists.php.net; php-general@lists.php.net Subject: [PHP-DB] PHP Database Problems have a database mysql describe Intake3; ++-+--**+-+-+---+ | Field | Type| Null | Key | Default | Extra | ++-+--**+-+-+---+ | Site | varchar(6) | NO | PRI | | | | MedRec | int(6) | NO | PRI | NULL| | | Fname | varchar(15) | YES | | NULL| | | Lname | varchar(30) | YES | | NULL| | | Phone | varchar(30) | YES | | NULL| | | Height | int(4) | YES | | NULL| | | Sex| char(7) | YES | | NULL| | | Hx | text| YES | | NULL| | ++-+--**+-+-+---+ 8 rows in set (0.00 sec) mysql describe Visit3; ++--+-**-+-+-+**+ | Field | Type | Null | Key | Default | Extra | ++--+-**-+-+-+**+ | Indx | int(4) | NO | PRI | NULL| auto_increment | | Site | varchar(6) | YES | | NULL|| | MedRec | int(6) | YES | | NULL|| | Notes | text | YES | | NULL|| | Weight | int(4) | YES | | NULL|| | BMI| decimal(3,1) | YES | | NULL|| | Date | date | YES | | NULL|| ++--+-**-+-+-+**+ and a program to enter and extract data. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] Let us say that I wish to deal with Medical Record 1: This it data from Intake3: Site Medical Record First Name Last Name Phone Height Sex History AA 1 David Dummy 845 365-1456 66 Male c/o obesity. Various treatments w/o success This is data from Visit3: Index Site Medical Record Notes Weight BMI Date 2322 AA 1 Second Visit. 170 27.4 2010-01-20 2326 AA 1 Third visit. Small progress, but pt is very happy. 165 26.6 2010-02-01 I then request to enter additional data: Site Medical Record First Name Last Name Phone Height Sex History AA 10003 Stupid Fool 325 563-4178 65 Male Has been convinced by his friends that he is obese. Normal BMI = 23. Index Site Medical Record Notes Weight BMI Date Notice that it is entered into record 10003 The data is First Try Index Site Medical Record Notes Weight BMI Date 2590 AA 10003 First Try 189 31.4 02 May 2012 Help and advice, please. Thanks. Ethan -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Duken Marga
Re: [PHP] PHP Database Problems -- Code Snippets
It is a good habbit to write the core code just for inserting/retrieving data from database. It will reduce much of your code complexity. When you see your code is working, you can continue to embed it with your visual front-end or with your filter. On Thu, May 3, 2012 at 4:43 AM, Ethan Rosenberg eth...@earthlink.netwrote: Dear list - Sorry for the attachment. Here are code snippets --- GET THE DATA FROM INTAKE3: function handle_data() { global $cxn; $query = select * from Intake3 where 1; if(isset($_Request['Sex']) trim($_POST['Sex']) != '' ) { if ($_REQUEST['Sex'] === 0) { $sex = 'Male'; } else { $sex = 'Female'; } } } $allowed_fields = array ( 'Site' =$_POST['Site'], 'MedRec' = $_POST['MedRec'], 'Fname' = $_POST['Fname'], 'Lname' = $_POST['Lname'] , 'Phone' = $_POST['Phone'] , 'Sex' = $_POST['Sex'] , 'Height' = $_POST['Height'] ); if(empty($allowed_fields)) { echo ouch; } $query = select * from Intake3 where 1 ; foreach ( $allowed_fields as $key = $val ) { if ( (($val != '')) ) { $query .= AND ($key = '$val') ; } $result1 = mysqli_query($cxn, $query); } $num = mysqli_num_rows($result1); if(($num = mysqli_num_rows($result1)) == 0) { ? br /br /centerbp style=color: red; font-size:14pt; No Records Retrieved #1/center/b/style/p ?php exit(); } DISPLAY THE INPUT3 DATA: THIS SEEMS TO BE THE ROUTINE THAT IS FAILING centerbSearch Results/b/centerbr / centertable border=4 cellpadding=5 cellspacing=55 rules=all frame=box tr class=\heading\ thSite/th thMedical Record/th thFirst Name/th thLast Name/th thPhone/td thHeight/td thSex/td thHistory/td /tr ?php while ($row1 = mysqli_fetch_array($result1, MYSQLI_BOTH)) { print_r($_POST); global $MDRcheck; $n1++; echo br /n1 br /;echo $n1; { if (($n1 2) ($MDRcheck == $row1[1])) { echo 2== ; echo $MDRcheck; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } elseif (($n1 2) ($MDRcheck != $row1[1])) { echo 2!= ; echo $MDRcheck; continue; } elseif ($n1 == 2) { define( MDR , $row1[1]); echo br /row1 br;echo $row1[1]; echo tr\n; $_GLOBALS['mdr']= $row1[1]; $_POST['MedRec'] = $row1[1]; $MDRold = $_GLOBALS['mdr']; echo td $row1[0] /td\n; echo td $row1[1] /td\n; echo td $row1[2] /td\n; echo td $row1[3] /td\n; echo td $row1[4] /td\n; echo td $row1[5] /td\n; echo td $row1[6] /td\n; echo td $row1[7] /td\n; echo /tr\n; } } } ? SELECT AND DISPLAY DATA FROM VISIT3 DATABASE ?php $query2 = select * from Visit3 where 1 AND (Site = 'AA') AND (MedRec = $_GLOBALS[mdr]); $result2 = mysqli_query($cxn, $query2); $num = mysqli_num_rows($result2); global $finished; $finished = 0; while($row2 = mysqli_fetch_array($result2, MYSQLI_BOTH)) { global $finished; echo tr\n; echo td $row2[0] /td\n; echo td $row2[1] /td\n; echo td $row2[2] /td\n; echo td $row2[3] /td\n; echo td $row2[4] /td\n; echo td $row2[5] /td\n; echo td $row2[6] /td\n; echo /tr\n; } echo /table; ENTER MORE DATA: function More_Data() { $decision = 5; ? Do you Wish to Enter More Data? form method=post action= centerinput type=radio name=decision value=1 /Yes input type=radio name=decision value=0 /No/centerbr / centerinput type=submit value=Enter more Data //center input type=hidden name=next_step value=step10 / /form ?php } //end function More_Data switch ( @$_POST[next_step] ) { case step10: { if (!isset($_POST['decision'])) { $_POST['decision'] = 5; } if ($_POST['decision'] == 0) { exit(); } if ($_POST['decision']
Re: [PHP] PHP Database Problems
On 5/2/2012 4:28 PM, Duken Marga wrote: But I don't see any attachments in this message. This was in the first email of this thread. I can easily extract data from the database. However, if I try to enter data, it goes into the incorrect record. Following are some screenshots. The program is attached. [pardon the comical names. This is a test, and any resemblance to true names is not intentional] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array_diff problems
Hello all. I have two arrays and when compared against each other via array_diff, I do not get any output: $myarray1 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 30 [Frequency_Description] = Other [Other_Funding] = some )) $myarray2 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 50 [Frequency_Description] = Other [Other_Funding] = none )) $arraydifferences = (array_diff($myarray1,$myarray2)); I need $arraydifferences to record the differences between the two. Any help is appreciated. Thanks, --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array_diff problems
-Original Message- From: Rick Dwyer [mailto:rpdw...@earthlink.net] Sent: Friday, April 27, 2012 3:37 PM To: PHP-General Subject: [PHP] Array_diff problems Hello all. I have two arrays and when compared against each other via array_diff, I do not get any output: $myarray1 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 30 [Frequency_Description] = Other [Other_Funding] = some )) $myarray2 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 50 [Frequency_Description] = Other [Other_Funding] = none )) $arraydifferences = (array_diff($myarray1,$myarray2)); I need $arraydifferences to record the differences between the two. Any help is appreciated. Thanks, --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I suggest you read Multidimensional array_diff for Nested Arrays and your format is not correct on the array that you gave an example of. http://www.php.net/manual/en/function.array-diff.php#98680 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array_diff problems
Thanks to both for the direction. --Rick On Apr 27, 2012, at 4:13 PM, Jim Giner wrote: Are these arrays nested in an array? In that case the manual says you have to do the compare differently. On Apr 27, 2012, at 4:19 PM, admin wrote: -Original Message- From: Rick Dwyer [mailto:rpdw...@earthlink.net] Sent: Friday, April 27, 2012 3:37 PM To: PHP-General Subject: [PHP] Array_diff problems Hello all. I have two arrays and when compared against each other via array_diff, I do not get any output: $myarray1 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 30 [Frequency_Description] = Other [Other_Funding] = some )) $myarray2 = Array ( [0] = Array ( [id] = 1 [Funding_Type] = Federal [Amount] = 10 [Frequency_Description] = Total [Other_Funding] = ) [1] = Array ( [id] = 2 [Funding_Type] = Trust [Amount] = 20 [Frequency_Description] = Per Year [Other_Funding] = ) [2] = Array ( [id] = 3 [Funding_Type] = Other Funding [Amount] = 50 [Frequency_Description] = Other [Other_Funding] = none )) $arraydifferences = (array_diff($myarray1,$myarray2)); I need $arraydifferences to record the differences between the two. Any help is appreciated. Thanks, --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I suggest you read Multidimensional array_diff for Nested Arrays and your format is not correct on the array that you gave an example of. http://www.php.net/manual/en/function.array-diff.php#98680 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems in extension development
Besides, are there some APIs I can use if I want to setget environment variables like DOCUMENT_ROOT in my extension(similar to sapi_cgienv_get/set). Thanks! 2012/2/17 Rui Hu tchrb...@gmail.com hi, I just started to write a simple PHP extension hello, but encountered some problems. I followed tutorials step by step: 1. ./ext_skel --extname=hello 2. modified hello.c and php_hello.h, and wrote function hello_world() which simply return a string hello world. 3. phpize 4. ./configure ; make ; 5. the I encountered error in make. I looked up in Makefile and found that $(PHP_MODULE) is null, which I think is the reason. Makefile is automatically generated by ./configure. What mistake did I make? How to fix it? Thanks! Vic Hu -- Best regards, Rui Hu State Key Laboratory of Networking Switching Technology Beijing University of Posts and Telecommunications(BUPT) MSN: tchrb...@gmail.com - -- Best regards, Rui Hu State Key Laboratory of Networking Switching Technology Beijing University of Posts and Telecommunications(BUPT) MSN: tchrb...@gmail.com -
[PHP] php.net problems?
Hi, is anyone else having problems with PHP.net today? Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
On 01/23/2012 10:28 AM, Donovan Brooke wrote: Hi, is anyone else having problems with PHP.net today? Donovan Working fine from here. Do a traceroute to the site, it might an ISP related problem. Xavier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
Xavier Del Castillo wrote: On 01/23/2012 10:28 AM, Donovan Brooke wrote: Hi, is anyone else having problems with PHP.net today? Donovan Working fine from here. Do a traceroute to the site, it might an ISP related problem. It came right up for me. --Curtis
Re: [PHP] php.net problems?
Can't get to doc at all here... -- The trouble with programmers is that you can never tell what a programmer is doing until it’s too late. ~Seymour Cray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
I can access to php.net, but in the 'Documentation', it doesn't show the View online formats Also, I can't search a function in Search for '' in the function list form. And if i try access to a url from google result, as php.net/manual/es/function.in-array.php i get the following answer: not found edit: right now, in the Documentation - View Oline Formats, it shows only the English option I can access to php.net/manual/en/function.in-array.php but not php.net/manual/es/function.in-array.php El 23/01/12 19:27, Curtis Maurand escribió: Xavier Del Castillo wrote: On 01/23/2012 10:28 AM, Donovan Brooke wrote: Hi, is anyone else having problems with PHP.net today? Donovan Working fine from here. Do a traceroute to the site, it might an ISP related problem. It came right up for me. --Curtis -- Dpto. Ingeniería y Desarrollo ingenie...@ort-telecomunicaciones.es ORT Telecomunicaciones Tlfno: (+34) 951 221 005
Re: [PHP] php.net problems?
From here is US everthing is hosed. Also hosed in CA mirrors. Additionally site says last updated today at 15:20:19 MST bit it is 11:40 MST! On Jan 23, 2012, at 1:36 PM, Dpto Ingeniería y Desarrollo wrote: I can access to php.net, but in the 'Documentation', it doesn't show the View online formats Also, I can't search a function in Search for '' in the function list form. And if i try access to a url from google result, as php.net/manual/es/function.in-array.php i get the following answer: not found edit: right now, in the Documentation - View Oline Formats, it shows only the English option I can access to php.net/manual/en/function.in-array.php but not php.net/manual/es/function.in-array.php El 23/01/12 19:27, Curtis Maurand escribió: Xavier Del Castillo wrote: On 01/23/2012 10:28 AM, Donovan Brooke wrote: Hi, is anyone else having problems with PHP.net today? Donovan Working fine from here. Do a traceroute to the site, it might an ISP related problem. It came right up for me. --Curtis -- Dpto. Ingeniería y Desarrollo ingenie...@ort-telecomunicaciones.es ORT Telecomunicaciones Tlfno: (+34) 951 221 005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
Rasmus confirmed that they are having issues with php.net: You can use the sk.php.net mirror while they fix their problems, as well as docs.php.net. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
2012/1/23 Alex Nikitin niks...@gmail.com: Rasmus confirmed that they are having issues with php.net: You can use the sk.php.net mirror while they fix their problems, as well as docs.php.net. We had a primary system failure at the same time as a migration was underway, which led to complications and subsequent failures of the mirroring network. The issues are being resolved and mirrors are coming back online. In the meantime, you may use one of the following mirrors: http://ca2.php.net/ http://sk.php.net/ http://docs.php.net/ And, until the matter is completely resolved, you can temporarily change your mirror preference at the bottom of this page: http://php.net/my.php -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
Daniel Brown wrote: 2012/1/23 Alex Nikitinniks...@gmail.com: Rasmus confirmed that they are having issues with php.net: You can use the sk.php.net mirror while they fix their problems, as well as docs.php.net. We had a primary system failure at the same time as a migration was underway, which led to complications and subsequent failures of the mirroring network. The issues are being resolved and mirrors are coming back online. In the meantime, you may use one of the following mirrors: http://ca2.php.net/ http://sk.php.net/ http://docs.php.net/ And, until the matter is completely resolved, you can temporarily change your mirror preference at the bottom of this page: http://php.net/my.php Good!, thought I went insane there for a moment and couldn't remember any of the PHP functions... (as nothing was coming up in the search) ;-) Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
On Mon, Jan 23, 2012 at 15:59, Donovan Brooke li...@euca.us wrote: Good!, thought I went insane there for a moment and couldn't remember any of the PHP functions... (as nothing was coming up in the search) ;-) Can't it be both? ;-P -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
Daniel Brown wrote: On Mon, Jan 23, 2012 at 15:59, Donovan Brookeli...@euca.us wrote: Good!, thought I went insane there for a moment and couldn't remember any of the PHP functions... (as nothing was coming up in the search) ;-) Can't it be both? ;-P Purple cucumbers are automobile.. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net problems?
On Mon, Jan 23, 2012 at 16:30, Donovan Brooke li...@euca.us wrote: Purple cucumbers are automobile.. Mmm. *nods* Giggity. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Continued Problems Accessing *.php.net?
ALL: As you may have noticed, early this morning we got bored and decided to delete php.net from the Internet. After getting an estimated sixteen-point-four trillion complaints, we became overwhelmed and aggravated by your incessant need to RTFM that we pressed CTRL+Z and brought it back. You're welcome. In earnest, a catastrophic failure on one of our systems coincided with a migration effort being headed by some very talented folks. This led to a domino effect of issues that resulted in a temporary - but widespread - impact on the online version of the documentation and downloads. Things are nearly back to normal now across the network --- or so it seems. If you come across any issues on your favorite *.php.net mirror, please let us know at https://bugs.php.net/ or via a reply to this thread and we'll check it out. As a result, a list of the top ten reasons PHP had an outage today: 10.) We installed an experimental PECL module named Invisible Ink. 9.) We learned our indoor solar panels don't work when the lights get turned off. 8.) We had our mobile bandwidth slowed to a crawl because we exceeded 2GB for the month. 7.) A Groupon swarm for two free downloads for the price of one killed our network. 6.) We whited out this time to protest another Patriots/Giants Superbowl, while the BC Lions never even got a phone call. 5.) Our build of mod_expires runs on the Mayan calendar, and attempting to do a 60-day expire segfaulted. 4.) The $25.90 check we wrote to cover the server's AOL dial-up bounced. 3.) It's Chinese New Year, but it was too cold to set off the fireworks outside today, so sorry. 2.) As it turned out, all our base truly were belong to them. 1.) We needed 7,500,001 signatures on the petition against SOPA/PIPA. Thanks to all for your patience and such. And, of course, apologies to all. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Continued Problems Accessing *.php.net?
I don't know what all the fuss was about. What's wrong with you people. That document has been there for so many years... you should have memorized it by now! -- Ghodmode http://www.ghodmode.com On Tue, Jan 24, 2012 at 7:22 AM, Daniel Brown danbr...@php.net wrote: ALL: As you may have noticed, early this morning we got bored and decided to delete php.net from the Internet. After getting an estimated sixteen-point-four trillion complaints, we became overwhelmed and aggravated by your incessant need to RTFM that we pressed CTRL+Z and brought it back. You're welcome. In earnest, a catastrophic failure on one of our systems coincided with a migration effort being headed by some very talented folks. This led to a domino effect of issues that resulted in a temporary - but widespread - impact on the online version of the documentation and downloads. Things are nearly back to normal now across the network --- or so it seems. If you come across any issues on your favorite *.php.net mirror, please let us know at https://bugs.php.net/ or via a reply to this thread and we'll check it out. As a result, a list of the top ten reasons PHP had an outage today: 10.) We installed an experimental PECL module named Invisible Ink. 9.) We learned our indoor solar panels don't work when the lights get turned off. 8.) We had our mobile bandwidth slowed to a crawl because we exceeded 2GB for the month. 7.) A Groupon swarm for two free downloads for the price of one killed our network. 6.) We whited out this time to protest another Patriots/Giants Superbowl, while the BC Lions never even got a phone call. 5.) Our build of mod_expires runs on the Mayan calendar, and attempting to do a 60-day expire segfaulted. 4.) The $25.90 check we wrote to cover the server's AOL dial-up bounced. 3.) It's Chinese New Year, but it was too cold to set off the fireworks outside today, so sorry. 2.) As it turned out, all our base truly were belong to them. 1.) We needed 7,500,001 signatures on the petition against SOPA/PIPA. Thanks to all for your patience and such. And, of course, apologies to all. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- 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] Curl problems
Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id) ; curl_exec($curl_handle); curl_close($curl_handle); --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer rpdw...@earthlink.net wrote: Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id); curl_exec($curl_handle); curl_close($curl_handle); --Rick It's maybe not a real answer to your question, but if all you want to do is call that page, why don't you just use file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id); (See [1]) It works out of the box, and I have found curl unstable too sometimes. Matijn [1] www.php.net/file_get_contents -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Jan 11, 2012, at 6:29 PM, Matijn Woudt wrote: On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer rpdw...@earthlink.net wrote: Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id) ; curl_exec($curl_handle); curl_close($curl_handle); --Rick It's maybe not a real answer to your question, but if all you want to do is call that page, why don't you just use file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id ); (See [1]) It works out of the box, and I have found curl unstable too sometimes. Matijn Thanks Matijn, But I get Notice: file_get_contents() [function.file-get-contents]: Unable to find the wrapper https - did you forget to enable it when you configured PHP?... I'm using a hosting provider and I don't believe they will enable this for security reasons. --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Thu, Jan 12, 2012 at 12:44 AM, Rick Dwyer rpdw...@earthlink.net wrote: On Jan 11, 2012, at 6:29 PM, Matijn Woudt wrote: On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer rpdw...@earthlink.net wrote: Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id); curl_exec($curl_handle); curl_close($curl_handle); --Rick It's maybe not a real answer to your question, but if all you want to do is call that page, why don't you just use file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'sess_id='.$sess_id); (See [1]) It works out of the box, and I have found curl unstable too sometimes. Matijn Thanks Matijn, But I get Notice: file_get_contents() [function.file-get-contents]: Unable to find the wrapper https - did you forget to enable it when you configured PHP?... I'm using a hosting provider and I don't believe they will enable this for security reasons. --Rick It seems like they have not compiled PHP with SSL support, or they're using a pretty old version. Anyway, you're probably stuck with cURL then, check the return of curl_exec, and if false, call curl_error to get an error message. Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OOP problems
Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. I need to achieve this schema( - is something like ../ it means that it is one level up folder): connec.php(class Connect MySql)- select.php(class Select MySql) - - mysql.php(class MySQL include all classes, Connect...)- - ... - - db.php(class db include all classes, MySQL, Oracle..) connec.php(class Connect Oracle)- select.php(class Select Oracle ) - - oracle .php(class Oracle include all classes, Connect...)- - ... - download.php(class Download)- unzip.php(class Unzip) - - files.php(class Files include all classes, Download...) - file.php(class file include class Files) - ... - hash.php(class Hash)- capcha.php(class Capcha) - - secure.php(class Secure include all classes, Hash...) - security.php(class security include class Secure) - ... - ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. And in the end, in the same folder as db.php and security.php I will have file application.php which will contain class application and in its __construct() method I will make link classes db, security, file ect. ect. So I will just include file application.php make object from class application and then just do $object-db-connect()(of course if it will by MySql or other database will be stored in some config.php file). Thanks, Dominik
Re: [PHP] OOP problems
I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) { $this-_path = $base_path; } public function __get($name) { $requested_path = $this-_path . DIRECTORY_SEPARATOR . $name; if (is_dir($requested_path)) { return new Base($requested_path); } else if (is_file($requested_path . '.php')) { include ($requested_path . '.php'); $classname = ucfirst($name); return new $clasname(); } } } // Assuming you have Mysql class in /home/user/project/classes/db/mysql.php // you may try $base = new Base(/home/user/project/classes/); $base-db-mysql-someFunctionOfMysqlClass(); 2011/12/15 Dominik Halvoník dominik.halvo...@gmail.com: Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. I need to achieve this schema( - is something like ../ it means that it is one level up folder): connec.php(class Connect MySql)- select.php(class Select MySql) - - mysql.php(class MySQL include all classes, Connect...)- - ... - - db.php(class db include all classes, MySQL, Oracle..) connec.php(class Connect Oracle)- select.php(class Select Oracle ) - - oracle .php(class Oracle include all classes, Connect...)- - ... - download.php(class Download)- unzip.php(class Unzip) - - files.php(class Files include all classes, Download...) - file.php(class file include class Files) - ... - hash.php(class Hash)- capcha.php(class Capcha) - - secure.php(class Secure include all classes, Hash...) - security.php(class security include class Secure) - ... - ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. And in the end, in the same folder as db.php and security.php I will have file application.php which will contain class application and in its __construct() method I will make link classes db, security, file ect. ect. So I will just include file application.php make object from class application and then just do $object-db-connect()(of course if it will by MySql or other database will be stored in some config.php file). Thanks, Dominik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP problems
On 12/15/2011 01:05 PM, Alex Pojarsky wrote: I'm not sure I've understood you correctly, but you may try something like the following primitive autoloader (I didn't debug it, it's just an example): class Base { protected $_path = ''; public function construct($base_path) { $this-_path = $base_path; } public function __get($name) { $requested_path = $this-_path . DIRECTORY_SEPARATOR . $name; if (is_dir($requested_path)) { return new Base($requested_path); } else if (is_file($requested_path . '.php')) { include ($requested_path . '.php'); $classname = ucfirst($name); return new $clasname(); } } } // Assuming you have Mysql class in /home/user/project/classes/db/mysql.php // you may try $base = new Base(/home/user/project/classes/); $base-db-mysql-someFunctionOfMysqlClass(); 2011/12/15 Dominik Halvoníkdominik.halvo...@gmail.com: Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. I need to achieve this schema( - is something like ../ it means that it is one level up folder): connec.php(class Connect MySql)- select.php(class Select MySql) - - mysql.php(class MySQL include all classes, Connect...)- - ... - - db.php(class db include all classes, MySQL, Oracle..) connec.php(class Connect Oracle)- select.php(class Select Oracle ) - - oracle .php(class Oracle include all classes, Connect...)- - ... - download.php(class Download)- unzip.php(class Unzip) - - files.php(class Files include all classes, Download...) - file.php(class file include class Files) - ... - hash.php(class Hash)- capcha.php(class Capcha) - - secure.php(class Secure include all classes, Hash...) - security.php(class security include class Secure) - ... - ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. And in the end, in the same folder as db.php and security.php I will have file application.php which will contain class application and in its __construct() method I will make link classes db, security, file ect. ect. So I will just include file application.php make object from class application and then just do $object-db-connect()(of course if it will by MySql or other database will be stored in some config.php file). Thanks, Dominik Why don't you modify include_path on initialization of 'Base' class? would make things much simpler. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP problems
Hi guys, I try to applied your solutions but I have problems whit it. I need to achieve this schema( - is something like ../ it means that it is one level up folder): connec.php(class Connect MySql)- select.php(class Select MySql) - - mysql.php(class MySQL include all classes, Connect...)- - ... - - db.php(class db include all classes, MySQL, Oracle..) connec.php(class Connect Oracle)- select.php(class Select Oracle ) - - oracle .php(class Oracle include all classes, Connect...)- - ... - download.php(class Download)- unzip.php(class Unzip) - - files.php(class Files include all classes, Download...) - file.php(class file include class Files) - ... - hash.php(class Hash)- capcha.php(class Capcha) - - secure.php(class Secure include all classes, Hash...) - security.php(class security include class Secure) - ... - *ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. ect. * And in the end, in the same folder as db.php and security.php I will have file application.php which will contain class application and in its __construct() method I will make link classes db, security, file ect. ect. So I will just include file application.php make object from class application and then just do $object-db-connect()(of course if it will by MySql or other database will be stored in some config.php file). Thanks, Dominik
[PHP] OOP problems
Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. Can you help my please? Sincerely, Dominik Halvonik
Re: [PHP] OOP problems
On 8 Dec 2011, at 17:14, Dominik Halvoník wrote: I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. Can you help my please? You don't say what the db class (in db.php) itself does other than wrapping the database-specific classes, so I've assumed it doesn't do anything. If it does do more then simply have the mysql, oracle, etc classes extend db. I've also assumed that the application doesn't need to support multiple database types simultaneously. class application { public $db = null; function __construct($db = 'mysql') { require __DIR__.'/db/'.$db.'.php'; $this-db = new MySQL(); } } $test = new application('mysql'); $test-db-connect(); -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP problems
Sent from a handheld device On 08-Dec-2011, at 11:14 PM, Dominik Halvoník dominik.halvo...@gmail.com wrote: Hello, I would like to ask you for help. This days I am trying to build one of my applications. But I have problem which stopped me. I have folder whit php files like connect.php, delete.php etc. These files contains classes named the same as files. So in file connect.php is class Connect. These files are placed in folder named mysql and this folder is inside folder named db. In folder db is a php file named mysql.php, in this file I include classes from folder mysql, after include I declare class MySQL and in it I have method __construct(). In this method I create dynamic objects from included classes. And this is the problem that I can not solve, I have more then one of this files(mysql.php[whit class MySQL], oracle.php[whit class Oracle] etc.) and I need to include them to file called db.php that is in the main folder of my app. In db.php is an class called db, how can I add classes MySQL, Oracle etc. to class db? I try to use abstract class whit __set and __get methods but I also need to include class db to main class application. I am really sorry for my English, so please be indulgent. So I need to connect classes like this: This is where common design patters comes handy. Your problem can be solved by factory pattern. Create a static method connect on db class. Then call it like $db = DB::connect($db_type) Here the db type variable contains MySQL or oracle. In connect static method you implement the logic on how to connect that specific database. In the connect method you can also take db credentials like username and password. Google php design pattern to know more. application-db-mysql-connect, but I can not use extends because in php you can have only one parent class. The reason why I am trying to do something like this is because I want to call methods like this: $test = new application(); $test-db-connect(); If it is mysql or othet database I set in config.php file. Can you help my please? Sincerely, Dominik Halvonik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql problems [SOLVED]
Sean Greenslade wrote: [MASSIVE SNIP] Well, from what I saw while wading through your code, you allow unsanitized variables to be concatenated to your queries. Big no-no! For ANY client-generated variable, always sanitize with mysql_real_escape_string. In fact, sanitize all your variables. It can't hurt. Also, please don't take a request for your entire code too literally. We don't like to see pages and pages and pages of code, just the pertinent bits. -- --Zootboy Sent from my PC. Thanks to all, but it was an infinite loop. there was a while ($_parent != 0) { } loop. In the loop the database is queried. If the returned number of rows is greater than 0 then perform then grab a $_parent from the database. At some point, there must be a parent that is = 0 and the loop breaks. However, if the page is called with category number that doesn't exist, then the if/then clause is never true and $_parent never gets set to 0. I simply added and else clause. while ($_parent != 0) { if ($num_rows 0) { perform some action } else { $_parent = 0; } } and that solved the problem. Thank you, everyone for your help. Curtis
RE: [PHP] mysql problems [SOLVED]
[SNIP] added and else clause. while ($_parent != 0) { if ($num_rows 0) { perform some action } else { $_parent = 0; } } and that solved the problem. Thank you, everyone for your help. Curtis A small remark: I think it is good programming practice to place such static if-clauses before the while statement. This prevents a lot of redundant checks and thus saves time. Best regards, Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] mysql problems
On 11 May 2011 at 19:25, Curtis Maurand cur...@maurand.com wrote: $_cartTotal=$0.00; Surely that should be: $_cartTotal = 0.00; tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] mysql problems
Tim Streater wrote: On 11 May 2011 at 19:25, Curtis Maurand cur...@maurand.com wrote: $_cartTotal=$0.00; Surely that should be: $_cartTotal = 0.00; Good pickup. I missed that. I didn't write the code, I'm just trying to figure out what's going on. Thanks, I'll look at that. --C
[PHP] mysql problems
I'm running PHP 5.3.6, Mysql 5.1.51 and Apache 2.2.17 I have code that does a simple mysql_query(); the query on the commandline returns an empty set. when run via PHP and the web server, the page hangs, it never gets to the if (mysql_num_rows($result) 0) {}. and the queries per second on mysql goes from roughly 4 per second to about 12,000. Does anyone have any ideas? Thanks, Curtis
Re: [PHP] mysql problems
Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql problems
Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query, SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat where $_currentCat is equal to a value not in the database. The only way that this can happen is if the page is called directly without going through the default page. the script follows. its called leftNav.php ?php include 'media/includes/productDetail.php'; //$username = alaric; $username = pinetree; //$password = password_removed; $password = password_removed; $hostname = 127.0.0.1; //$hostname = www.superseeds.com; if($_SESSION[u_id]==){ $_SESSION[u_id] = uniqid(); } // $_cartTotal=$0.00; $_cartCount=0; function tallyCart($_u_id){ global $username; global $password; global $hostname; global $_cartTotal; global $_cartCount; $dbhandle = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); $selected = mysql_select_db(pinetree,$dbhandle) or die(Could not select examples); //execute the SQL query and return records $result = mysql_query(SELECT * from tbl_Cart where u_ID='.$_u_id.'); $_holder=; $_counter=0; $_getSubTotal=0; $_showCheckOut=0; while ($row = mysql_fetch_array($result)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } $_cartTotal = $.number_format($_getSubTotal,2); $_cartCount = $_counter; mysql_close($dbhandle); } tallyCart($_SESSION[u_id]); ? div id=div_cartCall div id=div_cartCall_head You have ?php echo $_cartCount? items in your cart.br/br/ Cart total: ?php echo $_cartTotal? /div div id=div_cartCall_foot a href=cart.php#65533; Go to cart/a /div /div p ?php //$username = alaric; $username = pinetree; //$password = removed; $password = removed; //$hostname = 127.0.0.1; $hostname = www.superseeds.com; $_parents = array(); $counter=0; if($_GET[cat]!=){ $_parent =$_GET[cat]; } else{ $_parent =0; } $dbhandle2 = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); //echo Connected to MySQLbr; //select a database to work with $selected = mysql_select_db(pinetree,$dbhandle2) or die(Could not select examples); while ($_parent !=0) { $result_2 = mysql_query(SELECT catagory_parent FROM t_catagories where catagory_ID= .$_parent); $num_rows_2 = mysql_num_rows($result_2); if($num_rows_2 0) { while ($row = mysql_fetch_array($result_2)) { $_parent= $row{'catagory_parent'}; $_parents[$counter] = $row{'catagory_parent'}; $counter++; } } } mysql_close($dbhandle2); function getParent($catID, $matchingID){ //$username = alaric; $username = pinetree; //$password = removed; $password = removed; //$hostname = 127.0.0.1; $hostname = www.superseeds.com; $_parent=1; $_currentCat=$catID; $dbhandle2 = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); //echo Connected to MySQLbr; //select a database to work with $selected = mysql_select_db(pinetree,$dbhandle2) or die(Could not select examples); while ($_parent !=0) { $result_2 = mysql_query(SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat); while ($row = mysql_fetch_array($result_2)) { $_parent=$row{'catagory_parent'}; if($row{'catagory_parent'}==$matchingID){ mysql_close($dbhandle2); return true; } } } mysql_close($dbhandle2); return false; } ? ?php function getRowCount($_catID){ global $_parents; global $username; global $password; global $hostname; $dbhandle = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); $selected = mysql_select_db(pinetree,$dbhandle) or die(Could not select examples); $result = mysql_query(SELECT COUNT(*) as theCount FROM t_catagories where catagory_parent=.$_catID); while ($row = mysql_fetch_array($result)) { if($row{'theCount'}==0){ mysql_close($dbhandle); return 0; } else{ mysql_close($dbhandle); return .$row{'theCount'}; } } } function generateNav($_parent, $_style){ if(getRowCount($_parent)0){ global $_parents; global $username; global $password; global $hostname; $dbhandle3 =
Re: [PHP] mysql problems
Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query, SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat where $_currentCat is equal to a value not in the database. The only way that this can happen is if the page is called directly without going through the default page. the script follows. its called leftNav.php ?php include 'media/includes/productDetail.php'; //$username = alaric; $username = pinetree; //$password = password_removed; $password = password_removed; $hostname = 127.0.0.1; //$hostname = www.superseeds.com; if($_SESSION[u_id]==){ $_SESSION[u_id] = uniqid(); } // $_cartTotal=$0.00; $_cartCount=0; function tallyCart($_u_id){ global $username; global $password; global $hostname; global $_cartTotal; global $_cartCount; $dbhandle = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); $selected = mysql_select_db(pinetree,$dbhandle) or die(Could not select examples); //execute the SQL query and return records $result = mysql_query(SELECT * from tbl_Cart where u_ID='.$_u_id.'); $_holder=; $_counter=0; $_getSubTotal=0; $_showCheckOut=0; while ($row = mysql_fetch_array($result)) { $_showCheckOut=1; $_pdetail=new ProductDetail($row{'product_ID'}, $row{'product_Quantity'}, $_u_id); $_getSubTotal += $_pdetail-_subTotal; $_counter++; } $_cartTotal = $.number_format($_getSubTotal,2); $_cartCount = $_counter; mysql_close($dbhandle); } tallyCart($_SESSION[u_id]); ? div id=div_cartCall div id=div_cartCall_head You have ?php echo $_cartCount? items in your cart.br/br/ Cart total: ?php echo $_cartTotal? /div div id=div_cartCall_foot a href=cart.php#65533; Go to cart/a /div /div p ?php //$username = alaric; $username = pinetree; //$password = removed; $password = removed; //$hostname = 127.0.0.1; $hostname = www.superseeds.com; $_parents = array(); $counter=0; if($_GET[cat]!=){ $_parent =$_GET[cat]; } else{ $_parent =0; } $dbhandle2 = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); //echo Connected to MySQLbr; //select a database to work with $selected = mysql_select_db(pinetree,$dbhandle2) or die(Could not select examples); while ($_parent !=0) { $result_2 = mysql_query(SELECT catagory_parent FROM t_catagories where catagory_ID= .$_parent); $num_rows_2 = mysql_num_rows($result_2); if($num_rows_2 0) { while ($row = mysql_fetch_array($result_2)) { $_parent= $row{'catagory_parent'}; $_parents[$counter] = $row{'catagory_parent'}; $counter++; } } } mysql_close($dbhandle2); function getParent($catID, $matchingID){ //$username = alaric; $username = pinetree; //$password = removed; $password = removed; //$hostname = 127.0.0.1; $hostname = www.superseeds.com; $_parent=1; $_currentCat=$catID; $dbhandle2 = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); //echo Connected to MySQLbr; //select a database to work with $selected = mysql_select_db(pinetree,$dbhandle2) or die(Could not select examples); while ($_parent !=0) { $result_2 = mysql_query(SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat); while ($row = mysql_fetch_array($result_2)) { $_parent=$row{'catagory_parent'}; if($row{'catagory_parent'}==$matchingID){ mysql_close($dbhandle2); return true; } } } mysql_close($dbhandle2); return false; } ? ?php function getRowCount($_catID){ global $_parents; global $username; global $password; global $hostname; $dbhandle = mysql_connect($hostname, $username, $password) or die(Unable to connect to MySQL); $selected = mysql_select_db(pinetree,$dbhandle) or die(Could not select examples); $result = mysql_query(SELECT COUNT(*) as theCount FROM t_catagories where catagory_parent=.$_catID); while ($row = mysql_fetch_array($result)) { if($row{'theCount'}==0){ mysql_close($dbhandle); return 0; } else{ mysql_close($dbhandle); return .$row{'theCount'}; } } } function generateNav($_parent, $_style){ if(getRowCount($_parent)0){ global $_parents; global $username; global $password; global $hostname; $dbhandle3 =
Re: [PHP] mysql problems
On Wed, May 11, 2011 at 2:25 PM, Curtis Maurand cur...@maurand.com wrote: Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query, SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat where $_currentCat is equal to a value not in the database. The only way that this can happen is if the page is called directly without going through the default page. the script follows. its called leftNav.php [MASSIVE SNIP] Well, from what I saw while wading through your code, you allow unsanitized variables to be concatenated to your queries. Big no-no! For ANY client-generated variable, always sanitize with mysql_real_escape_string. In fact, sanitize all your variables. It can't hurt. Also, please don't take a request for your entire code too literally. We don't like to see pages and pages and pages of code, just the pertinent bits. -- --Zootboy Sent from my PC.
Re: [PHP] Memcache problems
Thanks for your help so far. I've just started noticing a bunch of zend_mm_heap corrupted in logs, Could this be the reason? On 02/03/2011 11:12 PM, Alex Nikitin wrote: Short of some process going crazy, which you should check for, some psing, top and netstat, i cant think of any reason you should ever get a connection drop, short of a hardware failure (memory perhaps), or an experimental kernel settings or modules or something... i cant think of any way that a connection to 127.0.0.1 would ever possibly get dropped, loopback device never hits your network hardware... ~Alex On Thu, Feb 3, 2011 at 5:00 PM, Jostein Eriksenphp-l...@morits.net wrote: On 02/03/2011 10:49 PM, Adam Richardson wrote: On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksenphp-l...@morits.net wrote: Both php and memcached is running on the same server. memcached version 1.2.2 php5-memcache version 2.2.0 php version 5.2.4 here is a snippet from my code that may be of interest $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1); ... $this-memcache = new Memcache(); foreach($cfg['serverList'] as $value){ /** host, port, persistent, weight, timeout, retry interval, status, failure callback */ $this-memcache-addServer($value[0], $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail')); } Are you sure you copied this correctly? In the code above, you set the array key 'serverList' to an array containing ('127.0.0.1', 11211, 1, 1); Then, you foreach through the values of the 'serverList' array (first iteration, value would equal '127.0.0.1', second, value would equal 11211, etc.) Then, you use array notation to access the first position of $value. In the first iteration of the foreach, $value would equal '127.0.0.1', so $value[0] would give you '1', $value[1] would give you '2', etc. Do you see what I'm saying? Did you forget or omit other relevant code? Or, I'm just having a really bad code day (in this case, I'll likely see my error just after sending this email.) Adam My bad. it should be: 'serverList' = array( /** host, port, weight, timeout */ 'default' = array('127.0.0.1', 11211, 1, 1), )), Didn't copy/paste the $cfg = line, so it got messed up. /Jostein -- 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] Memcache problems
Hi, I've been having some problems with memcache lately. It seems to me that php is dropping connection to the memcache server mid way through the scripts. I've sat the failure_callback to log failures. And I'm getting a lot of them. Several every minute. I'm quite stuck now and realy dont know where to go from here. I've tried to telnet into the server. And there is no problem with either set nor get commands. I've started the memcached daemon with -vvv to see if I can dig anything interesting from the logs, but I can find no errors of any kind in them. There is also no errors that I can find in the php_error log. I would appreciate some help, if anyone have any ideas of what is going on. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memcache problems
There could be many a reasons for this, and it really depends on your setup. For example, is php and memcache on the same server, if they are not what is the network topology like, it could be a piece of hardware starting to malfunction, it could be an issue with the networking driver, on the other hand it could be neither; but to help you figure out where to look, one should hope to see a little bit more info... ~Alex On Thu, Feb 3, 2011 at 3:10 PM, Jostein Eriksen php-l...@morits.net wrote: Hi, I've been having some problems with memcache lately. It seems to me that php is dropping connection to the memcache server mid way through the scripts. I've sat the failure_callback to log failures. And I'm getting a lot of them. Several every minute. I'm quite stuck now and realy dont know where to go from here. I've tried to telnet into the server. And there is no problem with either set nor get commands. I've started the memcached daemon with -vvv to see if I can dig anything interesting from the logs, but I can find no errors of any kind in them. There is also no errors that I can find in the php_error log. I would appreciate some help, if anyone have any ideas of what is going on. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memcache problems
Both php and memcached is running on the same server. memcached version 1.2.2 php5-memcache version 2.2.0 php version 5.2.4 here is a snippet from my code that may be of interest $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1); ... $this-memcache = new Memcache(); foreach($cfg['serverList'] as $value){ /** host, port, persistent, weight, timeout, retry interval, status, failure callback */ $this-memcache-addServer($value[0], $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail')); } /Jostein On 02/03/2011 09:34 PM, Alex Nikitin wrote: There could be many a reasons for this, and it really depends on your setup. For example, is php and memcache on the same server, if they are not what is the network topology like, it could be a piece of hardware starting to malfunction, it could be an issue with the networking driver, on the other hand it could be neither; but to help you figure out where to look, one should hope to see a little bit more info... ~Alex On Thu, Feb 3, 2011 at 3:10 PM, Jostein Eriksenphp-l...@morits.net wrote: Hi, I've been having some problems with memcache lately. It seems to me that php is dropping connection to the memcache server mid way through the scripts. I've sat the failure_callback to log failures. And I'm getting a lot of them. Several every minute. I'm quite stuck now and realy dont know where to go from here. I've tried to telnet into the server. And there is no problem with either set nor get commands. I've started the memcached daemon with -vvv to see if I can dig anything interesting from the logs, but I can find no errors of any kind in them. There is also no errors that I can find in the php_error log. I would appreciate some help, if anyone have any ideas of what is going on. thanks. -- 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] Memcache problems
On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksen php-l...@morits.net wrote: Both php and memcached is running on the same server. memcached version 1.2.2 php5-memcache version 2.2.0 php version 5.2.4 here is a snippet from my code that may be of interest $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1); ... $this-memcache = new Memcache(); foreach($cfg['serverList'] as $value){ /** host, port, persistent, weight, timeout, retry interval, status, failure callback */ $this-memcache-addServer($value[0], $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail')); } Are you sure you copied this correctly? In the code above, you set the array key 'serverList' to an array containing ('127.0.0.1', 11211, 1, 1); Then, you foreach through the values of the 'serverList' array (first iteration, value would equal '127.0.0.1', second, value would equal 11211, etc.) Then, you use array notation to access the first position of $value. In the first iteration of the foreach, $value would equal '127.0.0.1', so $value[0] would give you '1', $value[1] would give you '2', etc. Do you see what I'm saying? Did you forget or omit other relevant code? Or, I'm just having a really bad code day (in this case, I'll likely see my error just after sending this email.) Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com
Re: [PHP] Memcache problems
On 02/03/2011 10:49 PM, Adam Richardson wrote: On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksenphp-l...@morits.net wrote: Both php and memcached is running on the same server. memcached version 1.2.2 php5-memcache version 2.2.0 php version 5.2.4 here is a snippet from my code that may be of interest $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1); ... $this-memcache = new Memcache(); foreach($cfg['serverList'] as $value){ /** host, port, persistent, weight, timeout, retry interval, status, failure callback */ $this-memcache-addServer($value[0], $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail')); } Are you sure you copied this correctly? In the code above, you set the array key 'serverList' to an array containing ('127.0.0.1', 11211, 1, 1); Then, you foreach through the values of the 'serverList' array (first iteration, value would equal '127.0.0.1', second, value would equal 11211, etc.) Then, you use array notation to access the first position of $value. In the first iteration of the foreach, $value would equal '127.0.0.1', so $value[0] would give you '1', $value[1] would give you '2', etc. Do you see what I'm saying? Did you forget or omit other relevant code? Or, I'm just having a really bad code day (in this case, I'll likely see my error just after sending this email.) Adam My bad. it should be: 'serverList' = array( /** host, port, weight, timeout */ 'default' = array('127.0.0.1', 11211, 1, 1), )), Didn't copy/paste the $cfg = line, so it got messed up. /Jostein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Memcache problems
Short of some process going crazy, which you should check for, some psing, top and netstat, i cant think of any reason you should ever get a connection drop, short of a hardware failure (memory perhaps), or an experimental kernel settings or modules or something... i cant think of any way that a connection to 127.0.0.1 would ever possibly get dropped, loopback device never hits your network hardware... ~Alex On Thu, Feb 3, 2011 at 5:00 PM, Jostein Eriksen php-l...@morits.net wrote: On 02/03/2011 10:49 PM, Adam Richardson wrote: On Thu, Feb 3, 2011 at 4:19 PM, Jostein Eriksenphp-l...@morits.net wrote: Both php and memcached is running on the same server. memcached version 1.2.2 php5-memcache version 2.2.0 php version 5.2.4 here is a snippet from my code that may be of interest $cfg['serverList'] = array('127.0.0.1', 11211, 1, 1); ... $this-memcache = new Memcache(); foreach($cfg['serverList'] as $value){ /** host, port, persistent, weight, timeout, retry interval, status, failure callback */ $this-memcache-addServer($value[0], $value[1], false, $value[2], $value[3], 2, true, array($this, 'fail')); } Are you sure you copied this correctly? In the code above, you set the array key 'serverList' to an array containing ('127.0.0.1', 11211, 1, 1); Then, you foreach through the values of the 'serverList' array (first iteration, value would equal '127.0.0.1', second, value would equal 11211, etc.) Then, you use array notation to access the first position of $value. In the first iteration of the foreach, $value would equal '127.0.0.1', so $value[0] would give you '1', $value[1] would give you '2', etc. Do you see what I'm saying? Did you forget or omit other relevant code? Or, I'm just having a really bad code day (in this case, I'll likely see my error just after sending this email.) Adam My bad. it should be: 'serverList' = array( /** host, port, weight, timeout */ 'default' = array('127.0.0.1', 11211, 1, 1), )), Didn't copy/paste the $cfg = line, so it got messed up. /Jostein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Problems
On Fri, Jan 28, 2011 at 00:33, Ethan Rosenberg eth...@earthlink.net wrote: Please take a look at php.ini in the vicinity of line 510. You will see the construct to which I refer. Can you explain what is going on? I do not think it is a problem with commenting out a line. Any ideas from the rest of the list? Keep in mind that php.ini is not universal, and changes drastically with version, distribution, CLI vs. web, customization, and more. The answer that Adam gave you is absolutely correct with regard to the information you provided. You need to put a semicolon before the line you quoted as being line 510 in your php.ini. The directive you want is error_reporting, and should look like so: error_reporting = E_ALL ~E_NOTICE -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Problems
At 01:54 AM 1/27/2011, Adam Richardson wrote: On Thu, Jan 27, 2011 at 1:01 AM, Ethan Rosenberg eth...@earthlink.netwrote: Dear List - I am executing the command pear list. This is what I get - ethan@rosenberg:/usr/bin$ pear list PHP: syntax error, unexpected '' in /etc/php5/cli/php.ini on line 510 Installed packages, channel pear.php.net: = Package Version State Archive_Tar 1.3.7 stable Console_Getopt 1.2.3 stable PEAR 1.9.1 stable Structures_Graph 1.0.3 stable Validate_US 0.5.4 beta XML_Util 1.2.1 stable ethan@rosenberg:/usr/bin$ This is line 510 Default Value: E_ALL ~E_NOTICE That line should likely be commented out (it was probably originally commented out and then somebody accidentally uncommented.) Most php.ini files follow the convention (notice that there's no colon in the example): some_name = some_value Happy coding, Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com Adam - Thanks. Please take a look at php.ini in the vicinity of line 510. You will see the construct to which I refer. Can you explain what is going on? I do not think it is a problem with commenting out a line. Any ideas from the rest of the list? Ethan MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear Problems
Dear List - I am executing the command pear list. This is what I get - ethan@rosenberg:/usr/bin$ pear list PHP: syntax error, unexpected '' in /etc/php5/cli/php.ini on line 510 Installed packages, channel pear.php.net: = Package Version State Archive_Tar 1.3.7 stable Console_Getopt 1.2.3 stable PEAR 1.9.1 stable Structures_Graph 1.0.3 stable Validate_US 0.5.4 beta XML_Util 1.2.1 stable ethan@rosenberg:/usr/bin$ This is line 510 Default Value: E_ALL ~E_NOTICE Advice and help please. Thanks. Ethan MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pear Problems
On Thu, Jan 27, 2011 at 1:01 AM, Ethan Rosenberg eth...@earthlink.netwrote: Dear List - I am executing the command pear list. This is what I get - ethan@rosenberg:/usr/bin$ pear list PHP: syntax error, unexpected '' in /etc/php5/cli/php.ini on line 510 Installed packages, channel pear.php.net: = Package Version State Archive_Tar 1.3.7 stable Console_Getopt 1.2.3 stable PEAR 1.9.1 stable Structures_Graph 1.0.3 stable Validate_US 0.5.4 beta XML_Util 1.2.1 stable ethan@rosenberg:/usr/bin$ This is line 510 Default Value: E_ALL ~E_NOTICE That line should likely be commented out (it was probably originally commented out and then somebody accidentally uncommented.) Most php.ini files follow the convention (notice that there's no colon in the example): some_name = some_value Happy coding, Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com
[PHP] Re: problems with utf-8 conversion
I found lot of poeple having matters with chars over 1 byte, so I've published that : http://www.phpcs.com/codes/ENCODAGE-UTF16_51501.aspx If you take a look, give me a feedback please (to a...@apieum.com) regards, greg Le 05/04/2010 17:08, sudhir patil a écrit : Thanks Nathan, i tried with utf8_encode, that doesn't help. Yes both content-type metatag are set to utf-8. When i try utf-8 converted csv everything shows up properly. Issue is when i try to change encoding in php, special characters are messed up. Character that i am facing problem with is ’ #8217; rsquo; right single quotation mark Thanks, Sudhir -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems with utf-8 conversion
sudhir patil wrote: I have csv file with special characters, stored in default encoding(ISO-8859-1). I am convert file contents(string) to UTF-8using iconv. This doesn't convert special characters properly, shows broken on fronted. Page encoding meta tag are properly set to utf-8. Characters are shown properly on frontend if i save file encoding as utf-8(Using notepad). But iconv doesn't convert characters properly to UTF-8. $value = iconv(Latin1,utf-8, $value); having problem with below mentioned character ’ #8217; rsquo; right single quotation mark Any idea or suggestions to fix this would be helpful. 1: try utf8_encode instead of iconv 2: check the headers being sent and that they include: Content-Type: text/html; charset=UTF-8 as this normally overwrites and choice you make in html. a good way of debugging this is to view the page in firefox and see menu option View - Charecter Encoding - ; the one presently selected is generally the pages real encoding, and you can flick between iso-8859-1 / utf-8 to see which one fixes your problem (then change headers accordingly). regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Thu, 2010-02-11 at 22:38 -0500, Paul M Foster wrote: On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote: On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. When the first Word Macro virus appeared in the early 90s, the AV industry approached Microsoft for the specifications of the internal structure of the Word documents. After some discussion Microsoft agreed to make these available to firms who signed an NDA. Several large firms did so, but when they got the specifications they immediately discovered that they bore very little relation to the actual documents. When Microsoft was approached about this their reply was Well, that's all we've got! The industry had to run a joint program to reverse engineer the specifications before they could work out how to remove the virus. The story that went around was that with each update Microsoft hired a new batch of young graduates asidethey don't have preconceived notions (a.k.a. experience), and they don't have extravagant ideas of their own worth/aside, told them vaguely what they wanted, and left them to it. Then, as soon as they had something that sort of worked, they let them go again. So there was no continuity, no documentation, no hope of bug fixes, and very little likelihood that the next update would be improved in any meaningful sense. I have seen nothing to suggest that anything has changed. I suspect any lack of continuity was more due to the shifting of personnel internally to differing projects, rather than the hiring of all new coders each time. But more importantly, I suspect MS coders just coded without writing any docs. Coders usually suck at documentation and will avoid it unless forced. And if forced to write docs, the docs were just a toss-off no one ever actually looked at. Microsoft's attitude, I'm sure was, Why should we care about other players in the market? Just buy our crap and you won't have to worry about our formats. (Except until the next upgrade.) I think ISO's policy should be that if you're a company forwarding a standard, your off-the-shelf software should verifiably duplicate that standard. Otherwise, go pound sand. Same if you're a community proposing a standard. Produce some software which adheres to that standard or shut up. Paul -- Paul M. Foster Microsofts XML format should never have been made an ISO standard anyway. There's a bit of a conspiracy behind how they managed it, including large amounts of money and trade agreements trading hands, as well as secret voting... Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
Ashley Sheridan wrote: On Thu, 2010-02-11 at 22:38 -0500, Paul M Foster wrote: On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote: On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. When the first Word Macro virus appeared in the early 90s, the AV industry approached Microsoft for the specifications of the internal structure of the Word documents. After some discussion Microsoft agreed to make these available to firms who signed an NDA. Several large firms did so, but when they got the specifications they immediately discovered that they bore very little relation to the actual documents. When Microsoft was approached about this their reply was Well, that's all we've got! The industry had to run a joint program to reverse engineer the specifications before they could work out how to remove the virus. The story that went around was that with each update Microsoft hired a new batch of young graduates asidethey don't have preconceived notions (a.k.a. experience), and they don't have extravagant ideas of their own worth/aside, told them vaguely what they wanted, and left them to it. Then, as soon as they had something that sort of worked, they let them go again. So there was no continuity, no documentation, no hope of bug fixes, and very little likelihood that the next update would be improved in any meaningful sense. I have seen nothing to suggest that anything has changed. I suspect any lack of continuity was more due to the shifting of personnel internally to differing projects, rather than the hiring of all new coders each time. But more importantly, I suspect MS coders just coded without writing any docs. Coders usually suck at documentation and will avoid it unless forced. And if forced to write docs, the docs were just a toss-off no one ever actually looked at. Microsoft's attitude, I'm sure was, Why should we care about other players in the market? Just buy our crap and you won't have to worry about our formats. (Except until the next upgrade.) I think ISO's policy should be that if you're a company forwarding a standard, your off-the-shelf software should verifiably duplicate that standard. Otherwise, go pound sand. Same if you're a community proposing a standard. Produce some software which adheres to that standard or shut up. Paul -- Paul M. Foster Microsofts XML format should never have been made an ISO standard anyway. There's a bit of a conspiracy behind how they managed it, including large amounts of money and trade agreements trading hands, as well as secret voting... There was a great article in the NYT about microsoft from Dick Brass (a former Vice President) that's well worth a read: http://www.nytimes.com/2010/02/04/opinion/04brass.html regards :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Thu, Feb 11, 2010 at 5:18 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. Thanks, Ash http://www.ashleysheridan.co.uk You may be right as far as standards of the file format are concerned, but IMO OpenOffice.org just isn't quite where I'd like it compared to Microsoft Office, at least up through 2003. (I really dislike the whole reorganized interface they created for 2007.) Particularly there are differences between Excel and Calc that really annoy me. I would like to like OpenOffice.org, but I spend too much of the time I use it being frustrated by it. (Wow, has this thread digressed!) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Fri, 2010-02-12 at 16:03 -0500, Andrew Ballard wrote: On Thu, Feb 11, 2010 at 5:18 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. Thanks, Ash http://www.ashleysheridan.co.uk You may be right as far as standards of the file format are concerned, but IMO OpenOffice.org just isn't quite where I'd like it compared to Microsoft Office, at least up through 2003. (I really dislike the whole reorganized interface they created for 2007.) Particularly there are differences between Excel and Calc that really annoy me. I would like to like OpenOffice.org, but I spend too much of the time I use it being frustrated by it. (Wow, has this thread digressed!) Andrew I must admit that Calc doesn't seem quite as fully featured, particularly with respect to macros. It does have other good features though that make it better, like native external database connectivity. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: On Wed, 10 Feb 2010 10:12:01 -0500, Robert Cummings wrote: I'm doing quite a bit more work in public sector these days. Recently ne department finally did away with IE6 and moved to IE7. Here's what I had to do to accomodate this gotcha: Nothing See, that was tough. Why was it so hard? Because I developed for Firefox/Opera and touched up for IE6, 7, 8 since these are inevitable paths of evolution in the public sector. [...] We work the same way and generally just encounter a bit of swearing and minor CSS rework when we get around to IE6. Otherwise, it's all fine. Working to the standards and then patching for IE6 is easier than working to IE6 and patching for *everything else*. :) Regarding platforms, IMHO the main reason IE6 is so persistent is that it comes with Windows XP. Vista was such a flop that Windows XP is still the base of most SOE/COE distributions both in government and business. Now that Windows 7 is out and shown to be somewhat more worthy, IE6 will be replaced by IE8 in due course as Windows 7 becomes the SOE/COE base. I too am hoping for a switch to more Linux desktops, but I can't see it happening soon at most government / business organisations that deal in Microsoft Office documents until OpenOffice.org can better support the huge range of spottily formatted Office documents out there. That, or everyone moves to Google Docs, or regulations enforce exchange of government documents in OpenDocument formats :) -- Ross McKay, Toronto, NSW Australia The documentation and sample application having failed me, I resort to thinking. This desperate tactic works, and I resolve that problem and go on to the next - Michael Swaine, Programming Paradigms, Dr Dobb's Journal There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. When the first Word Macro virus appeared in the early 90s, the AV industry approached Microsoft for the specifications of the internal structure of the Word documents. After some discussion Microsoft agreed to make these available to firms who signed an NDA. Several large firms did so, but when they got the specifications they immediately discovered that they bore very little relation to the actual documents. When Microsoft was approached about this their reply was Well, that's all we've got! The industry had to run a joint program to reverse engineer the specifications before they could work out how to remove the virus. The story that went around was that with each update Microsoft hired a new batch of young graduates asidethey don't have preconceived notions (a.k.a. experience), and they don't have extravagant ideas of their own worth/aside, told them vaguely what they wanted, and left them to it. Then, as soon as they had something that sort of worked, they let them go again. So there was no continuity, no documentation, no hope of bug fixes, and very little likelihood that the next update would be improved in any meaningful sense. I have seen nothing to suggest that anything has changed. And Bill actually likes it this way! Someone who did a lot of support work for small and medium enterprises told me that the biggest pressure for updating to the latest version came from workers envious of the new employee, with his new computer and the new version of the Microsoft rubbish --- sorry, wonder product. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote: On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) wrote: On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote: ... There's a good reason for OpenOffice having some difficulties with MS Office documents. Back when MS rushed through getting their document standard ratified by ISO (which itself is a whole other story) they didn't explain all the details quite as well as they might have. Later on, MS found they were having some difficulty following their own 'standard' and so altered it in various ways in Office2007. Needless to say, ISO weren't too happy when MS asked if they could just 'change the specs' for their file format, and quite rightly refused to do so. In short, this means that there is a MS ISO standard that MS is the only one not trying to follow, and software like OpenOffice is left to reverse engineering the format again. When the first Word Macro virus appeared in the early 90s, the AV industry approached Microsoft for the specifications of the internal structure of the Word documents. After some discussion Microsoft agreed to make these available to firms who signed an NDA. Several large firms did so, but when they got the specifications they immediately discovered that they bore very little relation to the actual documents. When Microsoft was approached about this their reply was Well, that's all we've got! The industry had to run a joint program to reverse engineer the specifications before they could work out how to remove the virus. The story that went around was that with each update Microsoft hired a new batch of young graduates asidethey don't have preconceived notions (a.k.a. experience), and they don't have extravagant ideas of their own worth/aside, told them vaguely what they wanted, and left them to it. Then, as soon as they had something that sort of worked, they let them go again. So there was no continuity, no documentation, no hope of bug fixes, and very little likelihood that the next update would be improved in any meaningful sense. I have seen nothing to suggest that anything has changed. I suspect any lack of continuity was more due to the shifting of personnel internally to differing projects, rather than the hiring of all new coders each time. But more importantly, I suspect MS coders just coded without writing any docs. Coders usually suck at documentation and will avoid it unless forced. And if forced to write docs, the docs were just a toss-off no one ever actually looked at. Microsoft's attitude, I'm sure was, Why should we care about other players in the market? Just buy our crap and you won't have to worry about our formats. (Except until the next upgrade.) I think ISO's policy should be that if you're a company forwarding a standard, your off-the-shelf software should verifiably duplicate that standard. Otherwise, go pound sand. Same if you're a community proposing a standard. Produce some software which adheres to that standard or shut up. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Lester Caine wrote: Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Support of any type for Win2K is over in 5 months. Better upgrade. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 07:02 -0600, Shawn McKenzie wrote: Lester Caine wrote: Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Support of any type for Win2K is over in 5 months. Better upgrade. -- Thanks! -Shawn http://www.spidean.com I've not had any personal experience with the public sector, but I have heard stories from those who have. By all accounts, it seems that most of the public sector is still stuck in the dark ages with regards to technology, which could go some way to explaining the abysmal failure rate of public sector projects! Open source in this sector would be a perfect solution in most cases, but it's shunned because of fear of the unknown and worry that anything free is worth the money paid for it. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
On 10 February 2010 13:02, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I've not had any personal experience with the public sector, but I have heard stories from those who have. By all accounts, it seems that most of the public sector is still stuck in the dark ages with regards to technology, which could go some way to explaining the abysmal failure rate of public sector projects! Open source in this sector would be a perfect solution in most cases, but it's shunned because of fear of the unknown and worry that anything free is worth the money paid for it. I used to work for a company creating Payroll/Personal software. Our software was cheaper than the BIG boys, and several times, when it came to getting it into councils where there was little tech knowledge/skills, the lower prices worked against us. And once they knew the price, we couldn't just hike it up to get the deal. Dark ages indeed! -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
At 7:02 AM -0600 2/10/10, Shawn McKenzie wrote: Lester Caine wrote: Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Support of any type for Win2K is over in 5 months. Better upgrade. -- Thanks! -Shawn In addition to that, the stats on visitors show that IE6 popularity is dropping at around one percent per month. In January it was around 10 percent. As such, I believe that before the end of this year IE6 will be history regardless of IF management wants to upgrade or not. Lastly, I think I have a good feel for the general consensus of developers regards to IE6. I won't be considering it any longer for web development before the end of this year and I don't think I'm alone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 09:41 -0500, tedd wrote: At 7:02 AM -0600 2/10/10, Shawn McKenzie wrote: Lester Caine wrote: Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Support of any type for Win2K is over in 5 months. Better upgrade. -- Thanks! -Shawn In addition to that, the stats on visitors show that IE6 popularity is dropping at around one percent per month. In January it was around 10 percent. As such, I believe that before the end of this year IE6 will be history regardless of IF management wants to upgrade or not. Lastly, I think I have a good feel for the general consensus of developers regards to IE6. I won't be considering it any longer for web development before the end of this year and I don't think I'm alone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com My own stats on my site put it at about 1.2% of my total visitors this year, which is half of what it was in 2009. As for developing for it, I don't really think it's worth my time any more. Unless a client specifically asked for it, and I was not able to dissuade them, then IE6 is left out of my testing now. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Ashley Sheridan wrote: I've not had any personal experience with the public sector, but I have heard stories from those who have. By all accounts, it seems that most of the public sector is still stuck in the dark ages with regards to technology, which could go some way to explaining the abysmal failure rate of public sector projects! Open source in this sector would be a perfect solution in most cases, but it's shunned because of fear of the unknown and worry that anything free is worth the money paid for it. I'm doing quite a bit more work in public sector these days. Recently ne department finally did away with IE6 and moved to IE7. Here's what I had to do to accomodate this gotcha: Nothing See, that was tough. Why was it so hard? Because I developed for Firefox/Opera and touched up for IE6, 7, 8 since these are inevitable paths of evolution in the public sector. Open source presents several problems for Government; however, many of these issues are being addressed. It's just that the wheels of bureaucracy move slowly --Patience wins the day. Some of these issues are licensing schemes. The Government has difficulty with licenses such as the GPL due to their viral nature. Additionally, due to the MS stranglehold on so much of industry... most of the skillset within Government leans heavily towards Microsoft products and systems. Then there's the FUD that's been injected into society over the years purporting Linux to be inferior. Now just to offer some info on what I've had the joy (sorrow sometimes :) of encountering/recommending so far within various scenarios (Government, Councils, Task Forces, etc): PHP :) MySQL Mediawiki Drupal Joomla osCommerce Ubercart Moodle Feng Office (formerly OpenGoo) Debian InterJinn (mostly used for gluing applications together these days) There's a world of customization out there, being able to jump into any codebase and start creating modules, extensions, skins, or outright modify the core (when necessary) is an extreme plus. It also helps to have security clearance :) Within these scenarios, browsers are usually Internet Explorer or Firefox. IE is the predominant choice, but in some cases users have been able to push for Firefox. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Richard Quadling wrote: On 10 February 2010 13:02, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I've not had any personal experience with the public sector, but I have heard stories from those who have. By all accounts, it seems that most of the public sector is still stuck in the dark ages with regards to technology, which could go some way to explaining the abysmal failure rate of public sector projects! Open source in this sector would be a perfect solution in most cases, but it's shunned because of fear of the unknown and worry that anything free is worth the money paid for it. I used to work for a company creating Payroll/Personal software. Our software was cheaper than the BIG boys, and several times, when it came to getting it into councils where there was little tech knowledge/skills, the lower prices worked against us. And once they knew the price, we couldn't just hike it up to get the deal. Part of the problem is that there's sometimes someone, lurking in the shadow of their ignorance, afraid to have to maintain something open sourcey :) It is a fight with these people except they won't meet you in open battle. You need to root them out and address them on a level playing field, say in a needs analysis meeting, and knock them down to size. It goes a long way towards aiding your argument and allowing your proposal to be considered for it's technical and cost savings merit. It is important though to do this in a professional and succinct manner. The last thing you want is to be wrestled into a mud fight. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Manual problems
From: Robert Cummings Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Bob McConnell P.S. HTML Validator is available for Linux, but not from the Firefox add-on site. You need to go to the validator home page to get it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 10:17 -0500, Bob McConnell wrote: From: Robert Cummings Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Bob McConnell P.S. HTML Validator is available for Linux, but not from the Firefox add-on site. You need to go to the validator home page to get it. The W3C validator rejects that autocomplete attribute because it still isn't in any valid standard. Some browsers have introduced it, and PCI requires it to be there for browsers that recognise it, but it's not a good security feature, as browsers don't have to honor it and they can still claim standards compliance. It's a good attribute though, and makes sense in many situations, so it probably should be included in the standards I think. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
Bob McConnell wrote: From: Robert Cummings Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Bob McConnell P.S. HTML Validator is available for Linux, but not from the Firefox add-on site. You need to go to the validator home page to get it. Yep, the validator is a great tool. I also simplify my task for browser rendering incompatibilities by adding the following around every page's content: !--[if IE 7] div id=ie7 class=ie7 ![endif]-- !--[if lte IE 7] div id=ie7_lte class=ie7_lte ![endif]-- !--[if lt IE 7] div id=ie7_lt class=ie7_lt ![endif]-- !--[if IE 6] div id=ie6 class=ie6 ![endif]-- !--[if lte IE 6] div id=ie6_lte class=ie6_lte ![endif]-- !--[if lt IE 6] div id=ie6_lt class=ie6_lt ![endif]-- !--[if lt IE 6] div id=ie5 class=ie5 ![endif]-- !--[if IE] div id=ieX class=ieX ![endif]-- [[CONTENT]] !--[if IE] /div ![endif]-- !--[if lt IE 6] /div ![endif]-- !--[if lt IE 6] /div ![endif]-- !--[if lte IE 6] /div ![endif]-- !--[if IE 6] /div ![endif]-- !--[if lt IE 7] /div ![endif]-- !--[if lte IE 7] /div ![endif]-- !--[if IE 7] /div ![endif]-- This allows easy addition of CSS rules right where the main rule is defined: div.some-class { width: 90%; } div.ie7_lte div.some-class { width: 85%; } I've never understood the messy practice of having multiple stylesheets, one for each version of IE, where the rules are separated from the main rule. I also have a script, for the rare instances where I need to care about Safari, that uses JavaScript to insert similar tags as above but based on the browser actually being used. Cheers, Rob -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Manual problems
From: Ashley Sheridan On Wed, 2010-02-10 at 10:17 -0500, Bob McConnell wrote: From: Robert Cummings Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. The W3C validator rejects that autocomplete attribute because it still isn't in any valid standard. Some browsers have introduced it, and PCI requires it to be there for browsers that recognise it, but it's not a good security feature, as browsers don't have to honor it and they can still claim standards compliance. It's a good attribute though, and makes sense in many situations, so it probably should be included in the standards I think. I understand why the validator acts the way it does, I just don't understand why W3C acts the way it does. They started out documenting what browsers do, and calling that the standard. Now they seem to think they are above that and can dictate to the browser developers what they should do. That's bass ackwards, and completely unreasonable. They should still be documenting the best practices as they evolve in the browsers and incorporate them into the standards. In the case of autocomplete, they need to document what it should be doing in order to be a real security feature and require browsers actually do that for compliance. The current state where it simply provides security theatre is untenable. Yes, I have already lost that argument here. The PCI auditors have a lot more leverage than I do. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 11:20 -0500, Bob McConnell wrote: From: Ashley Sheridan On Wed, 2010-02-10 at 10:17 -0500, Bob McConnell wrote: From: Robert Cummings Lester Caine wrote: James McLean wrote: On Wed, Feb 10, 2010 at 2:26 PM, clanc...@cybec.com.au wrote: On Thu, 04 Feb 2010 02:39:03 +0100, joc...@iamjochem.com (Jochem Maas) wrote: as for using IE6 ... WTF ... you do realise this is essentially a web developers mailing list right? The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. Wow. Ignoring the issue that IE6 will soon be EOL (finally), and ignoring how bad it is at handling anything even remotely modern, your workstation must be a haven for virii, spyware and malware... IE6 has just about the worst security track record out there, at least on the desktop anyway. If you must have IE6 for whatever reason, stick it on Windows installed on a VM and upgrade your main workstation browser to something more recent. At least a VM can be backed up at a known-good point and if^H^Hwhen it gets compromised it can be deleted easily and replaced with your backup. I'll make it easy for you: http://www.getfirefox.com :) Since a large section of our USER base is still tied to W2k and does not have access to install other software, the call for IE6 to die is STILL somewhat premature! What is needed is someone to kick M$ to sort the mess out by at least allowing IE8 to install on W2k machines, rather than telling hundreds of councils they have to replace ALL their computers :( The alternative is to convince M$ controlled councils that Firefox is OK and that using it will not invalidate their contracts - but then all the work currently being done to convert legacy setups to work with *IE7* would have to be scrapped and reworked on Firefox. Many of my customers have only just got funds to start an *IE7* roll out! Redoing all that work for IE8 is yet another problem for which money is not available. Microsoft WANTS them to spend money upgrading... that's the point of questionable feature enhancement and the breaking of file formats so that older software can't read it properly. If the councils really want to save money they'd move to Linux. As for all the work being done to convert legacy setups to work with IE7... this is the WRONG philosophy... it should be all the work being done to convert legacy systems to work with Standards with a little bit of with IE7 compatibility layer on top. The target is standards, that way in the future they aren't locked in still. Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. The W3C validator rejects that autocomplete attribute because it still isn't in any valid standard. Some browsers have introduced it, and PCI requires it to be there for browsers that recognise it, but it's not a good security feature, as browsers don't have to honor it and they can still claim standards compliance. It's a good attribute though, and makes sense in many situations, so it probably should be included in the standards I think. I understand why the validator acts the way it does, I just don't understand why W3C acts the way it does. They started out documenting what browsers do, and calling that the standard. Now they seem to think they are above that and can dictate to the browser developers what they should do. That's bass ackwards, and completely unreasonable. They should still be documenting the best practices as they evolve in the browsers and incorporate them into the standards. In the case of autocomplete, they need to document what it should be doing in order to be a real security feature and require browsers actually do that for compliance. The current state where it simply provides security theatre is untenable. Yes, I have already lost that argument here. The PCI auditors have a lot more leverage than I do. Bob McConnell If they continued documenting what the browsers did, we'd still be living in a world where IE dominated, as they would have decided the 'standards' used, and all the other browsers would have been playing catch-up. Part of what people like about browsers that aren't IE is the standards
Re: [PHP] PHP Manual problems
Bob McConnell wrote: Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Go HTML 5. It doesn't work with the validator plugin but it validates at W3C. And while going HTML 5, start migrating to HTML 5 layout. IE div id=aside aside // stuff /aside /div Most browsers do not recognize the HTML 5 layout tags yet, so you have to wrap them in a div and attach the style to the div, but as browsers start adopting HTML 5 your content will work with context features even while still wrapped in the div tags. It is particularly useful for article and section, where the depth of a section within an article can be helpful for non visual browsers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Ashley Sheridan wrote: The W3C validator rejects that autocomplete attribute because it still isn't in any valid standard. Some browsers have introduced it, and PCI requires it to be there for browsers that recognise it, but it's not a good security feature, as browsers don't have to honor it and they can still claim standards compliance. It's a good attribute though, and makes sense in many situations, so it probably should be included in the standards I think. It is in HTML 5. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 10:20 -0800, Michael A. Peters wrote: Bob McConnell wrote: Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Go HTML 5. It doesn't work with the validator plugin but it validates at W3C. And while going HTML 5, start migrating to HTML 5 layout. IE div id=aside aside // stuff /aside /div Most browsers do not recognize the HTML 5 layout tags yet, so you have to wrap them in a div and attach the style to the div, but as browsers start adopting HTML 5 your content will work with context features even while still wrapped in the div tags. It is particularly useful for article and section, where the depth of a section within an article can be helpful for non visual browsers. What about search engines? Will there be any impact on these, particularly with regards to semantic content? Also, are there any browsers that would fall over with unknown tags? I know IE used to not take too kindly to these sorts of things, but that was a good few years ago (I'm thinking IE2/IE3 here)! Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
Michael A. Peters wrote: Bob McConnell wrote: Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Go HTML 5. It doesn't work with the validator plugin but it validates at W3C. And while going HTML 5, start migrating to HTML 5 layout. IE div id=aside aside // stuff /aside /div Most browsers do not recognize the HTML 5 layout tags yet, so you have to wrap them in a div and attach the style to the div, but as browsers start adopting HTML 5 your content will work with context features even while still wrapped in the div tags. It is particularly useful for article and section, where the depth of a section within an article can be helpful for non visual browsers. Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Wed, 2010-02-10 at 13:25 -0500, Robert Cummings wrote: Michael A. Peters wrote: Bob McConnell wrote: Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Go HTML 5. It doesn't work with the validator plugin but it validates at W3C. And while going HTML 5, start migrating to HTML 5 layout. IE div id=aside aside // stuff /aside /div Most browsers do not recognize the HTML 5 layout tags yet, so you have to wrap them in a div and attach the style to the div, but as browsers start adopting HTML 5 your content will work with context features even while still wrapped in the div tags. It is particularly useful for article and section, where the depth of a section within an article can be helpful for non visual browsers. Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP It would depend I think. I use ID's when I know that the element I'm giving it to will be the only one on the page. Such as the header, main navbar, footer, etc. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] PHP Manual problems
Ashley Sheridan wrote: On Wed, 2010-02-10 at 13:25 -0500, Robert Cummings wrote: Michael A. Peters wrote: Bob McConnell wrote: Our SOP is to generate standards compliant pages, validate them with Firefox and the HTML Validator add-on, then deal with the deviant browsers. It's a lot less work than trying to do it the other way around. There are a few minor issues, such as W3C still refusing to allow the autocomplete attribute for forms, while PCI requires it. But those are few and far between. Go HTML 5. It doesn't work with the validator plugin but it validates at W3C. And while going HTML 5, start migrating to HTML 5 layout. IE div id=aside aside // stuff /aside /div Most browsers do not recognize the HTML 5 layout tags yet, so you have to wrap them in a div and attach the style to the div, but as browsers start adopting HTML 5 your content will work with context features even while still wrapped in the div tags. It is particularly useful for article and section, where the depth of a section within an article can be helpful for non visual browsers. Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP It would depend I think. I use ID's when I know that the element I'm giving it to will be the only one on the page. Such as the header, main navbar, footer, etc. Thanks, Ash http://www.ashleysheridan.co.uk Agreed. Those make sense to demarcate the structure layout of the document... but still, for styling the class makes more sense since it keeps the specificity low and easy to override (especially true for skinnable apps). In my experience I've seen quite often things like: div id=header_wrapper div id=header div id=leftLOGO/div /div /div And then of course I'll see later: div id=footer_wrapper div id=footer div id=leftCOPYRIGHT/div /div /div And in the specific example I responded to the example was: div id=aside aside // stuff /aside /div This seemed like a classic example of ID abuse. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Ashley Sheridan wrote: What about search engines? Will there be any impact on these, particularly with regards to semantic content? I expect semantic markup to (eventually) improve how pages are indexed. Also, are there any browsers that would fall over with unknown tags? I know IE used to not take too kindly to these sorts of things, but that was a good few years ago (I'm thinking IE2/IE3 here)! As far as I know, browsers just ignore the unknown tags, which is why you need to attach your css to the div wrapped around the html 5 layout tags and not to the html 5 layout tags themselves. Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Robert Cummings wrote: Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. I use ID when there will only be one element that needs to be styled that way. Whether it implies a lack of understanding or not, I don't care about. It's not incorrect and if you are doing a fixed width layout where the aside (sidebar) is positioned on the page by the style sheet (allowing your content to be the very first thing in the page source), you only want one element attached to it anyway. For the wrapper divs around article and section I do use class because there may be more than one article on a page (though usually not) and there almost certainly are multiple sections within an article. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
On Wed, Feb 10, 2010 at 02:56:36PM +1100, clanc...@cybec.com.au wrote: snip The interesting things in my websites go on behind-the-scenes, in the PHP, and produce relatively straightforward HTML. I have avoided the well-known bugs in IE6, and think my webpages display correctly on any of the modern browsers, but as Microsoft delights in rearranging everything in every update, and making the features you need ever harder to find, I stick to IE6 for my everyday work. FWIW, note that Google recently declared they will soon no longer support IE6 for Google Apps. You may not use Google Apps (I don't), but as Google goes, so will go the internet, eventually. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Michael A. Peters wrote: Robert Cummings wrote: Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. I use ID when there will only be one element that needs to be styled that way. I should also point out that when all your js is external (as it should be) rather than inline, using an id tag makes it much easier to modify the DOM client side. Yes, you can do document.getElementsByTagName('whatever').item(n) if you know what item the node will happen to be in the nodelist, but if you don't know, then you have to look at other characteristics of the node to find out which node in the list you want. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual problems
Michael A. Peters wrote: Robert Cummings wrote: Just a word of thought... if you're doing styling... use classes and not IDs. Use of IDs for styling is very often indicative of inexperience, inability, or lack of understanding with respect to CSS. I use ID when there will only be one element that needs to be styled that way. Whether it implies a lack of understanding or not, I don't care about. It's not incorrect and if you are doing a fixed width layout where the aside (sidebar) is positioned on the page by the style sheet (allowing your content to be the very first thing in the page source), you only want one element attached to it anyway. For the wrapper divs around article and section I do use class because there may be more than one article on a page (though usually not) and there almost certainly are multiple sections within an article. Many government documents have the concept of aside as appearing through the document and contextually near to the information to which the aside relates. The entire sidebar seems a bit gratuitous as an aside. Sure it's aside, but it's not exactly the semantic meaning of aside. From the W3C Working Draft: The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography. The element can also be used for typographical effects like pull quotes. http://www.w3.org/TR/html5/semantics.html#the-aside-element Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php