require_once('/recaptcha/recaptchalib.php'); was in the correct place
but the error says:
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(C:\/recaptcha/recaptchalib.php) is not within the allowed path(s): (C:\Inetpub\vhosts\xxx.com\httpdocs\) in C:\Inetpub\vhosts\xxx.com\httpdocs\wp-content\themes\xxx\download.php on line 5
Line 5 point to require_once. I am not sure why it gave error, when on local development it doesn’t complain.
EDIT #2
Warning: touch() [function.touch]: Unable to create file C:\Inetpub\vhosts\xxx.com\httpdocs/csv/brochure-list.csv because No such file or directory in C:\Inetpub\vhosts\xxx.com\httpdocs\wp-content\themes\mta2013\downbrochure.php on line 161
code:
$filename= ABSPATH. 'csv/list.csv';
$isNew = (file_exists($filename) || is_file($filename)) ? false : true ;
touch($filename); //Sets access and modification time of file and If the file does not exist, Create it.
$fp = fopen($filename, 'a+');
forceHeader($columns,$filename);
fputcsv($fp, $formData);
fclose($fp);
I might be overlooking something here. but I added ABSPATH and it doesn’t resolve the error.
EDIT #3
Alright I resolved it because the directory wasn’t set to permission or ‘recognized’. thanks for the help.
By using
You are actually directing PHP to the root folder(which in windows is
C:\) while you actually want to move to the following folder:I guessed that your server folder is httpdocs, and PHP by-default takes it as its base directory. Hence, you don’t need to use the
/recaptcha. Therefore,Works great.