Form results from website through email - css

I have a script on my site. I want to get the results in my email when someone submits their details. How do I do that? My server only allow .css files; no .php or .asp.

You can, in fact, have an HTML form prompt to send an email without any scripting whatsoever.
<form method="post" action="mailto:thedude#isgreat.com" enctype="text/plain">
<input type="text" name="comment">
<input type="submit" value="Submit">
</form>
Submitting that form with the content "foobar" in the text field will invoke the user's mailto link handler (e.g. Mail.app, Outlook, etc) and prompt them to send a message with the contents of the form, like so:
To: thedude#isgreat.com
[other headers]
comment=foobar
Of course, they can change the message if they want. Oh, and your email address is ripe for harvesting, if you care.

Related

How can I request data with device access code for default gateway router 5268AC?

I would like to write a script that can collect data from the router, in this case 5268AC. So far, I've been able to use response.get() to get information from URLs that do not require device access code to see information. To get information about Wifi, for example, the default SSID, I need to enter the access code located on the router via the browser. I keep getting error 500 when trying request.post(url).
url="http://192.168.1.254/xslt?PAGE=C_2_1"
From inspection, I believe this is the form I'm trying fill. The key value is ADM_PASSWORD.
<h2>Login</h2>
<p>Device access code required. Please enter the device access code, then click Submit.</p>
<form name="pagepost" method="post" action="xslt?PAGE=login_post" id="pagepost">
<input type="hidden" name="NONCE" value="0abc59f54121398" />
<input type="hidden" name="THISPAGE" value="" />
<input type="hidden" name="NEXTPAGE" value="C_2_1" />
<input type="hidden" name="CMSKICK" value="" />
<div>
<div class="form-group">
<label for="ADM_PASSWORD">Access code</label>
<span>
<input type="password" id="ADM_PASSWORD" name="ADM_PASSWORD" size="16" maxlength="16" autofocus="autofocus" required="required" autocomplete="off" />
</span>
</div>
</div>
<p align="right">
<input type="submit" class="button" value="Submit" />
I tried this but got 500 status error.
payload = { 'ADM_PASSWORD':'*access code*' }
response = requests.post(url, headers=headers, data=payload)
Is there a way to be able to collect information via requests instead of using GUI?
First in Chrome/Firefox you can use DevTools (tab: Network) to see what browser sends when you login.
Form has action="xslt?PAGE=login_post" so you should send to
url = "http://192.168.1.254/xslt?PAGE=login_post"
It is relative path - so if you would open page ie. http://http://192.168.1.254/login/ then it would need
url = "http://192.168.1.254/login/xslt?PAGE=login_post"
You have to send all input which you see in form - especially hidden.
Sometimes it may need even submit.
And you should use name= as key, not id=
payload = {
'NONCE': '0abc59f54121398',
'THISPAGE': '',
'NEXTPAGE': 'C_2_1',
'CMSKICK': '',
'ADM_PASSWORD': '*access code*'
}
If you use post() with data= or json= then it should automatically set correct value in Content-Type and Content-Length and you don't have to set it in headers.
You may also first run get() to page with form because it may set cookies which server/device may also check.
Problem can be only if page uses JavaScript to generate some extra data in form and it would need to use Selenium - but it would need to write all with Selenium
Sometimes I send request to https://httpbin.org/post and it sends me back all headers, cookies, post data which it get from me and I can compare it with data which I see in DevTools.
Evetually I use local proxy server Charles and use it in browser and in Python to see if code sends the same data as browser.

Is there a good way to pass both form information and URL parameters to server?

In my web forms project (a forum) I have a form that is accessed through a link from another page, a link which includes parameters. for example:
EditPost.aspx?mid=0
When the page is loaded, the form hasn't yet been submitted and Request.QueryString contains the URL parameters I loaded the page with. However, after I send the form, Request.QueryString conatins the values of the form fields. This is a problem because I need the URL parameters after the form is sent.
The question is, how do i make the page send me those URL parameter with the form information?
If I'm approaching this wrong, and I'm supposed to keep the URL parameters from when the page is first loaded, let me know how.
Thanks!
Edit:
<form action="" id="f_editComment" name="f_editThread" method="post" onsubmit="return true;">
<%=ThreadTitle %>
<textarea id="body" name="body" runat="server"></textarea>
<input type="submit" id="submit" name="submit" />
</form>

