In my index.asp file I have the following code:
<input name="inf_custom_Referrer" type="hidden" value="<%=response.write(request.servervariables("HTTP_REFERER"))%>" />
<input name="inf_custom_IPAddress" type="hidden" value="<%=response.write(request.servervariables("REMOTE_ADDR"))%>" />
When I view the source in chrome, this is what is shown:
<input name="inf_custom_Referrer" type="hidden" value="<%=response.write(request.servervariables("HTTP_REFERER"))%>" />
<input name="inf_custom_IPAddress" type="hidden" value="<%=response.write(request.servervariables("REMOTE_ADDR"))%>" />
Why is it not writing the values properly?
Change this
<input name="inf_custom_Referrer" type="hidden" value="<%=response.write(request.servervariables("HTTP_REFERER"))%>" />
<input name="inf_custom_IPAddress" type="hidden" value="<%=response.write(request.servervariables("REMOTE_ADDR"))%>" />
To this
<input name="inf_custom_Referrer" type="hidden" value="<%=request.servervariables("HTTP_REFERER")%>" />
<input name="inf_custom_IPAddress" type="hidden" value="<%=request.servervariables("REMOTE_ADDR")%>" />
In ASP Classic response.write can be abbreviated, for example;
<% response.write myVariable %>
Can be also be coded
<%=myVariable%>
<%=x%> and <%response.write(x)%> are the same .
pick any ONE only.
Related
heloo,
i have a html form which is posting data to a link like
<body onload="javascript:document.E_FORM.submit();">
<form action= method="POST" name="E_FORM">
<input type="hidden" name="a" value="1" size="100"><br />
<input type="hidden" name="b" value="2"><br />
<input type="hidden" name="c" value="3"><br />
</form>
i want to submit this form using code behind using string builder to create form and then submit using WebClient.
I use a custom Aweber form on my Wordpress blog squeeze page :
http://kuznitsazdoroviya.com/podarki/
Here is the code :
<form method="post" action="https://www.aweber.com/scripts/addlead.pl">
<input type="hidden" name="listname" value="******" />
<input type="hidden" name="redirect" value="http://kuznitsazdoroviya.com/" />
<input type="hidden" name="meta_adtracking" value="custom form" />
<input type="hidden" name="meta_message" value="1" />
<input type="hidden" name="meta_required" value="name,email" />
<input type="hidden" name="meta_forward_vars" value="1" />
The registration is working fine but there is a problem with the redirection. I receive a 404 error because all the argument are add to the url.
So instead of going to the home page : http://kuznitsazdoroviya.com
Here is the redirection url generated :
http://kuznitsazdoroviya.com/?email=bon****%40outlook.fr&from=bon****%40outlook.fr&listname=awlist*******&meta_adtracking=custom%20form&meta_message=1&meta_required=name%2Cemail&name=barbe&submit=Download%20free%20pdf
How can I tell aweber not to add this ?
Regards.
So the anwser is simple, we only need to remove this line :
<input type="hidden" name="meta_forward_vars" value="1" />
Hello guys i have gatting issue on loading asp.net
i have using master page for sub pages there is a form tag in materpage i have add a paypal button in sub page which is this in master page form tag is also important
in masterpage <form id="form1" runat="server"></form>
and in sup age
<form id="form2" runat="server" name="Paypal" action="https://www.paypal.com/cgi-bin
/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="
<%=System.Web.Configuration.WebConfigurationManager.AppSettings["email"] %>
" />
<input type="hidden" name="item_name_1" value="<%=Session["ItemName"].ToString()%>"
/>
<input type="hidden" name="amount_1" value="<%=Session["ItemCost"].ToString() %>"/>
<input type="hidden" name="quantity_1" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="<%=Session["returnUrl"].ToString() %>"/>
<input type="hidden" name="lc" value="Stronger" />
<input type="image" src="images/paynow.png" border="0" name="submit" alt="Make
payments with PayPal - it's fast, free and secure!"
style="background: url(images/update-account.png);"/>
</form>
I'm getting bug this with sub page below
Server Error in '/Project' Application.
A page can have only one server-side Form tag.
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.
anybody have a idea how can i use form tag in sub page also.
Please check how many <form> tags are written on your aspx/html page. Make sure you are not using masterpage for this page.
Hi I have found this solution and its work solution is below:
<form name="Paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post" target="_blank"></form>
<form name="Paypal" action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="
<%=System.Web.Configuration.WebConfigurationManager.AppSettings["email"] %>
" />
<input type="hidden" name="item_name_1" value="<%=Session["ItemName"].ToString()%>"
/>
<input type="hidden" name="amount_1" value="<%=Session["ItemCost"].ToString() %>"/>
<input type="hidden" name="quantity_1" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="return" value="<%=Session["returnUrl"].ToString() %>"/>
<input type="hidden" name="lc" value="Stronger" />
<input type="image" src="images/paynow.png" border="0" name="submit" alt="Make
payments with PayPal - it's fast, free and secure!"
style="background: url(images/update-account.png);"/>
</form>
This code is working good as i want.
If you'are under a MasterPage Don't use the form tag as long as you're inside a form, just delete it, delete the hidden input that causes the SUBMIT and, instead, use the following ImageButton:
<asp:ImageButton ID="cmdpay" runat="server" PostBackUrl="https://www.paypal.com/cgi-bin/webscr" Text="" ImageUrl="images/paynow.png" ></asp:ImageButton>
It works
I am trying to incorporate a reservation widget within my wordpress install and I have everything working fine except sending the data or it not populating on the other sites form. The site I am trying to send data to is an online reservation software: http://www.directinn.com/demo/
Here is how I am doing my form:
<form name="bookingform" action="http://www.directinn.com/demo" method="get" target="_blank">
<input type="text" name="date1" id="Text1" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Arrival Date"/>
<input type="text" name="date2" id="Text2" class="ftxt MyDate three columns" maxlength="10" value="" placeholder="Departure Date" />
<input type="submit" name="bookingformsubmit" class="book-now" value="Book Now">
<input type="hidden" name="arrivalDay" value="" />
<input type="hidden" name="arrivalMonth" value="" />
<input type="hidden" name="arrivalYear" value="" />
<input type="hidden" name="departureDay" value="" />
<input type="hidden" name="departureMonth" value="" />
<input type="hidden" name="departureYear" value="" />
<input type="hidden" name="numAdults" value="1" />
Any help would be greatly appreciated ;)
So they are saying if you can iFrame in their Form on your page and if you add the USERNAME for example to the URL, your USERNAME will appear on the invoice. Like this I believe:
http://www.directinn.com/iframefull.html/BOB
I do not think you can make your own form and POST to their page. I see no indication that that is possible from the link you posted of the example.
The code you have will submit a load of Query String data to the receiving site.
The target site may implement some type of cross-site posting prevention which is causing the blockage - or they may ignore your query string parameters entirely.
I have multiple forms on a page which pass an id to the controller via hidden inputs. As I am using strongly typed views for these I think I need to keep the Id for each of these to be the same. It works currently though I think it's bad practice. How should I handle this? In Django there are form prefix values is there an equivalent?
Avoid duplication of form input element ID in Django
Here are the two forms I am using:
<form action="/Course/CropImage" method="post">
<input id="CourseId" name="CourseId" type="hidden" value="<%= Model.CourseId %>" />
<input id="X" name="X" type="hidden" value="<%= Model.X %>" />
<input id="Y" name="Y" type="hidden" value="<%= Model.Y %>" />
<input id="W" name="W" type="hidden" value="<%= Model.W %>" />
<input id="H" name="H" type="hidden" value="<%= Model.H %>" />
<input type="submit" value="Crop" />
</form>
<form action="/Course/UploadImage" enctype="multipart/form-data" method="post">
<input id="CourseId" name="CourseId" type="hidden" value="<%= Model.CourseId %>" />
<label for="Image">Select Image:</label><input id="Image" type="file" name="Select Image"/>
<input type="submit" value="Upload" />
</form>
If you are having 2 view models (one for the crop, one for the upload) you can prefix them like this (you can use html helpers):
<form action="/Course/CropImage" method="post">
<input id="Crop_CourseId" name="Crop.CourseId" type="hidden" value="<%= Model.CourseId %>" />
<input id="Crop_X" name="Crop.X" type="hidden" value="<%= Model.X %>" />
<input id="Crop_Y" name="Crop.Y" type="hidden" value="<%= Model.Y %>" />
<input id="Crop_W" name="Crop.W" type="hidden" value="<%= Model.W %>" />
<input id="Crop_H" name="Crop.H" type="hidden" value="<%= Model.H %>" />
<input type="submit" value="Crop" />
</form>
<form action="/Course/UploadImage" enctype="multipart/form-data" method="post">
<input id="Upload_CourseId" name="Upload.CourseId" type="hidden" value="<%= Model.CourseId %>" />
<label for="Image">Select Image:</label><input id="Upload_Image" type="file" name="Upload.Image"/>
<input type="submit" value="Upload" />
</form>
and then bind attribute with the prefix to you controller actions like this:
public ActionResult CropImage([Bind(Prefix="Crop")]CropViewModel viewModel)
{
// do something
}
public ActionResult UploadImage([Bind(Prefix="Upload")]UploadViewModel viewModel)
{
// do something
}
This is not a bad practise. They are completely different forms so that makes the input element unique. You will not make your server code or client js/markup any more semantic by adding prefixes.
I always prefix my column-names with the table name. Here's the database-layout of my latest MVC-project (using strongly typed views and LINQ to SQL):
WeblogEntries:
- WeblogEntryId
- WeblogEntryHeaderText
- WeblogEntryBodyText
- WeblogEntryDate
WeblogComments:
- WeblogCommentId
- WeblogCommentBodyText
- WeblogCommentDate
WeblogErrors
- WeblogErrorId
- WeblogErrorExceptionMessage
- WeblogErrorExceptionStackTrace
- WeblogErrorDate
These naming conventions work great with the entity classes that gets generated using dbml-files.