[PHP] Variable value doesn't stay "Null"

2001-03-15 Thread Michael Conley

I put up an HTML page that allows a user to modify some previously entered
information.  The information is taken from a MySQL database and displayed
on the page.  The user can leave the data alone or modify it.  If there is
no information in the database for one of the fields, the input box is
empty.

The problem is that when I submit this information, the page that is called
does not receive the variables from fields with no information as "null".
Instead, it gets them with something other than null, although if I print
the variable, they come out blank.  I check the variable using "is_null" and
they evaluate as not being null.  When my script then enters the information
into the MySQL database, a value of "0" is entered for the numeric fields.  

Having these "0" values in the database gives me the wrong information.  Any
idea why an input field that is populated with a null value would go to the
next page as a not null value (although no value shows up for it until it is
written to the database)?



-- 
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] Variable value doesn't stay "Null"

2001-03-15 Thread Michael Conley

So how do I get the PHP script that stores the information in the My SQL
database to not store "0"?  a "0" value is a valid value for this variable.
I don't want 0 to be the value of the variable if nothing is entered.  Right
now, the database is populated with 0's for the fields that are not filled
in.

-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 8:17 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable value doesn't stay "Null"


null is a bad idea. if a value is set to null in a table then that variable
will not be set.

namephonefaxemail
chris lee37710955541120NULL

$result['name'] is 'chris lee'
$result['phone'] is '3771095';
$result['fax'] is '5541120';
$result['email'] is an undefined variable

in php a variable is set or not set. if it set to '' its still set, if a
variable is undefined, then it is null.


-- 

 Chris Lee
 [EMAIL PROTECTED]




"Michael Conley" <[EMAIL PROTECTED]> wrote in message
2102328FD2ECD411879E00609737BFD10333E3@FATBOY">news:2102328FD2ECD411879E00609737BFD10333E3@FATBOY...
I put up an HTML page that allows a user to modify some previously entered
information.  The information is taken from a MySQL database and displayed
on the page.  The user can leave the data alone or modify it.  If there is
no information in the database for one of the fields, the input box is
empty.

The problem is that when I submit this information, the page that is called
does not receive the variables from fields with no information as "null".
Instead, it gets them with something other than null, although if I print
the variable, they come out blank.  I check the variable using "is_null" and
they evaluate as not being null.  When my script then enters the information
into the MySQL database, a value of "0" is entered for the numeric fields.  

Having these "0" values in the database gives me the wrong information.  Any
idea why an input field that is populated with a null value would go to the
next page as a not null value (although no value shows up for it until it is
written to the database)?








-- 
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]


RE: [PHP] Variable value doesn't stay "Null"

2001-03-15 Thread Michael Conley

The default value is null in the database.

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 12:20 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Variable value doesn't stay "Null"


You may want to check the field definitions in the database table. If I
recall correctly, some MySQL numeric field types default to "0" when an
empty string gets written to them. The problem (and solution) may not be in
the PHP script at all.

Kirk

> -Original Message-
> From: Michael Conley [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 15, 2001 1:01 PM
> To: 'Chris Lee'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable value doesn't stay "Null"
> 
> 
> So how do I get the PHP script that stores the information in 
> the My SQL
> database to not store "0"?  a "0" value is a valid value for 
> this variable.
> I don't want 0 to be the value of the variable if nothing is 
> entered.  Right
> now, the database is populated with 0's for the fields that 
> are not filled
> in.
> 

-- 
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] File Transfer over HTTPS

2001-04-24 Thread Michael Conley

I have an Apache Web server running on a Linux server with OpenSSL and all
that good stuff.  The HTTPS works just fine.  Now, many software companies
would like to add new features into their software so that their application
(written in VB, C and who  knows what other languages) can create a text
file dump of their information and transfer the file to us over a secure
connection.  They (the software companies) don't want to have their
application interface with a browser as they don't know what browser their
customer uses and don't want to deal with the differences between them.

