-1

Is there a way that I can possibly pass my variable from an offline page to my online page?

I have the following code on a page on Website A that contains the email of my receiver:
$emailOutput = $dataQuery_email->contact_email;

This is my code so far but it's not working. file_get_contents("http://my_domain.com/sendEmail.php?email_id=".$emailOutput);

On my sendEmail.php I did this:

$to = $_GET[$emailOutput];

Is there any other way?

jelo
  • 1
  • 2
  • 1
    Possible duplicate of [How to send a GET request from PHP?](https://stackoverflow.com/questions/959063/how-to-send-a-get-request-from-php) – Shadow Aug 26 '18 at 01:27

2 Answers2

0

Change $to = $_GET[$emailOutput]; to $to = $_GET['email_id']; as that is the name of the get parameter you have passed in your URL.

Take a look at this article for a basic overview of HTTP GET

Jed Hodson
  • 44
  • 7
0

Your url parameter was email_id, and $emailOutput was a variable/ value that youve passed to the url, replace $_GET[$emailOutput] with $_GET["email_id"];