I am writing a simple application that lists all the Notes via the Evernote API. I have successfully authenticated and retrieved a list of Notes.
Now I am trying to get Note thumbnails via the Evernote API. I have read their [documentation here][1]. I tried a POST request, but for some reason it's not working. Obviously, I am doing something wrong. Can you please give me a quick, simple, example?
Example Code:
<form method="post" action="https://www.evernote.com/shard/s226/thm/note/64c08998-0bd3-4964-83fd-73a3baaf53cd.jpg?size=40">
<input type="submit" value="View Thumbnail">
</form>
I just set the form method to POST and action to Note Thumbnail. The note thumbnail works when you log in yourself into the Evernote website, but otherwise, it just says access denied. I am new to Evernote API, so I tried the above code just to see if that works or not.
Correct Example Code:
<form method="post" action="https://www.evernote.com/shard/s226/thm/note/64c08998-0bd3-4964-83fd-73a3baaf53cd.jpg?size=40">
<input type="hidden" name="auth" value="{authentication token}">
<input type="submit" value="View Thumbnail">
</form>
You will need to include the authentication token in the request.
Related
I'm trying to make a PHP page that lets you upload a document to telegram servers and than retrives a file_id which is stored in the json of the redirect page. After some tutorials on YT this is the code:
<?php
$botToken = "1099xxxxxx:AxxxE-g9qDI2Uxxxxxxxxxxxxxxxxxxxxxxxx";
$website = "https://api.telegram.org/bot".$botToken;
?>
<form action="<?php echo $website.'/sendPhoto' ?>" method="post" enctype="multipart/form-data">
<input type="text" name="chat_id" value="mychatid">
<input type="file" name="photo">
<input type="submit" value="send">
</form>
Redirect after submit
The goal is to retrive the file_id of the file and save it in a variable, possibly without opening another tab.
Thanks!
You've making the request to the Telegram API from the browser by submitting a form directly to it.
There is no way your PHP can get any information from that API that way.
As a side effect, you are giving your token (which should be kept secret) to every visitor who uses the form.
You need the browser to submit the form to a PHP program you control and then make the request to the Telegram API from your PHP and not from the browser.
The usual way to do this is with the cURL library.
Hi guys im quite newbie on coding but i want to ask How to post HTML FORM Data to a http link given to you by a client thanks.
Try creating a .html file as below:
<html>
<form method="post" action="urclientlink">
<input type="text" name="firstname"/>
<input type="text" name="lastname"/>
<input type="text" name="submitButton" value="Submit Form"/>
</form>
</html>
Please elaborate on your question for a better answer. Thanks!
This is no different from submitting form data to a page on your own site. You simply amend the form's action attribute:
<form action="http://another-server.com/another-page">
You also need to be sure you get the right METHOD: e.g. GET or POST:
<form action="http://another-server.com/another-page" method="GET">
You will need to check with the client to see which page and method they need.
I am new to PHP. I have the following code and i seriously would like to have the result posted as a tweet via its API. Can anybody provide an example code how would i be able to achieve that result? I think the twitter API script should go after the submit button or so. Also when i created twitter application for this, they asked me for a url but how can i provide it? Since i am using xampp server to run PHP scripts on port number 9999. So would entering localhost:9999 in the url work? Please and thanks...
<html>
<body>
<center>
<form action="abc.php" method="POST">
<textarea rows="5" cols="50" name="typehere"></textarea><br/>
<br/>
<input type="submit" class="button" value="tweet this">
<input type="reset" class="button" value="Clear">
</from>
<?php
error_reporting(0);
$tweet = $_POST["typehere"];
echo "The following tweet has been tweeted.";
echo $tweet;
?>
</div>
</center>
</body>
</html>
Try using the API "twitter-php"
This is the official website with a tutorial
https://code.google.com/p/twitter-php/
You need more than "text message" : the username and the password
Well using the Twitter API is a bit more complicated than that.
You can use Twitter's REST Api, who works like a charm. You'll need to authenticate the user before posting, and some other things.
The complete and easy documentation is there : https://dev.twitter.com/docs/api/1.1/post/statuses/update
In my country some Sites are filtered, for example docs.google.com, bbc.co.uk, facebook etc.
I create a Form in google docs. When I embed form with iframe in my site, users from my country can't view From.
For this reason, I get source HTML google form and then insert to my site. Now users from my country can view the form but when they click Submit, data form can't be sent to google docs, becase google docs url is filtered! My server site is in USA.
Can I get data form from users and then send form with server (with POST method) to google docs?
For example my form code is this:
<form action="https://docs.google.com/forms/d/1B_p03NcbwnGRFAiAy0YoEPFckDELH1I-p71_2Kgq6_A/formResponse" method="POST" id="ss-form" target="_self" onsubmit="">
Your Name: <input type="text" name="entry.278240263" value="" class="ss-q-short" id="entry_278240263" dir="auto" aria-required="true" required="" title="">
<input type="submit" name="submit" value="Submit" class="button" id="ss-submit">
</form>
I need to send data form to https://docs.google.com/forms/d/1B_p03NcbwnGRFAiAy0YoEPFckDELH1I-p71_2Kgq6_A/formResponse with server by Json
Sure you can. Have a look at: https://wiki.base22.com/pages/viewpage.action?pageId=72942000
There is a section describing how to post data to google docs by ajax from javascript but it should be similar in php
I'm trying to use a standard form in a facebook application
the form code look like this
<form method="POST" action="/bristolhouse/">
<input type="hidden" name="kind" value="admin" />
{$admin_message} <br />
<input type="submit" value="Add" />
</form>
The error I'm getting is
API Error Code: 100
API Error Description: Invalid parameter
Error Message: Requires valid redirect URI.
I've seen this error before when I didn't have the correct values in my config file for the redirect URI. I'm not sure if i need to include auth_tokens or how I should be including the URI. I can't find any examples on the net.
Edit: For example the link I'm getting to is https://www.facebook.com/dialog/oauth?client_id=282683341837527&redirect_uri=
so I'm getting to the right place just not passing the correct parameter
Suggestion, try changing action="/bristolhouse/" to action="bristolhouse"
ie removing the slashes