abdfahim Posted August 26, 2008 Share Posted August 26, 2008 I read windows username by Vbscript. Now, I want to setup PHP Session against that username. For that I have to transfer that Vbscript variable to PHP. I can use GET method, but in that case, It'll not safe. Because anybody can directly type that get variable in address bar and thus login. So, is there any other way around to set up session against that username? Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/ Share on other sites More sharing options...
sKunKbad Posted August 26, 2008 Share Posted August 26, 2008 Can vbscript post or set cookies? If so, you can easily get at the username that way. Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625695 Share on other sites More sharing options...
abdfahim Posted August 26, 2008 Author Share Posted August 26, 2008 that's my question also, mate Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625701 Share on other sites More sharing options...
Zane Posted August 26, 2008 Share Posted August 26, 2008 Sorry, but run all that by me again just a little more detailed. Like for instance, how were you planning on sending the variable by GET in the first place and maybe we could get somewhere. In other words....what's your vbscript output....or how does it work Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625703 Share on other sites More sharing options...
redarrow Posted August 26, 2008 Share Posted August 26, 2008 ur already there really if u can use get then use mod_rewrite to rewrite the url........... Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625708 Share on other sites More sharing options...
abdfahim Posted August 26, 2008 Author Share Posted August 26, 2008 If I send the variable via GET method, there is one problem. For example, i used the following code to get Windows username <Script Language="VBScript"> Dim objNet Set objNet = CreateObject("WScript.NetWork") strInfo = objNet.UserName Document.Location ="t1.php?username=" & strInfo Set objNet = Nothing </Script> So, it will automatically redirect each user to his corresponding page. Like, for user X, it'll go to t1.php?username=X and for user Y, it will go to t1.php?username=Y. But, what happens if user Y type t1.php?username=X in his address bar? it will redirect him to user X's page, which will be a complete blunder!! mod_rewrite will not solve this. So, I am looking for a alternate way. Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625767 Share on other sites More sharing options...
abdfahim Posted August 26, 2008 Author Share Posted August 26, 2008 I work out one way. I put it for whom it may concern I will have a form in HTML body which will have only one hidden field. On body load, I write the user name as the value of that hidden field via Vbscript. Then automatically submit the form (on body load) via javascript. Quote Link to comment https://forums.phpfreaks.com/topic/121357-solved-transfer-variable-from-vbscript-to-php/#findComment-625770 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.