php-windows Digest 25 Jul 2002 02:32:29 -0000 Issue 1256
Topics (messages 14915 through 14926):
reading input from a magnetic stripe and then parsing it to a MySQL database for
querry?
14915 by: Mentor Mala
mktime limitation
14916 by: Kit Kerbel
14918 by: Kit Kerbel
Disregard last
14917 by: Kit Kerbel
Problem with mktime
14919 by: Kit Kerbel
socket_set_block(); - question
14920 by: Micha
Dumb date question
14921 by: R.S. Herhuth
14922 by: Scott Carr
PHP WIN2K MYSQL Authentication
14923 by: Frank Tudor
14924 by: Rich Gray
Re: Apache Virtual Hosts Local Machine Help
14925 by: Luis Ferro
Can php generate MS word doc format?
14926 by: Nicole Amashta
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]
----------------------------------------------------------------------
--- Begin Message ---
Hi all...
I have just been asked to try and develop a system which will read the
input from a magnetic stripe reader, and then parse the information onto
a MySQL database for searching/matching number/information. Then
displaying the info onto the screen.
In other words, what I am trying to accomplish or asking is how can I
grab the input from a magnetic stripe reader, and then parse it to a
MySQL database? Not sure if I am making any sense.. Hope I am...
Thanks for all your help in advance...
Mentor Mala
Senior Network Administrator
CITY Group, LTD
Executive Vice President,
LartaVista, Inc.
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.lartavista.com/
http://www.city-group.org/
--- End Message ---
--- Begin Message ---
Does anyone know of a way to do this:
//Date calculation
$today = getdate();
$mn = $today['mon'];
$dy = $today['mday'];
$year = $today['year'];
if ($AGEFROM=="")
{
$AGEFROMx = 32;
$AGEFROMCALC = strftime("%m/%d/%Y",mktime(0,0,0,$mn,$dy,$year
-$AGEFROMx));
}
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--- End Message ---
--- Begin Message ---
here it is again.
Does anyone know of a good way to do this:
//Date calculation
$today = getdate();
$mn = $today['mon'];
$dy = $today['mday'];
$year = $today['year'];
if ($AGEFROM=="")
{
$AGEFROMx = 32;
$AGEFROMCALC = strftime("%m/%d/%Y",mktime(0,0,0,$mn,$dy,$year -
$AGEFROMx));
}
**without the limitation of mktime of only being able to go back to 1970
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--- End Message ---
--- Begin Message ---
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--- End Message ---
--- Begin Message ---
I am running php4.2.1 on NT4. I can't seem to get the mktime function to
work for dates previous to jan, 1 1970. It notes on php.net that with 32
bit systems, the range should go back as far as 1902. Any ideas?
Kit
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--- End Message ---
--- Begin Message ---
Hi,
I found the function socket_set_block(); in ext/sockets/sockets.c (the
function is not documented) and I tried to use it but it seems to
doesn't take effect...
Why doesn't this function work ? Am I doing something wrong ?
Here is my code:
function sockRead($length = 1) {
socket_set_block($this->IcqSocket);
return @socket_read($this->IcqSocket, $length,
PHP_BINARY_READ);
socket_set_nonblock($this->IcqSocket);
}
--- End Message ---
--- Begin Message ---
I was hoping someone could help me quickly. I did a quick scan of the
documentation but I couldn't find the answer.
How can I convert a month that appears as a string like "Jan" into the
numerical equivelent such as "12" without doing a huge if-then statement?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
$strTime = date("mm/dd/yyyy", strtotime("Jan 13, 2002"));
--
Scott Carr
OpenOffice.org
Documentation Maintainer
http://documentation.openoffice.org/
Quoting "R.S. Herhuth" <[EMAIL PROTECTED]>:
>
> I was hoping someone could help me quickly. I did a quick scan of the
> documentation but I couldn't find the answer.
>
> How can I convert a month that appears as a string like "Jan" into the
> numerical equivelent such as "12" without doing a huge if-then statement?
>
> Thanks,
> Ron
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
I am trying to authenticate to my site. I have had no
success. All I get is the pop-up window reutrning
over and over again. Like it is not even looking at
the code. Please help. This seems like standard stuff
floating around various php sits so why it doesn't
work is a mystery.
Here is my code.
<?
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="My Private
Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
} else {
$connection = mysql_connect("localhost", "dude",
"pass")
or die ("Couldn't connect to server.");
$db = mysql_select_db("scis", $connection)
or die ("Couldn't select database.");
$sql = "SELECT userid
FROM regiuser
WHERE userid='$PHP_AUTH_USER' and
password='$PHP_AUTH_PW'";
$result = mysql_query($sql)
or die("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
echo "<P>You are valid!<br>";
echo "Your userid is $PHP_AUTH_USER<br>";
echo "Your password is $PHP_AUTH_PW</p>";
} else if ($num == 0) {
echo "You are not authorized!";
}
}
?>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--- End Message ---
--- Begin Message ---
Frank
I'll guess you are using v4.2.x of PHP - well the $PHP_AUTH_USER probably
won't be set as now the default installation has the register_globals
directive set to off rather than on... this has broken lots of existing
code...
You have 2 options...
1) Switch back on register_globals in php.ini (NB there are security
implications in doing that btw)
2) Use the new super globals - these are arrays that are always defined in
the global scope ... so in this case use $_SERVER['PHP_AUTH_USER']
HTH
Rich
-----Original Message-----
From: Frank Tudor [mailto:[EMAIL PROTECTED]]
Sent: 24 July 2002 14:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP WIN2K MYSQL Authentication
I am trying to authenticate to my site. I have had no
success. All I get is the pop-up window reutrning
over and over again. Like it is not even looking at
the code. Please help. This seems like standard stuff
floating around various php sits so why it doesn't
work is a mystery.
Here is my code.
<?
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="My Private
Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
} else {
$connection = mysql_connect("localhost", "dude",
"pass")
or die ("Couldn't connect to server.");
$db = mysql_select_db("scis", $connection)
or die ("Couldn't select database.");
$sql = "SELECT userid
FROM regiuser
WHERE userid='$PHP_AUTH_USER' and
password='$PHP_AUTH_PW'";
$result = mysql_query($sql)
or die("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
echo "<P>You are valid!<br>";
echo "Your userid is $PHP_AUTH_USER<br>";
echo "Your password is $PHP_AUTH_PW</p>";
} else if ($num == 0) {
echo "You are not authorized!";
}
}
?>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Indulging some patience to list subscribers regarding a not 100% in
topic message (but nevertheless very usefull to php under windows)...
Here is as promissed a overview of my configs with virtual hosting with
apache under windows...
Install apache then...
change the hosts file located in \winnt\system32\drivers\etc
127.0.0.1 localhost
127.0.0.1 otherdomainalias
then at the end of apache hosts.conf there is the following block
#
# Use name-based virtual hosting.
#
#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin [EMAIL PROTECTED]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
uncoment the following:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot C:/Apache/htdocs
ServerName localhost
ErrorLog logs/localhost.example.com-error_log
CustomLog logs/localhost.example.com-access_log common
</VirtualHost>
<VirtualHost *>
ServerAdmin webmaster@otherdomainalias
DocumentRoot e:/sites
ServerName otherdomainalias
ErrorLog logs/otherdomainalias.example.com-error_log
CustomLog logs/otherdomainalias.example.com-access_log common
</VirtualHost>
The entries that matter are the DocumentRoot which must point to a winnt
valid directory (root directory on one disk won't do) and
ServerName which must mimick each of the entries inserted in the hosts
Then restart apache and it should have two domains locally configured
(the operative word is locally, because as there isn't a dns server,
they will only work locally, unless on want's to indulge in a very
complex dns hand administrations by shuffling hosts and lmhost files
arround!)...
You just need to repeat the virtual host block for each aliased domain
to 127.0.0.1...
Hope that helps... To me is invaluable to test and develop in PHP/MySQL
with diferent domains at the same time and also to allow local
documentation when that is distributed as html files...
Cheers,
Luis Ferro
--- End Message ---
--- Begin Message ---
This is the first place I am going to look for an answer to this...
Can PHP generate a word document formatted file? If so, can someone point me
to where I might find some documentation for this. I checked php.net and
typed "doc" in the search field for functions .... I'll search elsewhere
also.
Thanks in advance!
--
Nicole Amashta
Web Application Developer
www.aeontrek.com
- - - - -
Hey! Want to know how I $AVE MONEY shopping online? Ask me how and I will
get you a FREE membership to my shopping club!
- - - - -
Got PayPal ? https://www.paypal.com/refer/pal=paypal%40aeontrek.com
- - - - -
I am an official Associates of Free-Banners.com. Find out how you can start
driving insane traffic to your website.
Click the link:
http://affiliate.free-banners.com/cgi-bin/adserver/affiliate?iid=311051
--- End Message ---