I'm using keyauth's api to try and create a simple page with a text input and submit button.
I'm trying to make it so the data (license key) that user inputs in the text field is added to "user" at the end of api url https://keyauth.win/api/seller/?sellerkey=mysellerkey&type=resetuser&user=licensekeyThatUserWantsToReset
any idea how can I make such thing? I know basics but not sure how to make a request that is based on user input
Related
Guys i'm creating a bot on a telegram that at certain (textual) input responds by writing in various ways.
The bot is also able to create buttons in the telegram chat (between the user and the bot).
In one of these buttons, if the user clicks, a page from my website opens.
I have to switch the chat ID to this internet page but I'm looking for a safe way to do it.
I could put the id in the link
example.com?chat_id=xxx
but it's unsafe and I don't want the user to be able to change the link and the value of the chat_id
So how could I do?
Is there a way to pass the data to the internet page from file.php?
In short, a POST method
I hope you can help me (sorry for my English)
When you get "chat_id", you can get user id too.
users.getUsers
Returns basic user info according to their identifiers.
You need to create a key, for your bot. Use the same in your php
application. Make a hash with infos and your key.
Replace example.com?chat_id=xxx with
example.com?chat_id=YOUR HASH.When the user go to your page, decrypt them with your key.
And now, you have chat id & user.
I recommend to use a salt
We built a survey tool on top of google forms using wordpress.
Simply, you create a google form, create a private open link, put into a wordpress backend page, then the system processes the module server side and generates the necessary html file. When the user fills the form and sent it, via ajax the server use zend gdata to write the results on the spreadsheet connected to the form et voilat.
But this system is limited, also because google form is quite limited. We want to improve it.
That's why I'm asking your opinions to upgrade the system to have some more features:
We want to be able to keep the form open so that users can fill it in more than one occasion. theoretically then, we need to know which user the spreadsheet rows are connected to. This could be done by saving some sort of ID key to recognize the user, but then we don't know how to refill the fields in the form, since the spreadsheet created from the forms don't retain any sort of key to connect columns and form field.
We need more field types! like a file upload field that put the uploaded file in a specific gdrive folder.
We need to see the data for the single entry while google gives you only the whole spreadsheet that's quite hard to read.
It's not an easy task! Which solutions should we use to solve these problems?
Many thanks!
UPGRADE:
We decided to go by using a mix of google forms, google fusion tables, google charts via api access. Here's the simplified algorithm:
The admin user create his form via google forms and save the url. To have more field type, user can put a tag in the field comment, eg [file] for, well, files upload.
The url is put into an admin page of our system. The page fetch the content of the form page and extrapolate into an array, for every field, the title, the ID, the type and the comment; if there's some tag in the comment, this become the field type.
Using this data, system create if not existing a folder with a fusion table inside. if file fields are present, another subfolder is generated. Addresses of these folders and files is saved.
Using the array data, in the fusion table a column is created for each of the array fields, with a column title of this sort "[field_ID field_type]field_title", plus a column for the end user ID.
The admin user, can more over open or close the form.
When a user goes to the form page, the array is used to generate the form. If the system doesn't have in memory the user ID it means that the user has never filled up the form. Otherwise the system will use the user ID to fetch the data from the fusion table to populate the form.
When the user fills up the form, the entries are feed to the columns using the field ID as reference, plus the user ID. The user ID is also stored in the system the remember that the user already filled the form, as said in point 5. If files are uploaded, they are stored in a gdrive folder.
The admin user therefore can go to the admin page and see how many people has filled up the form, can ask for single user data, for summary data using google charts, can download a pdf of data from single user, every user, or summary.
Of course this is the idea, we have to build it. One first question is whether we should use javascript or php to communicate with google, so doing the processing on the client or server side...
If you're asking about Javascript vs PHP, you should know that the Javascript API can't write to a Google Spreadsheet because of Cross-Domain Security issues.
PHP can as it is a server side language. Zend Framework makes it easy to interact with Google Spreadsheets. http://framework.zend.com/manual/1.12/en/zend.gdata.spreadsheets.html
So go with PHP if that was your question.
I was trying to build a php application which should be in form of service oriented.So I"m trying to build a login page , when I pass the user name & password with the URL I should get a confirmation with user details.I don't know what to do.So please help me!
So for this type of login form, you should look into .ajax from jQuery, if you wish to use that.
Facebook has in their documentation an example for a custom sign-up form:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'favorite_car','description':'What is your favorite car?',
'type':'text'}]" redirect-uri="URL_TO_LOAD_AFTER_REGISTRATION">
</fb:registration>
I want to create something like this but instead of favorite car my custom field is the address and I want fb-only registrations:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'address','description':'Address',
'type':'text'},{'name':'zipcode','description':'Zipcode',
'type':'text'}]" redirect-uri="http://example.com/register-exec.php"\
fb_only='true' fb_register='true'>
</fb:registration>
After the user registers, does Facebook keep in their database the custom field address and zipcode?
I can run
$facebook->api('\me')
to get user info but can I do something like
$facebook->api('\me\zipcode')
I am making the website facebook-only so I want facebook to keep track of these fields (I don't want to make my own database for this). Also, how can I know if someone has registered to the website when they access a page of the site?
Thanks
Facebook doesn't keep any record of the values provided by the user to any custom fields the developer requests
Your own app needs to process and store those in your own database - they won't be retrievable via the API as they're only passed during validation and submission of the registration plugin
On my site I've added a Tweet button. What I want to do is whenever user clicks on that button and the tweet gets posted on user's twitter account, I want to catch the unique id of that tweet and store it into the database.
Is it possible to do that using PHP??
When calling the REST API (http://api.twitter.com/1/statuses/update.json -- or whichever format), you get back the ID string. However, it also implies that you must route everything through your server using oAuth.
Alternatively, you could use the JavaScript API, along with one of the official Twitter JS widgets, and create an event listener to catch the tweet event. From there, you should have appropriate information in the data field of the event (something like evt.data), which you could pass to your server through AJAX.
JS Docs: https://dev.twitter.com/docs/intents/events
REST Docs: https://dev.twitter.com/docs/api