Is there a way to verify client with curl?
I'm making a client/server application with php.

The server takes an array serializes and echos the result.

the server could be hosted at www.site1.com/server.php

    echo serialize($array);

The client could be hosted at www.site2.com/client.php

    $ch = curl_init('http://www.site1.com/server.php');
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    echo curl_exec($ch);

What I'm trying to do is to make server.php only echo the information iff the client is from www.site2.com/client.php.

Something like

    iff('Client is from www.site2.com/client.php'){
      echo curl_exec($ch)
    } else {
      exit();
    }

site2 does not have SSL

What variable do i look up, or is there a way to do this?


Is there a way to verify client with curl?
===

I'm making a client/server application with php.

The server takes an array serializes and echos the result.

the server could be hosted at www.site1.com/server.php

    echo serialize($array);

The client could be hosted at www.site2.com/client.php

    $ch = curl_init('http://www.site1.com/server.php');
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    echo curl_exec($ch);

What I'm trying to do is to make server.php only echo the information iff the client is from www.site2.com/client.php.

Something like

    iff('Client is from www.site2.com/client.php'){
      echo curl_exec($ch)
    } else {
      exit();
    }

site2 does not have SSL

What variable do i look up, or is there a way to do this?

