I am not used to php but i need to use a script now, but it always give me a windwos error. This is my script:

$PHP_PATH = "c:\Program Files (x86)\PHP\\";
$PHP_PATH = addcslashes($PHP_PATH, ' ');
$VR_PATH = dirname(__FILE__)."\VRClient.php";
$VR_SERVER = "http://localhost:8080/vrmobile/VRServer";

$handle = popen("C:\WINDOWS\system32\cmd /C start ".$PHP_PATH." -f ".$VR_PATH." ".$VR_SERVER, 'r');

And this is the error:

Windows cannot find c:\program. Please make sure you typed the name correctly and then try again.

Can anyone help me solving this problem ? Thanks.

Btw, I used addcslashes because someone point out that i need to espace space characters. But this didn't work for me.

Recommended Answers

All 2 Replies

Try with '/' instead of this '\'

Thanks, that worked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.