I am new to Symbian C++. I want to send some values from my Symbian App to a PHP script using HTTP post.
i want to send two values to PHP script....how to do this...Please provide any sample coding...
I am new to Symbian C++. I want to send some values from my Symbian App to a PHP script using HTTP post.
i want to send two values to PHP script....how to do this...Please provide any sample coding...
have you checked SDK's examples folder already (Examples\AppProts\exampleclient) ?
yes i checked that..In that i see Httpclient Example....But I cannot find the particular http codings....I have tried from this url..http://www.developer.nokia.com/Devel...tworking.xhtml
can you any other simple sample code....simply i want to send two values to PHP script alone.....
Last edited by ramtrg; 2011-08-22 at 07:44.
httpexampleclient.cpp has all the codes needed, basically from client side it does not matter whether the receiver is PHP or something else.
I have tried to post some values to server using HTTP Post.After these below coding, What i want to do...Please help me t complete this code...Also shall i want to include any header files for HTTP POST...please help me
_LIT8(KPostUri, "http://www.mywebsite.com/fasttrack/apps.php");
_LIT8(KPostParamName1, "number");
_LIT8(KPostParamName2, "msg");
_LIT8(KMimeType, "text/plain");
Look in the wiki ( e.g., articles such as http://www.developer.nokia.com/Commu...Url_parameters ), and the SDK documentation.
If that's not enough to solve your problem, then more details are needed (more relevant code snippets, and any and all compiler and/or runtime errors).
Basically you do need loads of actual code there, those lines are just defining literal constants, i.e. string
I did suggest some code samples already in: http://www.developer.nokia.com/Commu...ht=#post857470 that are rather minimal ones, you would basically justn need to remove all GET etc parts of the code (check any switch statements etc.)
there is also bigger HTTP example available at examples section: http://www.developer.nokia.com/Devel...Code_examples/
if you find these too hard to figure out, then please do try using Qt instead, it is generally easier to get started with.
I have seen the "S60 Platform: HTTP Client Example v2.2" from "http://www.developer.nokia.com/Develop/Other_Technologies/Symbian_C++/Code_examples/". As Beginner, this sample is very hard to understand for me...So please give me some other simple Example....
the simpler one was the one I gave on that other thread.
Also as suggested, Qt might be easier: http://www.developer.nokia.com/Commu..._Post_using_Qt
In my Symbian Application, I want to post two values to server. For that, I have tred like below coding....Is the below coding is correct....Please help me....
Code:void CLiveTrackContainerView::PositionUpdatedL(TPositionInfoBase& aPosInfo) { ...... ...... if ( !Math::IsNaN(position.Longitude()) ) { .... ..... _LIT8(KPostUri, "http://mywebsite.com/fasttrack/apps.php"); _LIT8(Knumber, "01234567891"); _LIT8(Kmsg,ptr); //here ptr is message i want to post, also it is a String } } void CHTTPExampleEngine::PostRequestL(const TDesC& anumber,const TDesC& amessage) { delete iFormEncoder; iFormEncoder=null; iFormEncoder = CHTTPFormEncoder::NewL(); TBuf8<50> iTemp; TBuf8<50> iTemp2; iTemp.Copy(anumber); iTemp2.Copy(Knumber); iFormEncoder->AddFieldL(iTemp2,iTemp); iTemp.Copy(amessage); iTemp2.Copy(Kmsg); iFormEncoder->AddFieldL(iTemp2,iTemp); iTransaction.Request().SetBody(*iFormEncoder); iTransaction.SubmitL(); }
Can you please just check the examples that were suggested in two previous thread:
http://www.developer.nokia.com/Commu...sing-HTTP-POST
http://www.developer.nokia.com/Commu...sing-HTTP-Post
And see what they do, and then if they have problems, then please identify what kind of problem there is that you are having. Codes you have here are not really making too much sense.
[The threads are merged now, you do not even have to click]