Undefined index: HTTP_USER_AGENT (500 Internal Server Error)

Undefined index: HTTP_USER_AGENT

Exception

ErrorException

  1. <?php
  2. header('Access-Control-Allow-Origin:  *');
  3. //Stop Bots
  4. if(stripos($_SERVER['HTTP_USER_AGENT'],'bot') === false){
  5. header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"true404);
  6. }
  7. if(stripos($_SERVER['HTTP_USER_AGENT'],'WP Rocket/Partial_Preload') === false){
Application->Laravel\Lumen\Concerns\{closure}(8, 'Undefined index: HTTP_USER_AGENT', '/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', 6, array('__path' => '/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', '__data' => array('__env' => object(Factory), 'app' => object(Application)), '__env' => object(Factory), 'app' => object(Application))) in /home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php (line 6)
  1. <?php
  2. header('Access-Control-Allow-Origin:  *');
  3. //Stop Bots
  4. if(stripos($_SERVER['HTTP_USER_AGENT'],'bot') === false){
  5. header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"true404);
  6. }
  7. if(stripos($_SERVER['HTTP_USER_AGENT'],'WP Rocket/Partial_Preload') === false){
  1.             $__data $data;
  2.             return (static function () use ($__path$__data) {
  3.                 extract($__dataEXTR_SKIP);
  4.                 return require $__path;
  5.             })();
  6.         }
  7.         throw new FileNotFoundException("File does not exist at path {$path}.");
  8.     }
  1.             return (static function () use ($__path$__data) {
  2.                 extract($__dataEXTR_SKIP);
  3.                 return require $__path;
  4.             })();
  5.         }
  6.         throw new FileNotFoundException("File does not exist at path {$path}.");
  7.     }
  1.         // We'll evaluate the contents of the view inside a try/catch block so we can
  2.         // flush out any stray output that might get out before an error occurs or
  3.         // an exception is thrown. This prevents any partial views from leaking.
  4.         try {
  5.             $this->files->getRequire($path$data);
  6.         } catch (Throwable $e) {
  7.             $this->handleViewException($e$obLevel);
  8.         }
  9.         return ltrim(ob_get_clean());
  1.      * @param  array  $data
  2.      * @return string
  3.      */
  4.     public function get($path, array $data = [])
  5.     {
  6.         return $this->evaluatePath($path$data);
  7.     }
  8.     /**
  9.      * Get the evaluated contents of the view at the given path.
  10.      *
  1.      *
  2.      * @return string
  3.      */
  4.     protected function getContents()
  5.     {
  6.         return $this->engine->get($this->path$this->gatherData());
  7.     }
  8.     /**
  9.      * Get the data bound to the view instance.
  10.      *
  1.         // clear out the sections for any separate views that may be rendered.
  2.         $this->factory->incrementRender();
  3.         $this->factory->callComposer($this);
  4.         $contents $this->getContents();
  5.         // Once we've finished rendering the view, we'll decrement the render count
  6.         // so that each sections get flushed out next time a view is created and
  7.         // no old sections are staying around in the memory of an environment.
  8.         $this->factory->decrementRender();
  1.      * @throws \Throwable
  2.      */
  3.     public function render(callable $callback null)
  4.     {
  5.         try {
  6.             $contents $this->renderContents();
  7.             $response = isset($callback) ? $callback($this$contents) : null;
  8.             // Once we have the contents of the view, we will flush the sections if we are
  9.             // done rendering all views so that there is nothing left hanging over when
  1.         // If this content implements the "Renderable" interface then we will call the
  2.         // render method on the object so we will avoid any "__toString" exceptions
  3.         // that might be thrown and have their errors obscured by PHP's handling.
  4.         elseif ($content instanceof Renderable) {
  5.             $content $content->render();
  6.         }
  7.         parent::setContent($content);
  8.         return $this;
  1.      */
  2.     public function __construct($content ''$status 200, array $headers = [])
  3.     {
  4.         $this->headers = new ResponseHeaderBag($headers);
  5.         $this->setContent($content);
  6.         $this->setStatusCode($status);
  7.         $this->setProtocolVersion('1.0');
  8.     }
  9.     /**
  1.         }
  2.         if ($response instanceof PsrResponseInterface) {
  3.             $response = (new HttpFoundationFactory)->createResponse($response);
  4.         } elseif (! $response instanceof SymfonyResponse) {
  5.             $response = new Response($response);
  6.         } elseif ($response instanceof BinaryFileResponse) {
  7.             $response $response->prepare(Request::capture());
  8.         }
  9.         return $response->prepare($request);
  1.      */
  2.     protected function callControllerCallable(callable $callable, array $parameters = [])
  3.     {
  4.         try {
  5.             return $this->prepareResponse(
  6.                 $this->call($callable$parameters)
  7.             );
  8.         } catch (HttpResponseException $e) {
  9.             return $e->getResponse();
  10.         }
  11.     }
  1.             return $this->callLumenControllerWithMiddleware(
  2.                 $instance$method$routeInfo$middleware
  3.             );
  4.         } else {
  5.             return $this->callControllerCallable(
  6.                 [$instance$method], $routeInfo[2]
  7.             );
  8.         }
  9.     }
  10.     /**
  1.         if (! method_exists($instance $this->make($controller), $method)) {
  2.             throw new NotFoundHttpException;
  3.         }
  4.         if ($instance instanceof LumenController) {
  5.             return $this->callLumenController($instance$method$routeInfo);
  6.         } else {
  7.             return $this->callControllerCallable(
  8.                 [$instance$method], $routeInfo[2]
  9.             );
  10.         }
  1.     protected function callActionOnArrayBasedRoute($routeInfo)
  2.     {
  3.         $action $routeInfo[1];
  4.         if (isset($action['uses'])) {
  5.             return $this->prepareResponse($this->callControllerAction($routeInfo));
  6.         }
  7.         foreach ($action as $value) {
  8.             if ($value instanceof Closure) {
  9.                 $callable $value->bindTo(new RoutingClosure);
  1.                 return $this->callActionOnArrayBasedRoute($this['request']->route());
  2.             }));
  3.         }
  4.         return $this->prepareResponse(
  5.             $this->callActionOnArrayBasedRoute($routeInfo)
  6.         );
  7.     }
  8.     /**
  9.      * Call the Closure or invokable on the array based route.
  1.             return $this->sendThroughPipeline($this->middleware, function ($request) use ($method$pathInfo) {
  2.                 $this->instance(Request::class, $request);
  3.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  4.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  5.                 }
  6.                 return $this->handleDispatcherResponse(
  7.                     $this->createDispatcher()->dispatch($method$pathInfo)
  8.                 );
  1.                 ->send($this->make('request'))
  2.                 ->through($middleware)
  3.                 ->then($then);
  4.         }
  5.         return $then($this->make('request'));
  6.     }
  7.     /**
  8.      * Prepare the response for sending.
  9.      *
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  SymfonyRequest|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /home/d4kdy5danoy3/public_html/api/index.php (line 28)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

ErrorException

ErrorException:
Undefined index: HTTP_USER_AGENT

  at /home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php:6
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(8, 'Undefined index: HTTP_USER_AGENT', '/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', 6, array('__path' => '/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', '__data' => array('__env' => object(Factory), 'app' => object(Application)), '__env' => object(Factory), 'app' => object(Application)))
     (/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php:6)
  at require('/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php')
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/filesystem/Filesystem.php:107)
  at Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/filesystem/Filesystem.php:108)
  at Illuminate\Filesystem\Filesystem->getRequire('/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', array('__env' => object(Factory), 'app' => object(Application)))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/view/Engines/PhpEngine.php:58)
  at Illuminate\View\Engines\PhpEngine->evaluatePath('/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', array('__env' => object(Factory), 'app' => object(Application)))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/view/Engines/PhpEngine.php:38)
  at Illuminate\View\Engines\PhpEngine->get('/home/d4kdy5danoy3/public_html/api/lumen/resources/views/forms/form-personal-loan.php', array('__env' => object(Factory), 'app' => object(Application)))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/view/View.php:139)
  at Illuminate\View\View->getContents()
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/view/View.php:122)
  at Illuminate\View\View->renderContents()
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/view/View.php:91)
  at Illuminate\View\View->render()
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/http/Response.php:62)
  at Illuminate\Http\Response->setContent(object(View))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/illuminate/http/Response.php:34)
  at Illuminate\Http\Response->__construct(object(View))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:446)
  at Laravel\Lumen\Application->prepareResponse(object(View))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:386)
  at Laravel\Lumen\Application->callControllerCallable(array(object(FormController), 'getform'), array())
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:352)
  at Laravel\Lumen\Application->callLumenController(object(FormController), 'getform', array(true, array('uses' => 'App\\Http\\Controllers\\FormController@getform'), array()))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:326)
  at Laravel\Lumen\Application->callControllerAction(array(true, array('uses' => 'App\\Http\\Controllers\\FormController@getform'), array()))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:279)
  at Laravel\Lumen\Application->callActionOnArrayBasedRoute(array(true, array('uses' => 'App\\Http\\Controllers\\FormController@getform'), array()))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:264)
  at Laravel\Lumen\Application->handleFoundRoute(array(true, array('uses' => 'App\\Http\\Controllers\\FormController@getform'), array()))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:166)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(object(Request))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline(array(), object(Closure))
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:172)
  at Laravel\Lumen\Application->dispatch(null)
     (/home/d4kdy5danoy3/public_html/api/lumen/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:109)
  at Laravel\Lumen\Application->run()
     (/home/d4kdy5danoy3/public_html/api/index.php:28)