[PHP] spliting results into 2 colomns
Hello Guys I have following code, sorry it's pretty big for posting, i want to split the output into 2 colomns, been trying almost all still can't get it working here the link, with this code online http://funzz.cjb.net/itfaq/kbase.php -- ? include mainfile.php; $connection = mysql_connect (127.0.0.1, *, ); if ($connection == false){ echo mysql_errno().: .mysql_error(); exit; } $query = select topicid,topicname from nuke_topics order by topicname; $result = mysql_db_query (postnuke, $query); if ($result){ echo table border=1; $numOfRows = mysql_num_rows ($result); for ($i = 0; $i $numOfRows; $i++){ $topicid = mysql_result ($result, $i, topicid); $topicname = mysql_result ($result, $i, topicname); $result1 = mysql_query(select time from nuke_stories where topic=$topicid); $counter=mysql_num_rows($result1); preg_match (/([A-Z])/i, $topicname); $letter=$topicname[0]; if($lastletter!=$letter)echo trtdfont size=5b$letter/b/font/td/tr; echo trtda href=search.php?query=topic=$topicid$topicname /a (b$counter/b) /td/tr; $lastletter=$letter; } echo /table; } else{ echo mysql_errno().: .mysql_error().BR; } mysql_close (); include footer.php; ? -- Thank You very much, in advance Have a nice day :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem with LDAP
I have a problem with php (4.0.6) and ldap (openldap sever 2.0.11): When I use this .ldif file from shell I can enter this value without problem: -- dn: cn=pippo, dc=example, dc=it uid: pippo cn: pippo sn: pippo objectclass: person objectclass: account objectclass: posixAccount objectclass: top userpassword: {crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/ loginshell: /bin/bash uidnumber: 505 gidnumber: 505 homedirectory: /home/pippo -- but when I use this php script: -- [...] $ldap_bind = ldap_bind ($ldap_conn, $ldap_manager_dn, $ldap_password); $info [objectClass] = person;#ok $info [uid] = pippo; $info [cn] = pippo; #ok $info [sn] = pippo; #ok $info [objectClass] = person; $info [objectClass] = account; $info [objectClass] = posixAccount; $info [objectClass] = top; $info [userPassword] = {crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/; $info [loginShell] = /bin/bash; $info [uidNumber] = 505; $info [gidNumber] = 505; $info [homeDirectory] = /home/pippo; $ldap_bind = ldap_add ($ldap_conn, cn=pippo, dc=example, dc=it, $info); ldap_close ($ldap_conn); [...] -- I obtain tha following error message (in /var/log/httpd/error.log): -- LDAP: Object class violation additional info: attribute not allowed -- Note that if I use only entries tagged with the comment on the right the add is done... Why? Can anyone help me please? Thanx, tode [ [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Zipping a folder on a win2000 server with php4.06
pkzip's the name. M: Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: php mysql prob...
Your query is invalid, hence $test is false rather than a result set. I usually do if ($test = mysql_db_query( ... )) to trap this. Don't put quotes around table or field names, in your case 'Port$p' should be just Port$p and 'Port$p'.date just Port$p.date. Tim -- From: sc [SMTP:[EMAIL PROTECTED]] Sent: 31 October 2001 00:56 To: [EMAIL PROTECTED] Subject: php mysql prob... Hi; i keep getting an error of: Warning: Supplied argument is not a valid MySQL result resource in /datascripts/insertdata.php on line 17... Line 17 is: $row = mysql_fetch_assoc($test); and here is the rest of it (not all of it though): for ($p = 1; $p = 24; $p++) { $test = mysql_db_query(melbourne, SELECT * FROM 'Port$p' WHERE 'Port$p'.date='$yesterday'); $row = mysql_fetch_assoc ($test); $yindata = $row['switchin']; $youtdata = $row['switchout']; $dinPort = '$inPort$p' - $yindata; $doutPort = '$outPort$p' - $youtdata; Can anyone help me overcome this prob? i've prob missed something without thinking but i cant seem to get it... Thx. sc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] User Authentication against remote authentication serve r [ LDAP ]
On Mon, Oct 29, 2001 at 04:54:37PM -0700, Johnson, Kirk wrote: Thanks for the link, Kurt. Can you also point to any authentication code examples, or further discussion? The user comments in the manual suggest there are at least a couple ways to code stuff, ldap_compare vs ldap_bind. Any additional help appreciated. I might be able to help if you have some more precise questions, but basically there are two ways LDAP can be used. You can either use it as a data store or you can have LDAP make the authentication decision for you. If you want the user to supply username and password, the authentication can be done as follows: As data store: Hopefully the passwords are stored encrypted. Then there are two ways. If the password is stored encrypted with some unknown salt where the salt is stored together with the password (like the traditional UNIX way), your PHP script retrieves the encrypted password from LDAP, checks the salt, encrypts the user supplied password using the salt, and compare the two. If you don't use a salt you can encrypt the password from the user and just do an ldap_compare to check that it's the same as in the LDAP server. You get better security by not allowing people to read the encrypted passwords from LDAP. To store passwords encrypted in LDAP, SHA1 might be a good choice, PHP has this. As decision maker: You can simply bind to the server on behalf of the user, you use the user supplied username and password as arguments to ldap_bind(). If the bind succeeds, you let the user access your stuff. In this case you should consider using SSL/TLS for talking to the server. There are other ways to authenticate with LDAP, RFC 2829 gives a good overview. You can find it at for instance http://www.ietf.org/rfc/rfc2829.txt I could go into more detail, but to write a complete general overview would be a lot of work. You might also have a look at a really short presentation I've made at http://www.uninett.no/info/seminar/gnomis/ldapauth.pdf Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PEAR DB Results
I am trying to do a joined query using PEAR DB? My code looks something like this: $sql = SELECT wwwpages.pid,wwwpages.name,media.pid,media.name FROM wwwpages, media WHERE wwwpages.pid = '$pid'; if(DB::isError($result = $db-query($sql))){ echo ERROR: . DB::errorMessage($result); } else { while($row = $result-fetchRow(DB_FETCHMODE_ASSOC)){ echo $row[wwwpages.name]; echo $row[media.name] } } When I specify '$row[wwwpages.name]' I get a blank result, and if I try '$row[name]', I am obviously not specifying a table therefore it results in name for wwwpages table. How do I go about displaying both? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
Hi, from this command line test: select imglocation,height,width from img where imgname='alfstag1' it looks to me like your imgname field is *characters* rather than *numbers*. when ever I'm doing something like this (eg WHERE firstName=justin), I do it with a LIKE statement, rather than with a =. example: $query = SELECT imglocation,height,width FROM img WHERE imgname LIKE \$getimg\; So, I'd recommend giving that a try. From my understanding (limited) of MySQL, use = in the case of $id=2, and LIKE in the case of firstName LIKE justin. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] CANADA, SUBSIDIES, GRANTS, LOANS, FINANCING
MG PUBLISHING 4865 HWY 138,R.R 1 ST-ANDREWS WEST ONTARIO, KOC 2A0 PRESS RELEASE CANADIAN SUBSIDY DIRECTORY YEAR 2001 EDITION Legal Deposit-National Library of Canada ISBN 2-922870-01-4 M.G. Publishing is offering to the public a revised edition of the Canadian Subsidy Directory, a guide containing more than 1700 direct and indirect financial subsidies, grants and loans offered by government departments and agencies, foundations, associations and organizations. In this new 2001 edition all programs are well described. The Canadian Subsidy Directory is the most comprehensive tool to start up a business, improve existent activities, set up a business plan, or obtain assistance from experts in fields such as: Industry, transport, agriculture, communications, municipal infrastructure, education, import-export, labor, construction and renovation, the service sector, hi-tech industries, research and development, joint ventures, arts, cinema, theatre, music and recording industry, the self employed, contests, and new talents. Assistance from and for foundations and associations, guidance to prepare a business plan, market surveys, computers, and much more! To obtain the Canadian Subsidy Directory call one of the following distributors: Fureteur: 450-465-5597 Canadian Publications 866-322-3376 ALSO AVAILABLE U.S. SUBSIDY DIRECTORY To remove your e-mail from our mailing list contact us at: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Popup Window Problems Refresh
All, I am opening a popup window using the following code: a href= onClick=window.open('/gallery/upload_form.php3', 'triviaWnd', 'height=360,width=620,status=1,resizable=1,top=200,left=120'); return false; img src=gallery/images/bt_upload.gif width=60 height=17 border=0 alt=Use upload to copy your own images to the web site/a My popup window then runs some PHP code and finally displays a status message with a close window button. When the close window button is clicked I need to close the popup window and refresh the parent window or alternatively (preferably) just recalling the PHP script. Here is the HTML for my popup window: html head meta http-equiv=content-type content=text/html;charset=ISO-8859-1 meta name=generator content=Adobe GoLive 5 title/title link rel=stylesheet href=../master.css /head trbrtdThe file [b08lg.jpg/b]BHas been Successfully uploaded to the SouthLondonKidz Website/tdbody bgcolor=#ff leftmargin=50 marginwidth=0 topmargin=0 marginheight=0 background=c:/program files/apache group/apache/kidz/images/bgs/bg_grid.gif FORM METHOD=POST ACTION = ../gallery01.php3 PREINPUT TYPE=submit ALIGN=LEFT VALUE=Close Window onClick=window.close()/PRE/FORM/HTML The action for the form is only fired if the onClick=window.close() is removed. My question is how can I close the window and refresh or reload the specified window. TIA, Roger
[PHP] File upload
Hi! Where is file upload function? ;) From begining: some time I've found somewhere this handler: clearing_report_file is the input that is user sends to me. if(!isset($clearing_report_file)) { pp_xfer_trans(); } else { if (!@copy($clearing_report_file, $CFG[local_uri]./cfd- . $batch ..txt)) { echo(\nbSomething barfed, check the path to and the permissions for the upload directory/b); }else { // do domething exit(); } } but now, in php 4.0.5 this function don't want to work ;( i have allways something barfed message, even if i try to wrote to /tmp directory now i have this in phpinfo: HTTP_POST_FILES[userfile] Array ( [name] = helyjon [type] = [tmp_name] = none [size] = 0 ) where is my file? $variables shows the same values, where are my contents? Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it. - LJ Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Popup Window Problems Refresh
The action for the form is only fired if the onClick=window.close() is removed. My question is how can I close the window and refresh or reload the specified window. script language=javascript function endWindow() { window.opener.location.reload(); window.close(); } /script a href=javascript:endWindow()Close Window/a M: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Thank You Friends
Dear Venerable PHP List, I hope this isn't viewed as impolite on this list. I just wanted to write all of you to thank you for the immeasurable contributions you have made to the project I've been working on for the last three months: http://www.readfrank.com/ It is a site supporting an English language literary magazine published here in Paris, and has new stories and articles every day. While it is hard to see through the pretty pictures and words to the infinitely recursing arrays (which this list helped me debug) and the amazing grep challenge 2000 (which this list polished for me), we all know how crucial those invisible little combinations of syntax can be to bringing beautiful things to the surface. Please feel free to visit the site *if you want*. I just wanted to let you ALL know that even though we've never met, you've made me a smarter person and have helped bring the work of perhaps otherwise obscured talented writers and artists to the masses. Thank You Friends, Sondra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Quick array question
On Tuesday 30 October 2001 20:33, David Yee wrote: Well for that example I'm using 0 as the index for the first element of the array, so deleting element #2 results in 3 being deleted. BTW to correct myself in the second example I gave I want: $a = (1,2,4,5) instead of (1,2,3,4). $a = array(1,2,3,4,5) unset($a[2]); $a now = (1, 2, NULL, 4, 5), but I want (1, 2, 3, 4). Now do you want (1, 2, 4, 5) or (1, 2, 3,4 ) ? If second: So you want the array always to contain a continuous list of numbers (1..n) ? So it's irrelevant *what* element of the array you delete, only *how many* elements you delete? Why not just store the maximum value then and use $MaxVal-- instead of unset ($a[something]), $Index - 1 instead of $a[$Index] ? If the first: remember that arrays in PHP are always associative. So you get (0 = 1, 1 = 2, 3 = 4, 4 = 5) if you want the keys reordered you could use array_values() on that.. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) Never doubt that a small group of thoughtful, committed people can change the world... Indeed, it's the only thing that ever has. - Margaret Mead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Asian fonts
Hi all! Any idea how to use (install) asian fonts on an english version of RH? I need them in the gd library, to generate an image with chinese/japanese text. any clue greatly appreciated! Daniel BI -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] spliting results into 2 colomns
I have following code, sorry it's pretty big for posting, i want to split the output into 2 colomns, been trying almost all still can't get it working Harik, First off, have you checked the manual (http://uk.php.net/manual/en/function.mysql-result.php) and the recommendations against the use of mysql_result()? In this situation, one of the mysql_fetch_... functions might be a better choice because both data fields could be extracted in one operation. Apart from 'efficiency', the other reason for my saying this (I have never used _result()) is that I can't see where the manual talks about what _result() returns when it gets to an end-of-data situation (the _fetch_ functions return FALSE and are thus perfect for use in controlling while loops). Now to logic. May I offer a short programming lesson? If you are an experienced programmer and this is 'talking down' to you, I apologise. However this question has been asked (in a few guises) a couple of times recently, so lets get an answer up on the FAQs/archives... This program requires two processing loops: one to cycle through the available topic data, the other to display results in a two-column HTML table. Most of us think in terms of starting at the beginning (get the data) and working through to the end (display the results) - from the script provided it seems a reasonable assumption that you have done exactly this, and that everything is working properly (up to that last step before the end). However computers are logical but not rational. Sometimes it is worth starting at the end and working back towards the beginning! The 'second loop is described as being responsible for presenting the results (in this example, a table with two columns). There are three logical parts to the entire process: setting up the HTML code for the table, looping through the rows (and columns), closing off with the end of table HTML code. In pseudo code it looks like: prepare the web page (as necessary) and echo the TABLE tag for each row of the table echo the TR tag echo the first column (TDdata/TD) echo the first column (TDdata/TD) echo the /TR tag echo the /TABLE tag and close the web page Quick aside: with two columns the above is acceptable. If there were numerous columns, but also because the other processing required here brings added complexity, an inner loop might be appropriate, thus: prepare for each row TR for each column echo the TDdata/TD /TR finish-off Now let's talk about the topic-data loop process. Again, divide the logic into three parts: setting up MySQL and SELECTing the primary data, looping through each of the SELECTed records, and cleaning up afterwards. The existing script is neatly laid out to show this. In pseudo code, the script's logic becomes: set-up db and query table for each row returned perform secondary query/assemble and format full report data present topicId, topicName, and counter close down That being the case, can all of the processing of individual (in-bound) data records be packaged into a user-defined function? (modular programming) If the function returns true/false as well as the next data record, then the boolean state can be used to detect the end-of-data condition: set up while ( not end-of-data ) getnextrow() close down OK, so much for all that, how do the two halves get put back together? There are two loops, one cycling through HTML table tags, and the other cycling through a DB recordset/resultset. Because the output format is the important part/has the higher number of logical components/subdivisions, it must dominate the logic. Thus the data-provisioning part should be inverted - instead of squirting out data like a hose, which the HTML then has to be 'fitted around'; it should be set up like an on-demand drip feed, so that when the HTML requires a 'squirt' of data, it is delivered, one swallow at a time! Let's do this in two stages - first of all, with no data processing (ie just reporting/important part first). Combine the two set up code-blocks, and the two close-down code blocks and outline the HTML processing: prepare the page (as necessary) and echo the TABLE tag set-up db and query table --- for each row of the table echo the TR tag for each column echo the column data (TDdata/TD) echo the /TR tag --- echo the /TABLE tag close down (the DB) But how do we know how many rows to put in the table? Answer: we don't, and so have to set up the loop controls accordingly. if you prefer to continue using for-loops you can control these by use of the numOfRows = mysql_num_rows ($result) code; or if you make the outer into a while-loop then the idea of the boolean (mentioned above) brings a process-while-there's-still-data logic into play: Function getnextrow(...) perform secondary query/assemble and format full
Re[2]: [PHP] spliting results into 2 colomns
WoW, thank you very much DL Neil, this is the best reply i've ever got during my time on the web (since 1994). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 31 Oct 2001 13:07:32 -0000 Issue 967
php-general Digest 31 Oct 2001 13:07:32 - Issue 967 Topics (messages 72947 through 73007): Re: php mysql prob... 72947 by: David Robley 72948 by: Jason Brooke 72949 by: sc 72950 by: David Robley 72953 by: sc 72955 by: Jim Lucas 72956 by: sc 72958 by: Jim Lucas 72966 by: Mike Frazer 72969 by: David Robley 72970 by: Mike Frazer 72995 by: Tim Ward FREE MEMBERSHIP (ADULTS) 10113 72951 by: leslieann4587.yahoo.com Re: show png in the browser 72952 by: Luz Lopez 72954 by: Jim Lucas 72959 by: Luz Lopez date problem 72957 by: Steve Tsai Re: PHP+MySQL=Help(?) 72960 by: turtle 72998 by: Justin French Re: Session handling with cookies?? 72961 by: Jason G. Re: Zipping a folder on a win2000 server with php4.06 72962 by: Matt Friedman 72994 by: Matt Williams sharing data stored in mysql with another site 72963 by: Matthew Delmarter 72964 by: David Robley 72965 by: Mike Frazer Total Newbie in over head 72967 by: J W W L (Warwick) Berg 72976 by: Jack Dempsey 72988 by: Peter I rest my case 72968 by: J W W L (Warwick) Berg 72971 by: Mike Frazer 72972 by: Tyler Longren 72973 by: David Robley 72974 by: J W W L (Warwick) Berg 72975 by: Jason Murray 72977 by: J W W L (Warwick) Berg 72978 by: David Robley 72979 by: Jason Brooke 72980 by: J W W L (Warwick) Berg 72981 by: David Robley 72986 by: Joseph Blythe question about variables... 72982 by: sc 72983 by: Hugh Danaher 72985 by: sc Re: Problems inserting single quote into Oracle database 72984 by: Hugh Danaher 72987 by: Thies C. Arntzen Re: Trouble with php generated images 72989 by: Jason G. using PHPMyAdmin with SQL 72990 by: Peter Array of classes 72991 by: Andrzej Roszkowski spliting results into 2 colomns 72992 by: Daniel Harik 73006 by: DL Neil 73007 by: Daniel Harik Problem with LDAP 72993 by: Carlo Todeschini Re: User Authentication against remote authentication serve r [ LDAP ] 72996 by: Stig Venaas PEAR DB Results 72997 by: Ralph Guzman CANADA, SUBSIDIES, GRANTS, LOANS, FINANCING 72999 by: MG PUBLISHING Popup Window Problems Refresh 73000 by: Roger Bryant 73002 by: Matt Williams File upload 73001 by: Andrzej Roszkowski Thank You Friends 73003 by: Sondra Russell Re: Quick array question 73004 by: Christian Reiniger Asian fonts 73005 by: Daniel BI Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- On Wed, 31 Oct 2001 11:25, sc wrote: Hi; i keep getting an error of: Warning: Supplied argument is not a valid MySQL result resource in /datascripts/insertdata.php on line 17... Line 17 is: $row = mysql_fetch_assoc($test); and here is the rest of it (not all of it though): for ($p = 1; $p = 24; $p++) { $test = mysql_db_query(melbourne, SELECT * FROM 'Port$p' WHERE 'Port$p'.date='$yesterday'); $row = mysql_fetch_assoc ($test); $yindata = $row['switchin']; $youtdata = $row['switchout']; $dinPort = '$inPort$p' - $yindata; $doutPort = '$outPort$p' - $youtdata; Can anyone help me overcome this prob? i've prob missed something without thinking but i cant seem to get it... Thx. sc Er, want to be a little patient? That is three requests in seven minutes? Your query is probably broken - do some error checking after your database call with mysql_error() and see what the problem is. Guess; the table name. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I know all the wherefores, said Tom wisely. Or the single quotes around the table name in the sql string Your query is probably broken - do some error checking after your database call with mysql_error() and see what the problem is. Guess; the table name. Yeah sorry about that, didn't mean to send out 3... Ok i got it working... thanks for all the replys... -sc David Robley [EMAIL PROTECTED] wrote in message 01103111392904.28397@www">news:01103111392904.28397@www... On Wed, 31 Oct 2001 11:25, sc wrote: Hi; i keep getting an error of: Warning: Supplied argument is not a valid MySQL result resource in /datascripts/insertdata.php on line 17... Line 17 is: $row = mysql_fetch_assoc($test); and here is the rest of it (not all of it though): for ($p = 1; $p = 24; $p++) { $test = mysql_db_query(melbourne, SELECT * FROM
[PHP] Desperate: odbc_connect() does not work! Please help!
Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1b @ SCO UnixWare 7.1.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1b @ SCO UnixWare 7.1.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! My settings...
Sorry, here are my settings: Configure Command: './configure' '--with-mysql' '--with-apache=../apache_1.3.19' '--enable-track-vars' '--with-custom-odbc=/progress/dlc91/odbc/lib' ODBC Supportenabled -- Active Persistent Links 0 Active Links0 ODBC librarycustom ODBC_INCLUDE@ODBC_INCLUDE@ ODBC_LFLAGS @ODBC_LFLAGS@ ODBC_LIBS @ODBC_LIBS@ Directive Local Value Master Value -- odbc.allow_persistent On On odbc.check_persistent On On odbc.default_db no valueno value odbc.default_pw odbc.default_user no valueno value odbc.defaultbinmode return as isreturn as is odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes odbc.max_links Unlimited Unlimited odbc.max_persistent Unlimited Unlimited VariableValue -- ODBCINI /root/.odbc.ini ODBCINSTINI /root/.odbcinst.ini CUSTOM_ODBC_LIBS-L/progress/dlc91/odbc/lib -lodbc -lodbcinst CFLAGS -I/progress/dlc91/odbc/include -I/usr/local/src/apache_1.3.19/include -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:44 To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1b @ SCO UnixWare 7.1.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How I made My First Million
How I made My First Million. One sunday morning I opened my Outlook Mail-box and read a letter from my good friend. I live in a small town and I really like the way things go. Never aimed for anything that big. I would rather prefer a simple life. But there was something in this letter that subconsciously attracted me. At that time I knew not what it was. It was just a very simple line saying come and see everything for yourself. There was somethign about this new Internet project called BeginGame and about making lots of money in no time. I didn't believe a single word there, but decided to take a chance and look at it. I went into the project's head site over at www.begingame.com and read some of the texts there. As I was reading it, I thought to myself, Maybe I could be rich too... why not take a chance I went in and got registered. After that everything went on really fast and before I knew it, I already had some pretty good money on my account. I am not a programmer, I am strictly a user, but I am amazed how easily I was able to make my own begingame web-site (see it over at www.happydude.begingame.net). There are lots of different features there: some pretty cool games, free E-Mail account, your own WebSite, etc. but the most interesting is the money earning system. Its done in such a way that one person can easily make large sum of money just giving two-three hours a day to it. And now, as my bank account gets filled up with money, I can just relax myself and enjoy my peaceful life, spending most of the time communicating with my many new friends. The thing is that I am the kind of person who likes sharing his happiness with others. So, take your chance too, come and try it, there is no way to loose here, you can only gain, but this might just solve all of your problems. http://www.begingame.com Thank you for reading this letter. Sincerely yours, Michael _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP]
Please stop that ·$·%$·$ sending advertising
[PHP] PHP-arnings
Hi, I have a hopefully simple problem. Look at the following simple script: ?php if ($x) { echo $x; } ? This script runs properly on my productive system (Linux, Apache, PHP 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP 4.0.6) I always get a Warning, that variable x in not definded. Ok, thats true. But how can I suppress that Messages??? They destroy my HTML-Code. I've searched in the PHP.INI file, but I can't find anything, that looks like warning-suppression. Thanx for your help Harald -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Zipping a folder on a win2000 server with php4.06
Thank you all. It now works fine! I used the way with the add-on for winzip to make it command line able. There is indeed a command line tool. First it did not want to work at all until I found out, that the trial version of winzip wants the user to press a key (in the command line) to proceed - which I was unable to emulate within php. Luckily I have a registered version of winzip with which this works absolute perfectly. Here a short snippet: $result = @exec($winzip$zip_options $pathToArchive\\archive.zip @$pathToPacklist\\packlist.txt); Where $winzip contains the path to the folder of winzip + wzzip (example: $winzip = 'c:\\program files\\winzip\\wzzip';) $options contains switches for winzip (I used: $zip_options =' -ybc -es'; #-ybc: no interactive interface/all questions are answered with 'yes'; -es: fastest packaging since jpeg can't be packed better) $pathToArchive contains the path to the new file which winzip should create (example: $pathToArchive = 'C:\\') $pathToPacklist contains the path to the folder where the file packlist.txt is, which itself contains a return delimited list of all files to add to the zip (whole filepath is necessary) If someone is interested in that, I can give some additional info's Thank you all for your help! Stefan Rusterholz, [EMAIL PROTECTED] - Original Message - From: Matt Friedman [EMAIL PROTECTED] To: Stefan Rusterholz [EMAIL PROTECTED] Cc: php general [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 5:39 AM Subject: Re: [PHP] Zipping a folder on a win2000 server with php4.06 There is a command line version of winzip. I don't know much about it, but a friend of mine was just saying the other day that he had used it to zip some files at the server in an ASP environment. In php you could call the winzip exectutable using exec. In asp you'd use some shell object or something like that. Matt. - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 30, 2001 8:00 AM Subject: [PHP] Zipping a folder on a win2000 server with php4.06 Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Weird caching problem with PHP4/Apache
On Wednesday 31 October 2001 14:48, René Fournier wrote: Nope, unfortunately, nothing. It's a really weird problem. It's like the PHP function I wrote for generating the random image will only work the first time. I think it is not php that caches it. As I undertsand you wrote a script that generates an image, and give it back to the browser in an img src=... html tag. Am I right? I hope I am, so I continue :)) Images can be cached in many places (proxies, browser), but definietly not in php. Your script that generates in the image and should be called every time by the img html tag, won't ever called again if the previous image were stored somewhere. You should send pragma no-cache and other http headers (many posts were on this cache headers topic) from the script that generates and gives back the image. Or another sollution is that you can call your script with a random number or better with the current date and time, so you images's name won't be the same, and caches can't give back the old image. for example: ?php echoimg src=\generatebackground.php?x=.date(YmdHis). \;? Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP-arnings
From my php.ini: ;; ; Error handling and logging ; ;; ; error_reporting is a bit-field. Or each number up to get desired error ; reporting level ; E_ALL - All errors and warnings ; E_ERROR - fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING- warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING- user-generated warning message ; E_USER_NOTICE - user-generated notice message ; ; Examples: ; ; - Show all errors, except for notices ; ;error_reporting = E_ALL ~E_NOTICE ; ; - Show only errors ; ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; ; - Show all errors except for notices ; error_reporting = E_ALL ~E_NOTICE ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = Off ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = Off ; Store the last error/warning message in $php_errormsg (boolean). track_errors = Off ; String to output before an error message. ;error_prepend_string = font color=ff ; String to output after an error message. ;error_append_string = /font ; Log errors to specified file. ;error_log = filename ; Log errors to syslog (Event Log on NT, not valid in Windows 95). ;error_log = syslog ; Warn if the + operator is used with strings. warn_plus_overloading = Off -Original Message- From: Harald Witt [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 15:18 To: [EMAIL PROTECTED] Subject: [PHP] PHP-arnings Hi, I have a hopefully simple problem. Look at the following simple script: ?php if ($x) { echo $x; } ? This script runs properly on my productive system (Linux, Apache, PHP 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP 4.0.6) I always get a Warning, that variable x in not definded. Ok, thats true. But how can I suppress that Messages??? They destroy my HTML-Code. I've searched in the PHP.INI file, but I can't find anything, that looks like warning-suppression. Thanx for your help Harald -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] what does -1.#IND mean?
I have an equation that results in a floating point. The equation has no errors and works fine most of the time. When certain values are passed into the equation I get -1.#IND as the result. I have tried using round() to limit the size of the number, this hasn't helped, I'm not ever sure if I'm overloading the floating point or what? Please help me out here, I have a huge project that is totally done except for this bug and its driving me NUTZ!!! Thanks in advance for any help. - Anthony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP-arnings
in php.ini look for ;; ; Error handling and logging ; ;; specially for error_reporting= and set it properly. - Original Message - From: Harald Witt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 10:17 AM Subject: [PHP] PHP-arnings Hi, I have a hopefully simple problem. Look at the following simple script: ?php if ($x) { echo $x; } ? This script runs properly on my productive system (Linux, Apache, PHP 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP 4.0.6) I always get a Warning, that variable x in not definded. Ok, thats true. But how can I suppress that Messages??? They destroy my HTML-Code. I've searched in the PHP.INI file, but I can't find anything, that looks like warning-suppression. Thanx for your help Harald -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] setting member variables out of class
Hello, I want to set member variables out of their class. The code class is: ?php class translator { var $nombre; var $departamento; var $despacho; var $telefono; var $correo_electronico; var $pagina_personal; function translator(){ $nombre = array(Nombre,Name); $departamento = array(Departamento,Department); $despacho = array(Despacho,Office); $telefono = array(Teléfono,Phone); $correo_electronico = array(Correo Electrónico,E-mail); $pagina_personal = array(Página Personal,Personal HomePage); } } ? I access to this class from another php file and want to set this member variable: $c = new translator(); echo $c-telefono; /* this member isn't set but in constructor method has been set*/ I have written too: echo $c-$telefon; echo {$c-telefon}; but is not correct. Can anybody help me? Thanks Silvia Mahiques
Re: [PHP] PHP-arnings
If defined ($x) ??? If !empty ($x) ??? ...Well ... - Original Message - From: Martín Marqués [EMAIL PROTECTED] To: Harald Witt [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 3:43 PM Subject: Re: [PHP] PHP-arnings On Mié 31 Oct 2001 11:17, you wrote: Hi, I have a hopefully simple problem. Look at the following simple script: ?php if ($x) { echo $x; } ? This script runs properly on my productive system (Linux, Apache, PHP 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP 4.0.6) I always get a Warning, that variable x in not definded. Ok, thats true. But how can I suppress that Messages??? They destroy my HTML-Code. I've searched in the PHP.INI file, but I can't find anything, that looks like warning-suppression. Yes the error reporting. -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - Martín Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PEAR DB Results
Based on the snippet you have sent us you need to at least start by enclosing your column names in your accesses to the associative array containing your results. Each line just use print_r or var_dump: while($row = $result-fetchRow(DB_FETCHMODE_ASSOC)) { print_r($row); } This will show you exactly what is going on. Verify that your results are actually there as well. As a final note the actual problem appears to be that you are not accessing the associative array elements with quotes: echo $row[wwwpages.name]; Instead of: echo $row[wwwpages.name]; This should show you what is going on and help you easier determine what is going wrong, it is possible you are not returning any data with your query as well. Thanks Jeremy Allen -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 5:07 AM To: PHP General Mailing List Subject: [PHP] PEAR DB Results I am trying to do a joined query using PEAR DB? My code looks something like this: $sql = SELECT wwwpages.pid,wwwpages.name,media.pid,media.name FROM wwwpages, media WHERE wwwpages.pid = '$pid'; if(DB::isError($result = $db-query($sql))){ echo ERROR: . DB::errorMessage($result); } else { while($row = $result-fetchRow(DB_FETCHMODE_ASSOC)){ echo $row[wwwpages.name]; echo $row[media.name] } } When I specify '$row[wwwpages.name]' I get a blank result, and if I try '$row[name]', I am obviously not specifying a table therefore it results in name for wwwpages table. How do I go about displaying both? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] setting member variables out of class
Hello, I want to set member variables out of their class. The code class is: ?php class translator { var $nombre; var $departamento; var $despacho; var $telefono; var $correo_electronico; var $pagina_personal; function translator(){ $nombre = array(Nombre,Name); $departamento = array(Departamento,Department); $despacho = array(Despacho,Office); $telefono = array(Teléfono,Phone); $correo_electronico = array(Correo Electrónico,E-mail); $pagina_personal = array(Página Personal,Personal HomePage); } } ? I access to this class from another php file and want to set this member variable: $c = new translator(); echo $c-telefono; /* this member isn't set but in constructor method has been set*/ So what error message do you get? $c-telefono is an array so you will not be able to echo it straight out. It will echo 'Array'. Is this what you're getting? If so, read up on arrays from the manual, specifically each M: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Array of classes
Try something like this (you'll need to populate it afterward): $this-array = array(); Then populate it with the data. Mike Frazer Andrzej Roszkowski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! I have to create array of classes. When I do it this way: f add($sth) $this-array[] = $sth; it doesn't work :( when i'm trying to get class from there it says that this is not an object. How to do it rigth way? Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it. - LJ Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Bug ? Script download problem if user abort download
I retry using the following snuppet: ... while (!connection_aborted() !feof($fp) ) { echo fread($fp, 1000); } but nothing change. I try also with connection_status() and ignore_user_abort(false) but nothign change. If the user abort the download progress, the php process hang. Gianluca Morello [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a download script on IIS 5 and Php 4.0.6 as cgi: $filename=PDF_PATH.$codfile..pdf; $fp=fopen($filename,rb); if ($fp) { header(Content-type: application/octet-stream\n ); header(Content-transfer-encoding: binary\n); header(Content-length: . filesize($filename) . \n); header(Content-disposition: attachment; filename=.$codfile..pdf\n); $contents=; while (!feof($fp)) { $contents .= fread($fp, 1000); } fclose($fp); print($contents); the script works very well. But if the user press the Cancel button in the browser download dialog, the current php process stop working. If i try to load a new page another php process is spawned, but do nothing. If i look in the task manager i see my php processes running (without doing nothing). When the timeout occurs the php engine continue wotking correctly. If i close the browser while php is hang, and i start a new browser session the php pages are correctly processed. I try several other methods : readfile,fpassthru,fread($fp,filesize),read and print a small chunks of data, but nothing change, when the user abort the download operation the php hang. This behaviour is very similar to the following bug: http://bugs.php.net/?id=8215 , that appears to be closed -- Gianluca Morello Editek S.r.l. http://www.editek.it Via Vitruvio, 43 - Milano Mail: [EMAIL PROTECTED] Tel. : 02-671166208 Fax : 02-67493766 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
Kraa, The 01000 error is a 'General Error', probably at connect time. This suggest that your DSN settings might be bad or not being passed into PHP. Is your DSN named results and is that the one you are using in your tests? Also, are you setting your environment variables as appropriate? e.g.: setenv(ODBCINI=/path/to/odbc.ini); setenv(LD_LIBRARY_PATH=/path/to/your/driver/manager/lib); You may also which to try this connection with odbctest, a sample application available in the iODBC SDK at www.iodbc.org. HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:44 AM To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1b @ SCO UnixWare 7.1.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: I rest my case
Apache has a high learning curve. PHP isn't terribly hard to pick up on if you already know the basics of programming. Also, you may want to check out the newsgroup comp.infosystems.www.servers.unix for help with Apache if you continue to have problems. It appears from all the info you gave us that the problem is Apache and not PHP. Mike J W W L Berg [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... OK, there goes any pretense of intelligence that I may have been able to muster ;-) The AddType tag was found inside another as follows: IfModule mod_php4.c Is there some way I can check if this module is present, otherwise what you're saying is that the AddType isn't being executed if the IfModule is false, yes? What a pillock. I can see this is going to be some learning curve. Warwick Jason Brooke wrote: John, Jason didn't literally mean for you to search for the exact string 'Block' - he was telling you to look through the various types of ThisIsAnApacheDirective tags found in your httpd.conf file, such as Directory, File etc etc There is no BLOCK element in the httpd.conf. Is that where I should be looking? Warwick Jason Murray wrote: Hey thanks guys for the help, but it's still not happening. Apache had already the AddType lines mentioned by y'all. It's possible the AddType lines are inside a container that will ensure they're not executed. Backtrack to the Block element that the AddType lines are in, and see what it does. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Distributed Data Base
Hello, I want to Know how can I save information on a Data Bse that will be access for many persons at the same time. I use Postgressql Thanks. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: setting member variables out of class
I believe you would be getting a number echoed to the screen or dumpfile, but you want the values, correct? $telefono is declared as an array. Calling an echo statement on an array won't give you the values of the array elements. In order to have them all printed to screen, try: foreach ($telefono as $tele) { // $tele is just a tempo variable, name it what you want print $telefonobr\n; // br for screen formatting, \n for source formatting } Mike Silvia Mahiques [EMAIL PROTECTED] wrote in message 004401c16219$b50eb930$1a9cd29b@tscpc6">news:004401c16219$b50eb930$1a9cd29b@tscpc6... Hello, I want to set member variables out of their class. The code class is: ?php class translator { var $nombre; var $departamento; var $despacho; var $telefono; var $correo_electronico; var $pagina_personal; function translator(){ $nombre = array(Nombre,Name); $departamento = array(Departamento,Department); $despacho = array(Despacho,Office); $telefono = array(Teléfono,Phone); $correo_electronico = array(Correo Electrónico,E-mail); $pagina_personal = array(Página Personal,Personal HomePage); } } ? I access to this class from another php file and want to set this member variable: $c = new translator(); echo $c-telefono; /* this member isn't set but in constructor method has been set*/ I have written too: echo $c-$telefon; echo {$c-telefon}; but is not correct. Can anybody help me? Thanks Silvia Mahiques -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
On Wednesday 31 October 2001 02:32 am, you wrote: So, I'd recommend giving that a try. From my understanding (limited) of MySQL, use = in the case of $id=2, and LIKE in the case of firstName LIKE justin. Um...you *can* do that, but I don't think you want to. Using LIKE means that MySQL has to do a lot more searching on all your database records. Instead of searching for an exact match, where it can look at things like string length, first characters and other simple criteria, it now has to evaluate the entire contents of the field in case there's a possible match somewhere in the string. Much, much slower. So, yes it works, but you pay a performance price for it. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problems with pages generated by Apache's AddLanguage directive
Hi Just yesterday I installed Apache 1.3.22/PHP 4.0.6 to replace an ancient install of Apache 1.3.9/PHP 3.0.12. This is on FreeBSD 3.2. I have several sites which display content in different languages using Apache's AddLanguage, and LanguagePriority directives (page.php.en, page.php.fr, page.php.de, etc). This worked fine for my php pages in the old install and I was able to use variables contained in the query string. Now in the new install the variables in the query sting are no longer getting passed to the php pages. Whether used bare ($variable) or in the context of $HTTP_GET_VARS ($HTTP_GET_VARS[variable]) they don't get passed to the script. Any idea what is causing this? A remedy? Thanks -- Clint Gilders Servermaster OnlineHobbyist, Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
. Thanks to Kurt and Justin for the help offered on this simple (now that it is working) problem. I do not know where my stumbling block was but after a good nights rest and some coffee this morning I have this and the GetImageSize function incorporated.. I will list the code incase someone finds problems or a simpler way to go with it but it does seem to work well (at least on the local host) ? mysql_connect('localhost')or die (Could not connect); mysql_select_db('img760')or die (Could not select database); $results = mysql_query (select imglocation from img where imgname like '$getimg'); $row = mysql_fetch_array($results); $imglocation = $row['imglocation']; $size = GetImageSize ($imglocation); ? Display within the html doc is: img src=? echo $imglocation ? ? echo $size[3]; ? Again thanks for all of your patience and help Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] User Authentication against remote authentication serve r [ LDAP ]
Thanks very much, Stig, very helpful! We are just scouting the technology right now, so my more precise questions will come later ;) We will be using SSL. Given that, it looks to me like decision maker mode is the way to go? Kirk -Original Message- From: Stig Venaas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 3:06 AM To: Johnson, Kirk Cc: PHP General List Subject: Re: [PHP] User Authentication against remote authentication serve r [ LDAP ] On Mon, Oct 29, 2001 at 04:54:37PM -0700, Johnson, Kirk wrote: Thanks for the link, Kurt. Can you also point to any authentication code examples, or further discussion? The user comments in the manual suggest there are at least a couple ways to code stuff, ldap_compare vs ldap_bind. Any additional help appreciated. I might be able to help if you have some more precise questions, but basically there are two ways LDAP can be used. You can either use it as a data store or you can have LDAP make the authentication decision for you. If you want the user to supply username and password, the authentication can be done as follows: As data store: Hopefully the passwords are stored encrypted. Then there are two ways. If the password is stored encrypted with some unknown salt where the salt is stored together with the password (like the traditional UNIX way), your PHP script retrieves the encrypted password from LDAP, checks the salt, encrypts the user supplied password using the salt, and compare the two. If you don't use a salt you can encrypt the password from the user and just do an ldap_compare to check that it's the same as in the LDAP server. You get better security by not allowing people to read the encrypted passwords from LDAP. To store passwords encrypted in LDAP, SHA1 might be a good choice, PHP has this. As decision maker: You can simply bind to the server on behalf of the user, you use the user supplied username and password as arguments to ldap_bind(). If the bind succeeds, you let the user access your stuff. In this case you should consider using SSL/TLS for talking to the server. There are other ways to authenticate with LDAP, RFC 2829 gives a good overview. You can find it at for instance http://www.ietf.org/rfc/rfc2829.txt I could go into more detail, but to write a complete general overview would be a lot of work. You might also have a look at a really short presentation I've made at http://www.uninett.no/info/seminar/gnomis/ldapauth.pdf Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
. Thank you for the heads up on using like. I was wondering since there will be 2 similar variables from each page var1 var2 (identical except for the number). I programmed in DataFlex for about 6 years back in the late 80's early 90's but have not done anything db wise in over 8 years I still do not know where the problem was (maybe syntax or spelling) Again, thank you for all of your help... Mike Kurt Lieber [EMAIL PROTECTED] wrote in message E15yxVD-0005ls-00@z8">news:E15yxVD-0005ls-00@z8... On Wednesday 31 October 2001 02:32 am, you wrote: So, I'd recommend giving that a try. From my understanding (limited) of MySQL, use = in the case of $id=2, and LIKE in the case of firstName LIKE justin. Um...you *can* do that, but I don't think you want to. Using LIKE means that MySQL has to do a lot more searching on all your database records. Instead of searching for an exact match, where it can look at things like string length, first characters and other simple criteria, it now has to evaluate the entire contents of the field in case there's a possible match somewhere in the string. Much, much slower. So, yes it works, but you pay a performance price for it. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] defending PHP mail function
Title: Blank Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email addresses will simply "not work" with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
Blankwhat os was it?!?!? - Original Message - From: Matthew Luchak To: Php-General (E-mail) Sent: Thursday, November 01, 2001 2:04 AM Subject: [PHP] defending PHP mail function Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email addresses will simply not work with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1 ) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
WIN 2000 Blankwhat os was it?!?!? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
Which addresses won't work? - Original Message - From: Matthew Luchak [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 2:04 AM Subject: [PHP] defending PHP mail function Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email addresses will simply not work with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347 http://www.zend.com/codex.php?id=347single=1 single=1 ) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
My favorite email libraries are .. SMTP class http://www.phpguru.org/download.php?script_id=10 And working in conjunction with SMTP class .. HTML Email Class http://www.phpguru.org/download.php?script_id=4 -Original Message- From: Matthew Luchak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:04 AM To: Php-General (E-mail) Subject: [PHP] defending PHP mail function Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email addresses will simply not work with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1 ) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
On Wednesday 31 October 2001 07:45 am, turtle wrote: img src=? echo $imglocation ? ? echo $size[3]; ? Glad we could help. Also, you can re-write the above so you don't have to define two sets of ?php ? tags by doing the following: ?php print img src=\$imglocation\ $size[3]; ? Not a big deal here, but if you start writing multiple lines of HTML code, you probably don't want to enclose each PHP variable in its own set of ?php ? tags. Also, I tried to send you a couple suggestions off-list last night, but your email bounces -- I'm guessing the new owner of netobjects doesn't have their mail server set up to accept the correct email address. Just FYI. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
thats wierd it added blank infront of it all...wierd it might have been the smtp server its self that had rules or something... - Original Message - From: Matthew Luchak [EMAIL PROTECTED] To: Php-General (E-mail) [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 2:09 AM Subject: RE: [PHP] defending PHP mail function WIN 2000 Blankwhat os was it?!?!? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
I'd be interested to see an example of an address that will not work Which MTA are you using? On which OS? More info! (obPeeve): Please don't post in HTML. Cheers Jon -Original Message- From: Matthew Luchak [mailto:[EMAIL PROTECTED]] Sent: 31 October 2001 16:04 To: Php-General (E-mail) Subject: [PHP] defending PHP mail function Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email addresses will simply not work with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1 ) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
The addresses I know about are clients that are already a little peeved with me so I can't send them out for testing but I have found at least 4 addresses that will not work (no error message, just dead air) with Mail(). It is something about the string of letters that does it because if I try [EMAIL PROTECTED] it doesn't mail. If I try [EMAIL PROTECTED], or the like, it mails. I first noticed this problem when inserting addresses into the From: field and have now found it happening (not) in the To: field. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -Original Message- From: Jason Brooke [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 11:10 AM To: Matthew Luchak; Php-General (E-mail) Subject: Re: [PHP] defending PHP mail function Which addresses won't work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
On Wednesday 31 October 2001 08:16 am, you wrote: The addresses I know about are clients that are already a little peeved with me so I can't send them out for testing but I have found at least 4 addresses that will not work (no error message, just dead air) with Mail(). It is something about the string of letters that does it because if I try [EMAIL PROTECTED] it doesn't mail. If I try [EMAIL PROTECTED], or the like, it mails. Not that I doubt you, but I do suspect a problem other than PHP, such as a strange, non-printing character getting inserted in the email address somewhere (like at the end) or a newline character. It could also be a problem with the SMTP server that you're using. I highly recommend that you try this out on another, totally different PHP server (esp. one that runs on Apache/*nix, since that doesn't use SMTP to transport mail) That will help you isolate the exact area where the problem occurs. If you want to contact me off list, I'd be happy to help out with some simple tests. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
Well hey, if mail() won't send to those addresses, what's wrong with us testing them? :-) ahem Can you send to those addresses from a regular email client? If so, can you do it from the command line with your MTA? jon@maya~$ sendmail [EMAIL PROTECTED] hello there . Cheers Jon -Original Message- From: Matthew Luchak [mailto:[EMAIL PROTECTED]] Sent: 31 October 2001 16:17 To: Php-General (E-mail) Subject: RE: [PHP] defending PHP mail function The addresses I know about are clients that are already a little peeved with me so I can't send them out for testing but I have found at least 4 addresses that will not work (no error message, just dead air) with Mail(). It is something about the string of letters that does it because if I try [EMAIL PROTECTED] it doesn't mail. If I try [EMAIL PROTECTED], or the like, it mails. I first noticed this problem when inserting addresses into the From: field and have now found it happening (not) in the To: field. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -Original Message- From: Jason Brooke [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 11:10 AM To: Matthew Luchak; Php-General (E-mail) Subject: Re: [PHP] defending PHP mail function Which addresses won't work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
Well hey, if mail() won't send to those addresses, what's wrong with us testing them? :-) ;) Can you send to those addresses from a regular email client? If so, can you do it from the command line with your MTA? Of course I am talking about valid addresses, in fact there is at least one address that works with 4.04 but not with 4.06. I apologize about being vague with the addresses that fail but I obviously can't be sending out my client's email addresses for testing - for now it's PHP that's in question - if I send out the client's addresses well... management might just decide to kill two birds with one stone. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
On Wednesday 31 October 2001 08:40 am, you wrote: for now it's PHP that's in question AFAIK, this is the first I've ever heard of probelms with mail() not sending to perfectly valid email addresses. Scalability issues and other performance problems, sure, but that's a different animal. Given the number of people that use PHP (and use mail(), especially) I would certainly think this problem would have been reported before if it were a real bug. So, to be blunt, you probably have a problem with your code, your SMTP server, the way you've configured PHP, or something other than mail(). It's easy to blame it on mail() and/or PHP, but I think you're barking up the wrong tree. Find a forgiving customer who reported the problem, ask for their help in troubleshooting it and then send some test emails from a completely different server, preferably on a *nix platform. (not because *nix is better than windows, but because *nix PHP doesn't use smtp for mail delivery) --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: defending PHP mail function
Hello, Matthew Luchak wrote: Recently I have had to defend the use of PHP in light of a number of screw-ups with the mail function in 4.0+. It seems that some email If you are using Windows, that seems to be a problem that the mail() function implementation does not handle SMTP servers that return multi-line responses. The problem was reported a long time ago. I don't think it was ever fixed. addresses will simply not work with mail. I have been shopping around for a smtp direct class ( http://www.zend.com/codex.php?id=347single=1 ) looks pretty good to me and was wondering if anyone has any experiences, shortcuts etc. to this kind of problem with mail. That class does not handle multi-line responses either. Try this one: http://phpclasses.UpperDesign.com/browse.html/package/14 Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] defending PHP mail function
OK. here's why I think it's in PHP's SMTP support: There is an address that fails in 4.06 yet functions in 4.04 - exactly the same code, same SMTP server, same .ini, everything the same. I wouldn't question the class if I hadn't tested my own code and settings first. I've been trying to track this down for the past two weeks and have already been advised by someone on this list that PHP's SMTP support is not the greatest: SMTP code in PHP is not good enough. It needs to be rewritten. snip Yasuo Ohgaki It doesn't do much good to test on a nix box because what I'm looking for is a solution to a PHP/SMTP problem. Matthew Luchak Webmaster Kaydara Inc. [EMAIL PROTECTED] -Original Message- From: Kurt Lieber [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 11:57 AM To: PHP General List Subject: Re: [PHP] defending PHP mail function On Wednesday 31 October 2001 08:40 am, you wrote: for now it's PHP that's in question AFAIK, this is the first I've ever heard of probelms with mail() not sending to perfectly valid email addresses. Scalability issues and other performance problems, sure, but that's a different animal. Given the number of people that use PHP (and use mail(), especially) I would certainly think this problem would have been reported before if it were a real bug. So, to be blunt, you probably have a problem with your code, your SMTP server, the way you've configured PHP, or something other than mail(). It's easy to blame it on mail() and/or PHP, but I think you're barking up the wrong tree. Find a forgiving customer who reported the problem, ask for their help in troubleshooting it and then send some test emails from a completely different server, preferably on a *nix platform. (not because *nix is better than windows, but because *nix PHP doesn't use smtp for mail delivery) --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Weird caching problem with PHP4/Apache -- THE SAGA CONTINUES
Here's what I've got, starting at the top... == ?php header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');// Date in the past header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified header ('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header ('Pragma: no-cache'); // HTTP/1.0 ?html head titleTitle/title META HTTP-EQUIV=Expires CONTENT=0 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 [SNIP] ?php function randbg() { $num_of_bgs = 5; $the_one = rand(1,$num_of_bgs); echo bg.$the_one..jpg; } ? [SNIP] td valign=top align=left background=../common/images/bg/?php randbg(); ? == Here's why I think it's PHP4: If I look at these pages on my local machine (WinME, Apache 1.3.20, PHP4.06 module, MySQL 3.23.14 (not that it matters, right?)), the randbg() function works as it should--I get a random background image everytime. But if I look at these EXACT SAME pages on Fatcow (Linux/Apache, I believe, PHP4...), the randbg() function executes the first time, then [seemingly] fails to execute again--it never generates a different, random bakground. (Or maybe I'm looking at one hell of a coincidence :-) So my question is, who is caching what, where? ...Rene -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 7:24 AM To: René Fournier; Hugh Danaher Cc: Php-General Subject: Re: [PHP] Re: Weird caching problem with PHP4/Apache On Wednesday 31 October 2001 14:48, René Fournier wrote: Nope, unfortunately, nothing. It's a really weird problem. It's like the PHP function I wrote for generating the random image will only work the first time. I think it is not php that caches it. As I undertsand you wrote a script that generates an image, and give it back to the browser in an img src=... html tag. Am I right? I hope I am, so I continue :)) Images can be cached in many places (proxies, browser), but definietly not in php. Your script that generates in the image and should be called every time by the img html tag, won't ever called again if the previous image were stored somewhere. You should send pragma no-cache and other http headers (many posts were on this cache headers topic) from the script that generates and gives back the image. Or another sollution is that you can call your script with a random number or better with the current date and time, so you images's name won't be the same, and caches can't give back the old image. for example: ?php echoimg src=\generatebackground.php?x=.date(YmdHis). \;? Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
On Wednesday 31 October 2001 09:08 am, you wrote: It doesn't do much good to test on a nix box because what I'm looking for is a solution to a PHP/SMTP problem. Really? No good at all, huh? I would think that would answer the question right there if it was an SMTP problem or a problem that lies elsewhere. If you take SMTP out of the equation, and the problem still occurs, then you know that's not the issue. If the problem does go away, then you've isolated it to either PHP SMTP code (probably) or your SMTP server (not as likely, but still a possibilty) --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Weird caching problem with PHP4/Apache -- THE SAGA CONTINUES
On Wednesday 31 October 2001 18:18, René Fournier wrote: Here's what I've got, starting at the top... == ?php header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');// Date in the past header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified header ('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header ('Pragma: no-cache'); // HTTP/1.0 ?html head titleTitle/title META HTTP-EQUIV=Expires CONTENT=0 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 [SNIP] ?php function randbg() { $num_of_bgs = 5; $the_one = rand(1,$num_of_bgs); echo bg.$the_one..jpg; } ? [SNIP] td valign=top align=left background=../common/images/bg/?php randbg(); ? == Ah, so you have bg1.jpg, bg2.jpg and so on till 5. And want to show one of them selected by a random value? So when you click on browser's refresh button, what happens? You always get the same page as before with for example bg1.jpg? Do you seed the random number generator (srand()) before you use rand() function? Arpi Here's why I think it's PHP4: If I look at these pages on my local machine (WinME, Apache 1.3.20, PHP4.06 module, MySQL 3.23.14 (not that it matters, right?)), the randbg() function works as it should--I get a random background image everytime. But if I look at these EXACT SAME pages on Fatcow (Linux/Apache, I believe, PHP4...), the randbg() function executes the first time, then [seemingly] fails to execute again--it never generates a different, random bakground. (Or maybe I'm looking at one hell of a coincidence :-) So my question is, who is caching what, where? ...Rene -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 7:24 AM To: René Fournier; Hugh Danaher Cc: Php-General Subject: Re: [PHP] Re: Weird caching problem with PHP4/Apache On Wednesday 31 October 2001 14:48, René Fournier wrote: Nope, unfortunately, nothing. It's a really weird problem. It's like the PHP function I wrote for generating the random image will only work the first time. I think it is not php that caches it. As I undertsand you wrote a script that generates an image, and give it back to the browser in an img src=... html tag. Am I right? I hope I am, so I continue :)) Images can be cached in many places (proxies, browser), but definietly not in php. Your script that generates in the image and should be called every time by the img html tag, won't ever called again if the previous image were stored somewhere. You should send pragma no-cache and other http headers (many posts were on this cache headers topic) from the script that generates and gives back the image. Or another sollution is that you can call your script with a random number or better with the current date and time, so you images's name won't be the same, and caches can't give back the old image. for example: ?php echoimg src=\generatebackground.php?x=.date(YmdHis). \;? Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] defending PHP mail function
Really? No good at all, huh? I would think that would answer the question right there if it was an SMTP problem or a problem that lies elsewhere. If you take SMTP out of the equation, and the problem still occurs, then you know that's not the issue. If the problem does go away, then you've isolated it to either PHP SMTP code (probably) or your SMTP server (not as likely, but still a possibilty) He already stated that the same code worked with a previous version. He also made it clear that he was using Win32/SMTP. We all know it will probably work on a Unix box with sendmail or similar because so many of us use it on a daily basis with no such problem - that won't help his situation. I think probing the guy a bit on the premise that he might be mistakenly loking at Php as the problem is fair enough, but beginning an inquisition certainly isn't warranted ;) jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Weird caching problem with PHP4/Apache -- THE SAGA CONTINUES
Yes! That's it! I added that srand function, and it works great. Thanks! ..Rene -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 10:58 AM To: René Fournier Cc: Php-General Subject: Re: [PHP] Re: Weird caching problem with PHP4/Apache -- THE SAGA CONTINUES On Wednesday 31 October 2001 18:18, René Fournier wrote: Here's what I've got, starting at the top... == ?php header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');// Date in the past header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified header ('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 header ('Pragma: no-cache'); // HTTP/1.0 ?html head titleTitle/title META HTTP-EQUIV=Expires CONTENT=0 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 [SNIP] ?php function randbg() { $num_of_bgs = 5; $the_one = rand(1,$num_of_bgs); echo bg.$the_one..jpg; } ? [SNIP] td valign=top align=left background=../common/images/bg/?php randbg(); ? == Ah, so you have bg1.jpg, bg2.jpg and so on till 5. And want to show one of them selected by a random value? So when you click on browser's refresh button, what happens? You always get the same page as before with for example bg1.jpg? Do you seed the random number generator (srand()) before you use rand() function? Arpi Here's why I think it's PHP4: If I look at these pages on my local machine (WinME, Apache 1.3.20, PHP4.06 module, MySQL 3.23.14 (not that it matters, right?)), the randbg() function works as it should--I get a random background image everytime. But if I look at these EXACT SAME pages on Fatcow (Linux/Apache, I believe, PHP4...), the randbg() function executes the first time, then [seemingly] fails to execute again--it never generates a different, random bakground. (Or maybe I'm looking at one hell of a coincidence :-) So my question is, who is caching what, where? ...Rene -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 7:24 AM To: René Fournier; Hugh Danaher Cc: Php-General Subject: Re: [PHP] Re: Weird caching problem with PHP4/Apache On Wednesday 31 October 2001 14:48, René Fournier wrote: Nope, unfortunately, nothing. It's a really weird problem. It's like the PHP function I wrote for generating the random image will only work the first time. I think it is not php that caches it. As I undertsand you wrote a script that generates an image, and give it back to the browser in an img src=... html tag. Am I right? I hope I am, so I continue :)) Images can be cached in many places (proxies, browser), but definietly not in php. Your script that generates in the image and should be called every time by the img html tag, won't ever called again if the previous image were stored somewhere. You should send pragma no-cache and other http headers (many posts were on this cache headers topic) from the script that generates and gives back the image. Or another sollution is that you can call your script with a random number or better with the current date and time, so you images's name won't be the same, and caches can't give back the old image. for example: ?php echoimg src=\generatebackground.php?x=.date(YmdHis). \;? Arpi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] A way to simulate modem speeds?
I apologize for the only-vaguely-PHP-related nature of this, but I'm endlessly impressed with the knowledge here. I'm looking for a way to clamp down a network machine (we're on a T1) to modem speeds (28 to 52 K) for testing purposes. Is there software (preferably for Windows) that would do this? Better yet, would this software be free? I don't want much, do I? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A way to simulate modem speeds?
On Wed, 31 Oct 2001, Michael Hall wrote: I'm looking for a way to clamp down a network machine (we're on a T1) to modem speeds (28 to 52 K) for testing purposes. Well, mod_throttle on the server side will do this for you. Client side.. hrum. A linux box with bandwidth controls, a packeteer. There is throttling software for Win, I've seen it in use - I just have no clue what it was called. -- Sapere aude My mind not only wanders, it sometimes leaves completely. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
Hi Andrew, I'm using the Merant DataDirect 3.6 Progress SQL92 ODBC drivers and they seem to be working fine when I try their test C program. I can connect to the Progress database en retrieve data. I'm using their driver manager as well (--with-custom-odbc). The test C program uses: SQLConnect (hdbc, driver, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); SQLConnect is executed without problems. A connection can be made. When I try odbctest (from iODBC / odbcsdk) the connect fails (same drivers, same odbc.ini, same odbcinst.ini). SQLDriverConnect (hdbc, 0, (UCHAR *) dataSource, SQL_NTS, (UCHAR *) buf, sizeof (buf), buflen, SQL_DRIVER_COMPLETE); SQLDriverConnect returns -1. A connection cannot be made. Why is the first program using SQLConnect() and the other SQLDriverConnect()? Are ODBC driver and ODBC driver manager dependent on each other? Or can I use the iODBC driver manager and the Merant ODBC drivers together? Are there alternatives to the Merant ODBC drivers? I am connect a Progress 9.1c database on SCO UnixWare 7.1.1 from Red Hat Linux 7.1 with Merant DataDirect 3.6 Progress SQL92 ODBC drivers and ODBC driver manager. Any ideas? Regards, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 16:12 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, The 01000 error is a 'General Error', probably at connect time. This suggest that your DSN settings might be bad or not being passed into PHP. Is your DSN named results and is that the one you are using in your tests? Also, are you setting your environment variables as appropriate? e.g.: setenv(ODBCINI=/path/to/odbc.ini); setenv(LD_LIBRARY_PATH=/path/to/your/driver/manager/lib); You may also which to try this connection with odbctest, a sample application available in the iODBC SDK at www.iodbc.org. HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:44 AM To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1b @ SCO UnixWare 7.1.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP+MySQL=Help(?)
. Thank you Kurt, The day for the server to be move from Cal to Fla is the 31st (today) I would image that it is somewhere in transit at the present time... Will send you an email with another address you can respond to... Thanks for all of your help Mike Kurt Lieber [EMAIL PROTECTED] wrote in message E15yy3N-0005qE-00@z8">news:E15yy3N-0005qE-00@z8... On Wednesday 31 October 2001 07:45 am, turtle wrote: img src=? echo $imglocation ? ? echo $size[3]; ? Glad we could help. Also, you can re-write the above so you don't have to define two sets of ?php ? tags by doing the following: ?php print img src=\$imglocation\ $size[3]; ? Not a big deal here, but if you start writing multiple lines of HTML code, you probably don't want to enclose each PHP variable in its own set of ?php ? tags. Also, I tried to send you a couple suggestions off-list last night, but your email bounces -- I'm guessing the new owner of netobjects doesn't have their mail server set up to accept the correct email address. Just FYI. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A way to simulate modem speeds?
duno about for windows, but there's quite a bit around on packet shaping for Linux and *BSD which amounts to the same thing - could be worthwhile sticking an old server in the middle with some different rules on different ports (i.e. port 81 set up for 14k4 equiv, 82 for 28k8 equiv, etc..) sorry aint got any URLs but some googling should get you somewhere... Shane On Wednesday 31 October 2001 6:23 pm, Michael Hall wrote: I apologize for the only-vaguely-PHP-related nature of this, but I'm endlessly impressed with the knowledge here. I'm looking for a way to clamp down a network machine (we're on a T1) to modem speeds (28 to 52 K) for testing purposes. Is there software (preferably for Windows) that would do this? Better yet, would this software be free? I don't want much, do I? Thanks. -- Shane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
Kraa, I'm not sure why the two sample apps are using different connection calls; It's not terribly relevant - both are legal. Driver manager and driver are not typically dependent on each other, no. The fact that the connection fails in odbctest is probably due to a missing parameter that iODBC wants in the DSN or the environment variables. You can look at error messages for the Merant driver - I'm not going to get into debugging it :) If you want to try OpenLink's ODBC drivers, you will find they work fine with PHP and Progress. I suggest you download the Multi-Tier driver from our site - they comes free with a 2 user connection. I would also suggest that you compile --with-iodbc, as it is in greater use and has been more thoroughly tested with PHP. Free support is available as well if you have difficulties, at: http://www.openlinksw.com/support/suppindx.htm. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 1:59 PM To: '[EMAIL PROTECTED]'; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Hi Andrew, I'm using the Merant DataDirect 3.6 Progress SQL92 ODBC drivers and they seem to be working fine when I try their test C program. I can connect to the Progress database en retrieve data. I'm using their driver manager as well (--with-custom-odbc). The test C program uses: SQLConnect (hdbc, driver, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); SQLConnect is executed without problems. A connection can be made. When I try odbctest (from iODBC / odbcsdk) the connect fails (same drivers, same odbc.ini, same odbcinst.ini). SQLDriverConnect (hdbc, 0, (UCHAR *) dataSource, SQL_NTS, (UCHAR *) buf, sizeof (buf), buflen, SQL_DRIVER_COMPLETE); SQLDriverConnect returns -1. A connection cannot be made. Why is the first program using SQLConnect() and the other SQLDriverConnect()? Are ODBC driver and ODBC driver manager dependent on each other? Or can I use the iODBC driver manager and the Merant ODBC drivers together? Are there alternatives to the Merant ODBC drivers? I am connect a Progress 9.1c database on SCO UnixWare 7.1.1 from Red Hat Linux 7.1 with Merant DataDirect 3.6 Progress SQL92 ODBC drivers and ODBC driver manager. Any ideas? Regards, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 16:12 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, The 01000 error is a 'General Error', probably at connect time. This suggest that your DSN settings might be bad or not being passed into PHP. Is your DSN named results and is that the one you are using in your tests? Also, are you setting your environment variables as appropriate? e.g.: setenv(ODBCINI=/path/to/odbc.ini); setenv(LD_LIBRARY_PATH=/path/to/your/driver/manager/lib); You may also which to try this connection with odbctest, a sample application available in the iODBC SDK at www.iodbc.org. HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:44 AM To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The ODBC config itself works fine. I can make a connection and retrieve data from the database using a test C program. BTW 2 I used --with-custom-odbc and set env var CUSTOM_ODBC_LIBS to the lib dirs and env var CFLAGS to the include dirs. Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
Hi, The problem is that a Progress 9.1c is not available at openlinksw.com for: Client: Linux glibc2.1 (x86) Server: UnixWare 7 (x86) Only Progress 8.3b is supported. So you are saying that a setting in the .ini files or some environment variable could be missing. I will have a look at it. Thanks, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 20:25 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, I'm not sure why the two sample apps are using different connection calls; It's not terribly relevant - both are legal. Driver manager and driver are not typically dependent on each other, no. The fact that the connection fails in odbctest is probably due to a missing parameter that iODBC wants in the DSN or the environment variables. You can look at error messages for the Merant driver - I'm not going to get into debugging it :) If you want to try OpenLink's ODBC drivers, you will find they work fine with PHP and Progress. I suggest you download the Multi-Tier driver from our site - they comes free with a 2 user connection. I would also suggest that you compile --with-iodbc, as it is in greater use and has been more thoroughly tested with PHP. Free support is available as well if you have difficulties, at: http://www.openlinksw.com/support/suppindx.htm. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 1:59 PM To: '[EMAIL PROTECTED]'; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Hi Andrew, I'm using the Merant DataDirect 3.6 Progress SQL92 ODBC drivers and they seem to be working fine when I try their test C program. I can connect to the Progress database en retrieve data. I'm using their driver manager as well (--with-custom-odbc). The test C program uses: SQLConnect (hdbc, driver, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); SQLConnect is executed without problems. A connection can be made. When I try odbctest (from iODBC / odbcsdk) the connect fails (same drivers, same odbc.ini, same odbcinst.ini). SQLDriverConnect (hdbc, 0, (UCHAR *) dataSource, SQL_NTS, (UCHAR *) buf, sizeof (buf), buflen, SQL_DRIVER_COMPLETE); SQLDriverConnect returns -1. A connection cannot be made. Why is the first program using SQLConnect() and the other SQLDriverConnect()? Are ODBC driver and ODBC driver manager dependent on each other? Or can I use the iODBC driver manager and the Merant ODBC drivers together? Are there alternatives to the Merant ODBC drivers? I am connect a Progress 9.1c database on SCO UnixWare 7.1.1 from Red Hat Linux 7.1 with Merant DataDirect 3.6 Progress SQL92 ODBC drivers and ODBC driver manager. Any ideas? Regards, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 16:12 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, The 01000 error is a 'General Error', probably at connect time. This suggest that your DSN settings might be bad or not being passed into PHP. Is your DSN named results and is that the one you are using in your tests? Also, are you setting your environment variables as appropriate? e.g.: setenv(ODBCINI=/path/to/odbc.ini); setenv(LD_LIBRARY_PATH=/path/to/your/driver/manager/lib); You may also which to try this connection with odbctest, a sample application available in the iODBC SDK at www.iodbc.org. HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:44 AM To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 14:40 To: Php-General (E-mail) Subject: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, When I execute: ? odbc_pconnect(results, sysprogress, mls); ? I get error: Warning: SQL error: , SQL state 01000 in SQLConnect in /usr/local/apache/htdocs/odbc.php on line 1 See attachment for phpinfo(). BTW 1 The
[PHP] Re: File upload
Your files are being uploaded to the pre-defined temporary directory. $userfile contains the name of the temporary file the file was uploaded as. After you run all the checks on the file to make sure its valid, you should use copy() to move the file to its permament home in your file system, then use unlink() to remove the temporary file. http://www.php.net/manual/en/features.file-upload.php contains a whole bunch of information on the topic that may be useful -- Liz Fulghum -- http://www.lipstickalley.com/ - Be Popular! Want to learn PHP? http://webdeveloper.earthweb.com/scripting/article/0,,12014_900521,00.html -- Andrzej Roszkowski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Where is file upload function? ;) From begining: some time I've found somewhere this handler: clearing_report_file is the input that is user sends to me. if(!isset($clearing_report_file)) { pp_xfer_trans(); } else { if (!@copy($clearing_report_file, $CFG[local_uri]./cfd- . $batch ..txt)) { echo(\nbSomething barfed, check the path to and the permissions for the upload directory/b); }else { // do domething exit(); } } but now, in php 4.0.5 this function don't want to work ;( i have allways something barfed message, even if i try to wrote to /tmp directory now i have this in phpinfo: HTTP_POST_FILES[userfile] Array ( [name] = helyjon [type] = [tmp_name] = none [size] = 0 ) where is my file? $variables shows the same values, where are my contents? Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better at it. - LJ Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] $ENV{'REMOTE_ADDR'}
In perl I do something like this: if (!($ENV{'REMOTE_ADDR'} =~ /\b(132\.210)/)) or ... $ENV{'REMOTE_HOST'} PHP is not Perl. So how do I parse the user's remote address or host to display one thing if IP = 127.0.0.1, another if = 209.247.2.3 another if host = remote.somewhere.com else echo Blah; John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and qmail
Hi list, I have recently installed qmail-1.03 now what settings should I make in php.ini file to send email with mail() function. Thanks.
[PHP] Re: $ENV{'REMOTE_ADDR'}
if ($REMOTE_ADDR==127.0.0.1) { do something } elseif ($REMOTE_ADDR==remote.somewhere.com) { do something else } else { eeks! its the end } List of all the predefined variables: http://www.php.net/manual/en/language.variables.predefined.php -- Liz Fulghum -- http://www.lipstickalley.com/ - Be Popular! Want to learn PHP? http://webdeveloper.earthweb.com/scripting/article/0,,12014_900521,00.html -- Jtjohnston [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In perl I do something like this: if (!($ENV{'REMOTE_ADDR'} =~ /\b(132\.210)/)) or ... $ENV{'REMOTE_HOST'} PHP is not Perl. So how do I parse the user's remote address or host to display one thing if IP = 127.0.0.1, another if = 209.247.2.3 another if host = remote.somewhere.com else echo Blah; John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP and qmail
If you have installed Qmail and removed Sendmail create symlinks to the qmail sendmail wrapper and you should not have to edit you php.ini. Read the qmail INSTALL file for more. # ln -s /var/qmail/bin/sendmail /usr/lib/sendmail # ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail -Original Message- From: Suleyman Kuran [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 12:22 PM To: '[EMAIL PROTECTED]' Subject: [PHP] PHP and qmail Hi list, I have recently installed qmail-1.03 now what settings should I make in php.ini file to send email with mail() function. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Desperate: odbc_connect() does not work! Please help!
Kraa, Sorry for the confusion; we should have that component available by the end of the week. Best regards, Andrew -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 2:50 PM To: '[EMAIL PROTECTED]'; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Hi, The problem is that a Progress 9.1c is not available at openlinksw.com for: Client: Linux glibc2.1 (x86) Server: UnixWare 7 (x86) Only Progress 8.3b is supported. So you are saying that a setting in the .ini files or some environment variable could be missing. I will have a look at it. Thanks, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 20:25 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, I'm not sure why the two sample apps are using different connection calls; It's not terribly relevant - both are legal. Driver manager and driver are not typically dependent on each other, no. The fact that the connection fails in odbctest is probably due to a missing parameter that iODBC wants in the DSN or the environment variables. You can look at error messages for the Merant driver - I'm not going to get into debugging it :) If you want to try OpenLink's ODBC drivers, you will find they work fine with PHP and Progress. I suggest you download the Multi-Tier driver from our site - they comes free with a 2 user connection. I would also suggest that you compile --with-iodbc, as it is in greater use and has been more thoroughly tested with PHP. Free support is available as well if you have difficulties, at: http://www.openlinksw.com/support/suppindx.htm. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 1:59 PM To: '[EMAIL PROTECTED]'; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Hi Andrew, I'm using the Merant DataDirect 3.6 Progress SQL92 ODBC drivers and they seem to be working fine when I try their test C program. I can connect to the Progress database en retrieve data. I'm using their driver manager as well (--with-custom-odbc). The test C program uses: SQLConnect (hdbc, driver, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS); SQLConnect is executed without problems. A connection can be made. When I try odbctest (from iODBC / odbcsdk) the connect fails (same drivers, same odbc.ini, same odbcinst.ini). SQLDriverConnect (hdbc, 0, (UCHAR *) dataSource, SQL_NTS, (UCHAR *) buf, sizeof (buf), buflen, SQL_DRIVER_COMPLETE); SQLDriverConnect returns -1. A connection cannot be made. Why is the first program using SQLConnect() and the other SQLDriverConnect()? Are ODBC driver and ODBC driver manager dependent on each other? Or can I use the iODBC driver manager and the Merant ODBC drivers together? Are there alternatives to the Merant ODBC drivers? I am connect a Progress 9.1c database on SCO UnixWare 7.1.1 from Red Hat Linux 7.1 with Merant DataDirect 3.6 Progress SQL92 ODBC drivers and ODBC driver manager. Any ideas? Regards, Simon. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: woensdag 31 oktober 2001 16:12 To: Kraa de Simon; Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! Kraa, The 01000 error is a 'General Error', probably at connect time. This suggest that your DSN settings might be bad or not being passed into PHP. Is your DSN named results and is that the one you are using in your tests? Also, are you setting your environment variables as appropriate? e.g.: setenv(ODBCINI=/path/to/odbc.ini); setenv(LD_LIBRARY_PATH=/path/to/your/driver/manager/lib); You may also which to try this connection with odbctest, a sample application available in the iODBC SDK at www.iodbc.org. HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Kraa de Simon [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 8:44 AM To: Php-General (E-mail) Subject: RE: [PHP] Desperate: odbc_connect() does not work! Please help! So desperate I even forgot the attachment... -Original Message- From: Kraa
Re: [PHP] spliting results into 2 colomns
I't just came into my mind, if 1 simple split that arrey in to 2 arrays, it would be much simplier and wouldn't need second loop, i just wanted to know how can i split 1 array in 2 arrays Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] split array in 2 halfs
Good evening I was wondering how can I split, array that has 60 elements in it, into 2 arrays with 30 elements each? Thank You very much and have a good night :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] split array in 2 halfs
Based on what criteria? if you just want to split the array at element 30, you could use array_splice to get the necessary data... - Original Message - From: Daniel Harik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 2:16 AM Subject: [PHP] split array in 2 halfs Good evening I was wondering how can I split, array that has 60 elements in it, into 2 arrays with 30 elements each? Thank You very much and have a good night :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] split array in 2 halfs
Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
take a look at the manual http://www.php.net/manual/en/function.array-slice.php it will show you the right way to do it jim - Original Message - From: Daniel Harik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 11:25 PM Subject: Re[2]: [PHP] split array in 2 halfs Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[3]: [PHP] split array in 2 halfs
$smallarray1=array_slice($bigarray,0,3); $smallarray2=array_slice($bigarray,3,3); On Wed, 31 Oct 2001 23:25:55 -0800, Daniel Harik wrote: Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- Mark, [EMAIL PROTECTED] on 10/31/2001 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A way to simulate modem speeds?
On Wed, 2001-10-31 at 10:23, Michael Hall wrote: I'm looking for a way to clamp down a network machine (we're on a T1) to modem speeds (28 to 52 K) for testing purposes. Is there software (preferably for Windows) that would do this? Better yet, would this software be free? I've not used it, but you might checkout: http://www.dallaway.com/sloppy/ --Brent www.spek.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
You could also grab the midpoint of the array: $count = round(count($array), 0); then populate your new arrays by using a foreach loop: $x = 0; foreach($array as $key = $value) { if ($x =$count) { $array1[] = $value; } else { $array2[] = $value; } $x++; } Daniel Harik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
You may find this helpful: $arr = array('a','b','c','d','e'); $second_half = array_splice($arr,floor(sizeof($arr)/2)); print_r($arr); // Array ( [0] = a [1] = b ) print_r($second_half); // Array ( [0] = c [1] = d [2] = e ) In the above, $second_half will be one larger then $arr if the number of elements is odd, otherwise they'll be equally sized halves. Using ceil() as opposed to floor() will make $second_half the smaller of the two. Regards, Philip Olson On Wed, 31 Oct 2001, Daniel Harik wrote: Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re[2]: [PHP] split array in 2 halfs
Correction: $count = count($array); $count = $count/2; $count = round($count,0); Liz Fulghum [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You could also grab the midpoint of the array: $count = round(count($array), 0); then populate your new arrays by using a foreach loop: $x = 0; foreach($array as $key = $value) { if ($x =$count) { $array1[] = $value; } else { $array2[] = $value; } $x++; } Daniel Harik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] basic mcrypt questions
I'm working on my first shopping cart web application (done in php) and have started to look into ways to secure it. After reading up a little bit on mcrypt I have some basic questions about it: 1. If I use mcrypt to encrypt user input before storing it in a database, do I have to use it in conjunction with a utility like PGP, or is mcrypt a self-contained encryption and decryption tool. 2. One article I read almost immediately started talking about public and private keys, another did not mention them at all. Does mcrypt require the use of 3rd party keys? 3. If php scripts are used to decrypt data, where are these scripts kept? Thanks, SW -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parsing a string
Mike Eheler [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Beyond that, why not keep it conforming to HTML, and use an IMG tag, for example: This is some text img src=name.jpg alt=Alt Text processat=server. That way if you need to view the page as-is in a browser or whatever, it'd still look fine.. go grab yourself some good free html parser code, and analyse the options. If processat=server then do your thing, and re-write the img tag. :) I think I want something more simple. The idea is to let the machine do all of the dirty work, not just in looking up the image size, but also formatting the output. For example, I'm already using functions like: emitlink(http://www.microsoft.com,Microsoft;); so I will have a similar function: emitimg(bird.gif,this is a bird); that will do all of the IMG stuff, not just some of it. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] parsing a string
Dl Neil [EMAIL PROTECTED] wrote in message 042101c157f6$4cd9fb90$c014100a@jrbrown">news:042101c157f6$4cd9fb90$c014100a@jrbrown... Two inter-dependent problems: 1 a means of identifying a cipher within the text 2 a means of replacing the cipher with HTML code Succinctly stated. space+bird.gifthis is a bird This is a possibility, but it requires a bit trickier code to recognize split it. I was hoping for something easier to identify and parse, so maybe: #bird.gif|some text# That should be easy enough to find explode() -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: parsing a string
Yz James [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey John, something like this might work: ? $string = This is a string with an embedded image [bird.gif,this is a bird]; $string = preg_replace(/\[(.*?\.)(gif|jpg),(.*?)\]/i, img src=\\\1\\2\ alt=\\\3\, $string); echo $string; ? Great!. I love it when I see stuff like this written by someone who knows regex better than I. The ability to insert the pieces that are recognized/extracted via \1, \2 is pretty cool. Thanks. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: Re[3]: [PHP] split array in 2 halfs
More generally, this should work: $smallarray1=array_slice($bigarray, 0, sizeof($bigarray) / 2); $smallarray2=array_slice($bigarray, sizeof($bigarray) / 2); I haven't tested it though... -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 31, 2001 4:32 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re[3]: [PHP] split array in 2 halfs $smallarray1=array_slice($bigarray,0,3); $smallarray2=array_slice($bigarray,3,3); On Wed, 31 Oct 2001 23:25:55 -0800, Daniel Harik wrote: Want to split it in half 1 Big array: 1 2 3 4 5 6 Want to make 1 Small array: 1 2 3 2 Small array: 4 5 6 Thank You -- Mark, [EMAIL PROTECTED] on 10/31/2001 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how do I use and lt with eval()?
I'm not having an easy time understanding the discussion in the doc for eval(). I want to read this string from a file: xxx ?php somefunc(yyy,3); ? zzz and then run it. I tried this code: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } $string='xxx ?php somefunc(yyy,3); ? zzz'; eval($string); ? but I get Parse error: parse error in eval.php(11) : eval()'d code on line 1 Do I have to use lt; and gt; in place of ? I tried several combinations, but I still get the same error. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: how do I use and lt with eval()?
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (John A. Grant) wrote: I tried this code: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } $string='xxx ?php somefunc(yyy,3); ? zzz'; eval($string); ? but I get Parse error: parse error in eval.php(11) : eval()'d code on line 1 eval() treats the passed argument as if it were inline PHP code. You're effectively doing this: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } xxx ?php somefunc(yyy,3); ? zzz ? So the extra set of PHP tags is a problem, and xxx and zzz must both be valid code (i.e. terminating statements with semi-colons, concatenating strings with a period...) I'm guessing what you really want is: eval('somefunc(yyy,3);') In that case, you could use a regex to extract the portion of your text string that's enclosed by PHP tags. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] WindowsXP, PHP4 and MS SQL functions
Hello, I am trying to get php4 to use mssql function under WindowsXP. I don't know if this is a problem or not. I uncommented the extensions line in the php.ini file that says: extension=php_mssql.dll But when I try to use mssql_connect it says call to undifiened function. Does anyone know anything I should try to resolve this? Thanks Brandon
[PHP] MSSQL functions
Hello, Since I am not able to get msssql functions running. Can someone please give me instructions on exactly what I need to do to get the functions werking? Thanks Brandon
[PHP] Re: Where are lists of PHP's predefined constants and keywords?
In article 01A4B59FD1EBD311838100A0C98BE0D9AD5D91@chef, [EMAIL PROTECTED] (Kirk Johnson) wrote: The manual at http://www.php.net/manual/en/language.types.array.php mentions that empty and default are special keywords. Does anyone know of any lists of PHP's predefined constants and keywords? I'm not having any luck finding them. The chapter on variables has a page devoted to predefined vars; the predefined constants list is likewise under the constants chapter. I suspect that the caution on the arrays page may refer to the fact that empty is a function name and the default keyword is used by the switch control structure. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php filling apache error log with copies of the server environment
Hey - My php installation is filling my apache error log with copies of the piece of the environment that PHP knows as HTTP_SERVER_VARS. It seems to be caused by imap functions. ? phpinfo(); ? doesnt do it... but if i do ? $mb = imap_open({imap.blah.edu:143}INBOX, 'user', 'passwd'); ? I get a bunch of: REDIRECT_nokeepalive=1 REDIRECT_STATUS=200 REDIRECT_URL=/test.php REMOTE_ADDR=x.x.x.x REMOTE_HOST=mojojojo.blah.edu etc... in the apache error log. I'm using PHP 4.0.6 (CGI), Apache 1.3.20, Solaris (SPARC) 2.6 Is there anyway to stop this? I've tried turning off error loggin in my php.ini file, to no avail. thanks Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Where are lists of PHP's predefined constants and keywords?
Don't forget true, false, and null. :) A good place to look might be to grab a syntax definition file for some sort of popular editor (like textpad), and just go through it. Not the best way, for sure. The best place to look easily is http://www.php.net/manual/en/ Mike Johnson, Kirk wrote: The manual at http://www.php.net/manual/en/language.types.array.php mentions that empty and default are special keywords. Does anyone know of any lists of PHP's predefined constants and keywords? I'm not having any luck finding them. TIA Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Need Mortgage Leads?
Are you a Mortgage Office in need of leads? We receive refinance requests direct from borrowers throughout the United States daily! Whether your office services one state or multiple states, our leads will meet your needs! A few features of our program: *Leads are exclusive---sold ONLY to you! *Leads contain 30 pieces of information regarding each borrower! *Leads delivered within 24-48 hours from borrower's original request! *Leads are sent daily--depending on your needs! *And best of allpricing to meet your marketing budget! Dont forget to ask about our volume discount! TO ORDER YOUR LEADS, CALL (888) 725-9246! * Since you have received this message you have either responded to one of our offers in the past or your address has been registered with us. If you wish to be removed please reply mailto:[EMAIL PROTECTED]?subject=remove * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] WindowsXP, PHP4 and MS SQL functions
Hello! Have you specified path to extensions? In my case: extension_dir = c:/apps/php/extensions/ Best regards, Andrew Kirilenko. -Original Message- From: Brandon Orther [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 1:41 AM To: PHP User Group Subject: [PHP] WindowsXP, PHP4 and MS SQL functions Hello, I am trying to get php4 to use mssql function under WindowsXP. I don't know if this is a problem or not. I uncommented the extensions line in the php.ini file that says: extension=php_mssql.dll But when I try to use mssql_connect it says call to undifiened function. Does anyone know anything I should try to resolve this? Thanks Brandon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]