Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
810 views
in Q2A Core by
edited by
Hi there using this API how can i post anonymously POST Question ?
<?php

	require_once '/PATH/TO/qa-include/qa-base.php';

	require_once QA_INCLUDE_DIR.'qa-app-users.php';
	require_once QA_INCLUDE_DIR.'qa-app-posts.php';
	
	$type='Q'; // question
	$parentid=null; // does not follow another answer
	$title='Why do birds sing?';
	$content='And why do they fall in love?';
	$format=''; // plain text
	$categoryid=null; // assume no category
	$tags=array('birds', 'sing', 'love');
	$userid=qa_get_logged_in_userid();
	
	qa_post_create($type, $parentid, $title, $content, $format, $categoryid, $tags, $userid);

2 Answers

0 votes
by
selected by
 
Best answer
Please look at the function definition in qa-app-posts.php in Q2A 1.6.
by
Thanks it helped me
0 votes
by

Here what I understood and according to my Logic...

See qa-app-post-create.php may be you will get more idea how it works..

qa_combine_notify_email() // this function checks whether usre is logged in or anonymous and entered value. which is used in 

qa_question_create() and this function called in qa_post_create() which you are using in your code.

So when you create a post it will check for logged in user id and if not than will consider anonymous and insert data accordingly. Just you need to get email ID from them.

by
THank u so Much
...