« first day (80 days earlier)      last day (4868 days later) » 

5:27 PM
Anyone home?
@ircmaxell are you there?
 
Hello
how's it going?
 
Hey! Pretty good.. the upgraded security seems to have worked, there was an attempt overnight from an IP address in Saudi Arabia, I guess we're popular..
Quick question - the SALT generator you showed me generates a bunch of special characters and my MySQL table (VARCHAR column) does not seem to like them if I directly update a row..
It will just dump the salt. Any suggestions?
 
Well, you can base64_encode the salt prior to storage (and decode it right before verification)
 
And I am referring to when I update a row in PHPMyAdmin
Okay..
Can you suggest maybe a strong salt that doesn't use special characters? I mean, I seldom if ever make changes directly in phpMyAdmin.. perhaps I should just leave it as is? Getting ready to open the doors to the users again, trying to fix little details
 
Don't make changes in phpMyAdmin....
 
5:35 PM
Okay
 
Or just base64 encode it right out of the box.
(right after it comes out of substr)
 
I mainly make changes in there during testing.. I guess I'll leave it as is for now..
Okay, back to coding I go. I might pop back in here later. Thanks again for everything :)
 
no problem
 
 
1 hour later…
6:49 PM
hey guys quick question about php usage...
@ircmaxell , @NightMICU
 
What's up?
 
I'm wondering if there is some way I can create and test php programs without having to ftp my file to a php server everytime I want to save. I want to make acouple programs in solely php (no html) and I want to test the progress as I develop it....is there a program I can use or something?
 
you're on windows I take it?
 
indeed
but I have ubuntu as a virtual machine if there is a linux program I can use
 
XAMPP or WAMP
either will let you run a web server on your computer
 
6:54 PM
windows?
 
yes
and as far as just executing them (once that's installed), it's as easy as opening a command line and typing php filename.php
 
and it doesn't need a network or anything?
 
no
 
it seems like installing either of those will make my windows machine a webserver so that a user can enter my IP address and get to a webpage....is this true?
 
only from your local machine by default
(localhost only, any access from outside will be denied).
 
6:59 PM
oh ok..
 
7:34 PM
@ircmaxell Do you know how to get the SQL server extension working with PHP on Windows?
 
What have you tried?
 
I downloaded WAMP, installed a copy of "php_mssql.dll" to the ext directory, and edited my php.ini file, but it still doesn't work.
I also restarted Apache.
 
what doesn't work?
do you get an error? is it ignored?
 
The mssql_* functions
"Call to undefined function mssql_connect()"
 
check your phpinfo() to make sure you're editing the correct php.ini
 
7:36 PM
I'm opening it via the WAMP options, but I'll check.
The "Configuration File (php.ini) Path" is "C:\WINDOWS"
Oh wait a sec.
 
;-)
 
I think it's using the php.ini from my old PHP installation.
Not from the WAMP installation.
 
Well, then to quote Jamie Hyneman, Well, there's your problem...
 
Indeed.
 
Did it work? (Or at least seem that way)?
 
7:44 PM
Now it says I'm missing MSVCR71.dll
 
Well, that's one step closer!
 
I also had to copy "ntwdblib.dll" into the PHP installation root.
 
Msvcr71.dll for Microsoft Visual C++ .NET 2003 with the Microsoft .NET Framework 1.1
 
Ugh, I need to install .NET?
Wait, I already have it.
 
Well, you need .NET 1.1, not just any .NET
(or just download a copy of that DLL)
 
7:46 PM
I have .NET 3.0
 
It's standalone, so you shouldn't need to install anything
 
Oh wow there's like 20 copies of the file on my computer.
Most are in the Java directory...wtf??
 
Well, each program includes it, since otherwise managing the different versions would be a nightmare...
(or so Microsoft thinks, other OS's solve the problem well enough for themselves)...
 
Now it says: "Unable to initialize module. Module compiled with module API=20060613. PHP compiled with module API=20090626. These options need to match"
I look php_mssql.dll from a PHP 5.2 installation
Maybe I can't do that
Installing extensions in PHP is annoying
Why can't you just include a dll or something and be done with it
It seems like half the extensions out there require you to recompile PHP.
 
No
you need to use mssql.dll from the same version
 
7:57 PM
It doesn't come with PHP 5.3 though.
 
Well, the only other option is to use ODBC
 
Can you use that with a SQL Server database?
 
That's what it was designed to work with
// Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008
$connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password);
 
I'm just trying to get my company's application to run on my local box.
It already uses the mssql_* functions
 
oh.
 
8:03 PM
Oh well, I'll figure it out eventually
 
Well, then you have two options. Install 5.2.x and the native driver, or write a compat layer where you redefine the mssql functions in terms of odbc functions
 
Oh, yeah, I could just install 5.2
 
There's a reason I stay away from MS
Not to mention that SQLSERVER and PHP don't play nicely in the character set department
 
PHP has trouble supporting other char sets from what I've heard.
 
(Where SQLServer treats everything as UCS2le, and PHP works best with UTF-8).
 
8:07 PM
What's UCS2le? I haven't even heard of that
 
That's the character set that MS uses for everything
It's basically another name for UTF-16, but with little-endian byte order
UTF-16 (16-bit Unicode Transformation Format) is a character encoding for Unicode capable of encoding 1,112,064 numbers (called code points) in the Unicode code space from 0 to 0x10FFFF. It produces a variable-length result of either one or two 16-bit code units per code point. The older UCS-2 (2-byte Universal Character Set) is a similar character encoding that was superseded by UTF-16 in version 2.0 of the Unicode standard in July 1996.. It produces a fixed-length format by simply using the code point as the 16-bit code unit and produces exactly the same result as UTF-16 for 63,488 code ...
 
Ok, thanks, it looks like it's working now.
 
cool
 
I still had to copy MSVCR71.dll in my PHP root though.
Do you know what the best way to do byte manipulation in PHP is?
 
yeah, suspected that
describe what you want to do, "byte manipulation" can mean a few things...
 
8:14 PM
I'm using substr to get the first 8 bytes from binary data.
From what I understand, this works fine as long as mbstring doesn't override the substr function
 
That's exactly right
 
Shouldn't there be a function for doing stuff at the byte-level??
 
But, if you want a catch-all:
$bytes = mb_substr($string, 0, 8, '8bit');
 
Ahh, then I could set the $encoding to be an encoding where 1 char == 1 byte?
Ah ok
 
Exactly (Use 8bit over ascii since 8bit doesn't treat \0 as a terminator)
 
8:17 PM
I don't think we have mbstring installed, so I should be OK using substr
 
Well, you could do a simple conditional:
if (function_exists('mb_substr')) {
    $bytes = mb_substr($string, 0, 8, '8bit');
} else {
    $bytes = substr($string, 0, 8);
}
 
Oh, that's a good idea.
 
which would be a catch-all, since it doesn't depend on anything other than the fuynction being installed...
as far as should it be a native function (working with bit/byte level data), it's up for debate. It isn't the most common thing to do in PHP, so is it really worth extending the language for (and adding bloat to an already bloated language)...
 
That's true. PHP is used mostly for just web pages.
What about concatenating strings?
If mbstring is installed, and you do $text1 . $text2, will this have any effect on the resulting string?
Or would you have to use a special mb function for concatenating?
 
contactonation is independent of anything
so for all settings $text1 . $text2 will give the same result
 
8:28 PM
yeah, I guess that makes sense
Do you know where I can see a list of encodings for mb_substr?
 
Cool thanks
 

« first day (80 days earlier)      last day (4868 days later) »