Bottom line- Is there a way that an application (not browser-based) can
transfer a file to my web server over HTTPS without going through the
browser?  Can they just open a connection on port 443 and transfer?  Where
does the encryption happen?  I have this happening easily through a browser
via a PHP script, but now I need to figure out how to do it without the
browser interface.

Any help is appreciated

Michael Conley




-- 
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] File Transfer over HTTPS

2001-04-24 Thread Michael Conley

I have gone through this documentation, but I don't see how to do what I
want to do.

My goal is to have someone on a Windows machine running a program be able to
transfer a file from the client workstation to my web server over HTTPS (but
without a browser).  With CURL, does the client need to run this app on
their system?  Of course, I would like this to be as simple and
non-intrusive as possible.

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 2:25 PM
To: Michael Conley
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] File Transfer over HTTPS


> Bottom line- Is there a way that an application (not browser-based) can
> transfer a file to my web server over HTTPS without going through the
> browser?  Can they just open a connection on port 443 and transfer?  Where
> does the encryption happen?  I have this happening easily through a
browser
> via a PHP script, but now I need to figure out how to do it without the
> browser interface.

There is a command-line tool called curl that can do this.

See http://curl.haxx.se/docs/readme.curl.html

-Rasmus



-- 
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] File Transfer over HTTPS

2001-04-24 Thread Michael Conley

If I wanted to use this utility to copy a file from a users (Windows)
workstation to my (Linux) webserver, how would I do this?  The program on
the users workstation will create a file called "info.txt" and place it in
c:\wow.  I want it to go to my server upload.mydomain.com.  How do I get the
file c:\wow\info.txt from the user to my web server over https?  

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 24, 2001 2:45 PM
To: Michael Conley
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] File Transfer over HTTPS


> My goal is to have someone on a Windows machine running a program be able
to
> transfer a file from the client workstation to my web server over HTTPS
(but
> without a browser).  With CURL, does the client need to run this app on
> their system?  Of course, I would like this to be as simple and
> non-intrusive as possible.

Yes, they would.  The SSL protocol is complex involving a key exchange and
then encryption done client-side.  You are going to have to run something
on the client to do this.

-Rasmus



-- 
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] Compressing an upload

2001-04-25 Thread Michael Conley

I am going to have a page that will be used for visitors to upload a file to
my web server.  I already use gzcompress to compress some of the pages that
I send to visitors, but can I also compress files that they are uploading to
my web server?  They will be text files and some may be fairly large (20
MB).  How would I implement compression on files that are getting uploaded?



-- 
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] fsockopen question

2001-04-26 Thread Michael Conley

I am looking to process credit card transactions on my site.  In order to do
this, I need to open a socket to a particular URL.  I then submit an XML
string to them.  They process the string and send me a response.

I am going to a certain (secure) location on the site of my credit card
processor (https://www.myprovider.com/XMLSubmit/processtrans.asp) and then
submit the XML string.  After I submit all of the XML, the processor will
give me a response as to whether or not the transaction is approved.

How do I send the XML string to the above URL?  When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com).  I don't even really see where to force this to go over
HTTPS.  I set the port to 443, but need to be sure that the data going
across uses SSL.

How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.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]


RE: [PHP] fsockopen question

2001-04-26 Thread Michael Conley

It looks like that is working, but I'm not getting a response.  I created
the XML string and set it as $xmlstring.  Then, after the fputs that you
provided below (except with the URL I'm sending to) I have:
fputs($fp, "$xmlstring");

Then, to receive the response I enter:
$RetValue=fgets($w_socket, 4096);
echo $RetValue;

I am not getting any response, so I have no idea if my XML string is
accepted, rejected or what.  Is this the right way for me to get the
response?  After I send the XML string, they will send me back some info
that will let me know if the transaction is accepted.

-Original Message-
From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 10:04 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question


I use:

$fp = fsockopen("www.somewhere.com",80); 
fputs($fp, "GET http://www.somewhere.com/somedir/somepage.html
HTTP/1.0\r\n\r\n");

to parse.  Should be easily modified

 
Matthew Luchak 
Webmaster
Kaydara Inc. 
[EMAIL PROTECTED]


-Original Message-
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 12:37 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] fsockopen question



How do I send the XML string to the above URL?  When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com).  I don't even really see where to force this to go
over
HTTPS.  I set the port to 443, but need to be sure that the data going
across uses SSL.

