Jump to content

PHP Login


parshuramsk

Recommended Posts

Hi

 

I am writing a login page using php in linux. I am getting a problem.

 

 

Problem Description:

 

I have C file which checks user name and password & returns value

 

When I execute C file it gives proper/required output.

 

I am using the executable of this file in a shell script. My shell script is log_in.sh following is its content.

 

 

[root@locuzhpc Programs]# cat log_in.sh

 

uname=$1

passwd=$2

/var/www/html/Locuz/Programs/ULogin $uname $passwd

RET=$?

echo $RET

 

 

This Shell script Iam using in login-test.php file. My

 

login-test.php file content is

 

 

 

[root@locuzhpc PHP]# cat login-test.php

 

 

<?php

 

system("sh /var/www/html/Locuz/Programs/log_in.sh root root123");

 

#echo "$output\n";

 

?>

 

 

When I execute it in command prompt, it gives proper/required output.

 

[root@locuzhpc PHP]# php login-test.php

 

Content-type: text/html

 

X-Powered-By: PHP/4.3.9

 

10

 

But When I run this file in web browser the result is wrong i.e. it is displaying

 

5

 

But I want 10 on the browser.

 

 

Regards,

 

Parshuram K.

Link to comment
https://forums.phpfreaks.com/topic/47370-php-login/
Share on other sites

I'm not sure why your making this such a complicated process, you can execute the C program directly from PHP. Also, what do the return outputs of 10 and 5 actually mean?

 

Can we see the C code?

 

 

Yes u r right...

 

I tried that method also. But both are same.

 

The return value 10 means Login is Successfull.

 

The return value 5 means Login is Unsuccessfull.

 

 

What is your answer for,

 

Why it is giving right output when i execute it on command prompt. but when it ran on or opened that perticular file on browser it is displaying wrong.

 

 

Please replay urgently...

Link to comment
https://forums.phpfreaks.com/topic/47370-php-login/#findComment-231161
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.