Forum Moderators: coopster

Message Too Old, No Replies

PHP on Secure Website

php on secure web

         

waqas

2:53 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



I want to use php script on my website under https but my php script are not working. I want that visitor submit form on one page and data will be transmitted to php page, where i want to print the data received from the form on first page.
I have used both get and post actions on forms and also tried

$password = $_REQUEST['password'];
echo $password

$_GET['password']

$HTTP_GET['password']

in php page but under secure server it doesn't display any thing.
Can any one please help me in this matter

coopster

3:07 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Does the code work if you aren't using SSL?

waqas

3:40 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



Yes it is working on non secure web page

coopster

4:10 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What version of PHP are you running? (You can use phpinfo [php.net] to find out).
Note: HTTPS is supported starting from PHP 4.3.0, if you have compiled in support for OpenSSL.

waqas

7:32 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



I have php version 4.2.3, also i have checked and run phpinfo.php on both secure and unsecure website and it is working, just not working is that can't get form values on php page

kknusa

8:32 pm on Jan 8, 2004 (gmt 0)

10+ Year Member



Hi guys

i'm experimenting withh ssl too and have tried my website under it especially the form and when u submit them they seems to be working fine i also use php 4.2.3 so i don't think that's a factor.

volatilegx

8:47 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you checked possible variable scope issues? If you are accessing the password from inside a function without passing it thru the function call, maybe the function's local scope is keeping the variable from being read.

waqas

12:04 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



thanks for all replies, finally i got the problem and solved it as well.
The problem is with variable, which i was using to get data from FORM and DIRECT CALL.
kknusa, try to use the same variables as i do

<?php
echo $HTTP_POST_VARS["password"]?>

<?php
echo $HTTP_GET_VARS["password"]?>

or

<?php
print($HTTP_POST_VARS["password"]);?>

<?php
print($HTTP_GET_VARS["password"]);?>

coopster

2:49 pm on Jan 9, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



waqas, you stated that you have php version 4.2.3. Superglobal arrays, like $_POST and $_GET, became available in PHP 4.1.0. Here is more information about Variables from outside PHP [php.net]. You should be able to get your information via the $_POST superglobal [us3.php.net].

Also, HTTPS is supported starting from PHP 4.3.0 [php.net]. I guess what I am suggesting is that just because your script is running may not mean it is running securely. I don't have a test server running 4.2.3 so I can't confirm. Regards, coopster