Re: [PHP] Re: What am I doing wrong - PHP
--- M. Sokolewicz [EMAIL PROTECTED] wrote: I would suggest writing it like this: [snip] I'm getting the page now with the box but no values inside. Database conn is fine and all. I can print out the value , just can't get them to show up inside form element (Multiple select) Here is what I have Again, StaIndTypes is made up of CareerIDs [int] and CareerCategories [varchar] ?php mysql_select_db($database_Pmmodel, $Pmmodel); $inds = mysql_query(SELECT * FROM StaIndTypes, $Pmmodel) or die(mysql_error()); ? body form name=form1 id=form1 method=Post action= select name=Ind size=10 multiple=multiple id=Ind ?php //I tried MYSQL_ASSOC, NUM and BOTH, no diff while($row = mysql_fetch_array($inds, MYSQL_BOTH)) { echo 'option value='.$inds['CareerIDs'].''.$inds['CareerCategories'].'/option'; } echo '/select/form'; Thanks Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: What am I doing wrong - PHP
On Saturday 13 November 2004 17:40, Stuart Felenstein wrote: //I tried MYSQL_ASSOC, NUM and BOTH, no diff while($row = mysql_fetch_array($inds, MYSQL_BOTH)) { echo 'option value='.$inds['CareerIDs'].''.$inds['CareerCategories'].'/option'; } $row is what contains the data you're grabbing from the DB and you're not using it -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* BOFH Excuse #175: OS swapped to disk */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: What am I doing wrong - PHP
--- Jason Wong [EMAIL PROTECTED] wrote: $row is what contains the data you're grabbing from the DB and you're not using it Jason Wong - Gremlins Associates - Thank you Jason, its working now ! Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Do different browsers treat Sessions Cookies differently?
Hello I have two php files ~~~ firstpage.php ? session_start(); $_SESSION['name']=test; $_SESSION['value']=test; echo session_id(); ? a href=secondpage.phpNext page/a; ~~~ ~~~ secondpage.php ? session_start(); echo br; print_r($_COOKIE); echo br; echo session_id(); echo br; print_r($_SESSION); ? a href=firstpage.phpPrevious page/a ~~~ 1st scenario : - Enable cookies. Traverse from first page to second page and back. The values are maintained in IE, Mozilla on windows Mozilla in Debian Linux. 2nd scenario : - Disable cookies. Traverse from first page to second page and back. The values are maintained in IE but not in Mozilla in Windows Linux I get a new session id everytime I refresh the page. Can anyone help me out with this? -- Warm Regards Vinayak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Help: Database Search
I think I'm almost there :) Only right now I'm getting an error message: Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 ?php $where = array(); $Ind = ; $Ind = $_POST['Ind']; if (count($Ind) 1) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN($IndStr); }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } ? ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) I can't find the problem. Anyone see anything ? Thank you. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Help: Database Search
Sorry, I fixed Ind , since the element is named Ind[]. Now I get a different error: Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '','','Array)' at line 3 ?php $where = array(); $Ind[] = ; $Ind[] = $_POST['Ind']; if (count($Ind) 1) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN($IndStr); }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } ? ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) I can't find the problem. Anyone see anything ? Thank you. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: probably stupid, but...
I know I'm a bit late to this topic and I may have missed a comment along the way, but what about making a change to the form, is that possible? Instead of calling your form entries book_title_1, book_title_2, book_title_3 etc why not use book_title[] for all instances of book_title? This way the PHP code would be something like: for($i=0; $isizeof($_POST['book_title']); $i++) { $addtocart = INSERT INTO `curriculum` VALUES ('',$_POST['book_title'][$i],$_POST['book_level'][$i], $_POST['level_grades'][$i],$_POST['book_section'][$i], $_POST['chapter'][$i],$_POST['chapter_title'][$i], $_POST['lesson_title'][$i],$_POST['skill'][$i], $_POST['life_skill'][$i],$_POST['success_indicator'][$i], $_POST['ncscos'][$i],$_POST['subject'][$i], $_POST['pages'][$i],$_POST['c_kit'][$i]); } This would allow you to add or remove form 'rows' without having to update the PHP code. (Code is untested !!) HTH Graham -Original Message- From: Robert Sossomon [mailto:[EMAIL PROTECTED] Sent: 12 November 2004 21:20 To: Ben Ramsey Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: probably stupid, but... Ben Ramsey is quoted as saying on 11/12/2004 3:41 PM: You've got some parsing errors going on. Nothing particularly wrong with the logic... snip OK, I took out the extra ' that I had at the beginning, and then I changed everything around to: if (!empty($_POST['book_title_'.$i])) { $addtocart = INSERT INTO `curriculum` VALUES ('',$_POST['book_title_'.$i],$_POST['book_level_'.$i],$_POST['leve l_grades_'.$i],$_POST['book_section_'.$i],$_POST['chapter_'.$i],$_ POST['chapter_title_'.$i],$_POST['lesson_title_'.$i],$_POST['skill _'.$i],$_POST['life_skill_'.$i],$_POST['success_indicator_'.$i],$_ POST['ncscos_'.$i],$_POST['subject_'.$i],$_POST['pages_'.$i],$_POS T['c_kit_'.$i]); echo $addtocart; mysql_query($addtocart); And it still is producing an empty page (not even echoing out the $addtocart variable) when I run it. Unfortunately my server admins went AWOL, so I can get the exact error message, but I know it has to be some stupid that I just haven't put my finger on yet. I could have had this done already doing it one line @ a time, however I want to be able to change either form at any time and have only 2 pieces of code to change. Thanks for the help so far guys. Robert -- Robert Sossomon, Business and Technology Application Technician 4-H Youth Development Department 200 Ricks Hall, Campus Box 7606 N.C. State University Raleigh NC 27695-7606 Phone: 919/515-8474 Fax: 919/515-7812 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
On Saturday 13 November 2004 20:41, Stuart Felenstein wrote: Sorry, I fixed Ind , since the element is named Ind[]. Now I get a different error: Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '','','Array)' at line 3 ?php $where = array(); $Ind[] = ; $Ind[] = $_POST['Ind']; if (count($Ind) 1) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN($IndStr); }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } ? ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) I can't find the problem. Anyone see anything ? Uhmm, you could try some debugging of your own instead of relying on the list. Liberally douse your code with print_r() and var_dump() of all your important variables. Do they contain what you expected? If not try and figure out why not. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Soap and education are not as sudden as a massacre, but they are more deadly in the long run. -- Mark Twain */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
--- Jason Wong [EMAIL PROTECTED] wrote: Uhmm, you could try some debugging of your own instead of relying on the list. Liberally douse your code with print_r() and var_dump() of all your important variables. Do they contain what you expected? If not try and figure out why not. -- Jason Wong - Gremlins Associates - Okay, took your advice, but it seems to be a sql error as the message says. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
On Saturday 13 November 2004 21:10, Stuart Felenstein wrote: Okay, took your advice, but it seems to be a sql error as the message says. Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '','','Array)' at line 3 Yes, that was apparent from your previous post. So did you print out your query and examine it for any obvious mistakes? And if you couldn't spot any obvious mistakes then the least you could have done was to copy and paste the full query in your post so that we could see it in all its glory instead of the truncated query that was posted as part of the mysql error message. Please help us to help you. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Wagner's music is better than it sounds. -- Mark Twain */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
--- Jason Wong [EMAIL PROTECTED] wrote: Yes, that was apparent from your previous post. So did you print out your query and examine it for any obvious mistakes? And if you couldn't spot any obvious mistakes then the least you could have done was to copy and paste the full query in your post so that we could see it in all its glory instead of the truncated query that was posted as part of the mysql error message. Please help us to help you. -- Jason Wong - Gremlins Associates - It was not apparent whatsoever. Let me show the code again , but I'll include the print_r returns inline code. ?php $where = array(); $Ind[] = ; print_r($Ind); //Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 [29] = [30] = Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 ) ) So maybe this is weird, since it seems to print out twice ? if (count($Ind) 0) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN($IndStr); }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } ? ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); print_r($where); //Array ( [0] = VendorJobs.Industry IN(1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','35','','Array) ) $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) ? Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
On Saturday 13 November 2004 21:31, Stuart Felenstein wrote: It was not apparent whatsoever. Let me show the code again , but I'll include the print_r returns inline code. ?php $where = array(); $Ind[] = ; Not sure why you're adding an empty element to $Ind? print_r($Ind); //Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 [29] = [30] = Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 ) ) So maybe this is weird, since it seems to print out twice ? Look at it carefully, you've got a multi-dimensional array. Element [30] contains an array (see below). Here's a tip, when using print_r(), wrap a pre tag around it: echo pre; // you may want to consider creating a print_r($var); // function for this echo /pre; That way you can see clearly the structure of any array that you print. IN(1','2','3', See that the 1 has a missing quote? ,'27','28','35','','Array) ) See the Array (also missing a single-quote), that's element [30] mentioned above. Summary: the missing single-quotes are the show-stopper. When I said ... was to copy and paste the full query in your post so that we could see it in ... I meant post the full query that you are sending off the the DB, which in this case is the contents of $sql: $result = mysql_query($sql) or die (Query failed: -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I am ... a woman ... and ... technically a parasitic uterine growth -- Sean Doran the Younger [allegedly] ll */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
Stuart, On Sat, Nov 13, 2004 at 05:31:06AM -0800, Stuart Felenstein wrote: It was not apparent whatsoever. Let me show the code again , but I'll include the print_r returns inline code. ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); print_r($where); //Array ( [0] = VendorJobs.Industry IN(1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','35','','Array) ) Right here, print the contents of $sql. That is the most important thing to know right now. $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) ? Stuart -- Jim Kaufman Linux Evangelist public key 0x6D802619 --- A dog teaches a boy fidelity, perseverance, and to turn around three times before lying down. -- Robert Benchley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Do different browsers treat Sessions Cookies differently?
On Saturday 13 November 2004 19:13, Vinayakam Murugan wrote: [snip] 1st scenario : - Enable cookies. Traverse from first page to second page and back. The values are maintained in IE, Mozilla on windows Mozilla in Debian Linux. 2nd scenario : - Disable cookies. Traverse from first page to second page and back. The values are maintained in IE but not in Mozilla in Windows Linux I get a new session id everytime I refresh the page. Can anyone help me out with this? First, can I assume that transparent session id is disabled in php? If so, then php has to rely solely on browser settings to propagate the session id. Most browsers these days have separate configs for normal cookies and session cookies. So are you enabling/disabling *session* cookies in your browsers or just the normal cookies? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* To IBM, 'open' means there is a modicum of interoperability among some of their equipment. -- Harv Masterson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
--- Jason Wong [EMAIL PROTECTED] wrote: See the Array (also missing a single-quote), that's element [30] mentioned above. Summary: the missing single-quotes are the show-stopper. I see that , but I'm not sure how that is happening. Here is the sql: $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); // Is it the Where statement maybe ? //print_r($where); $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help: Database Search
--- James Kaufman [EMAIL PROTECTED] wrote: Right here, print the contents of $sql. That is the most important thing to know right now. SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE VendorJobs.Industry IN(1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','Array)Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '','2','3','4','5','6','7','8','9','10','11','12','13','14','15' Looks like the array is matching ? Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pagination need help again
Sorry, Its me again. I tried all the recommendations from my first responses and could not find the proper syntax on how to use it in my file. My original email question,error, and my php code is listed below. Thank you in advance for all your help, this is a great community. Original Question? Previous email subject: Pagination need help. Im using an HTML search form that passes the searchterm to a php file. In my case the searchterm can have 1000s of records in my database, so I implemented a limit which displays 20 records per page. The pagination function works fine with one exception. Example of my problem: searchterm typed in the html search form equals ford, in the database there are 2000 fords, the first page displays 20 fords and then the next page forgets that we are searching fords and displays the equivalent to a wildcard % search and displays accordingly. Does anyone have sample code for using an HTML search form with pagination? Generally what Im trying to do is type a searchterm on the html search page, have the php file run the query and if it is an item that has many results to display it 20 records per page without it displaying every record in the database. Error. Notice: Undefined index: searchterm in C:\Inetpub\cars\search\my_php_file.php on line 2 Notice: Undefined index: searchterm1 in C:\Inetpub\cars\search\my_php_file.php on line 3 Notice: Undefined index: searchterm2 in C:\Inetpub\cars\search\my_php_file.php on line 4 My php file. Attached also if not displayed in email properly. ?php $searchterm=$_POST['searchterm']; $searchterm1=$_POST['searchterm1']; $searchterm2=$_POST['searchterm2']; $searchterm = addslashes($searchterm); $searchterm1 = addslashes($searchterm1); $searchterm2 = addslashes($searchterm2); @mysql_pconnect(localhost, root, ) or die(error -- can't connectto server); @mysql_select_db(list) or die (error -- can't connect to DB); if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } // Define the number of results per page $max_results = 20; // Figure out the limit for the query based // on the current page number. $from = (($page * $max_results) - $max_results); // Perform MySQL query on only the current page number's results $sql = select * from parts where .'model'. like '%.$searchterm.%' AND .'seller'. like '%.$searchterm1.%' AND .'description'. like '%.$searchterm2.%' ORDER BY 'model', 'price', 'quantity' LIMIT $from, $max_results; echo 'body bgcolor=#dfefff'; $result = mysql_query($sql) or die(mysql_error()); $numofrows = mysql_num_rows($result); echo TABLE BORDER=\0\\n; echo TR bgcolor=\3366cc\TD align=leftfont color=\FF\ face=\Verdana\ size=\1\bSeller/TD/font/b/TDTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bModel Number/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bManufacturer/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bDescription/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bQuantity/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bPrice/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bCondition/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bEmail Address/TD/font/bTD align=leftfont color=\FF\ face=\Verdana\ size=\1\bAIM/TD/font/b/TR\n; for($i = 0; $i $numofrows; $i++) { $row = mysql_fetch_array($result); //get a row from our result set if($i % 2) { //this means if there is a remainder echo TR bgcolor=\eaeaea\\n; } else { //if there isn't a remainder we will do the else echo TR bgcolor=\d5eaff\\n; } echo TD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['seller']./a/TD/font/b/aTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['model']./TD/font/bTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['manufacturer']./TD/font/bTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['description']./TD/font/bTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['quantity']./TD/font/bTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['price']./TD/font/bTD align=leftfont color=\80\ face=\Verdana\ size=\1\b.$row['condition']./TD/font/bTD align=lefta href="" color=\80\ face=\Verdana\ size=\1\b.$row['email']./TD/font/bTD align=lefta href="" color=\80\ face=\Verdana\ size=\1\bAIM Link/TD/font/a\n; echo /TR\n; } //now let's close the table and be done with it echo /TABLE\n; while($row = mysql_fetch_array($result)){ // Build your formatted results here. $variable1=$row[manufacturer]; $variable2=$row[seller]; $variable3=$row[model]; $variable4=$row[description]; $variable5=$row[email]; //results print (tr); print (td class='body_1'$variable1/td); print (td class='body_1'$variable2/td); print (td class='body_1'$variable3/td); print (td class='body_1'$variable4/td); print (td class='body_1' style='border-right:
Re: [PHP] Re: Help: Database Search
On Saturday 13 November 2004 22:14, Stuart Felenstein wrote: Summary: the missing single-quotes are the show-stopper. I see that , but I'm not sure how that is happening. Here is the sql: $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); // Is it the Where statement maybe ? OK, so $sql is built from $where, and what is $where built from? And so on. trace back up through your code examining each variable assignment. May I remind you of this very useful advice: http://marc.theaimsgroup.com/?l=php-generalm=109956779311140w=2 Yes debugging is tedious but someone has to do it. Or alternatively: - write bug free code (not even Bill Gates can do that) - pay someone to debug it for you (my going rate is HKD600/hour) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Maternity pay? Now every Tom, Dick and Harry will get pregnant. -- Malcolm Smith */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] probably stupid, but...
* Thus wrote -{ Rene Brehmer }-: At 21:32 12-11-2004, Chris W. Parker wrote: also you need to wrap your array values in { } when an array is referenced within a string. i.e. // normal $value = $_GET['something']; // with { } $value = Here is some data: {$_GET['something']}; Is that actually in the manual ??? If it is, where ? Yeah, its defined in the array section where it defines the proper way to access array's (Array do's and dont's) http://php.net/manual/en/language.types.array.php Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pagination need help again
* Scott McWhite [EMAIL PROTECTED]: I'm using an HTML search form that passes the searchterm to a php file. In my case the searchterm can have 1000s of records in my database, so I implemented a limit which displays 20 records per page. The pagination function works fine with one exception. Example of my problem: searchterm typed in the html search form equals ford, in the database there are 2000 fords, the first page displays 20 fords and then the next page forgets that we are searching fords and displays the equivalent to a wildcard % search and displays accordingly. I use PEAR's Pager class for this sort of thing. It's highly configurable -- which means it may take a few tries to get it working with your own code, but it *will* work, eventually. Browse for the Pager class at http://pear.php.net -- look in the HTML category. -- Matthew Weier O'Phinney | mailto:[EMAIL PROTECTED] Webmaster and IT Specialist | http://www.garden.org National Gardening Association| http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] http response
Is it possible in php to get a hold of the response stream and see what has been sent already? I have a global php function, but it can't be called inside html form elements, because it creates its own form, and when you nest html forms things get weird. In this function, I want to check if there is already an open form tag in the response without a corresponding /form tag. Is there any way to do this? Thanks!!
Re: [PHP] http response
On Sat, 2004-11-13 at 10:38, Josh Howe wrote: Is it possible in php to get a hold of the response stream and see what has been sent already? I have a global php function, but it can't be called inside html form elements, because it creates its own form, and when you nest html forms things get weird. In this function, I want to check if there is already an open form tag in the response without a corresponding /form tag. Is there any way to do this? Thanks!! Look into ob_get_contents() Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pagination need help again
Matthew Weier O'Phinney wrote: * Scott McWhite [EMAIL PROTECTED]: I'm using an HTML search form that passes the searchterm to a php file. In my case the searchterm can have 1000s of records in my database, so I implemented a limit which displays 20 records per page. The pagination function works fine with one exception. Example of my problem: searchterm typed in the html search form equals ford, in the database there are 2000 fords, the first page displays 20 fords and then the next page forgets that we are searching fords and displays the equivalent to a wildcard % search and displays accordingly. I use PEAR's Pager class for this sort of thing. It's highly configurable -- which means it may take a few tries to get it working with your own code, but it *will* work, eventually. Browse for the Pager class at http://pear.php.net -- look in the HTML category. however, like most PEAR projects it's heavily bloated, and if you only need partial functionality, your script will be faster when you write it yourself. Back to the question. I've modified the code for you a bit, so the search-args can also be sent via GET and thus can be embedded in the next-page URL. I've also removed/recoded a few minor things, all with comments around it explaining why that was done. ---[ code ]--- ?php // change to _REQUEST so we can pick from both GET and POST $searchterm = addslashes($_REQUEST['searchterm']); $searchterm1 = addslashes($_REQUEST['searchterm1']); $searchterm2 = addslashes($_REQUEST['searchterm2']); // don't surpress warnings here. They're never issued anyway, so what's the use? mysql_pconnect(localhost, root, ) or die(error -- can't connect to server); // what's the persistent connection for? mysql_select_db(list) or die (error -- can't connect to DB); if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } // Define the number of results per page $max_results = 20; // Figure out the limit for the query based // on the current page number. $from = (($page * $max_results) - $max_results); // Perform MySQL query on only the current page number's results $sql = SELECT * FROM parts WHERE `model` LIKE '%.$searchterm.%' AND `seller` LIKE '%.$searchterm1.%' AND `description` like '%.$searchterm2.%' ORDER BY `model`, `price`, `quantity` LIMIT $from, $max_results; echo 'body bgcolor = #dfefff'; $result = mysql_query($sql) or die(mysql_error()); $numofrows = mysql_num_rows($result); echo TABLE BORDER=\0\\n; echo TR bgcolor=\3366cc\TD align=\left\font color=\FF\ face=\Verdana\ size=\1\bSeller/TD/font/b/TDTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bModel Number/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bManufacturer/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bDescription/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bQuantity/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bPrice/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bCondition/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bEmail Address/TD/font/bTD align=\left\font color=\FF\ face=\Verdana\ size=\1\bAIM/TD/font/b/TR\n; for($i = 0; $i $numofrows; $i++) { $row = mysql_fetch_array($result); //get a row from our result set if($i % 2) { //this means if there is a remainder echo TR bgcolor = \eaeaea\\n; } else { //if there isn't a remainder we will do the else echo TR bgcolor = \d5eaff\\n; } echo TD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['seller']./a/TD/font/b/aTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['model']./TD/font/bTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['manufacturer']./TD/font/bTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['description']./TD/font/bTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['quantity']./TD/font/bTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['price']./TD/font/bTD align = leftfont color = \80\ face = \Verdana\ size = \1\b.$row['condition']./TD/font/bTD align = lefta href = \mailto:.$row['email'].\font color = \80\ face = \Verdana\ size = \1\b.$row['email']./TD/font/bTD align = lefta href = \aim:goim?message = Hi.+Are+you+there?screenname = .$row['aim'].\font color = \80\ face = \Verdana\ size = \1\bAIM Link/TD/font/a\n; echo /TR\n; } //now let's close the table and be done with it echo /TABLE\n; // what are you doing here? you've already looped trough the entire resultset before! // This code will never get executed, since mysql_fetch_array returns false (because it // looped trough all results already), and thus it won't execute anything in the loop. /** while($row = mysql_fetch_array($result)){ // Build your formatted results here. $variable1 = $row[manufacturer]; $variable2 =
[PHP] Shifting banner on re-display
Hi, I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, shifts down by about an inch. I've isolated the cause to the form action tag. Simplified code for bad.php page: ?php session_start(); ob_start(); ? /* html head style body tags */ form action=bad.php method=post ?php include(banner.php); ? input type=submit name=submit value=Add Names /* closing form body html tags */ ?php if($_POST['submit'] == Add Names){ switch ($_SESSION['status']) : case Member : header(location: add-names.php); break; default : header(location: join.php); break; endswitch; } ? Is there a workaround for this problem, or is this a normal occurence? Any suggestions or pointers would be gratefully appreciated. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] http response
That's perfect, thanks Rob. -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Saturday, November 13, 2004 10:48 AM To: Josh Howe Cc: PHP-General Subject: Re: [PHP] http response On Sat, 2004-11-13 at 10:38, Josh Howe wrote: Is it possible in php to get a hold of the response stream and see what has been sent already? I have a global php function, but it can't be called inside html form elements, because it creates its own form, and when you nest html forms things get weird. In this function, I want to check if there is already an open form tag in the response without a corresponding /form tag. Is there any way to do this? Thanks!! Look into ob_get_contents() Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- 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] Re: Shifting banner on re-display
such things never have anything to do with PHP, and everything to do with the browser and/or HTML source code. So... either consider it a browser bug, or a bug in your HTML (I'd guess #1, and if you're using IE, then you can't do anything about it) - Tul Andre Dubuc wrote: Hi, I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, shifts down by about an inch. I've isolated the cause to the form action tag. Simplified code for bad.php page: ?php session_start(); ob_start(); ? /* html head style body tags */ form action=bad.php method=post ?php include(banner.php); ? input type=submit name=submit value=Add Names /* closing form body html tags */ ?php if($_POST['submit'] == Add Names){ switch ($_SESSION['status']) : case Member : header(location: add-names.php); break; default : header(location: join.php); break; endswitch; } ? Is there a workaround for this problem, or is this a normal occurence? Any suggestions or pointers would be gratefully appreciated. Tia, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] displaying repetitive results
On Sat, 13 Nov 2004 06:30:14 +, Curt Zirzow [EMAIL PROTECTED] wrote: You might normalize the data a bit. agreed! Curt My data IS Normalized! The results you are seeing below are from joining together the books, subjects, and books_subjects xref table, as I explained below. But my point is that because the data is normalized, I end up with a result set that shows one row per subject, making aggregate display of the subjects (so they appear as one set for the user) painful... Thus the tables and query I posted: The query and tables are simple: select books.id, books.title, subjects.subject from books, subjects, books_subjects where books_subjects.bid = books.id and books_subjects.sid = subjects.id BOOKS 1. collected poems of keats 2. spy high 3. sci-fi spies SUBJECTS: 1. poetry 2. suspense 3. sci-fi 4. horror 5. mystery BOOKS_SUBJECTS bid sid 11 22 32 33 c -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
Hello, On 11/13/2004 04:08 AM, Curt Zirzow wrote: * Thus wrote Jason Wong: On Wednesday 10 November 2004 12:36, Garth Hapgood - Strickland wrote: But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] ... This is a VERY FAQ. googling the error message will tell you what it means. Searching the archives will give you some solutions. Or you can wait for Manuel Lemos' reply :) for some reason I find that very funny :) I also find it funny that you found it funny because in the end the original poster only got an useful reply from me! ;-) -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help: Database Search
I've changed my logic around but still running into a sql query error. I've tried a number of things with no success. Here is the error that returns on POST: SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE (VendorJobs.Industry = ''1','2','3''Query failed: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1','2','3''' at line 2 . Here is the relevant code: $Ind = $HTTP_POST_VARS['Ind']; if (count($Ind) 0 AND is_array($Ind)) { $Ind = '.implode(',', $Ind).'; } $sql = SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs; //if ($Ind) $sql .= WHERE (VendorJobs.Industry = '$Ind'; I'm not trying to be a pain here. Either I'm not catching a syntax error or something else. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple mail() question
Hello All, I have a simple mail() question, and I hope a hero can shed some light. I can't understand why my messages are being encoded, and extra headers are being added, *before* the message is sent through sendmail. Infinite Thanks, Adam Input: $more test.php ? $header = Content-Type: text/plain; charset=us-ascii; mail('[EMAIL PROTECTED]', 'subject', 'body', $header); ? Expected Result: $php -d sendmail_path=/bin/cat test.php To: [EMAIL PROTECTED] Subject: subject Content-Type: text/plain; charset=us-ascii body Actual Result: $php -d sendmail_path=/bin/cat test.php To: [EMAIL PROTECTED] Subject: subject Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: BASE64 Ym9keQ== -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Unsetting vars when not needed?
On Fri, 12 Nov 2004 16:46:52 +, pete M [EMAIL PROTECTED] wrote: Unsetting class objects does take time and is really of no benefit unless there are memory problems as for freeing resuslts - the same applies pete Many thanks for comments. I see that if not having memory problems it's best to let PHP to automatically destroy the objects at the end of the script. Best regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shifting banner on re-display
On Sat, 13 Nov 2004 11:00:08 -0500, Andre Dubuc [EMAIL PROTECTED] wrote: Hi, I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, shifts down by about an inch. I've isolated the cause to the form action tag. I had this problem sometimes, specially when the user uses Mozilla as the browser. Reloading the page does not render always the same way. Normally the same page renders always the same in IE. But the problem was not with the browser itself and nothing to do there. In my cases, the problem was always a misformed HTML source ... missing closing tags, bad columns width ... Specially the problem has arised in the past when some columns or rows need to have exact sizes. Checking the HTML sintax and styles helped. Specially, I use the w3c validator and also validate the CSS for bugs in my code. After that, and correcting my bugs, the page always renders the same way. And this not means that it does as exepected :P Check the page sintax at http://validator.w3.org Best regards. Jordi. For me, the problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: simple mail() question
Hello, On 11/13/2004 04:28 PM, Adam Fleming wrote: Hello All, I have a simple mail() question, and I hope a hero can shed some light. I can't understand why my messages are being encoded, and extra headers are being added, *before* the message is sent through sendmail. It seems that you have mbstring.func_overload set to an odd number making mail be overloaded by mb_send_mail. Actually the way those messages go they will be blocked by most modern spam filters. So, I would say mb_send_mail is buggy, meaning do not use it. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shifting banner on re-display
Hi, Sunday, November 14, 2004, 2:00:08 AM, you wrote: AD Hi, AD I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, AD shifts down by about an inch. I've isolated the cause to the form action tag. AD Simplified code for bad.php page: AD ?php session_start(); ob_start(); ? AD /* html head style body tags */ AD form action=bad.php method=post AD ?php include(banner.php); ? AD input type=submit name=submit value=Add Names AD /* closing form body html tags */ AD ?php AD if($_POST['submit'] == Add Names){ AD switch ($_SESSION['status']) : AD case Member : AD header(location: add-names.php); AD break; AD default : AD header(location: join.php); AD break; AD endswitch; AD } ? AD Is there a workaround for this problem, or is this a normal occurence? AD Any suggestions or pointers would be gratefully appreciated. AD Tia, AD Andre You could try this: form action=bad.php method=post style=display: inline; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shifting banner on re-display
On Saturday 13 November 2004 05:02 pm, you wrote: Hi, Sunday, November 14, 2004, 2:00:08 AM, you wrote: AD Hi, AD I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, AD shifts down by about an inch. I've isolated the cause to the form action tag. AD Simplified code for bad.php page: AD ?php session_start(); ob_start(); ? AD /* html head style body tags */ AD form action=bad.php method=post AD ?php include(banner.php); ? AD input type=submit name=submit value=Add Names AD /* closing form body html tags */ AD ?php AD if($_POST['submit'] == Add Names){ AD switch ($_SESSION['status']) : AD case Member : AD header(location: add-names.php); AD break; AD default : AD header(location: join.php); AD break; AD endswitch; AD } ? AD Is there a workaround for this problem, or is this a normal occurence? AD Any suggestions or pointers would be gratefully appreciated. AD Tia, AD Andre You could try this: form action=bad.php method=post style=display: inline; Thanks Tom, Tried it. No difference - still shifts. Seems like it is a browser problem. Regards, Andre -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:[SOLVED] [PHP] Help: Database Search
--- Stuart Felenstein [EMAIL PROTECTED] wrote: Okay, so what did I learn. 1) That a comma delimited list (from the array) to be used correctly in the sql statement had to use the IN word. $sql .= WHERE VendorJobs.Industry IN ($s_Ind); 2) I need a space between the first quotation in the first and second sql statements. 3) Debug my code. Perhaps I need to learn more about that but i was printing out the sql statements and had the mysql_error() set for the failure. Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Help: Database Search
Hi Stuart Not sure what's happening with the $Ind variable, maybe check the $_POST array as you enter the script to ensure that the form is passing the data correctly. It is almost as if you are appending it to itself at some point. You don't have a line like this anywhere do you : $Ind[] = $Ind; OR maybe 2 of: $Ind[] = $_POST['Ind']; ?? Part of the problem is with the implode statement. It is this that is not adding the initial and final ' to your IN statement, see below: if (count($Ind) 0) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN('$IndStr'); ^---^ }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } I would also remove this line: $Ind[] = ; HTH Graham -Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 13 November 2004 13:31 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Help: Database Search --- Jason Wong [EMAIL PROTECTED] wrote: Yes, that was apparent from your previous post. So did you print out your query and examine it for any obvious mistakes? And if you couldn't spot any obvious mistakes then the least you could have done was to copy and paste the full query in your post so that we could see it in all its glory instead of the truncated query that was posted as part of the mysql error message. Please help us to help you. -- Jason Wong - Gremlins Associates - It was not apparent whatsoever. Let me show the code again , but I'll include the print_r returns inline code. ?php $where = array(); $Ind[] = ; print_r($Ind); //Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 [29] = [30] = Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 [6] = 7 [7] = 8 [8] = 9 [9] = 10 [10] = 11 [11] = 12 [12] = 13 [13] = 14 [14] = 15 [15] = 16 [16] = 17 [17] = 18 [18] = 19 [19] = 20 [20] = 21 [21] = 22 [22] = 23 [23] = 24 [24] = 25 [25] = 26 [26] = 27 [27] = 28 [28] = 35 ) ) So maybe this is weird, since it seems to print out twice ? if (count($Ind) 0) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN($IndStr); }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } ? ?php $sql = 'SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE ' . implode( ' AND ', $where ); print_r($where); //Array ( [0] = VendorJobs.Industry IN(1','2','3','4','5','6','7','8','9','10','11','12','13','14','15 ','16','17','18','19','20','21','22','23','24','25','26','27','28','35','',' Array) ) $result = mysql_query($sql) or die (Query failed: .mysql_error()); while($row = mysql_fetch_assoc($result)) ? Stuart -- 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] RE: [SOLVED][PHP] Re: simple mail() question
Hi Manuel, That was *exactly* the issue. I can't express my gratitude for the assistance enough -Adam Original Message Follows From: Manuel Lemos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Re: simple mail() question Date: Sat, 13 Nov 2004 19:21:18 -0200 Hello, On 11/13/2004 04:28 PM, Adam Fleming wrote: Hello All, I have a simple mail() question, and I hope a hero can shed some light. I can't understand why my messages are being encoded, and extra headers are being added, *before* the message is sent through sendmail. It seems that you have mbstring.func_overload set to an odd number making mail be overloaded by mb_send_mail. Actually the way those messages go they will be blocked by most modern spam filters. So, I would say mb_send_mail is buggy, meaning do not use it. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- 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] Shifting banner on re-display
What if you try: ?php include(banner.php); ? form action=bad.php method=post Andre Dubuc wrote: Hi, I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, shifts down by about an inch. I've isolated the cause to the form action tag. Simplified code for bad.php page: ?php session_start(); ob_start(); ? /* html head style body tags */ form action=bad.php method=post ?php include(banner.php); ? input type=submit name=submit value=Add Names /* closing form body html tags */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] postfix and php on suse 9.1
I recently installed SUSE 9.1 and my php script that sent mail no longer works. It works fine on an suse 9.0 box. I was wondering if anyone can give me a hint as to what to look for to fix this. Below is some of my error log from a send attempt. Nov 13 11:50:34 WebServer postfix/pickup[30613]: 1EF48D587: uid=30 from=wwwrun Nov 13 11:50:34 WebServer postfix/cleanup[31469]: 1EF48D587: message-id=[EMAIL PROTECTED] Nov 13 11:50:34 WebServer postfix/cleanup[31469]: 1EF48D587: to=unknown, relay=none, delay=0, status=bounced (No recipients specified) Nov 13 11:50:34 WebServer postfix/cleanup[31473]: 2CA3DD5AF: message-id=[EMAIL PROTECTED] Nov 13 11:50:34 WebServer postfix/qmgr[3547]: 2CA3DD5AF: from=, size=1833, nrcpt=1 (queue active) Nov 13 11:50:34 WebServer postfix/local[31474]: 2CA3DD5AF: to=[EMAIL PROTECTED], orig_to=[EMAIL PROTECTED], relay=local, delay=0, status=sent (delivered to mailbox) Nov 13 11:50:34 WebServer postfix/qmgr[3547]: 2CA3DD5AF: removed Here is the simple mail script that I am using to test ?php $message = This is a Test Message ; mail('[EMAIL PROTECTED]', test message, $message); ? HTMLBODY Message sent. /BODY/HTML Thanks for the help. -- Chris W Bring Back the HP 15C http://hp15c.org Not getting the gifts you want? The Wish Zone can help. http://thewishzone.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: postfix and php on suse 9.1
Hello, On 11/13/2004 10:48 PM, Chris W wrote: I recently installed SUSE 9.1 and my php script that sent mail no longer works. It works fine on an suse 9.0 box. I was wondering if anyone can give me a hint as to what to look for to fix this. Below is some of my error log from a send attempt. Nov 13 11:50:34 WebServer postfix/pickup[30613]: 1EF48D587: uid=30 from=wwwrun Nov 13 11:50:34 WebServer postfix/cleanup[31469]: 1EF48D587: message-id=[EMAIL PROTECTED] Nov 13 11:50:34 WebServer postfix/cleanup[31469]: 1EF48D587: to=unknown, relay=none, delay=0, status=bounced (No recipients specified) Nov 13 11:50:34 WebServer postfix/cleanup[31473]: 2CA3DD5AF: message-id=[EMAIL PROTECTED] Nov 13 11:50:34 WebServer postfix/qmgr[3547]: 2CA3DD5AF: from=, size=1833, nrcpt=1 (queue active) Nov 13 11:50:34 WebServer postfix/local[31474]: 2CA3DD5AF: to=[EMAIL PROTECTED], orig_to=[EMAIL PROTECTED], relay=local, delay=0, status=sent (delivered to mailbox) Nov 13 11:50:34 WebServer postfix/qmgr[3547]: 2CA3DD5AF: removed Here is the simple mail script that I am using to test ?php $message = This is a Test Message ; mail('[EMAIL PROTECTED]', test message, $message); ? HTMLBODY Message sent. /BODY/HTML It seems PHP is not configured properly to send messages via postfix. You may want to try this class that comes with a wrapper function named sendmail_mail() that works like the mail() function except that it calls the postfix sendmail wrapper program directly. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A simple question
Hey, I have just upgrade my box and my forms are no longer passing information into the database. I did a simple echo test and sure enough nothing. I was using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I thinking there is something that needs to be turn on in my php.ini that I need to turn to pass information. Any clues, Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] probably stupid, but...
At 16:28 13-11-2004, Curt Zirzow wrote: * Thus wrote -{ Rene Brehmer }-: At 21:32 12-11-2004, Chris W. Parker wrote: also you need to wrap your array values in { } when an array is referenced within a string. i.e. // normal $value = $_GET['something']; // with { } $value = Here is some data: {$_GET['something']}; Is that actually in the manual ??? If it is, where ? Yeah, its defined in the array section where it defines the proper way to access array's (Array do's and dont's) http://php.net/manual/en/language.types.array.php Thanks alot :) ... Could've sworn I read everything in the syntax section ... but must've overlooked that somehow :-/ Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A simple question
Read this.. http://www.php.net/release_4_1_0.php (Especially the part about global variables...) - Original Message - From: Chuck PUP Payne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 13, 2004 9:02 PM Subject: [PHP] A simple question Hey, I have just upgrade my box and my forms are no longer passing information into the database. I did a simple echo test and sure enough nothing. I was using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I thinking there is something that needs to be turn on in my php.ini that I need to turn to pass information. Any clues, Payne -- 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] Shifting banner on re-display
Hi Mark, Tried your idea - no go. Somehow I think the problem may be related to the banner's gif width (set at 101%). I recall when I first made the banner, which has a horizontal rule (a png) above it set at 100%, that the HR caused some problems. Perhaps I should toy more with the combo. Thanks for the suggestion. Regards, Andre On Saturday 13 November 2004 07:42 pm, Marek Kilimajer wrote: What if you try: ?php include(banner.php); ? form action=bad.php method=post Andre Dubuc wrote: Hi, I have a very annoying problem with pages that re-display using the form action tag. On re-display the banner, which is set absolute position at 0px, shifts down by about an inch. I've isolated the cause to the form action tag. Simplified code for bad.php page: ?php session_start(); ob_start(); ? /* html head style body tags */ form action=bad.php method=post ?php include(banner.php); ? input type=submit name=submit value=Add Names /* closing form body html tags */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A simple question
If I was still on 4.1 I would understand, but I am on 4.3.4 now I will read it but I think it will there is something that turn on in the php.ini. Payne On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote: Read this.. http://www.php.net/release_4_1_0.php (Especially the part about global variables...) - Original Message - From: Chuck PUP Payne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 13, 2004 9:02 PM Subject: [PHP] A simple question Hey, I have just upgrade my box and my forms are no longer passing information into the database. I did a simple echo test and sure enough nothing. I was using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I thinking there is something that needs to be turn on in my php.ini that I need to turn to pass information. Any clues, Payne -- 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] Re: postfix and php on suse 9.1
Manuel Lemos wrote: It seems PHP is not configured properly to send messages via postfix. You may want to try this class that comes with a wrapper function named sendmail_mail() that works like the mail() function except that it calls the postfix sendmail wrapper program directly. http://www.phpclasses.org/mimemessage Wouldn't it be easier to just fix the PHP config problem on the standard suse 9.1 install? Surely someone knows what the config error is and can tell me how to fix it/ -- Chris W Bring Back the HP 15C http://hp15c.org Not getting the gifts you want? The Wish Zone can help. http://thewishzone.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: postfix and php on suse 9.1
* Thus wrote Chris W: Manuel Lemos wrote: It seems PHP is not configured properly to send messages via postfix. You may want to try this class that comes with a wrapper function named sendmail_mail() that works like the mail() function except that it calls the postfix sendmail wrapper program directly. http://www.phpclasses.org/mimemessage Wouldn't it be easier to just fix the PHP config problem on the standard suse 9.1 install? Surely someone knows what the config error is and can tell me how to fix it/ yes it probably would be easier.. instead of guessing on what the problem is.. what exactly is the error message you get back in the bounced email? Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A simple question
* Thus wrote Chuck PUP Payne: Hey, I have just upgrade my box and my forms are no longer passing information into the database. I did a simple echo test and sure enough nothing. I was using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I thinking there is something that needs to be turn on in my php.ini that I need to turn to pass information. 4.1 is really old and very many changes have been made. The best thing to do is to set up a simple form post test. My bet is you are probably running into a register_globals issue. This might help with how to handle POST data: http://php.net/language.variables.external Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: postfix and php on suse 9.1
Hello, On 11/14/2004 12:37 AM, Chris W wrote: It seems PHP is not configured properly to send messages via postfix. You may want to try this class that comes with a wrapper function named sendmail_mail() that works like the mail() function except that it calls the postfix sendmail wrapper program directly. http://www.phpclasses.org/mimemessage Wouldn't it be easier to just fix the PHP config problem on the standard suse 9.1 install? Surely someone knows what the config error is and can tell me how to fix it/ It may be a PHP configuration error or not. It is just a guess based on the similarity of past reports. It is hard to guess it right without seeing the actual configuration. OTOH, if you try the class above and it still does not work, the problem maybe something else related with postfix configuration. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A simple question
Ugh, from what I read now I have to re-write all my forms. No fun. Thanks guys, I was hoping it was something simple. I would like to ask one thing, here is a simple code that I was using can someone explain to what need to be change to work with 4.3.4 so that I can work on my other pages ? $db_name = mylinks; $table_name = links; $connection = @mysql_connect(localhost,xxx,xxx) or die (Couldn't connect); $db = @mysql_select_db($db_name, $connection) or die (Couldn't select database.); $sql = INSERT INTO $table_name (abc, keywords, links, name) VALUES ('$abc', '$keyword', '$links', '$name'); // echo what should be going into the table... print A: $abc, KW: $keyword, LINKS: $links, NAME: $name, SQL: $sqlP; $result = @mysql_query($sql, $connection) or die(Couldn't execute query.); ? Sorry to ask, just nothing is inserting into the data, and most of the books I have are from 2000 a little dated. Payne PS. Before someone tells me that it not good to post information here, things have been change to protect my database. On 11/13/04 9:59 PM, Janet Valade [EMAIL PROTECTED] wrote: Actually, read this: http://us2.php.net/manual/en/security.globals.php Janet Chuck PUP Payne wrote: If I was still on 4.1 I would understand, but I am on 4.3.4 now I will read it but I think it will there is something that turn on in the php.ini. Payne On 11/13/04 9:13 PM, Brad Bonkoski [EMAIL PROTECTED] wrote: Read this.. http://www.php.net/release_4_1_0.php (Especially the part about global variables...) - Original Message - From: Chuck PUP Payne [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 13, 2004 9:02 PM Subject: [PHP] A simple question Hey, I have just upgrade my box and my forms are no longer passing information into the database. I did a simple echo test and sure enough nothing. I was using Apache 1.3 with php 4.1 I am now using Apache 2 with php 4.3.4, I thinking there is something that needs to be turn on in my php.ini that I need to turn to pass information. Any clues, Payne -- 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] displaying repetitive results
* Thus wrote Chris Lott: On Sat, 13 Nov 2004 06:30:14 +, Curt Zirzow [EMAIL PROTECTED] wrote: You might normalize the data a bit. agreed! Curt My data IS Normalized! The results you are seeing below are from joining together the books, subjects, and books_subjects xref table, as I explained below. But my point is that because the data is normalized, I end up with a result set that shows one row per subject, making aggregate display of the subjects (so they appear as one set for the user) painful... oops, i was kind of quick to jump to that decision without reading everyting... Thus the tables and query I posted: The query and tables are simple: select books.id, books.title, subjects.subject from books, subjects, books_subjects where books_subjects.bid = books.id and books_subjects.sid = subjects.id The GROUP_CONCAT() tool, mentioned earlier does seem like a decent solution unless you plain on writing sql code that is portable. If the latter is true, then you can aggregate the data within php with something like: $id = 0; //assuming no id can be zero $subjects = ''; while ($row = mysql_fetch_assoc($result_handle) ) { if ($id $id != $row['id'] ) { echo id: {$row['id']}br; echo title: {$row['title']}br; echo Subjects: {$subjects}br; $subjects = ''; // reset } $subjects .= $row['subject'] . ','; $id = $row['id']; } // and echo last item here as well. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
Hello, On 11/14/2004 01:29 AM, Curt Zirzow wrote: But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] ... This is a VERY FAQ. googling the error message will tell you what it means. Searching the archives will give you some solutions. Or you can wait for Manuel Lemos' reply :) for some reason I find that very funny :) I also find it funny that you found it funny because in the end the original poster only got an useful reply from me! ;-) um. you may want to reread the whole thread. If you even paid attention to Jason's message a simple google search for: smtp 550 5.7.1 unable to rely for returns a bunch more information than spam. FYI, that is a common error message that SMTP servers return when they only allow relaying messages to remote addresses after prior authentication. This way the SMTP servers do not leave relaying opened to unauthorized users. SMTP servers opened to anybody for relaying usually end in a black list. Requiring authentication is one common solution to not leave relaying opened. If you really knew how SMTP servers work, you would have avoided making a fool of yourself with yet another personal attack against somebody that is offering a practical solution that solves the original poster problem. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
* Thus wrote Manuel Lemos: Hello, On 11/14/2004 01:29 AM, Curt Zirzow wrote: If you even paid attention to Jason's message a simple google search for: smtp 550 5.7.1 unable to rely for returns a bunch more information than spam. FYI, that is a common error message that SMTP servers return when they only allow relaying messages to remote addresses after prior authentication. correct. prior authentication means you either authenticated via smtp or have access other ways.. pop relay, fall within a certain ip range.. etc... Requiring authentication is one common solution to not leave relaying opened. Common but not the *only* way. If you really knew how SMTP servers work, you would have avoided making a fool of yourself with yet another personal attack against somebody that is offering a practical solution that solves the original poster problem. my god.. you take it as a personal attack that I provide someone else an alternative method of finding out what there problem is? Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
* Thus wrote Manuel Lemos: Hello, On 11/13/2004 04:08 AM, Curt Zirzow wrote: * Thus wrote Jason Wong: On Wednesday 10 November 2004 12:36, Garth Hapgood - Strickland wrote: But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] ... This is a VERY FAQ. googling the error message will tell you what it means. Searching the archives will give you some solutions. Or you can wait for Manuel Lemos' reply :) for some reason I find that very funny :) I also find it funny that you found it funny because in the end the original poster only got an useful reply from me! ;-) um. you may want to reread the whole thread. If you even paid attention to Jason's message a simple google search for: smtp 550 5.7.1 unable to rely for returns a bunch more information than spam. :sigh: Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: postfix and php on suse 9.1
Curt Zirzow wrote: yes it probably would be easier.. instead of guessing on what the problem is.. what exactly is the error message you get back in the bounced email? The errors from the mail log are in my first post here is the bounced email Date: Sat, 13 Nov 2004 14:06:38 -0600 (CST) From: Mail Delivery System [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Undelivered Mail Returned to Sender Parts/Attachments: 1 Shown 13 lines Text, Notification 2 Shown279 bytes Message, Delivery report 3 Shown314 bytes Message, Undelivered Message 3.1 Shown 1 lines Text This is the Postfix program at host aopro.com. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please send mail to postmaster If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program unknown: No recipients specified [ Part 2: Delivery report ] Reporting-MTA: dns; aopro.com X-Postfix-Queue-ID: D1F5CD458 X-Postfix-Sender: rfc822; [EMAIL PROTECTED] Arrival-Date: Sat, 13 Nov 2004 14:06:37 -0600 (CST) Final-Recipient: rfc822; unknown Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; No recipients specified [ Part 3: Undelivered Message ] Date: Sat, 13 Nov 2004 14:06:37 -0600 (CST) From: WWW daemon apache [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: test message This is a Test Message -- Chris W Bring Back the HP 15C http://hp15c.org Not getting the gifts you want? The Wish Zone can help. http://thewishzone.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] displaying repetitive results
Hi, Thursday, November 11, 2004, 4:04:27 AM, you wrote: CL Given a database query thats returns results from a linking (or xref) CL table which includes repetition because of the joins: CL ++--+--+ CL | id | title| subject | CL ++--+--+ CL | 1 | Collected Poems of Keats | poetry | CL | 2 | Spy High | suspense | CL | 3 | Sci Fi Spies | suspense | CL | 3 | Sci Fi Spies | sci-fi | CL ++--+--+ CL What is the best way to go about displaying this for the user so that CL the record looks complete: CL ID: 3 CL title: Sci Fi Spies CL Subjects: suspense, scifi CL or something similar? Or is there some better way to query? It's also CL a problem in terms of limiting the query because if I limit the query CL to 10 records I might be chopping off some subjects for the last book? CL The query and tables are simple: CL select books.id, books.title, subjects.subject CL from books, subjects, books_subjects CL where books_subjects.bid = books.id CL and books_subjects.sid = subjects.id CL BOOKS CL 1. collected poems of keats CL 2. spy high CL 3. sci-fi spies CL SUBJECTS: CL 1. poetry CL 2. suspense CL 3. sci-fi CL 4. horror CL 5. mystery CL BOOKS_SUBJECTS CL bid sid CL 11 CL 22 CL 32 CL 33 CL c when you read the rows create an array of subjects like this (assuming mysql) while ($row = mysql_fetch_assoc($result){ $list[$row['title']]['subjects'][] = $row['subject']; } //Then you can loop through $list and implode the subjects foreach ($list as $title=$subjects){ $subject_list = implode(',',$subjects); echo trtd$title/tdtd$subject_list/td/tr; } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR DB PAGER array_push
Salut! is there a good way to present data from table (many fields / not only one) into $itemData instead of array_push (line 12 .. 16) ? And how come the result always has space (kinda TRTD) and it's moving upper and upper when I click Next. Correction to my code below would be very welcome . 1 ?php 2 /** 3 * PEAR DB 4 */ 5 require_once DB.php; 6 7 $db = DB::connect(mysql://valerie:@localhost/valerie); 8 $q = 'SELECT * FROM country LIMIT 0,30'; 9 $res= $db-query($q); 10$total = $res-numRows(); 11 12 $from_db= array(); 13 while ( list($id, $country) = $res-fetchRow() ) { 14 $special_from_db = array(); 15 array_push($special_from_db, $id, $country); 16 array_push($from_db, $special_from_db); 17 } 18 19 /** 20 * PEAR Pager 21 */ 22 require_once 'Pager/Pager.php'; 23 24$params = array( 25'mode' = 'Jumping', 26'perPage'= 10, 27'delta' = 3, 28'itemData' = $from_db 29); 30$pager = Pager::factory($params); 31$data = $pager-getPageData(); 32$links = $pager-getLinks(); 33 34echo $links['all']; 35echo $pager-linkTags; 36 ? 37 table border=1 38 tr 39 thID/th 40 thCountry/th 41 /tr 42 ? 43 for ( $i=0; $isizeof($from_db); $i++ ) { 44 echo tr; 45 for ( $j=0; $jsizeof($data[$i]); $j++ ) { 46echo td. $data[$i][$j] ./td; 47 } 48 echo /tr; 49 } 50 ? 51 /table Thank you. Valérie Delon étudiante // on a besoin d'apprendre beacoup plus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
Hello, On 11/14/2004 02:15 AM, Curt Zirzow wrote: If you even paid attention to Jason's message a simple google search for: smtp 550 5.7.1 unable to rely for returns a bunch more information than spam. FYI, that is a common error message that SMTP servers return when they only allow relaying messages to remote addresses after prior authentication. correct. prior authentication means you either authenticated via smtp or have access other ways.. pop relay, fall within a certain ip range.. etc... Requiring authentication is one common solution to not leave relaying opened. Common but not the *only* way. That is irrelevant because most servers that issue the message above only allow relaying with prior authentication. FYI, the class that I suggested implements both SMTP and POP3 based authentication. Maybe if you try them you will realize that I am provide a plain simple solution for the problem of the original poster because it consists only in replacing the mail() calls to the smtp_mail() provided with these classes: http://www.phpclasses.org/mimemessage http://www.phpclasses.org/smtpclass http://www.phpclasses.org/sasl If you really knew how SMTP servers work, you would have avoided making a fool of yourself with yet another personal attack against somebody that is offering a practical solution that solves the original poster problem. my god.. you take it as a personal attack that I provide someone else an alternative method of finding out what there problem is? Are you still trying to insult my intelligence? Sometimes I forget names. But then when I notice the pattern of labeling as spam my messages helping others in PHP mailing lists, some bells ring. There aren't many people that get keep protesting against my messages of helping others with ready to use PHP components that I have developed for many years to solve problems like they present. Then I remember that you are one of that elite of arrogant individuals that do not want me to help others proposing the use of my components because you belong to the anti-Manuel Lemos bandwagon as you declared yourself in the bottom of this message: http://news.php.net/php.general/190968 Although, I am almost used to people like yourself, it is always kind of surprising to see that how much certain people act as if I am threat to their existence in the PHP world. You ought to know me better in person to realize how pointless are your personal attacks against me. My lemma is that cooperating is better than competing. I do not have a problem if you really try to help others, with your components or whoever. I don't know why you have a problem when I try to help with my components!?! -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mail() error
Hello, On 11/13/2004 04:12 AM, Curt Zirzow wrote: Im using the php mail() function to try send an email to a user that has just registered. mail($HTTP_POST_VARS['emailaddress1'], 'Matchmakers Website Registration' , 'Welcome'); But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] Can someone help me out, by telling me what it means or what Im doing wrong? (Thank you Jason for the introduction! :-) That means your SMTP server requires authentication to relay messages. The mail function does not support SMTP authentication. for the record.. and to not mislead several people.. 550 simply means the message was not accepted. There are several other reasons why this will happen. The text after the 550 usually signifies what exactly the problem is. Yes, but 550 with the text in front of 5.7.1 Unable to relay for [EMAIL PROTECTED] is a common message presented by servers that only relay with prior authentication. If you had enough real world experience with SMTP servers you would know that. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() error
* Thus wrote Manuel Lemos: Hello, On 11/14/2004 02:15 AM, Curt Zirzow wrote: If you even paid attention to Jason's message a simple google search for: smtp 550 5.7.1 unable to rely for returns a bunch more information than spam. FYI, that is a common error message that SMTP servers return when they only allow relaying messages to remote addresses after prior authentication. correct. prior authentication means you either authenticated via smtp or have access other ways.. pop relay, fall within a certain ip range.. etc... Requiring authentication is one common solution to not leave relaying opened. Common but not the *only* way. That is irrelevant because most servers that issue the message above only allow relaying with prior authentication. FYI, the class that I suggested implements both SMTP and POP3 based authentication. Maybe if you try them you will realize that I am provide a plain simple solution for the problem of the original poster because it consists only in replacing the mail() calls to the smtp_mail() provided with these classes: you know we're going down the same road that took up to much of my time from the last time. You simply dont comprehend that your solution is *not* the only solution and take offence to that. If you really knew how SMTP servers work, you would have avoided making a fool of yourself with yet another personal attack against somebody that is offering a practical solution that solves the original poster problem. my god.. you take it as a personal attack that I provide someone else an alternative method of finding out what there problem is? Are you still trying to insult my intelligence? no.. just trying to expand other people intelligence. Sometimes I forget names. But then when I notice the pattern of labeling as spam my messages helping others in PHP mailing lists, some bells ring. This is the very first time i ever labeled your stuff as spam. There aren't many people that get keep protesting against my messages of helping others with ready to use PHP components that I have developed for many years to solve problems like they present. I have no problem with your solutions, I've simply stated that it may not be the only solution. Then I remember that you are one of that elite of arrogant individuals that do not want me to help others proposing the use of my components because you belong to the anti-Manuel Lemos bandwagon as you declared yourself in the bottom of this message: http://news.php.net/php.general/190968 You're personal issues are none of my business, i simply povide alternatives. Dont forget you accused me of being a some sort of pear freak. Although, I am almost used to people like yourself, it is always kind of surprising to see that how much certain people act as if I am threat to their existence in the PHP world. hehe.. php world? I'm only here to help people. You ought to know me better in person to realize how pointless are your personal attacks against me. My lemma is that cooperating is better than competing. I do not have a problem if you really try to help others, with your components or whoever. I don't know why you have a problem when I try to help with my components!?! As I have said time and time again.. you can always provide your solutions that you've developed or have accessable to people.. but dont mislead them thinking that your solution is the *only* way. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mail() error
* Thus wrote Manuel Lemos: Hello, On 11/13/2004 04:12 AM, Curt Zirzow wrote: Im using the php mail() function to try send an email to a user that has just registered. mail($HTTP_POST_VARS['emailaddress1'], 'Matchmakers Website Registration' , 'Welcome'); But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] Can someone help me out, by telling me what it means or what Im doing wrong? (Thank you Jason for the introduction! :-) That means your SMTP server requires authentication to relay messages. The mail function does not support SMTP authentication. for the record.. and to not mislead several people.. 550 simply means the message was not accepted. There are several other reasons why this will happen. The text after the 550 usually signifies what exactly the problem is. Yes, but 550 with the text in front of 5.7.1 Unable to relay for [EMAIL PROTECTED] is a common message presented by servers that only relay with prior authentication. If you had enough real world experience with SMTP servers you would know that. Again.. a simple google search reveals the other issues that may be involved. Your tool's *may* solve the problem, but it isn't 100% http://support.microsoft.com/default.aspx?scid=kb;en-us;q289553 quote While there are several causes for this error, the most common one is that there may be no recipient policy for the expected domain in the Exchange 2000 organization or the Exchange 2003 organization. /quote http://support.microsoft.com/?kbid=304897 http://www.eudora.com/techsupport/kb/1593hq.html :sigh: Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Help: Database Search
--- Graham Cossey [EMAIL PROTECTED] wrote: Hi Stuart Not sure what's happening with the $Ind variable, maybe check the $_POST array as you enter the script to ensure that the form is passing the data correctly. It is almost as if you are appending it to itself at some point. You don't have a line like this anywhere do you : $Ind[] = $Ind; OR maybe 2 of: $Ind[] = $_POST['Ind']; ?? Part of the problem is with the implode statement. It is this that is not adding the initial and final ' to your IN statement, see below: if (count($Ind) 0) { $IndStr = implode(',', $Ind); $where[] = VendorJobs.Industry IN('$IndStr'); ^---^ }else{ $where[] = VendorJobs.Industry = {$Ind[0]}; } I would also remove this line: $Ind[] = ; HTH Graham I think it's working , at least I get results now with no error messages. Still some work to go on the script. Here is the current initializatin and sql code: $Ind = $HTTP_POST_VARS['Ind']; if (count($Ind) 0 AND is_array($Ind)) { $s_Ind = '.implode(',', $Ind).'; } I guess here I should put this in braces as it should be conditional if $Ind is set, if not the subsequent sql statement shouldn't go in. if ($Ind) $sql .= WHERE VendorJobs.Industry IN ($s_Ind); Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php