Answer the question
In order to leave comments, you need to log in
1C integration. Gives a cropped file
I do integration with 1C.
Here is a simplified code example
$type=$_GET['type'];
$mode=$_GET['mode'];
if($mode=='init') {
echo "zip=no\n";
echo "file_limit=2000";
exit;
}
if($mode=='checkauth') {
// проверку на логин пароль убрал
echo "success\n";
echo session_name()."\n";
echo session_id() ."\n";
exit;
}
if($type=='catalog' && $mode=='file') {
$content=file_get_contents('php://input');
// и вот тут проблема описание выше
}
if($type=='sale' && $mode=='query') {
// не существенно
}
if($type=='sale' && $mode=='file') {
// не существенно
echo 'success';
exit;
}
Answer the question
In order to leave comments, you need to log in
Or maybe like this
$f = fopen($dir.$filename, 'ab');
fwrite($f, file_get_contents('php://input'));
fclose($f);
$xml = simplexml_load_file($dir.$filename);
I also suffered with this 1s =))
$files = file_get_contents('php://input');
if(!empty($files)){
file_put_contents('data/'.$filename, $files, FILE_APPEND);
echo "success\n";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question