How to allow a particular referrer page in servlet?

I have a HTML page:
<form method="post" action="Servlet" name="frm">
Enter your name: <input type="text" name="name" id="name" /><br/>
<input type="submit" name="sub" value="Submit" />
</form>
A servlet will get value from that HTML page but I want to a servlet doesn’t accept from external page other than this HTML page.
If the request doesn’t come from the HTML page, a warning message would be shown saying that the user are not allow to access the page this way. What should I do?
There are so many ways to achieve this
Way 1:
Place the following code in the sevrlet
if(new URI(request.getHeader("referer")).getPath()=="static html url")
{
//allow
}
else
{
//redirect to some other page
}
Way 2:
When the users logs in for the first time generate a random token and keep it in a session variable
When you load this particular html page pass the session variable as query string
When you post the form to servlet post this value along with other values
Compare the values from session and the value received through post if both are equal allow else transfer the page to logout or some other page/

Form work on server, not locally. Ultimately need a programatic solution to submit the form

I need to submit this form (preferrebly using cURL):
<form method="post" action="results.asp" name=FrontPage_Form1 onSubmit="return true">
<input name="regno" size="7" maxlength=7>
<input type="submit" name="B1" size="15" value="Submit">
</form>
This form is on a website and works well there, redirects to page http:website//results.asp and shows the information.
BUT if I download this html form and open it in my local browser and submit, it does not work
the results.asp page says 'Access denied' in html page generated by the asp page.
Additional information:
- when the html page is on the same server: entering a wrong 'regno' results in a page which says exactly that
- Upon opening this form locally, it always says, access denied.
Please let me know if any of this is not clear.
If you open an html file into your local browser and then try to post to another page without the full URL, then it will look in the same directory for that file, which I imagine doesn't exist since you don't have access to it. You need to enter the full path in the form action, like so:
<form method="post" action="http://www.resultsserver.com/results.asp" name=FrontPage_Form1 onSubmit="return true">

Drupal WebForm With PinPointe--Avoid Confirmation Page

Our company uses PinPointe for email marketing and we have a Drupal 6 site with several language domains. I have created a web form except I did not create any fields in Drupal. Instead in the node Edit NOT THE NODE WEBFORM EDIT....in the node edit for the body section I added the HTML and the javascript for form. Everything works well and the data is captured to pinpointe. The problem lies in the fact that the page..upon clicking submit..actually redirects to PinPointe where I get a friendly message saying. Thanks for joining. Well I don't want this. I would like to just pop an alert saying thanks and leave the user on the page they were on. I tried this code for using jquery to do the post but it isn't loading and I suspect that's because I need it in the header not the body.
So all I want is to submit the data to pinpointe and not redirect the user. So here is where my limited Drupal knowledge runs out:
If I create the input fields in the node webform then how do I get the form to post to pinpointe?
If I create the fields dynamically in the node body (not node>>webform) I can direct the submission to PinPointe but then how do I stop the redirect?
FWIW here is the jquery I was trying to use but suspect has to go in the header http://jsfiddle.net/4xDFK/4/
FWIW here is the code for the dynamic creation:
<form action="http://na04.mypinpointe.com/...." id="webform-client-form-1375" method="post" onsubmit="return CheckForm257(this);">
<div>
<div id="webform-component-UsrEmail">
<div id="edit-submitted-UsrEmail-wrapper">
<input id="edit-submitted-UsrEmail" name="email" size="30" type="email" />
</div>
</div>
<div class="form-actions form-wrapper" id="edit-actions">
<input class="form-submit" id="edit-submit" name="op" type="submit" value=" " />
</div>
</div>
</form>
Create your custom confirmation page in Drupal. Then set up PinPointe to redirect to this confirmation page.
In the PinPointe form manager, there is a option under the 'Thank you page options' to send a signup user to a custom URL.

Resources