Jump to content

Sending text via button without form


Doublea

Recommended Posts

Hi guys,

 

I'm currently trying to send some text when a button is clicked via PHP without using a form.

 

I've managed to send text from a form and get that sent using post method:

 

<form name="" action="<?=$config['baseurl']?>" method="post">
            <label for="eventbox">Facebook Events</label>
            <br />
            <textarea id="eventbox" name="tt" cols="50" rows="5">I am attending Cadenza - 4th July and signed up via Ibizatalk.com</textarea>
            <br />
            <input type="submit" name="eventbox" value="Attend Event on Facebook" />
        </form>

 

and then my PHP:

 

if (isset($_POST['tt'])){
            try {
                $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> $_POST['tt'], 'cb' => ''));
            } catch (FacebookApiException $e) {
                d($e);
            }
        }

 

So currently I have it posting 'tt' but I need it to not post the form content but just post text. How can I send text that isn't in a form?

 

Thanks guys, really need your help!

 

 

Link to comment
https://forums.phpfreaks.com/topic/208672-sending-text-via-button-without-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.