I was developing a simple client and Server in php and came up with this

```
Client.php

<?php
// Create map with request parameters
$params = array ('name' => 'ASD', 'lastname' => 'SDF');

// Build Http query using params
$query = http_build_query ($params);

// Create Http context details
$contextData = array (
    'method' => 'POST',
    'header' => "Connection: close\r\n".
        "Content-Length: ".strlen($query)."\r\n",
    'content'=> $query );

// Create context resource for our request
$context = stream_context_create (array ( 'http' => $contextData ));

// Read page rendered as result of your POST request
$result =  file_get_contents (
    'http://localhost/phpserver/server.php',  // page url
    false,
    $context);

// Server response is now stored in $result variable so you can process it

```

The server File is:

```
Server.php

<?php

if( $_POST["name"] || $_POST["lastname"] )
{
    echo "Welcome: ". $_POST['sirname']. "<br />";
    echo "Your Email is: ". $_POST["lastname"]. "<br />";

}
?>

```

I got an error saying

> 
> Notice: file\_get\_contents(): Content-type not specified assuming
>  application/x-www-form-urlencoded in C:\wamp\www\phpServer\client.php
>  on line 22
> 
> 
> 

**I do not have much of a knowledge in php. Just want to pass a data between a simple server and a client** **(Better a Curl-less solution)**