Zend Framework: How to POST data to some external page (e.g. external payment gate) without using form? - zend-framework

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g. Firebug. I think you cannot do this using $this->_redirect(...). But maybe there is some other solution?
Many thanks for any tips or suggestions.

I would like to have a user redirected to an external credit card gate. Of course I have to POST some user info to that gate, but I don't know how exactly can I do this.
Using a form is the only method available. The RFC states that the user should explicitly agree to sending a POST (i.e. click on a submit button).
I know that I could do this by generating a html form with hidden or read-only fields and have a user click "Submit" button. But this solution is not perfect, because all the form data could be easily changed using e.g.
It is no more secure that using a redirect as the header data can be modified without too much of a problem. There are even Firefox plugins to do it.

use cURL to post data
http://framework.zend.com/manual/en/zend.http.client.adapters.html

Related

Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow?

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T
In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

How do I make a link that pre-fills a form checkbox?

I have a page called contact.htm with a working form. One of the checkbox fields on the form is named Garden (so either it is checked or not when using the form).
I have another page that I want to link to my form page, so that if a user clicks a particular link, they are sent to the form page and the field Garden is pre-clicked.
I have not been able to do this though I have tried several methods...such as:
a href="contact.htm?checkbox=Garden,on" or
a href="contact.htm?checkbox=Garden,checked" or
a href="contact.htm?input type="checkbox" name="Garden" value="checked", and some others.
I would appreciate any help.
You'll need to use JavaScript on the target webpage to process the argument and fill the values in. There is no automatic way of doing this just by URL.
This link shows how to retrieve URL arguments from JavaScript. From there, it's a matter of using standard JavaScript or JQuery to fill the values in.

check user availability in forms in jsp

I have a jsp form which takes in user details. On submit button it goes to a jsp page where the details are entered into the database. But before that I would like to check if the username is available as soon as the user clicks the check availability button. How can this be done?
2 ways:
Just redisplay the same page after submitting the form wherein you conditionally display the validation message. This is rather trivial and already covered in the Hello World example in our Servlets wiki page.
Use Ajax to send an asynchronous HTTP request and manipulate the HTML DOM based on the response of the request. This requires a bit more in depth understanding of how websites really work and what JavaScript is. You can find some concrete examples in How to use Servlets and Ajax?
Use AJAX(Asynchronous Javascript and Xml). Its the best web2.0 technology. You can manipulate DOM based on the answer from server

ASP Classic - Passing form data to Iframe

I'm looking to pass data from a form into an iFrame, but I have a slight problem.
The form page I can edit with no restrictions
The page I send the data to I cannot edit unless its html or JavaScript
The data needs to end up in an iframe within this page, which I can edit with no restrictions
I'm incorporating a search function into a CMS system which is why I cannot edit the iframe's parent page, and why I am using iframes at all.
At the moment the data sends to the parent page but is not picked up within the iframe, I am sending via the POST method.
I got it..
Added and extra page which converted the post data into session data,
if anyone knows a better way i would like to hear it though.
And they are the same domain, but editing the CMS system would have taken ages to look through as its not mainstream or developed by me.
Maybe I'm oversimplifying the problem, but can't you use the "target" attribute of the form tag to post to the Iframe?

Grab html code by entering username and password on a webpage on iPhone

Im trying to grab a HTML source code from a webpage which needs user to login with username and password, the code are all done in the back end, i can not use "?username=xx&pw=xxx" to get the html code.
There are many apps that does this kind of things, such as getting usage from a phone provider or view bills.
I would like to know how do people implement this. do they create some kind of robot that input those username into the textfield and click submit? and is there a way to download the html straight from the server, rather than create our own server to retrieve it.
How do i set the username textfield on the webpage and click log in button to retrieve the next page?
Thanks in advance
i can not use "?username=xx&pw=xxx" to get the html code.
Why not? If a user can submit their login creds over HTTP, then you can do the same. You'll probably need to use POST instead of GET to submit those fields, and there may be other fields on the form that you'll need to match. But the web server doesn't (in principle) have any idea what sort of client is submitting login data to it.
Now, they might screen out older, non-supported browsers, in which case your USER_AGENT field will need to be fudged to some legal value. There may be some session timeout token in the form that you need to get first and provide in your submitted data. Who knows what else they need back from you to validate the login. But if a web browser can do it, you can do it from the HTTP client methods in your app.