Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Auto actions pass variable

  • GUEST
9 years 3 months ago - 9 years 3 months ago #268086 by
Hi,

Trying to POST a variable to a PHP script with CB Auto actions.
For now the script only echo's back the received POST variable.

I can see that the script is called and returns the "OK".
The problem is that the script does not seem to receive any POST variable I put in Auto actions Headers.

Auto action header:
Trigger: Manual 'Click to Execute'
Conditions: none
Action:
Methode = POST
URL = url to script
Header Key= cb_id
Header Value= [user_id] (or anything I put here)


Script:
<?php
echo "OK, $_POST["cb_id"]";
?>

also tried echo "OK,$_POST[0]";

I would expect to see the user_id being echo'd or anything I put in the Header value, but only get OK, back.

What am I doing wrong?
Last edit: 9 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #268135 by krileon
Replied by krileon on topic Auto actions pass variable
It's sending an HTTP POST request using CURL to your script. The URL to your script needs to be a live path beginning with domain. You're also sending the POST data as a Header of the CURL request. You need to send it as part of the Body.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • GUEST
9 years 3 months ago #268138 by
Replied by on topic Auto actions pass variable
Ah..in the body..I thought I tested that, but tried it again, (deleted the Header entry) and now indeed it works.
Thanks for clearing that up!

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum