mattachoo Posted April 8, 2008 Share Posted April 8, 2008 Ok, I have a form where the user enters in a bunch of information in a text area box called 'xmldata' Then, when they submit the form, this is how I process it <?php $xmlString = stripslashes(urldecode($_POST['xmldata'])); if (is_null($xmlString)) { print "No data was sent"; } else { $md5 = md5($xmlString); $filename = "paintings/".$md5.".xml"; $file = fopen($filename, "w+") or die("codename=Cant open XML file"); if(!fwrite($file, $xmlString)){ print "Error writing to XML-file"; } else { require('connect.php'); .................. blahbittyblah ........................ ?> Now this code seems to do the trick for me with small amounts of data, but when the file gets too large, I dunno, I think around 25000 characters or something, it cuts it off. So if the file was 30,000 chars, now the .xml file is 25,000 chars. You can see how this can be frustrating. Any ideas guys? Thanks. Quote Link to comment Share on other sites More sharing options...
mattachoo Posted April 8, 2008 Author Share Posted April 8, 2008 Anyone? Quote Link to comment Share on other sites More sharing options...
Roq Posted April 8, 2008 Share Posted April 8, 2008 How long does this process normally take to run? Is the script timing out after say, 30 seconds by default? It probably shouldn't be taking that long but just a thought.... Quote Link to comment Share on other sites More sharing options...
mattachoo Posted April 8, 2008 Author Share Posted April 8, 2008 no, it timing out would not be a problem here. It takes I dont know, 4 seconds to run. And a max-upload_file is not doing it either. The file is less than 40 kb, and my max upload is I think 8 mb. Still any ideas? I think is happens somewhere in the POST section. Like even though the text area has 30,000 chars, the form can't hold that much data, and it only holds the max amount when it goes into the $_POST var. There should be an easier way to do this. Any help would be much appreciated. Quote Link to comment Share on other sites More sharing options...
mattachoo Posted April 8, 2008 Author Share Posted April 8, 2008 Nevermind, I'm dumb. What was going in the text field was a huge XML file, and what would screw it up was if the user entered in a (") or a ('), then it would cut it off at the end. Whoops! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.