How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.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 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] XML Parsing

2001-04-30 Thread Michael Conley

I am posting information to a credit card processing server.  This is done
over HTTPS (with cURL) and seems to work fine.  I get the response that I
want from the server, which consists of an XML doc with about 20 tags and
their corresponding values.  I have gone through the mailing list and
manuals, yet I still can't seem to figure out how to get each piece of the
XML doc into their own variables.

Here is the code I am using:

$server = "https://www.creditcard.com";;
$path = "xmlhttps/xtrans.asp";
$ch = curl_init();
$requestedurl = "$server" . "/$path";
curl_setopt($ch, CURLOPT_URL, "$requestedurl");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "$xmlstring");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);   

curl_close ($ch);

This replies (as it should) with an XML doc like this:

CCDEBITAUTH1010PC-12347512341202MichaelConleyPO BOX
59AuburnCA95604USASomebody840
1003509KQEGVHMGED4172823043020011NO
MATCHVITAL6N0

What I need to do now is get certain parts of the return string.  How do I
assign the value in the  tags to the variable $approvalcode?
I also need to get several other parts of the XML string assigned to
variables so that I can use them elsewhere.  I can't seem to figure out how
to do this.  I know that I need to change the "CURLOPT_RETURNTRANSFER" to
"1" to allow the information to be placed somewhere other than the screen
for processing, but after that I am not sure how to do this.  I have gone
through the mailing lists and through the docs online, but I'm having no
luck.

Any help is appreciated.





-- 
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] xmlHTTP.send equiv?

2001-05-17 Thread Michael Conley

does anyone have info on this?

-Original Message-
From: Todd Kennedy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 01, 2001 1:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] xmlHTTP.send equiv?


Does anyone know of an equivilent for ASP's xmlHTTP.send command for
PHP?

i need to send a XML string out to an HTTP server without using user
interaction (from the inside of a script).

please respond via email at [EMAIL PROTECTED]

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]



-- 
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] Incoming XML request

2001-05-17 Thread Michael Conley

I want to set up a page that can accept an XML string, which I will then
parse for the data I need, perform a database lookup based on that data and
return an XML string to the client.  I am unsure of where to start this.

1.  I don't know how to have my PHP page capture the XML string they send
me.  This will be an automated system, so my web server needs to be ready to
accept their XML string.
2.  If I can take the XML string from #1 and assign it to a variable, I can
extract the information I need.
3.  If I can do #1 and #2, I can do the database lookups that I need.
4.  How do I send them the results of my lookups in XML?

I am running PHP4.04pl1 on RedHat 7.1 and Apache 1.3.14.  I have SSL and
cURL installed and working properly.




-- 
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] URL Variables

2001-05-22 Thread Michael Conley

First, I realize this isn't really a PHP question.

If I include variables in a URL that I am passing to a web server over
HTTPS, is the URL (and hence, the variables) encrypted?
example:  https://www.yourdomain.com?firstname=michael&lastname=conley

I need to make sure that the firstname and lastname information is not sent
over the internet in clear text.  




-- 
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] Using PHP Variables with a Header

2001-07-09 Thread Michael Conley

I have a form that requires a user to enter various information (name,
address, phone number, etc...).  When they submit this form, the next PHP
page checks to make sure that the required fields were filled in.  What I
would like to do is check to see if the required fields are all filled in
and if they are not, save the values they submitted and go back to the
original page, display a message that says the fields that need to be filled
in and populate the rest of the fields with the information the user
orignally submitted.  This will keep them from having to type in all of the
information again.

