Mudsaf Posted November 8, 2012 Share Posted November 8, 2012 Hello, i have problem with my website upload system. Example if i upload game through the php This game success http://www.mochimedia.com/games/play/boat-racing-challenge But this game fails http://www.mochimedia.com/games/play/magnet-ninja Here is my form code <p> <label> <input type="radio" name="Upload" value="radbo" checked="checked" id="Upload_0" /> Upload files and do query (Not working untill beta 0.3)</label> <br /> <label> <input type="radio" name="Upload" value="radqu" id="Upload_1" /> Do query only (Not working untill beta 0.3)</label> <br /> <label> <input type="radio" name="Upload" value="radup" id="Upload_2" /> Upload files only (Not working untill beta 0.3)</label> <br /> </p> if (isset($_POST["Upload"]) && $_POST["Upload"] == "radup") { $target_path_img = "../games/img/";$target_path_swf = "../games/swf/";$mysql_path_img = "img/" . $_FILES['imagefile']['name'];$mysql_path_swf = "swf/" . $_FILES['flashfile']['name'];if (!empty($_FILES["imagefile"]) && ($_FILES['imagefile']['error'] == 0) && !empty($_FILES["flashfile"]) && ($_FILES['flashfile']['error'] == 0)) {if ($_FILES["flashfile"]["size"] <= 5000000 && $_FILES["imagefile"]["size"] <= 3000000) {if ($_FILES["flashfile"]["type"] == 'application/x-shockwave-flash' && $_FILES["imagefile"]["type"] == 'image/jpeg') {if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $target_path_img . $_FILES['imagefile']['name']) && move_uploaded_file($_FILES['flashfile']['tmp_name'], $target_path_swf . $_FILES['flashfile']['name'])) {echo "<p>You have sussefully uploaded the 2 files.</p>";} else{echo "There was an error uploading the files, please try again!";}} else {echo "<p>You tried to upload files with wrong fileformat, only (.JPG) allowed on image field and (.SWF) allowed on flash file field.</p>";}} else {echo "The filesize you tried to upload was too big";}} else {echo $_FILES['imagefile']['error'] . $_FILES['flashfile']['error'];}} else { //This comes with MAGNET AND NOT WITH BOATecho "<p>No radio button selections detected, please go back and confirm that you have selected some radio button.</p>";echo $_POST["Upload"]; //This returns as empty} With boat racing the code success Link to comment Share on other sites More sharing options...
justsomeguy Posted November 8, 2012 Share Posted November 8, 2012 Here is my form codeThat's just 3 radio buttons. Is your entire form 3 radio buttons? It sounds like you're hitting the post_max_size limit: http://www.php.net/manual/en/ini.core.php#ini.post-max-size 1 Link to comment Share on other sites More sharing options...
Mudsaf Posted November 8, 2012 Author Share Posted November 8, 2012 Yea you're right, i though the server php maxfilesize was 5mb but it was only 2mb, thx anyways. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now