Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to create and access angular HTTP params in PHP

//Crreating HTTP params
//e.g. http://localhost/api/something.php?title=value&content=value
let httpParams = new HttpParams()
  .set('title', this.createNewForm.controls['title'].value)
  .set('content', this.createNewForm.controls['content'].value);

//Then pass the Http params object to the http.get) method
this.http.get('http://localhost/api/something.php', {httpParams}).then();

//Accessing these parameters in PHP
$title = $_GET['title'];
$title = $_GET['content'];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #create #access #angular #HTTP #params #PHP
ADD COMMENT
Topic
Name
4+3 =