[PHP] Using post method thru php-script

2001-06-23 Thread George Alexander

Hi,

I am developing a shopping-cart application and i need to 
authorize the credit-card no. of the customer.

I need to use a post method thru my php-script a replica 
of which I am giving below:

Script Start:

// Build the request string

$request.='cardnum='.urlencode();
$request.='address='.urlencode(99 xyz);
$request.='zipcode='.urlencode(96004);
$request.='amount='.urlencode(2.00); 

// Build the header 

$header=POST /cgi-bin/xyz.exe HTTPS/1.0\r\n; 
$header.=Host: secure.aaa.com\n. User-Agent: PostIt\r\n;
$header.=Content-type: application/x-www-form-urlencoded\r\n; 
$header.=Content-length: .strlen($request).\r\n\r\n; 

// Open the connection 
$fp = fsockopen('secure.aaa.com',443,$err_num,$err_msg); 
$i=0;
if ($fp) 
{ 
 // Send everything 
fputs($fp,$header.$request); 

 // Get the response
$response=I am in;
 while (!feof($fp))
 {
$response.=fgets($fp,128);
$i++;
 }
 fclose($fp);
}
else
$response=Dead;
?
html
head
titleResponse from aaa.com/title
/head

body bgcolor=#FF
p
? echo Response from aaa: .$response; ?
? echo brNo. of loops: .$i; ?
? echo brError no: .$err_num. Error Message: .$err_msg; ?
/p
/body
/html

Script End.

In the above code I am posting my form data to
 https://secure.aaa.com/cgi-bin/xyz.exe which 
processes the credit card and returns some 
string values showing whether the credit-card 
is valid or not.

My question is that whether the method I'm 
using is correct to post data to secure servers.
Well my code runs on a normal server ie. non-
secure.
My code is able to connect to the secure 
server i.e fsockopen works but i do not get
any response from the server. 
Well you can judge this by the result I am 
getting on my browser.
The result  I am getting on browser is:

Response from aaa: I am in 
No. of loops: 1 
Error no: 0 Error Message:

So am i doing anything wrong somewhere or is
there some other way to do this thing.

Please help asap. I need to finish this stuff by 27th
of this month.

regards
George


_
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] math question

2001-06-23 Thread George Alexander

If u don't want to use the pi() function.
Try M_PI. This is a pi constant its value is 3.14159265358979323846

$theta=15*M_PI/360;

- Original Message - 
From: Anon Y Mous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, June 23, 2001 2:21 PM
Subject: Re: [PHP] math question


 pi is a function. Try this:
 
 $theta = 15*pi()/360;
 
 It should return 0.13089969389957
 
 
 -Evan Nemerson
 
 
  $theta = 15*pi/360;
  gives a value of 0 for $theta...  it should be something like 0.131...
 
  Julia
 
 
 -- 
 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]


_
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] Want to send email in html format

2001-04-24 Thread George Alexander

Hi,

I am working on a newsletter module. What I want
to know is that how can we send a newsletter via
email to all the subscribers in html format 
with images in the htm too???

Well I am able to send an html file as attachment
using the php mail() function. But I still can't
see the images in the htm file. What I think is
the mail function just sends the file as text only
and it will not pick up the images in the html file.
So is there a way that I can send the html format 
with images via email.

Please reply asap.

regards
George

_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.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] Can't connect php to mysql on linux

2001-02-23 Thread George Alexander

Hi,

I working on Redhat Linux 6.1 and I've installed MySQL-3.23.33-1.i386.rpm and 
MySQL-client-3.23.33-1.i386.rpm.
MySql is working fine. I've even created a database also using MySqlAdmin.
Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for Apache : 
apache-1.3.14-2.6.2.i386.rpm.
I've even installed php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.

My problem is I can't connect PHP to Mysql Db using the 
mysyql_connect("localhost","root","mypassword") command.

Please help me asap.
Regards,
George




_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.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]