How to send online user in wordpress with POST method? [closed]









up vote
-3
down vote

favorite
1












I would like to send the username of the user who is online in the WordPress system with a POST method to another link.



For example: I want to send the user name from http://mywordpresssite.ir to http://myaspsite.ir.










share|improve this question















closed as unclear what you're asking by Matthew L Daniel, Mark Amery, Shiladitya, Billal Begueradj, Tân Nguyễn Nov 11 at 6:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • it's very important for me. plz hlp me.
    – Mehdi Niknejad
    12 hours ago














up vote
-3
down vote

favorite
1












I would like to send the username of the user who is online in the WordPress system with a POST method to another link.



For example: I want to send the user name from http://mywordpresssite.ir to http://myaspsite.ir.










share|improve this question















closed as unclear what you're asking by Matthew L Daniel, Mark Amery, Shiladitya, Billal Begueradj, Tân Nguyễn Nov 11 at 6:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • it's very important for me. plz hlp me.
    – Mehdi Niknejad
    12 hours ago












up vote
-3
down vote

favorite
1









up vote
-3
down vote

favorite
1






1





I would like to send the username of the user who is online in the WordPress system with a POST method to another link.



For example: I want to send the user name from http://mywordpresssite.ir to http://myaspsite.ir.










share|improve this question















I would like to send the username of the user who is online in the WordPress system with a POST method to another link.



For example: I want to send the user name from http://mywordpresssite.ir to http://myaspsite.ir.







php wordpress post






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 at 12:36









Karsten Koop

2,02111219




2,02111219










asked Nov 10 at 17:59









Mehdi Niknejad

1




1




closed as unclear what you're asking by Matthew L Daniel, Mark Amery, Shiladitya, Billal Begueradj, Tân Nguyễn Nov 11 at 6:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Matthew L Daniel, Mark Amery, Shiladitya, Billal Begueradj, Tân Nguyễn Nov 11 at 6:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • it's very important for me. plz hlp me.
    – Mehdi Niknejad
    12 hours ago
















  • it's very important for me. plz hlp me.
    – Mehdi Niknejad
    12 hours ago















it's very important for me. plz hlp me.
– Mehdi Niknejad
12 hours ago




it's very important for me. plz hlp me.
– Mehdi Niknejad
12 hours ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













UPDATED:



This code sends the username of an online user to an example link.



You should use the following code.



function send_username_online_user()

if ( is_user_logged_in() )

$get = wp_get_current_user();

$url = "http://myaspsite.ir";
$data = wp_remote_post( $url,
array(
'body' => array(
'username' => $get->user_login
),
'method' => 'POST'
)
);


add_action( 'init', 'send_username_online_user' );





share|improve this answer






















  • No. I want send UserName of OnlineUser with POST METHOD
    – Mehdi Niknejad
    Nov 12 at 4:37










  • I updated the answer. Read it again. @mehdi-niknejad
    – Arman Hosseini
    Nov 12 at 21:34










  • how and where use this code?
    – Mehdi Niknejad
    Nov 14 at 4:32











  • Use this in following path: wp-includes/functions.php
    – Arman Hosseini
    Nov 14 at 6:46











  • I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
    – Mehdi Niknejad
    Nov 14 at 7:07


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













UPDATED:



This code sends the username of an online user to an example link.



You should use the following code.



function send_username_online_user()

if ( is_user_logged_in() )

$get = wp_get_current_user();

$url = "http://myaspsite.ir";
$data = wp_remote_post( $url,
array(
'body' => array(
'username' => $get->user_login
),
'method' => 'POST'
)
);


add_action( 'init', 'send_username_online_user' );





share|improve this answer






















  • No. I want send UserName of OnlineUser with POST METHOD
    – Mehdi Niknejad
    Nov 12 at 4:37










  • I updated the answer. Read it again. @mehdi-niknejad
    – Arman Hosseini
    Nov 12 at 21:34










  • how and where use this code?
    – Mehdi Niknejad
    Nov 14 at 4:32











  • Use this in following path: wp-includes/functions.php
    – Arman Hosseini
    Nov 14 at 6:46











  • I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
    – Mehdi Niknejad
    Nov 14 at 7:07















