I'm basically looking for a solution to exactly the same problem as described in this dead post:
http://railsforum.com/viewtopic.php?pid=88192#p88192
Could someone please advise? Thanks.
I am thinking of moving my static .JS files to a CDN such as Amazon S3 for performance reasons. As my PHP files and mySQL DB remain on my primary hosting domain what is the best way to manage my JS AJAX requests if they are now cross domain?
Currently they look like this within my .JS file (with relative paths):
$.ajax({
type: "POST",
url: "/myNearbyPhpFile.php",
data: {data:someData},
success: function($r){}
});
I am using Ajax.BeginForm to post comment.
How should I update the Comments section area to incorporate this new comment?
I am displaying comments on the page using the typical "foreach(Comment comment in Model.Comments)"
Is it able to download the flash video from this site? Seems not able to find an direct flv link. If it's appropriate to ask, I will delete this post. Thanks.
i have a form that submits data to a database, i have a function that looks like this:
//connect
foreach ($_POST as $key => $value) {
$_POST[$key] = mysql_real_escape_string($value);
}
now when i post, SOMETIMES i get an error that says this:
Allowed memory size of 268435456 bytes exhausted
i figured out that when i do a linebreak, or press enter in the message field, then that is when it causes the error, otherwise it works normal. any ideas?
I have an ASP.net MVC 1.0 VS2008 application that I just opened in Visual Studio 2010. When I did this Studio upgraded the app from VS2008 to the VS2010 project. It also upgraded the MVC references from 1.0 to 2.0.
In my app I have a class for a form post, I then use the class for the model binding in the Action method so it will auto populate the values. This worked fine in mvc 1.0 but now it does not work in 2.0 after the upgrade.
Does does anyone know why? Or where I should look to resolve this?
Here is my class,
public class Add_Postal_Form_Input
{
public string ACTION_RDO { get; set; }
public string POSTALSELECT { get; set; }
public string CNY_CD { get; set; }
public string S_PST_LOW { get; set; }
public string R_PST_LOW { get; set; }
public string R_PST_HI { get; set; }
public string G_PST_LOW { get; set; }
public string G_GRP_CD { get; set; }
public string CAT_CD { get; set; }
public string SUB_CD { get; set; }
public string ATTR_VAL { get; set; }
public string NBG_HR { get; set; }
public string NBG_MN { get; set; }
public string REC_STT_DT { get; set; }
public string REC_END_DT { get; set; }
public string DEFAULT_DATE { get; set; }
}
Here is the method,
[AcceptVerbs("POST")]
public PartialViewResult AddData(Add_Postal_Form_Input FORM_IN)
{
Thanks
Hello there,
I've got a textbox(id="tb1") and a button(id="btn1").
I want that whenever I click on btn1 a text "hello world" must be inserted in the tb1 at the current position of cursor in text-box.
Please provide me a cross browser solution for this.
Since I'm frosted from some heavy extra ordinary links so it'd be better to post a function considering the current scenario.
Thanks,
Guru
I have here a set of form from the index.php to upload a zip file, select an option then perform a converter process.
<form action="" method="post" accept-charset="utf-8">
<p class="buttons"><input type="file" value="" name="zip_file"/></p>
</form>
<form action="index.php" method="post" accept-charset="utf-8" name="form1">
<h3><input type="radio" name="option" value="option1"/> Option1 </h3>
<h3><input type="radio" name="option" value="option2"/> Option2 </h3>
<h3><input type="radio" name="option" value="option3"/> Option3 </h3>
<p class="buttons"><input type="submit" value="Convert"/></p>
</form>
In the other hand, this is my code for the upload.php that will extract the Zip file.
<?php
if($_FILES["zip_file"]["name"]) {
$filename = $_FILES["zip_file"]["name"];
$source = $_FILES["zip_file"]["tmp_name"];
$type = $_FILES["zip_file"]["type"];
$name = explode(".", $filename);
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
foreach($accepted_types as $mime_type) {
if($mime_type == $type) {
$okay = true;
break;
}
}
$continue = strtolower($name[1]) == 'zip' ? true : false;
if(!$continue) {
$message = "The file you are trying to upload is not a .zip file. Please try again.";
}
$target_path = "C:xampp/htdocs/themer/".$filename; // change this to the correct site path
if(move_uploaded_file($source, $target_path)) {
$zip = new ZipArchive();
$x = $zip->open($target_path);
if ($x === true) {
$zip->extractTo("C:xampp/htdocs/themer/"); // change this to the correct site path
$zip->close();
unlink($target_path);
}
$message = "Your .zip file was uploaded and unpacked.";
} else {
$message = "There was a problem with the upload. Please try again.";
}
}
?>
How can i connect both files that will perform the extracting process?
And how to include the codes for radio button after submission?
Please Help.
Hi ive got an mvc form with a fileupload functionality. Ive got an action that accepts an file and extracts thumbnails from it, after which the user can select the images and then proceed to submit the form. How can post the initial file via ajax, bearing in mind, this is not the final submission on the form and I want to retain user input. ie no postback
Thanks
Hi,
I really like the idea of putting forms into a seperate class that manages validation etc, but I don't like everything ending up in a DL and also not being able to use square bracket notation in post elements like <input type='checkbox' name='data[]'>.
Is there another way of generating forms - like in views so I can style them the way I want, but also keeping the validation aspect? Also how would I load this view into my current view (using partial view somehow?)
I am looking for a PHP example/tutorial which can accept hi-scores/survey upload from an iPhone. Hopefully, the PHP script:
accepts POST, in additional to GET
works over SSL (https)
connects to MySQL
In addition, it'd best the iPhone can get a session from the server and submit the session value along with the hi-score. Thanks
I need to gather a list of items associated with another item from my user in a ASP.NET MVC project. I would like to have a controller action like bellow.
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(int x, int y, IEnumerable<int> zKeys)
{
//Do stuff here
}
How can I setup my form to pass data in this way? If data of this particular form can't be provided, what's the next best way to pass this type of information in ASP.NET MVC?
I have a form as
<form action="" method="post">
<input name="Descripcion" type="hidden" value="" id="Descripcion" runat="server" />
<input id="Submit1" type="submit" value="Comprar" />
Instead of clicking on submit button i want that the form should be posted without clicking submit button with hidden fields
I was reading Robert Rossney's entry on "What's the most unsound program you've had to maintain?" found at: (What's the most unsound program you've had to maintain?) when I realized that I had inadvertently developed a near-identical application!
The app consists of an HTTPListener object that grabs incoming POST requests. Based on the information in the header, I pass the body of the request to SQL Server to perform the appropriate transaction.
The requests look like:
<InvoiceCreate Control="389>
<Invoice>
<CustomerNumber>5555</CustomerNumber>
<Total>300.00</Total>
<RushOrder>1</RushOrder>
</Invoice>
</InvoiceCreate>
Once it's received by the HTTPListener object, I perform the required INSERT to the Invoice table using SQL Server's built-in XML handling functionality via a stored procedure:
INSERT INTO Invoice (InvoiceNumber, CustomerNumber, Total, RushOrder)
SELECT @NEW_INVOICE_NUMBER,
@XML.value('(InvoiceCreate/Invoice/CustomerNumber)[1]', 'varchar(10)'),
@XML.value('(InvoiceCreate/Invoice/Total)[1]', 'varchar(10)'),
@XML.value('(InvoiceCreate/Invoice/Total)[1]', 'varchar(10)')
I then use another SELECT statement in the same stored procedure to return the value of the new Invoice Number that was inserted into the Invoices table:
SELECT @NEW_INVOICE_NUMBER FOR XML PATH 'InvoiceCreateAck'
I then read the generated XML using a SQL data reader object in C# and use it as the response of the HTTPListener object.
My issue is, I'm noticing that Robert is indeed correct. All of my application logic exists inside the stored procedure, so I find myself having to do a lot of error-checking (i.e. validating the customer number and invoicenumber values) inside the stored procedure.
I'm still a midlevel developer, and as such, am looking to improve. Given the original post, and my current architecture, what could I have done differently to improve the application? Are there any patterns or best practices that I could refer to? What approach would you have taken? I'm open to any and all criticism, as I'd like to do my part to reduce the amount of "unsound programming" in the world.
Hi,
I am looking for HTTP parsing library for C/C++.
I have looked curl library, but it seems it is a http client library.
I am looking for a library which parses HTTP header (e.g. a way to
get the query string, get cookie, get request url, getPost Data)?
Thank you.
how to get the value of input box while submitting the form in php
i need the url like this
www.example.com/te/?a=test&firstname=blabla
<form action="te/?a=test" method="post">
<input type="text" name="firstname" />
<input type="submit" name="button" />
</form>
On the page load event of my webpage i fill the list of with the contents of the structure
Structure MainStruct
Dim Ans1 As String
Dim Ans2 As String
End Structure
Dim Build As New List(Of MainStruct)
The problem i that on post-back the contents of the list-of get lost.
So, how can i preserve the contents of the list-of in ASP.NET?
Hello,
I'm having trouble identifying a plugin (or perhaps is not even a plugin), but can you tell me what plugin outputs the section at the bottom of the post that has the headers: "Did you like this article?" and "Related Posts", and has a list of bookmarking links, and a list of posts respectively.
Image of the stuff I'm referring to:
Example URL: http://www.escapefromcorporate.com/networking-tools-and-help-upmo/
Thanks!
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]
An XML file is being posted to a url that my spring mvc is responding to.
In .NET, I could do this:
request.Form[0]
request.Form["abc"]
or
request.QueryString[0]
request.QueryString["some_key"]
Now with spring/servlets it seems I can only do this:
request.getParameter("some_key")
or get all the names or values.
When someone is posting a file to a url, using http post, won't this be just a single request parameter then?
Can I get the parameter using index with servlets?
There's a dearth of info in the supporting PDFs and on the web. I happened to come across a post in a blog that mentioned that $.write() or $.writeln() will write a string to the javascript console. Quite useful. Does anyone know if this $ object has any additional properties or methods?
Hi All
I'm trying to pass data between blocks using sinatra. For example:
@data = Hash.new
post "/" do
@data[:test] = params.fetch("test").to_s
redirect "/tmp"
end
get "/tmp" do
puts @data[:test]
end
However whenever i get to the tmp block @data is nil and throws an error. Why is that?
I would like to know whether it is possible to post topics on Facebook Groups by using either the old Rest API or Graph API? I somehow was unable to find any function within the API which would help me to do so.
Any work around or alternate solution to the above problem is welcome. Thanks.
Hi,
I'm searching for android phones that can use video out to the tv for a research project. I'm considering the HTC Touch Pro.
Is there anything I have to do specifically to get the video out to work (for displaying my app on the tv)? or will the phone just display a running app on the tv without extra work?
Thanks, I hope the post made sense =)
I am using combination of php+jQuery for captcha validation and later sending mails and do other stuff. The pseudo code is something like this:
captcha_code = jQuery.post(.....execute captcha script and get status)
if(captcha_code == "correct"){
send_mail_using_php_script;
}
Now I have no idea whether spammers can directly execute the "send_mail_using_php_script". Do they? If yes, then shall I move captcha validation in send_mail_using_php_script to make it more safer? Is there any other safer method?
Prashant