• I’m using a plugin and i’ve added some code to it to send an email. Now i’m getting an unexpected T_VARIABLE.

    I’m not a php developer so i know it’s probably something obvious but i don’t know what.

    Most of this code was already in the plugin. The bit i’ve added is in the middle. i’ve put a comment to show where.

    Here’s the code:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    Does anyone know what’s wrong with it?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Corbula

    (@corbula)

    Headers line is this

    $headers = ‘From: ‘$_POST[’email’];

    but should read this

    $headers = ‘From: ‘ . $_POST[’email’];

    Notice the ‘.’, which is the concatenation operator which puts 2 strings together

    Thread Starter Corbula

    (@corbula)

    Thanks.

    I’ve managed to get this to work. I thought i would of needed something between the bit i’ve added and the first section, an elseif or something but it’s working without anything in between them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding php causes unexpected T_VARIABLE’ is closed to new replies.