 |
| Recent blog posts: | |
 |
| They have birthday today: | |
 |
| Forums: | | |
 |
| Discuss: | |
 |
| Recent forum topics: | |
 |
| Recent forum comments: | |
 |
| Модератор: | |
 |
Tuesday, 23 January 2007
|
| [PHP-DEV] PHP 4.4.0 5.2.0 and FreeTds 0.64 login trouble Un Named 19:49:31 |
| | Hello, I have a Linux server that's running PHP 4.4.0 and 5.2.0 along with FreeTDS 0.64 I am trying to connect to a MS SQL Server 2005 with PHP and I encounter a problem. Here is the php script content: $dbhost = "192.168.55.3:1433"; $dbuser = "sa"; $dbpass = "samepassword"; $db = mssql_connect($dbhost,$dbuser,$dbpassword) or die("Unable to connect to server"); Output of runnign script: <br /> <b>Warning</b>: mssql_connect() [<a href='function.mssql-connect'>function.mssql-connect</a>]: message: Login failed for user 'sa'. (severity 14) in <b>/bin/pipe.php</b> on line <b>7</b><br /> <br /> <b>Warning</b>: mssql_connect() [<a href='function.mssql-connect'>function.mssql-connect</a>]: Unable to connect to server: 192.168.55.3:1433 in <b>/bin/pipe.php</b> on line <b>7</b><br /> Anyway if I am logging using tsql it works: [root@softlink bin]# tsql -C Compile-time settings (established with the "configure" script): Version: freetds v0.64 MS db-lib source compatibility: yes Sybase binary compatibility: unknown Thread safety: yes iconv library: yes TDS version: 8.0 iODBC: no unixodbc: no [root@softlink bin]# tsql -S 192.168.55.3 -U sa locale is "en_US.UTF-8" locale charset is "UTF-8" Password:1>
The freetds.log files are different in each case: [working - running by tsql] .... 02:30:59.504763 1052 (iconv.c:361):iconv to convert client-side data to the "UTF-8" character set 02:30:59.504906 1052 (iconv.c:514):tds_iconv_info_init: converting "UTF-8"->"UCS-2LE" 02:30:59.505100 1052 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:30:59.505193 1052 (net.c:168):Connecting to 192.168.55.3 port 1433. 02:30:59.505951 1052 (write.c:134):tds_put_string converting 8 bytes of "softlink" 02:30:59.506271 1052 (write.c:162):tds_put_string wrote 16 bytes 02:30:59.506321 1052 (write.c:134):tds_put_string converting 2 bytes of "sa" 02:30:59.506360 1052 (write.c:162):tds_put_string wrote 4 bytes 02:30:59.506398 1052 (write.c:134):tds_put_string converting 4 bytes of "TSQL" 02:30:59.506434 1052 (write.c:162):tds_put_string wrote 8 bytes 02:30:59.506467 1052 (write.c:134):tds_put_string converting 12 bytes of "192.168.55.3" 02:30:59.506503 1052 (write.c:162):tds_put_string wrote 24 bytes 02:30:59.506536 1052 (write.c:134):tds_put_string converting 11 bytes of "TDS-Library" 02:30:59.506571 1052 (write.c:162):tds_put_string wrote 22 bytes 02:30:59.506604 1052 (write.c:134):tds_put_string converting 10 bytes of "us_english" 02:30:59.506640 1052 (write.c:162):tds_put_string wrote 20 bytes 02:30:59.506673 1052 (write.c:162):tds_put_string wrote 0 bytes 02:30:59.506849 1052 (token.c:310):tds_process_login_tokens() 02:30:59.508366 1052 (net.c:446):Received header 0000 04 01 01 95 00 33 01 00- |.....3..|
[non working - running by php] .... 02:31:37.444823 1059 (iconv.c:361):iconv to convert client-side data to the "ISO-8859-1" character set 02:31:37.444969 1059 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:31:37.445067 1059 (iconv.c:514):tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" 02:31:37.445145 1059 (net.c:168):Connecting to 192.168.55.3 port 1433. 02:31:37.446876 1059 (write.c:134):tds_put_string converting 8 bytes of "softlink" 02:31:37.447186 1059 (write.c:162):tds_put_string wrote 16 bytes 02:31:37.447269 1059 (write.c:134):tds_put_string converting 2 bytes of "sa" 02:31:37.447311 1059 (write.c:162):tds_put_string wrote 4 bytes 02:31:37.447349 1059 (write.c:134):tds_put_string converting 7 bytes of "PHP 4.0" 02:31:37.447385 1059 (write.c:162):tds_put_string wrote 14 bytes 02:31:37.447418 1059 (write.c:134):tds_put_string converting 12 bytes of "192.168.55.3" 02:31:37.447453 1059 (write.c:162):tds_put_string wrote 24 bytes 02:31:37.447485 1059 (write.c:134):tds_put_string converting 10 bytes of "DB-Library" 02:31:37.447520 1059 (write.c:162):tds_put_string wrote 20 bytes 02:31:37.447553 1059 (write.c:134):tds_put_string converting 10 bytes of "us_english" 02:31:37.447587 1059 (write.c:162):tds_put_string wrote 20 bytes 02:31:37.447620 1059 (write.c:162):tds_put_string wrote 0 bytes 02:31:37.447814 1059 (token.c:310):tds_process_login_tokens() 02:31:37.449340 1059 (net.c:446):Received header 0000 04 01 00 74 00 33 01 00- |...t.3..|
The main difference here appears to be the charset that is set as UTF-8 in TSQL query regardless of freetds.conf that I specified in cmd line. PHP appears to use ISO-8859-1, is this the reason of failure and if so is there a fix? Or it is a library issue?
Thank you for your time, any help is appreciated.
Jim
--------------------------------- Get your own web address. Have a HUGE year through Yahoo! Small Business. --------------------------------- Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers. |
| | 1 answer | Add comment |
|
| Connection pooling Manoj Nahar 19:48:22 |
| | Hi there,
Is connection pooling possible in PHP as in JSP???
Manoj Nahar
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 6 answers | Add comment |
|
| PDF Natividad Castro 19:12:38 |
| | Hi to all, How can I display info in a PDF? All I need is to be able to read from a table and display fields into a PDF. Before, I had my DB in Microsoft Access, so I bounded all the fields in a report and then I converted it into PDF document. But now that we switch to MySQL, I don't know how to generate those PDFs. I've been reading about FDF, but I still I little bit confused.
If someone has any idea, please let me know
Thanks in advanced Nato
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 40 answers | Add comment |
|
| [PHP-DEV] C++ in non-threaded PHP Caroline Maynard 18:07:00 |
| | I hit some problems compiling a C++ extension in a non-threaded environment, because of some missing extern "C" declarations. Looks like this was previously fixed for threaded mode only. Please would someone with karma apply the following patch?
Index: zend_globals_macros.h =================================================================== RCS file: /repository/ZendEngine2/zend_globals_macros.h,v retrieving revision 1.22.2.1.2.2 diff -u -r1.22.2.1.2.2 zend_globals_macros.h --- zend_globals_macros.h18 Jul 2006 09:06:33 -00001.22.2.1.2.2 +++ zend_globals_macros.h23 Jan 2007 14:57:45 -0000 @@ -34,8 +34,10 @@ END_EXTERN_C() #else # define CG(v) (compiler_globals.v) +BEGIN_EXTERN_C() extern ZEND_API struct _zend_compiler_globals compiler_globals; int zendparse(void); +END_EXTERN_C() #endif
@@ -44,7 +46,9 @@ # define EG(v) TSRMG(executor_globals_id, zend_executor_globals *, v) #else # define EG(v) (executor_globals.v) +BEGIN_EXTERN_C() extern ZEND_API zend_executor_globals executor_globals; +END_EXTERN_C() #endif
/* Language Scanner */
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| Work order issues Rich 17:47:46 |
| |
I can't attach a document to a work order. I keep getting errors. I'm getting a no such file or directory error.Sent from the phpGroupWare forums @ http://forums.phpGroupWare.org
|
| | 1 answer | Add comment |
|
| [PHP-DEV] Diagnosing bug David Mytton 16:51:59 |
| | Hi,
I have been trying to track down a potential bug in my code and after testing everything I could, I believe it is a bug in PHP. The problem is that it's quite a complex issue and only occurs when mod_rewrite is being used on Linux (it works fine on my Windows PC I'm developing on).
I have done all the usual things like disable all 3rd party extensions and use the latest PHP snapshot (PHP 5) but the bug still comes up. I can work around it but I would prefer to submit a bug report so it can be looked and hopefully fixed. This is where the problem is.
I have been discussing the problem on php.general - http://news.php.net/php.general/247543 - and my difficulty is producing test code that I can use to submit a bug report. I have attempted to "extract" the code out of the applicatiom but when I do that, the code works fine. I know that this suggests that it is a bug in my code and not PHP at all, but the nature of the bug, and the fact that it only occurs with mod_rewrite on Linux, I believe suggests otherwise.
So I'm asking if someone could take a look at my post to php.general and possibly give me some advice for writing up a test case for this so I can report it properly?
Thanks,
David Mytton
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| Function returning but continues execution David Mytton 13:00:14 |
| | Hi,
I have come across what appears to be a bug in PHP, but one that I am having difficulty writing test code for. Also, the bug only happens on a Linux build of PHP - the code is working as expected on Windows. This is on both PHP 5.2.0 and the very latest snapshots:
Windows: 5.2.1RC4-dev Jan 19 2007 16:16:57 Linux: PHP Version 5.2.1RC4-dev Jan 22 2007 11:54:28 (php5.2-200701221130.tar.gz)
The configure line is:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-curl' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr' '--with-mysql' '--with-openssl' '--with-pdo-mysql' '--with-pear' '--with-png-dir=/usr' '--with-zlib' '--enable-calendar' '--enable-exif' '--enable-gd-native-ttf' '--enable-pdo' '--enable-soap' '--enable-sockets'
and no 3rd party extensions are enabled.
The code that is causing the problem exists within a class in a function called approve_friend. This is called by a "public" page with a parameter provided in GET being passed to the function approve_friend:
$username = filter_input(INPUT_GET, 'username', FILTER_SANITIZE_STRING); if (!empty($username)) { if ($username != $_SESSION['user']['username']) { if ($core->user->add_friend($username)) { echo 1; } else { echo 2; } } }
There is code in place of echo 1 and echo 2 but it's not relevant. Here, the code checks to make sure the username submitted is the not the same as the currently logged in use. If not, it will execute the $core->user->add_friend function.
add_friend runs through as follows:
1. Makes a call to $this->get_user where it gets data for the username $username provided when calling the function. It returns an array.
$friend = $this->get_user(1, NULL, $username);
2. Grabs some data from the session about the currently logged in user
$user['name'] = filter_var($_SESSION['user']['name'], FILTER_SANITIZE_STRING); $user['user_id'] = filter_var($_SESSION['user']['user_id'], FILTER_SANITIZE_NUMBER_INT); $user['username'] = filter_var($_SESSION['user']['username'], FILTER_SANITIZE_STRING); $user['friend_count'] = filter_var($_SESSION['user']['friend_count'], FILTER_SANITIZE_NUMBER_INT);
3. Checks to make sure $friend has a value
if (empty($friend)) { return false; }
4. Checks to make sure that the friend being added is not already added.
if (!empty($_SESSION['user']['friends'])) { if (in_array($friend['user_id'], $_SESSION['user']['friends'])) { return false; } }
This is the point at which there is a problem. If I add this code before #4:
print_r($_SESSION['user']['friends']); echo $friend['user_id']; exit;
Then I get the following output:
Array ( [0] => 3 ) 3
i.e. $_SESSION['user']['friends'] is an array with the key 0 and the value 3 and $friend['user_id'] has a value of 3. Therefore, the in_array() check above will return true and the function will return false. No further code in the function should execute. This is what happens on Windows - 2 is output to the page because the add_friend function has returned false.
Now, after #4, there is more code. This code is only supposed to execute if the friend doesn't already exist - it adds the friend, increments the friend count and sends an e-mail.
// Insert into friends $core->database->exec('INSERT INTO users_friends SET user_id = "'.$user['user_id'].'", user_friend_id = "'.$friend['user_id'].'", status = 1'); $core->database->exec('INSERT INTO users_friends SET user_id = "'.$friend['user_id'].'", user_friend_id = "'.$user['user_id'].'"');
// Update friend count $core->database->exec('UPDATE users_insiders SET friend_count = "'.++$user['friend_count'].'" WHERE user_id = "'.$user['user_id'].'"');
// E-mail sending code using phpmailer
return true;
On my Linux server, the function returns false at step #4 as it should do, but it appears to continue executing. The friend count is incremented and the page execution slows temporarily whilst the mail is being sent (not a problem in testing). However, no e-mail actually gets sent.
The key is that the function is returning false but it continues to execute! If I stick in an exit; after the in_array() check at point #4, this doesn't happen. There are no other places where this function is called, and it is only called once.
Strangely, if I force the values of the 2 variables before the in_array() check:
$_SESSION['user']['friends'] = array(0 => 3); $friend['user_id'] = 3;
it reacts as expected - the function returns false and no further code is executed.
Anyone have any suggestions?
Regards,
David Mytton
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 26 answers | Add comment |
|
| Help With Inventory Brandon Bearden 11:18:51 |
| | Can anyone help me figure out how to solve my inventory listing problem?
I am using php_5 and mysql_5.0 w/apache on fbsd.
I need to figure out a way to make a subtitle for every category (genre) in the inventory so when I list the entire inventory on a sheet (at client's request), it is organized by category (genre) and each category (genre) has a title line above it. So the there is not just one big list rather a neat list with titles for each category THEN all the rows in that category etc. I can't figure out the loop to make the titles.
I have them sorted as you can by genre, the list is formatted fine There are alternating colors on the rows to make it read easier. I just want to keep from having to make a statement for EACH genre. I will eventually make the genre list dynamic too, so I need to figure out how to dynamically generate this inventory list.
This is the output I have now:
DVD ID TITLE GENRE 1 GENRE 2 GENRE 3 ACT QTY BCK HLD INC OG USR OUT DATE OUT USR IN DATE IN USR CY 20860003 Movie name action 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0 20860020 Move Name COMEDY 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0 20860006 Movie name COMEDY 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0
What I WANT to see is: I will fix the background colors, I just want to see the "GENRE: ACTION - 1 TITLES and GENRE: COMEDY - 2 TITLES"
DVD ID TITLE GENRE 1 GENRE 2 GENRE 3 ACT QTY BCK HLD INC OG USR OUT DATE OUT USR IN DATE IN USR CY
GENRE: ACTION - 1 TITLES 20860003 Movie name ACTION 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0
GENRE: COMEDY - 2 TITLES 20860023 Movie name COMEDY 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0 20860006 Movie name COMEDY 1 1 0 10000000 0000-00-00 00:00:00 0000-00-00 00:00:00 0
This is the code: 1. function invlistONE(){ 2. dbconnect('connect'); 3. $invlist = mysql_query("SELECT * FROM sp_dvd ORDER BY dvdGenre"); 4. 5. 6. ?> 7. <table cellspacing="0" style="font-size:8pt;> 8. <tr> 9. <div style="font-size:8pt"> 10. <td align="left" class="body"><b>DVD ID</b></td> 11. <td align="left" width="225"><b>TITLE</b></td> 12. <td align="left" class="body" width="75"><b>GENRE 1</b></td> 13. <td align="left" width="75"><b>GENRE 2</b></td> 14. <td align="left" class="body" width="75"><b>GENRE 3</b></td> 15. <td align="left" width="10"><b>ACT</b></td> 16. <td align="left" class="body" width="10"><b>QTY</b></td> 17. <td align="left" width="10"><b>BCK</b></td> 18. <td align="left" class="body" width="10"><b>HLD</b></td> 19. <td align="left" width="10"><b>INC</b></td> 20. <td align="left" class="body" width="50"><b>OG USR</b></td> 21. <td align="left"><b>OUT DATE</b></td> 22. <td align="left" class="body" width="55"><b>OUT USR</b></td> 23. <td align="left"><b>IN DATE</b></td> 24. <td align="left" class="body" width="50"><b>IN USR</b></td> 25. <td align="left" width=\"10\"><b>CY</b></td> 26. </div> 27. </tr> 28. <? 29. 30. $count = 0; 31. while($row = mysql_fetch_array($invlist)){ 32. 33. $dvdId = $row['dvdId']; 34. $dvdGenre = $row['dvdGenre']; 35. $dvdGenre2 = $row['dvdGenre2']; 36. $dvdGenre3 = $row['dvdGenre3']; 37. $dvdTitle = $row['dvdTitle']; 38. $dvdOnHand = $row['dvdOnHand']; 39. $dvdOnHand = $row['dvdOnHand']; 40. 41. $active = $row['dvdActive']; 42. $back = $row['backordered']; 43. $hold = $row['dvdHoldRequests']; 44. $incoming = $row['incomingInventory']; 45. 46. $ogUserId = $row['ogUserId']; 47. $outDate = $row['outDate']; 48. $outUserId = $row['outUserId']; 49. $inDate = $row['inDate']; 50. $inUserId = $row['inUserId']; 51. $cycles = $row['cycles']; 52. $dvdLastUpdate = $row['dvdLastUpdate']; 53. $dvdLastAdminUpdate = $row['dvdLastAdminUpdate']; 54. 55. if ( $count == 1 ) { echo ("<tr bgcolor=\"#c1c1c1\">"); } 56. else { echo ("<tr>");} 57. 58. echo ("<div >"); 59. echo ("<td class=\"body\" align=\"left\"> $dvdId </td>"); 60. echo ("<td align=\"left\" width=\"225\">$dvdTitle</td>"); 61. echo ("<td class=\"body\" align=\"left\" width=\"75\">$dvdGenre</td>"); 62. echo ("<td align=\"left\" width=\"75\">$dvdGenre2</td>"); 63. echo ("<td class=\"body\" align=\"left\" width=\"75\">$dvdGenre3</td>"); 64. echo ("<td align=\"left\" width=\"10\">$active</td>"); 65. echo ("<td class=\"body\" align=\"left\" width=\"10\">$dvdOnHand</td>"); 66. echo ("<td align=\"left\" width=\"10\">$back</td>"); 67. echo ("<td class=\"body\" align=\"left\" width=\"10\">$hold</td>"); 68. echo ("<td align=\"left\" width=\"10\">$incoming</td>"); 69. echo ("<td class=\"body\" align=\"left\" width=\"50\">$ogUserId</td>"); 70. echo ("<td align=\"left\" width=\"75\">$outDate</td>"); 71. echo ("<td class=\"body\" align=\"left\" width=\"55\">$outUserId</td>"); 72. echo ("<td align=\"left\" width=\"75\">$inDate</td>"); 73. echo ("<td class=\"body\" align=\"left\" width=\"50\">$inUserId</td>"); 74. echo ("<td align=\"left\" width=\"10\">$cycles</td>"); 75. echo ("</div>"); 76. echo ("</tr>"); 77. 78. $count++; 79. if ( $count == 2 ) { $count = 0; } 80. } 81. ?></table><? 82. } HERE IS THE MYSQL TABLE:
CREATE TABLE sp_dvd( dvdId int(8) UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE PRIMARY KEY, dvdActive smallint(1) NOT NULL, backordered smallint(1) NOT NULL, dvdHoldRequests int(4), incomingInventory int(3), dvdTitle varchar(50) NOT NULL UNIQUE, dvdDescription text(500), dvdActors varchar(200), dvdGenre varchar(35), dvdGenre2 varchar(35), dvdGenre3 varchar(35), dvdYear int(4), dvdLength int(4), dvdCover varchar(100), dvdCover2 varchar(100), dvdOnHand int(3), firstInventoryDate TIMESTAMP, ogUserId int(8), outDate TIMESTAMP, outUserId int(8), inDate TIMESTAMP, inUserId int(8), cycles int(4), dvdLastUpdate TIMESTAMP, dvdLastAdminUpdate int(8), rand varchar(150), exchangeId int(8), FULLTEXT (dvdTitle,dvdActors) )TYPE=MyISAM AUTO_INCREMENT=20860000;
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 5 answers | Add comment |
|
| Php coding help - Newbie question Ramdas 09:53:07 |
| | Hi Group,
A very newbie question. Might be discussed earlier, please forgive.
I am having a site in PHP ( not very great design ) which I need to convert/modify to use functions. Such the code for connecting / binding to Ldap is not repeated & scripts are more readable.
The site deals with modifying / adding / deleting entries in a LDAP dir.
In each of the pages following is done:
<?php
require 'validate.php' ;// validate.php checks if the user is loged in
$connect = ldap_connect(ldapserver); if ($connect) {
bind ... do the things....
}else { echo erro..}
?>
Also please advice what is a correct method of checking the user's session. Currenlty I use a "HTTP_SESSION_VARS" variable to store the user's login & passwd . Each time the user hits the page these vars are checked with the existing values in the LDAP (this is done by validate.php).
Please suggest me some good starting point where I can start a fresh with more compact/cleaner Code.
Many thanx in advance.
Regards Ram
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 6 answers | Add comment |
|
| [PHP-DEV] PHP Object-Caching and Reference Counting Lars Schultz 00:42:53 |
| | Hello there...
I am making my debut appearance here hoping that I am not giving offense to anyones well honed php-instincts or programming practices with my feature-request. This is what it comes down to, I guess. A Feature Request for some meta-info on the instantiated PHP-Objects. Specifically I want to know how many references are currently pointing to any one object. Since PHP's Memory Management is based on Reference-Counting this information should already be available "somewhere". Not knowing any php-source-code internals, I can't even guess at the problems which prohibit the implementation of such a feature. Nevertheless I'd like to point out an advantage to the community if the reference-count were available.
I have been working on a large project for 6 years now and I got to a point where I'd like to cache certain objects singleton-like. To better explain my problem I provide this small example which surely is error-prone but should get the basic idea across.
<? class MyObject { private static $instances = array(); protected $id; private function __constructor($id){ $this->id = $id; } /** * Returns an instance of the class. * If no object was instantiated with the given $id before, * it will instantiate a new object which will be associated with the given $id. * * It will also check the current memory-usage and if its used up for more than * 80% it will call the collect() method. * * @param int $id * @return MyObject */ public static function getInstance($id){ if ( !isset(self::$instances[$id]) ) { //check the used up memory wether to collect unused objects or not if ( memory_get_usage() > ini_get('memory limit')*0.8 ) self::collect(); self::$instances[$id] = new MyObject($id); } return self::$instances[$id]; } /** * Removes any object from the cache-list which is not referenced anymore. * (safe for the list and the local-reference to it) */ public static function collect(){ foreach( self::$instances as $id => $instance ) { if ( reference_count($instance) < 3 ) unset(self::$instances[$id]); } } } ?>
As you can see I boldly used the function reference_count(Object) even though it doesn't exist. This is exactly what I'd need to allow my concept to work. I keep thinking of any other solutions, but up until now, I didn't find any better solution for this problem. Of course I can always ignore the memory usage and hope that it wont hit the limit...but hoping is a rather ethereal and mystic idea which doesn't go well with my preferred down-to-earth 1 plus 1 equals 2 programming.
I know that a lot of you may say: Why do need to do that?...and I'd have to think for 3 days and then write for 4 days and would give up. It seems like a nice solution to me and if any of you have an idea as to how I could implement this differently, please feel free to point it out to me.
Thanks for reading this far. Lars
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 11 answers | Add comment |
|
| Network Time Protocol Ron Piggott 00:42:53 |
| | Where could I get instructions to set up a network time protocol through my web site hosting server? Ron
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| ouput the contents of a folder for download Ross 00:32:42 |
| | I want to output the file contents of a folder to a php page and provide a link for them to be downloaded.
This is what I have so far but I cannot get a filename or get it to iterate through all the files in a folder.
<?php
$dir = "mydirectory";
// Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) {
echo filetype($file) . "\n"; echo filesize($file); } closedir($dh); } } ?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
Monday, 22 January 2007
|
| [PHP-DEV] GCC / Rounding Problem Christian Schneider 22:59:58 |
| | I tracked down the failure of test ext/standard/tests/math/bug24142.phpt when I tried PHP 4.4.5RC1 and found out the following: The brokenness test in the configure script, namely
#include <math.h> int main() { return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5; }
didn't work properly for me. I changed it to the following to detect the proper PHP_ROUND_FUZZ (reducing it further changed its behaviour):
#include <math.h>
int main(int argc, char **argv) { double value = 0.045; value = floor(value * 100.0 + 0.5) / 100.0; return value != 0.05; }
Reproduction sequence: cschneid@abflex:~/ $ cc -lm -O0 -Wall -o t t.c cschneid@abflex:~/ $ ./t && echo OK OK cschneid@abflex:~/ $ cc -lm -O2 -Wall -o t t.c cschneid@abflex:~/ $ ./t && echo OK cschneid@abflex:~/ $
System information: SUSE LINUX 10.0 (i586) gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
The difference doesn't exist (i.e. I guess the gcc problem was fixed) in SUSE LINUX 10.1 / gcc version 4.1.0 (SUSE Linux).
Do you think the configure script should be changed? I'm not sure if my version of the test works on the system where the original test was developed.
Regards, - Chris
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 2 answer | Add comment |
|
| Embeded image on mail() Bagus Nugroho 22:49:11 |
| | Hi All, It was possible to send embeded image on mail() function. Curently, I'm using linked image to send image on mail. Thanks in advance bn
|
| | 3 answer | Add comment |
|
| selecting random rows Guest 20:00:20 |
| | I'm sure this is pretty simple, but I'm having a hard time finding the answer:
How do you select two random rows in a mysql table?
Thanks, Kent |
| | 9 answers | Add comment |
|
| [PHP-DEV] COM extension defects: defect 39930 Andy Wharmby 19:46:03 |
| | Hi Internals As promised back in December I have now found some time to look at the COM defects to help reduce the backlog.
I have now investigated the first of these; http://bugs.php.net/bug.php?id=39930 and have updated the defect with my findings. In this case I believe the defect is in Word rather than PHP or the COM extension. Can someone with enough karma please take a look at my comments and if they are OK return the defect as "bogus".
Many thanks.
Regards Andy
Andy Wharmby IBM United Kingdom Limited Winchester, England SO21 2JN E-mail: andy_wharmby@uk.ibm.com
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| wierd slash Don 19:41:12 |
| | I have a line of code that validates form info for some POST vars, but not others.
if (!ereg("^[A-Za-z' -]{1,50}$",$_POST[$field]) )
when I put O'Toole in the form to test, my script kicks the page back (I thought this entry would be OK)
but moreover, when it redisplays the form and populates the new form with the entries previously entered, O'Toole becomes O\
when I put similar entries into fields that are not run through this line, they go to the DB as typed.
Any advice?
Thanks again
Don
|
| | 3 answer | Add comment |
|
| os php scheduler? Blackwater Dev 18:18:37 |
| | Does anyone have recommendations for an open source php based, 'lightweight', scheduling app? I just want something clean that I can use to schedule trainings within our company. I need to be able to put in details for each training and then see a synopsis on a calender. Just a basic scheduler but clean and useful.
Thanks!
|
| | 1 answer | Add comment |
|
| socket_write buffer problem Richard Luckhurst 16:09:35 |
| | Hi List
I am working with an application that has to run as a socket listener. It receives a string from another application on a certain socket and then does some processing and then passes the result back to the client application via the socket. Here is the listener code I am using
while(true) { $client = socket_accept($socket); $arev_data = socket_read($client, 1024); $yresponse = build_XML_request($arev_data); socket_write($client, $yresponse); socket_close($client); } socket_close($socket);
The application is working fine but I have just noticed that when the $yresponse variable is larger than 1024 bytes the string returned to the client is truncated. I just had a look at the php manual for socket_write and it mentions that truncating the data at the buffer size can be a problem. The manual does not offer any possible solutions though. I am stumped here as the value for $yresponse will often be larger than 1024 bytes and its length is quite variable.
Does anyone have any suggestions on how I can make sure the entire contents of $yresponse are passed back to the client?
Regards, Richard Luckhurst Product Development Exodus Systems - Sydney, Australia.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 8 answers | Add comment |
|
| [PHP-DEV] Possible Upload Bug Sergiu Voicu 15:26:35 |
| | Hello
I've discovered something that seems to be a bug. Not sure which one is the cause (the PHP processor or the browser), but here it is the description.
I've created a form with enctype=multipart/form-data and of course a file input field.
Now everything seem to work fine until I try to upload a certain PDF document, when the script that processes the upload shows me an empty $_FILES array. I have tried uploading other PDF files and without anything weird happening.
I am not very sure that I am allowed to attach files when using this mailing list, so if someone can take a look at this problem I will send him/her this specific file.
Other details related to the system where I have tested Server: Apache/2.0.55 PHP: PHP 5.1.6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/0000000000 Firefox/2.0.0.1 (Ubuntu-edgy)
Sergiu
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| Newbie - help with a foreach Pub 14:59:40 |
| | Could someone please help me figure out how to hide the info in the right bottom part of my page unless the corresponding link is selected in the top left.
The company names and job types at the top left need to show at all time. But the corresponding picture at the bottom left and the web address/info at the bottom right should appear only when selected.
I have the same query repeating twice once for the top left part and once for the bottom right part because I can't figure out how else to do it!
Thank you.
http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg |
| | 8 answers | Add comment |
|
| Re: Table
'phpgroupware.phpgw_contact_comm_descr' doesn't exist ? Datasurfer 11:47:58 |
| |
I have the same problem/error with the phpgroupware phpgw 0.9.16!
The are a lot of tables automaticle installed, but tables "phpgw_lang", "contact_comm_type", "phpgw_contact_comm_descr" not installed.
I use php 4.4.4, apache 2.0 and mysql 4.1.21.
Any idea/help?Sent from the phpGroupWare forums @ http://forums.phpGroupWare.org
|
| | 3 answer | Add comment |
|
| Date and time DIFF FanneHH 11:47:32 |
| | Hi,
I have this date in timestamp format:
$a= 20040810114155;
I want to add 7 days to this date. How can i do that?
Thanks
----
Home, no matter how far... http://www.home.ro
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 13 answers | Add comment |
|
|