marklarah Posted March 21, 2008 Share Posted March 21, 2008 My uploader doesn't work - its not entering into the database or uploading the file ??? <? include 'top.php'; if(isset($_SESSION['user'])){ if($_SESSION['lvl'] < "49"){ $error = "You are not high enough."; } }else{ $error2 = "You are not logged in."; } $title = 'Games Upload'; include 'main.inc.php'; if(isset($error)){ echo $error; } if(isset($error2)){ echo '<div class="error"><h2>Error!</h2>'.$error2.'</div>'; } if(isset($error2) || isset($error)){ include 'bottom.inc.php'; exit; } echo '<h2>Insert new game</h2><hr><br>'; if(isset($_POST['name']) && isset($_POST['emb']) && isset($_POST['blurb']) && isset($_POST['rating']) && isset($_POST['x']) && isset($_POST['y']) && isset($_POST['uploaded'])){ $name = $_POST['name']; $blurb = $_POST['blurb']; $y = $_POST['y']; $emb = $_POST['emb']; $x = $_POST['x']; $rating = $_POST['rating']; $sqll = "SELECT * FROM `site`"; $resultt = mysql_query($sqll) or die(mysql_error()); $roww = mysql_fetch_array($resultt); $gid = $roww['lastgid']; $img1 = $gid + 1; $url = 'gimages/'.$img1.'.gif'; $sql = "INSERT INTO `3` (ID, emb, blurb, played, date, name, x, y, rating, img) VALUES (NULL, '$emb', '$blurb', 20, NOW(), '$name', '$x', '$y', '$rating', '$url')"; mysql_query($sql) or die(mysql_error()); if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $url)) { echo 'Succesful! - <a href="g_upload.php">Upload More</a>'; }else{ echo 'Soz'; } }else{ ?> <form enctype="multipart/form-data" action="g_upload.php" method="POST"> Name:<br> <input type="text" name="name"><br> SWF URL: <br> <textarea cols="40" rows="7" name="emb"> </textarea><br> Blurb: <br> <textarea cols="40" rows="7" name="blurb"> </textarea><br> Rating: <br> <input type="text" name="rating" maxlength="3"><br> Width: <br> <input type="text" name="x" maxlength="3"><br> Height: <br> <input type="text" name="y" maxlength="3"><br> Image: <br> <input name="uploaded" type="file"><br > <br> <input type="submit" value="Go"> </form> <? } ?> <br> <? $result="SELECT * FROM `3`"; $dn = mysql_query($result) or die(mysql_error()); $num = mysql_num_rows($dn); echo '<h3>Number of games in database: '.$num.'</h3>'; ?> <? include 'bottom.inc.php'; ?> Link to comment https://forums.phpfreaks.com/topic/97182-uploader/ Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 very generic error can u be more specific or is it a mystery that we suppose to also solve? Link to comment https://forums.phpfreaks.com/topic/97182-uploader/#findComment-497291 Share on other sites More sharing options...
marklarah Posted March 21, 2008 Author Share Posted March 21, 2008 Its a mystery muh haw haw haw........ No, but like it just refreshes the page when I enter the form, it doesn't do anything. Can anyone see a reason for this? Link to comment https://forums.phpfreaks.com/topic/97182-uploader/#findComment-497398 Share on other sites More sharing options...
marklarah Posted March 21, 2008 Author Share Posted March 21, 2008 ...no? Link to comment https://forums.phpfreaks.com/topic/97182-uploader/#findComment-497402 Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 well if it reports a blank page u have php errors that aren't being displayed Link to comment https://forums.phpfreaks.com/topic/97182-uploader/#findComment-497443 Share on other sites More sharing options...
marklarah Posted March 22, 2008 Author Share Posted March 22, 2008 it doesnt show a blank page, it just doesn't do anything. Link to comment https://forums.phpfreaks.com/topic/97182-uploader/#findComment-498007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.