{"id":324,"date":"2018-06-03T01:05:46","date_gmt":"2018-06-03T04:05:46","guid":{"rendered":"http:\/\/www.ctasoftware.com.br\/blog\/?p=324"},"modified":"2018-06-03T01:05:46","modified_gmt":"2018-06-03T04:05:46","slug":"authorization-no-php","status":"publish","type":"post","link":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/","title":{"rendered":"Authorization no PHP"},"content":{"rendered":"<p>O PHP por default n\u00e3o aceita Authorization enviado no header.<br \/>\nPara utilizar se faz necess\u00e1rio alterar o .htaccess do apache.<\/p>\n<p>RewriteEngine On<br \/>\nRewriteCond %{HTTP:Authorization} ^(.*)<br \/>\nRewriteRule .* &#8211; [e=HTTP_AUTHORIZATION:%1]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>O PHP por default n\u00e3o aceita Authorization enviado no header. Para utilizar se faz necess\u00e1rio alterar o .htaccess do apache. RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* &#8211; [e=HTTP_AUTHORIZATION:%1]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Authorization no PHP - CTASoftware Blog<\/title>\n<meta name=\"description\" content=\"CTASoftware Blog Authorization no PHP\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Authorization no PHP - CTASoftware Blog\" \/>\n<meta property=\"og:description\" content=\"CTASoftware Blog Authorization no PHP\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CTASoftware Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-03T04:05:46+00:00\" \/>\n<meta name=\"author\" content=\"Everton Gon\u00e7alves\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Everton Gon\u00e7alves\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\"},\"author\":{\"name\":\"Everton Gon\u00e7alves\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4\"},\"headline\":\"Authorization no PHP\",\"datePublished\":\"2018-06-03T04:05:46+00:00\",\"dateModified\":\"2018-06-03T04:05:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\"},\"wordCount\":35,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\",\"name\":\"Authorization no PHP - CTASoftware Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#website\"},\"datePublished\":\"2018-06-03T04:05:46+00:00\",\"dateModified\":\"2018-06-03T04:05:46+00:00\",\"description\":\"CTASoftware Blog Authorization no PHP\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/www.ctasoftware.com.br\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authorization no PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#website\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/\",\"name\":\"CTASoftware Blog\",\"description\":\"Para Desenvolvedores De Software\",\"publisher\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ctasoftware.com.br\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\",\"name\":\"CTASoftware\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1\",\"width\":225,\"height\":44,\"caption\":\"CTASoftware\"},\"image\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4\",\"name\":\"Everton Gon\u00e7alves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g\",\"caption\":\"Everton Gon\u00e7alves\"},\"description\":\"http:\/\/www.ctasoftware.com.br\",\"sameAs\":[\"http:\/\/www.ctasoftware.com.br\"],\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/author\/everton-goncalves\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Authorization no PHP - CTASoftware Blog","description":"CTASoftware Blog Authorization no PHP","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/","og_locale":"pt_BR","og_type":"article","og_title":"Authorization no PHP - CTASoftware Blog","og_description":"CTASoftware Blog Authorization no PHP","og_url":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/","og_site_name":"CTASoftware Blog","article_published_time":"2018-06-03T04:05:46+00:00","author":"Everton Gon\u00e7alves","twitter_misc":{"Escrito por":"Everton Gon\u00e7alves"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#article","isPartOf":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/"},"author":{"name":"Everton Gon\u00e7alves","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4"},"headline":"Authorization no PHP","datePublished":"2018-06-03T04:05:46+00:00","dateModified":"2018-06-03T04:05:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/"},"wordCount":35,"commentCount":0,"publisher":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization"},"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/","url":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/","name":"Authorization no PHP - CTASoftware Blog","isPartOf":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#website"},"datePublished":"2018-06-03T04:05:46+00:00","dateModified":"2018-06-03T04:05:46+00:00","description":"CTASoftware Blog Authorization no PHP","breadcrumb":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ctasoftware.com.br\/blog\/authorization-no-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/www.ctasoftware.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"Authorization no PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#website","url":"https:\/\/www.ctasoftware.com.br\/blog\/","name":"CTASoftware Blog","description":"Para Desenvolvedores De Software","publisher":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ctasoftware.com.br\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization","name":"CTASoftware","url":"https:\/\/www.ctasoftware.com.br\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1","width":225,"height":44,"caption":"CTASoftware"},"image":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4","name":"Everton Gon\u00e7alves","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g","caption":"Everton Gon\u00e7alves"},"description":"http:\/\/www.ctasoftware.com.br","sameAs":["http:\/\/www.ctasoftware.com.br"],"url":"https:\/\/www.ctasoftware.com.br\/blog\/author\/everton-goncalves\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6ACmG-5e","jetpack-related-posts":[{"id":23,"url":"https:\/\/www.ctasoftware.com.br\/blog\/drop-user-the-database-principal-owns-a-schema-in-the-database-and-cannot-be-dropped\/","url_meta":{"origin":324,"position":0},"title":"Drop User: The database principal owns a schema in the database, and cannot be dropped","author":"Everton Gon\u00e7alves","date":"22 de fevereiro de 2012","format":false,"excerpt":"Na tentativa de excluir um usu\u00e1rio de um SCHEMA do SQL Server podemos nos deparar com a seguinte mensagem \"Drop User: The database principal owns a schema in the database, and cannot be dropped\". Para resolver este problema devemos utilizar o ALTER AUTHORIZATION, movendo o usu\u00e1rio do banco para um\u2026","rel":"","context":"Em &quot;SQL&quot;","block_context":{"text":"SQL","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/sql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":327,"url":"https:\/\/www.ctasoftware.com.br\/blog\/push-envio-de-notificacao-firebase-para-usuario-especifico\/","url_meta":{"origin":324,"position":1},"title":"Push Envio de Notifica\u00e7\u00e3o Firebase Para Usu\u00e1rio Espec\u00edfico","author":"Everton Gon\u00e7alves","date":"11 de setembro de 2018","format":false,"excerpt":"H\u00e1 em nossas aplica\u00e7\u00f5es mobile sempre a necessidade de enviar notifica\u00e7\u00f5es push aos usu\u00e1rios dos nossos app. O Google vem mudando recentemente o GCM para FCM (Firebase Cloud Messassing). Neste post mostro como realizar o envio atrav\u00e9s do PostMan. Voc\u00ea ir\u00e1 enviar um POST para a URL https:\/\/fcm.googleapis.com\/fcm\/send Atribuir o\u2026","rel":"","context":"Em &quot;Dicas&quot;","block_context":{"text":"Dicas","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/dicas\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2018\/09\/postman-push-ctasoftware.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2018\/09\/postman-push-ctasoftware.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2018\/09\/postman-push-ctasoftware.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2018\/09\/postman-push-ctasoftware.png?resize=700%2C400 2x"},"classes":[]},{"id":407,"url":"https:\/\/www.ctasoftware.com.br\/blog\/upload-de-multiplos-arquivos-html-e-jquery\/","url_meta":{"origin":324,"position":2},"title":"Upload de Multiplos Arquivos HTML e jQuery","author":"Everton Gon\u00e7alves","date":"17 de julho de 2020","format":false,"excerpt":"Informa\u00e7\u00e3o b\u00e1sica de como fazer upload de v\u00e1rios arquivos utilizando de forma r\u00e1pida o HTML e jQuery Arrastar ou escolher arquivo Script \u00c9 s\u00f3 isso!Obrigado e at\u00e9 mais!","rel":"","context":"Em &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":227,"url":"https:\/\/www.ctasoftware.com.br\/blog\/invocar-chamar-web-api-via-php\/","url_meta":{"origin":324,"position":3},"title":"Invocar\/Chamar WEB API via PHP","author":"Everton Gon\u00e7alves","date":"15 de abril de 2017","format":false,"excerpt":"Chamar API atrav\u00e9s de PHP. A fun\u00e7\u00e3o abaixo chama uma Web API atrav\u00e9s do PHP. [php] function CallAPI($method, $url, $data = false) { $curl = curl_init(); switch ($method) { case \"POST\": curl_setopt($curl, CURLOPT_POST, 1); if ($data) curl_setopt($curl, CURLOPT_POSTFIELDS, $data); break; case \"PUT\": curl_setopt($curl, CURLOPT_PUT, 1); break; default: if ($data) $url\u2026","rel":"","context":"Em &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/php\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":109,"url":"https:\/\/www.ctasoftware.com.br\/blog\/gerador-de-codigo-php-versao-1-0-3-0\/","url_meta":{"origin":324,"position":4},"title":"Gerador de C\u00f3digo PHP Vers\u00e3o 1.0.3.0","author":"Everton Gon\u00e7alves","date":"17 de abril de 2014","format":false,"excerpt":"Prezados, Disponibilizado no link www.ctasoftware.com.br\/download\/gerador_php.msi a nova vers\u00e3o do gerador de c\u00f3digo php. Principais mudan\u00e7as: Valida\u00e7\u00e3o se valor \u00e9 nulo, antes da inser\u00e7\u00e3o na base de dados. Retornar o \u00faltimo ID inclu\u00eddo ap\u00f3s a inclus\u00e3o na base de dados. Corre\u00e7\u00e3o de BUG ao tratar com muitas tabelas. Obrigado.","rel":"","context":"Em &quot;MySQL&quot;","block_context":{"text":"MySQL","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":349,"url":"https:\/\/www.ctasoftware.com.br\/blog\/validar-e-mail-com-filter-no-php\/","url_meta":{"origin":324,"position":5},"title":"Validar E-mail com FILTER no PHP","author":"Everton Gon\u00e7alves","date":"3 de janeiro de 2019","format":false,"excerpt":"Existem in\u00fameras formas de validar e-mail no PHP e em diversas outras tecnologias. Para os programadores PHP existe a constante FILTER_VALIDATE_EMAIL utilizada para valida\u00e7\u00e3o de e-mails. Como sempre vamos direto ao uso. <?php $email = \"validacao-email@ctasoftware.com.br\"; \/\/ Remove os caracteres ilegais, caso tenha $email = filter_var($email, FILTER_SANITIZE_EMAIL); \/\/ Valida o\u2026","rel":"","context":"Em &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/php\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/324"}],"collection":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/comments?post=324"}],"version-history":[{"count":1,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/324\/revisions\/325"}],"wp:attachment":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/media?parent=324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/categories?post=324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/tags?post=324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}