up vote
0
down vote













UPDATED:



This code sends the username of an online user to an example link.



You should use the following code.



function send_username_online_user()

if ( is_user_logged_in() )

$get = wp_get_current_user();

$url = "http://myaspsite.ir";
$data = wp_remote_post( $url,
array(
'body' => array(
'username' => $get->user_login
),
'method' => 'POST'
)
);


add_action( 'init', 'send_username_online_user' );





share|improve this answer






















  • No. I want send UserName of OnlineUser with POST METHOD
    – Mehdi Niknejad
    Nov 12 at 4:37










  • I updated the answer. Read it again. @mehdi-niknejad
    – Arman Hosseini
    Nov 12 at 21:34










  • how and where use this code?
    – Mehdi Niknejad
    Nov 14 at 4:32











  • Use this in following path: wp-includes/functions.php
    – Arman Hosseini
    Nov 14 at 6:46











  • I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
    – Mehdi Niknejad
    Nov 14 at 7:07













up vote
0
down vote










up vote
0
down vote









UPDATED:



This code sends the username of an online user to an example link.



You should use the following code.



function send_username_online_user()

if ( is_user_logged_in() )

$get = wp_get_current_user();

$url = "http://myaspsite.ir";
$data = wp_remote_post( $url,
array(
'body' => array(
'username' => $get->user_login
),
'method' => 'POST'
)
);


add_action( 'init', 'send_username_online_user' );





share|improve this answer














UPDATED:



This code sends the username of an online user to an example link.



You should use the following code.



function send_username_online_user()

if ( is_user_logged_in() )

$get = wp_get_current_user();

$url = "http://myaspsite.ir";
$data = wp_remote_post( $url,
array(
'body' => array(
'username' => $get->user_login
),
'method' => 'POST'
)
);


add_action( 'init', 'send_username_online_user' );






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 21:33

























answered Nov 10 at 19:20









Arman Hosseini

209




209











  • No. I want send UserName of OnlineUser with POST METHOD
    – Mehdi Niknejad
    Nov 12 at 4:37










  • I updated the answer. Read it again. @mehdi-niknejad
    – Arman Hosseini
    Nov 12 at 21:34










  • how and where use this code?
    – Mehdi Niknejad
    Nov 14 at 4:32











  • Use this in following path: wp-includes/functions.php
    – Arman Hosseini
    Nov 14 at 6:46











  • I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
    – Mehdi Niknejad
    Nov 14 at 7:07

















  • No. I want send UserName of OnlineUser with POST METHOD
    – Mehdi Niknejad
    Nov 12 at 4:37










  • I updated the answer. Read it again. @mehdi-niknejad
    – Arman Hosseini
    Nov 12 at 21:34










  • how and where use this code?
    – Mehdi Niknejad
    Nov 14 at 4:32











  • Use this in following path: wp-includes/functions.php
    – Arman Hosseini
    Nov 14 at 6:46











  • I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
    – Mehdi Niknejad
    Nov 14 at 7:07
















No. I want send UserName of OnlineUser with POST METHOD
– Mehdi Niknejad
Nov 12 at 4:37




No. I want send UserName of OnlineUser with POST METHOD
– Mehdi Niknejad
Nov 12 at 4:37












I updated the answer. Read it again. @mehdi-niknejad
– Arman Hosseini
Nov 12 at 21:34




I updated the answer. Read it again. @mehdi-niknejad
– Arman Hosseini
Nov 12 at 21:34












how and where use this code?
– Mehdi Niknejad
Nov 14 at 4:32





how and where use this code?
– Mehdi Niknejad
Nov 14 at 4:32













Use this in following path: wp-includes/functions.php
– Arman Hosseini
Nov 14 at 6:46





Use this in following path: wp-includes/functions.php
– Arman Hosseini
Nov 14 at 6:46













I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
– Mehdi Niknejad
Nov 14 at 7:07





I used it in function.php but not work. please tell me step by step. i'm not prefissional user in php and wordpress. I want to check if the user clicks on the link to see if he has logged in. After login, his username will be sent to a ASP page.
– Mehdi Niknejad
Nov 14 at 7:07




這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto