Do two actions with a form - forms

Hey, I'm just wondering if it's possible to have a form in html do two things on submit, have the action go to a url like normal (PayPal) but also go to a php program to send me an email.

You could use AJAX to submit the two actions requests individually.
Alternatively, just process the request at your server end code and make the appropriate requests from there.
There maybe better solutions depending on the exact context.

Related

Automate clicking in a website and performing tasks

I want to add my email as an allowed email address to those who use my program. In amazon i need to follow a set of procedures for making sure that my email address is allowed. I want to know if it is possible to automate this process using a perl module since it is extremely repetitive.
I have to login and then click manage kindle and then a few other buttons as a user . How would i automate this process using a perl script.
Sounds like you want WWW::Mechanize.
You have two options. You can either use greasemonkey to run a browser script to automate the clicking for you using javascript or you can use your programming language of choice with curl to get the page you need, scrape the data, then resubmit that data via get or post depending on what the site uses. If you know the url for the page to press the final button on, you can make a curl request to log in, then make a curl request to pretend like you just clicked the button on that page. Most of the time you don't need to visit all the pages in-between the two. Sometimes though, you do. Curl can be complex and a bit daunting to new users, but here's a curl module for perl http://search.cpan.org/perldoc?WWW::Curl If you need to learn how to use it, here's a good resource http://php.net/manual/en/ref.curl.php It's in php, but I think all the functions should be the same as the ones in perl. Amazon shouldn't, but if they do block curl requests, just copy the headers from your browser into curl and use those. Good luck!

Prevent form data from being cached, and re-accessing with back button

I am considering making a very simple form for clients to use in a sort of web browser kiosk fashion, where they submit some of their information through the computer in the lobby at their option instead of writing something out by hand. This would be used if they come in person rather than calling or going to the web site first. I already have a form on our site for clients to use from their home computers so this would be very similar but tailored for and only used for the in-person clients.
Since the form will sort of just loop back to itself (not really "back" but just have a link to go back to a fresh form) for a fresh form after every client, how can I ensure that one can't hit back a few times to see the previous client's info? It's not really sensitive data, I just would like to provide that bit of privacy. Of course clients using our web site and the form there from their own computer are responsible for their own privacy.
Apart from having customer service walk to the computer and close and reopen the browser, or using AJAX, what should I do?
The other topics I've read related to this all have someone basically saying "you're not supposed to do that, you bad person". This seems like a valid reason to me. Any ideas?
Thanks!
Disable autocomplete by adding autocomplete="off" to the input tags or form tag.

Forwarding to Paypal with GET

i usually use the standard POST form on my site, with fields that the user fills out, which POSTs directly to https://www.paypal.com/cgi-bin/webscr
what i would like to do now, is have the form submit to my own site, for my own internal programming purposes, and when that is done, my site would automatically forward the user to paypal, with the relevant field data in the URL, for example, to: https://www.paypal.com/cgi-bin/webscr?first_name=foo&last_name=bar& etc...
this would save me from having to put the intermediate stage of the form with the hidden fields, asking the user to "click here to complete your transaction on PayPal"
hope i'm understood....
thanks!
Sure, it'll work. But keep in mind that unless you involve the BMCreateButton or Express Checkout API's, the amount will be open to URL manipulation, so you must do a check on the paid amount afterwards.
For example; https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=blah#blah2.com&amount=0.99&currency_code=GBP&item_name=Blah+for+sale
Note: The GET redirect must be initiated on the browser-side or via a header() redirect. You can't use cURL for this, since that's a server-to-server communication.

using ajax to make email addresses safe?

I'm sorry if this is duplicating another post. I have a possible answer to a question in another post but I'm not sure if its a good solution and I wanted to ask people for their views.
The problem is the one raised in this post, how to protect emails from spam bots.
Rather than have the addresses on the page, split into different vars and then assembled by JavaScript, I send an ajax request to the server (just a GET to the welcome_controller) with a key ie 'address_id_42' in the params and it returns a mailto link which is then inserted into the page.
Is there any gain by not having any address data on the page initially? Is any advantage immediately lost by the fact the server will just hand out mailto links if you send it the right address id?
I could easily extend it so the server replies with some custom structure which gets unraveled by the js, but I agree that really this is not the right place to focus and that better spam filtering is the way forward, but I'm interesting in what people think to using ajax as a level of obfuscation?
Cheers :)
It depends on the kind of website it is.
Is the page only accessible after authentication (login)?
Is there another (simpler) way of doing it rather than getting it using AJAX?
The answer to your question really depends on these things.
But in a general way, yes, it might help. But such AJAX requests should only be triggered by some "humanly" action like clicking on "show email" button or something like that.
Also you could convert the email text to an image (which I believe is pretty easy to do with PHP).
Also other solutions could involve separating the two parts of the email address (part before and after '#' symbol) by putting them in different 'spans' etc.
I think obfuscating content through AJAX is a great idea. However, you can also try ready to use third party implementations like Mailhide instead of building all of this yourself. You get an additional layer of security by making the user fill up a CAPTCHA before the email address is revealed.

Advice needed- aweber form submission using curl?

Advice needed for backend form submission to aweber and get response.
Scenario
When customer signup at my form, I will
1. insert the customer details into my own database,
2. send them a welcome email from my system,
3. at the same time I want the email to be added into aweber (this should run in the background, so that customer no need to fill in details for second time)
If I use the php curl call alone, is it a good solution?
I want to submit form value to aweber, so that aweber add the new email into their system, and then response to my backend script?
I have seen many versions outside, which may include:
http://scripts.incutio.com/httpclient/
http://freshmeat.net/projects/curl_http_client/
http://snoopy.sourceforge.net/
Are they having any special benefit over the normal php curl call to pass in data?
I have done this successfully before just using just a cURL request, but I couldn't get aweber to accept the submission without sending the person a confirmation message of their own. Basically it acts as if you have "confirmed opt-in" turned on, even if you turn it off.
Also, aweber addlead.pl script doesn't return anything, so if you had something in mind for that it won't go anywhere.
Hope this helps!