I built a form where user post urls of different categories of website. I did some validation that user only post url at right format. I also want to filter the adult urls or i want to stop the user to not post Adult urls. For submit the form there is no login or logout options. No signup required to post the urls. Any idea how to do this .?
i will suggest you use if statements to check if user codes content words like porn, xxx, pornhub etc...
you need a lot of listing if you you actually want to do it my way.
Related
On the website (http://bread.org.nz/teams) users pick the team they want to donate to (using paypal). How can I redirect to a webpage, depending on who they donate to, so I can give options like "share on facebook that I voted for team 'x' "?
thanks
I see you're using item_number but I think that's being deprecated. Now, you can include custom variable in your donation link and when it posts back to you (callback), that custom variable will be included in the data.
Your donation LINK may look something like this
...&item_name=RALLY+TEAM+DONATION&custom=I+PICK+TEAM+1¤cy_code=NZD
If this doesn't work, then I think you should achieve it with a custom made solution which of course isn't much reliable.
So, your donation links on the buttons may look like this example.com/donate.php?team1. From there, you can get information of Team 1, set a PHP session say $_SESSION['team_chosen'] = 'team1'.
Now, on the callback page, you can check team in the session and decide further.
I've got a basic contact form that asks for email address and a message, which is then emailed to me. I want to add a checkbox after the email input that gives the option to subscribe to a newsletter as well. I can do the form, I can do a newsletter sign up, I'm just not sure how to combine the two. Any ideas?
Edit: To clarify, I'm planning to use a basic html form. I was hoping there'd be someway to combine that with a mailchimp or phplist newsletter signup.
You need an onSubmit() action with a method - generally post, and you'll probably have to use PHP and link it to that page so it knows to go there to process the action =}
in that page is where the clever stuff will happen like subscribe the user.
(Connect to the DB, add the email address to said table/column etc...)
Unfortunately this is not something I can just give you a snippet to insert - it'll have to be completed your side.
I have working the auto population of this form: http://getpocket.com/save
I'm using it rather than the API so that it works when users are logged into Pocket on the same browser as my website.
However, it's not a good user experience to then have to click 'save', so how can I "automate" that?
I won't show my code, because it essentially is just to generate a link of the form:
http://getpocket.com/save/?title=thetitle&url=encodedurl
It populates the form fine, but how can I submit? I tried apending &save and &submitand then each of those =True, in vain. Is the issue that the save button doesn't have a name= field, which is what's used to hook into the title and URL fields?
EDIT: Just to be clear, I didn't have any malicious intentions, only to save articles to read later on click of a button.
If I find the time I'll have a look at the API.
Luckily this is impossible (on Pocket and most sites) due to cross site forgery request protection to prevent exactly what you are trying to do.
A token is set in the form and together with session information for the user on pocket (or any other site that uses csfr token protection) it will need to form some sort of secret hash. When the 'save' form is submitted the combination of these strings will be checked and normally new strings will be set. Because there is (practically) no chance that you will be able to predict the token form the form itself and have no real way of manipulating the session hash, you are out of luck. And we are all very happy for that :).
Otherwise you could make links on other sites that would delete your whole database when you happen to click on them, etc.
In short: You can't.
On any form without csrf protection you'd have to target not the url of the page with the form, but the 'action' of the form. You can see this action by inspecting the form with your browser's DOM inspector. But, as I said, csrf protection will prevent this from working most of the time.
http://en.wikipedia.org/wiki/Cross-site_request_forgery
https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
i am working on a submit form in my html page. When i click submit button, i should get mail in my inbox.
So what all the procedures, i need to follow to get the output.
You need to use a server side language like PHP / ASP.NET etc. Then:
User submits form.
Retrieve the submitted information.
Send an email using the email functionality specific to the language you decide to use.
You haven't given much so this is only an outline of what you need to do to get going. You can use Google for the various areas you need to implement.
Instead of using any server, is there any plugins which can be useful
to get my output. – Bharadwaj
I think this might do the job for you http://www.emailmeform.com/
I've never used it, but it looks like a website that hosts the form for you and emails you the results. You'd just put the form html on your page and let them do the rest.
Hope that helps.
I have a profile edit page on my website with preset age and country lists so people can choose their age and country.
My problem is a guy made an HTML form that can submit a custom age and country. Does somebody know how to block form submitting from websites that are not on my domain?
I changed my form a few times, but he can find the input names just as simply as I changed them.
The only fail-safe way to prevent a submission of a form with undesirable values is to perform validation on server side.
I think the referrer (Request.ServerVariables("http_referrer")) should tell you the page the request came from. As Oleg said you should additionally validate the returned form data in any case.