I can run the checks just fine to see if the required fields are all filled
in.  I then save the data from all the fields into variables.  What I would
like to do is automatically forward the user back to the original page with
the values (i already have all of the fields set with
"value="$variablename"" to allow them to get the data that is sent back).
The only way I have been able to get this to work is to set this up as a
regular form with hidden HTML fields and a Submit button.  I really want
this to be an automatic process.  Any thoughts on how to accomplish this?
When I set up a "Header", the user is forwarded back to the page that I
want, but none of the variables go with them (they are set by simply putting
something like "$savedlastname = $lastname, where $lastname is the HTML
variable from the original form).

Any help is appreciated.

-- 
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] File Upload Size Limits

2001-07-26 Thread Michael Conley

I am running PHP 4.0pl1 with Apache 1.3.14 on RedHat Linux 7.1.  I am trying
to do a file upload from the users PC to my web server.  If I do a small
file, the transfer goes fine.  If I do a large file (> 50 MB), the transfer
fails saying either the file was not available for reading or my script just
bombs out.  I need to be able to have people upload large files.  I have
changed the setting in php.ini to upload_max_filesize = 100M.  

Do I also need to change the following entries in php.ini?
max_execution_time = 60
memory_limit = 8M

Is this an apache limit?  I'm not sure what to do with this as I really need
to be able to transfer large files.


-- 
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] File Upload Size Limits

2001-07-26 Thread Michael Conley

Did anyone have any thoughts on this?  I can upload an 8 MB file, but after
that the upload fails.

-Original Message-
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 7:41 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] File Upload Size Limits


I am running PHP 4.0pl1 with Apache 1.3.14 on RedHat Linux 7.1.  I am trying
to do a file upload from the users PC to my web server.  If I do a small
file, the transfer goes fine.  If I do a large file (> 50 MB), the transfer
fails saying either the file was not available for reading or my script just
bombs out.  I need to be able to have people upload large files.  I have
changed the setting in php.ini to upload_max_filesize = 100M.  

Do I also need to change the following entries in php.ini?
max_execution_time = 60
memory_limit = 8M

Is this an apache limit?  I'm not sure what to do with this as I really need
to be able to transfer large files.


-- 
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: File Upload Size Limits

2001-07-27 Thread Michael Conley

I increased apache to 60 seconds, but it still fails.  it doesn't actually
go for 60 seconds.  It's more like 10 seconds before it fails.  Any idea
where I would allow Apache to deal with a larger POST?  

-Original Message-
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 27, 2001 7:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: File Upload Size Limits


I think you need to check your Apache time limits too.

Michael Conley wrote:

> I am running PHP 4.0pl1 with Apache 1.3.14 on RedHat Linux 7.1.  I am
trying
> to do a file upload from the users PC to my web server.  If I do a small
> file, the transfer goes fine.  If I do a large file (> 50 MB), the
transfer
> fails saying either the file was not available for reading or my script
just
> bombs out.  I need to be able to have people upload large files.  I have
> changed the setting in php.ini to upload_max_filesize = 100M.
>
> Do I also need to change the following entries in php.ini?
> max_execution_time = 60
> memory_limit = 8M
>
> Is this an apache limit?  I'm not sure what to do with this as I really
need
> to be able to transfer large files.


-- 
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] Files only available via HTTPS

2001-02-01 Thread Michael Conley

I have several PHP files that I only want users to be able to access via
HTTPS.  How can I control that on an Apache 1.3.14 server running on RedHat
7?  I have openssl and mod_ssl working fine.  Currently, I can access all of
the files on my site via either http or https.  I want to keep certain files
(with interesting information) from being accessed via http.  I realize this
isn't really a PHP question, but I have no idea how to do this.

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]