PHP warning

file_get_contents(https://samp.znu.ac.ir/web/activity/data?type=journals&national_code=4281326618&begin_date=&end_date=): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error

/var/www/vhosts/znuweb/protected/views/members/list-articles.php(446)

434 
435 $MonthFinishName[0]='MonthFinishNameFa';
436 $MonthFinishName[1]='MonthFinishNameEn';
437 */
438 $FirstName[0]='first_name_fa';
439 $FirstName[1]='first_name_en';
440 
441 $LastName[0]='last_name_fa';
442 $LastName[1]='last_name_en';
443 
444 $url="https://samp.znu.ac.ir/web/activity/data?type=journals&national_code=".$model->national_code."&begin_date=&end_date=";
445 
446 $xmlfile = file_get_contents($url);
447 //$xmlfile = html_entity_decode($xmlfile, ENT_QUOTES, "utf-8");
448 $xmlfile = str_replace("&", '&', $xmlfile);
449 //$xmlfile = preg_replace('#&(?=[a-z_0-9]+=)#', '&', $xmlfile);
450 $xmlfile = str_replace('MY_AND', '&', $xmlfile);
451 $xmlfile = preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $xmlfile);  //MMM baraye raf e Error e PCDATA invalid Char value 2
452 /*
453 $xmlfile = str_replace("'", ''', $xmlfile);
454 $xmlfile = str_replace('"', '"', $xmlfile);
455 $xmlfile = str_replace('>', '>', $xmlfile);
456 $xmlfile = str_replace('<', '&lt;', $xmlfile);
457 $xmlfile = str_replace(array('&', '<', '>', '\'', '"'), array('&amp;', '&lt;', '&gt;', '&apos;', '&quot;'), $xmlfile);
458 $xmlfile = preg_replace('/-+/', '-', $xmlfile);  //Replace multiple dashes with one dash

Stack Trace

#0
+
 /var/www/vhosts/znuweb/protected/views/members/list-articles.php(446): file_get_contents("https://samp.znu.ac.ir/web/activity/data?type=journals&national_...")
441 $LastName[0]='last_name_fa';
442 $LastName[1]='last_name_en';
443 
444 $url="https://samp.znu.ac.ir/web/activity/data?type=journals&national_code=".$model->national_code."&begin_date=&end_date=";
445 
446 $xmlfile = file_get_contents($url);
447 //$xmlfile = html_entity_decode($xmlfile, ENT_QUOTES, "utf-8");
448 $xmlfile = str_replace("&", '&amp;', $xmlfile);
449 //$xmlfile = preg_replace('#&(?=[a-z_0-9]+=)#', '&amp;', $xmlfile);
450 $xmlfile = str_replace('MY_AND', '&amp;', $xmlfile);
451 $xmlfile = preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $xmlfile);  //MMM baraye raf e Error e PCDATA invalid Char value 2
#4
+
 /var/www/vhosts/znuweb/protected/views/members/view_pages_fa.php(499): CController->renderPartial("list-articles", array("model" => ZuTeachers, "lang" => "fa"))
494     
495 <?php //echo $content 
496 if ($pg=='list-articles' and $model->articlefromsamp==0)
497   $this->renderPartial($pg, array('model'=>$model, 'model2'=>$model2, 'model3'=>$model3,'lang'=>$language));
498 else if ($pg=='list-articles' and $model->articlefromsamp==1)    
499   $this->renderPartial($pg, array('model'=>$model,'lang'=>$language));
500 else
501  $this->renderPartial($pg, array('model'=>$model, 'model2'=>$model2,'lang'=>$language)); 
502  ?> 
503 
504        
#9
+
 /var/www/vhosts/znuweb/protected/controllers/MembersController.php(1402): CController->render("view_pages_fa", array("pg" => "list-articles", "model" => ZuTeachers, "lang" => "fa"))
1397 else if ($model->articlefromsamp==1)
1398 {
1399          if($lang=="en")
1400          $this->render('view_pages_en',array('pg'=>'list-articles','model'=>$model,'lang'=>$lang));
1401          else
1402          $this->render('view_pages_fa',array('pg'=>'list-articles','model'=>$model,'lang'=>$lang));
1403 }
1404     
1405 else
1406             throw new CHttpException(404,'The requested page does not exist66.');
1407     
2025-01-23 03:22:41 Apache Yii Framework/1.1.14