Xtremer360 Posted September 30, 2008 Share Posted September 30, 2008 With this script it's supposed to when filled out post the information into the shows table with the showname,type,showimage. However with the showimage what I want it to do is when the admin clicks browse and finds the showimage he wants to assign to that show I want the image to be sent to the images folder in the main directory as well as I want it to take the file name like whatever.jpg and put that into the shows table as well under showimage. When I run the script right now it gives me the following error: Parse error: parse error, unexpected $ in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 63 What did I do wrong and for what I want the script to do did I write it all correctly. <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ require ('database.php'); // Where the file is going to be placed $target_path = "/home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } //This code runs if the form has been submitted if (isset($_POST['addshowname'])) { //This makes sure they did not leave any fields blank if (!$_POST['showname'] || !$_POST['type'] || !$_POST['showimage'] ) { die('You did not complete all of the required fields'); } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['showname'] = addslashes($_POST['showname']); } $showname = $_POST['showname']; $check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the show name '.$_POST['showname'].' is already in use.'); } // now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert,$link) or die(mysql_error()); echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="30000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p><b>Enter Show Name:</b><input name="showname" type="text"></p>'; echo '<p><b>Show Type:</b><select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p><b>Upload Show Image:</b><input name="showimage" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/ Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 you are missing a } at the end of the script echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="showimage" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; } ----------- THIS IS THE ONE YOU ARE MISSING!! please use the code tags in this forum so we can see code properly Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654035 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Okay I add the last } now when I reload the page it says: There was an error uploading the file, please try again! That's all it says. Is that part of my script where it handles the file upload wrong? Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654049 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ require ('database.php'); // Where the file is going to be placed $target_path = "/home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } //This code runs if the form has been submitted //This makes sure they did not leave any fields blank if (!$_POST['showname'] || !$_POST['type'] || !$_POST['showimage'] ) { die('You did not complete all of the required fields'); } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['showname'] = addslashes($_POST['showname']); } $showname = $_POST['showname']; $check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the show name '.$_POST['showname'].' is already in use.'); } // now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert,$link) or die(mysql_error()); echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="30000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="showimage" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> try that and tell me what happens.... Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654055 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Now all it says is: You did not complete all of the required fields Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654062 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 ok dont worry about the database stuff so much, just worry about the file upload. <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ // Where the file is going to be placed $target_path = "/home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } echo '<form enctype="multipart/form-data" action="test.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="30000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="showimage" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654063 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Well it says upon submission: There was an error uploading the file, please try again! Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654072 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 I can see what you have done wrong you need to rename your <input name> to uploadedfile so ur form looks like this <form enctype="multipart/form-data" action="addshowname.php" method="post"> <input name="MAX_FILE_SIZE" type="hidden" value="100000"> <legend>Enter the following information to add a show name:</legend> <p>Enter Show Name:<input name="showname" type="text"></p> <p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p> <p>Upload Show Image:<input name="uploadedfile" type="file"></p> <div align="center"><input name="submit" type="submit"></div> </form> you are better off putting this outside of your php tags Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654089 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Still says: There was an error uploading the file, please try again! Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654097 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 let me work out the bugs and i will post the full script here.. Gaz Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654109 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ //require ('database.php'); // Where the file is going to be placed $target_path = "home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); //This code runs if the form has been submitted if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } // checks if the username is in use //if (!get_magic_quotes_gpc()) { //$_POST['showname'] = addslashes($_POST['showname']); //} //$showname = $_POST['showname']; //$check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") //or die(mysql_error()); //$check2 = mysql_num_rows($check); //if the name exists it gives an error //if ($check2 != 0) { //die('Sorry, the show name '.$_POST['showname'].' is already in use.'); //} // now we insert it into the database //$insert = "INSERT INTO shows (showname, type, showimage) //VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; //$add_show = mysql_query($insert,$link) or die(mysql_error()); echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="uploadedfile" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> i have tried this on a testing server so i know it works try that and let me know how u get on.. try uploading something small first Gaz p.s. if it does not upload check the path you are supplying Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654128 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Parse error: parse error, unexpected '&' in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 20 <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ require ('database.php'); // Where the file is going to be placed $target_path = "home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); //This code runs if the form has been submitted if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {     echo "The file ".  basename( $_FILES['uploadedfile']['name']).     " has been uploaded"; } else{     echo "There was an error uploading the file, please try again!"; } } checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['showname'] = addslashes($_POST['showname']); } $showname = $_POST['showname']; $check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the show name '.$_POST['showname'].' is already in use.'); } // now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert,$link) or die(mysql_error()); echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="uploadedfile" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654144 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 sometimes php freaks does this sometimes   ---= not sure why <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ //require ('database.php'); // Where the file is going to be placed $target_path = "home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); //This code runs if the form has been submitted if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ".basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } // checks if the username is in use //if (!get_magic_quotes_gpc()) { //$_POST['showname'] = addslashes($_POST['showname']); //} //$showname = $_POST['showname']; //$check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") //or die(mysql_error()); //$check2 = mysql_num_rows($check); //if the name exists it gives an error //if ($check2 != 0) { //die('Sorry, the show name '.$_POST['showname'].' is already in use.'); //} // now we insert it into the database //$insert = "INSERT INTO shows (showname, type, showimage) //VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; //$add_show = mysql_query($insert,$link) or die(mysql_error()); echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="uploadedfile" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> copy and paste that code.... Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654152 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 44 Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654156 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ require ('database.php'); // Where the file is going to be placed $target_path = "home/content/y/a/n/yankeefaninkc/html/images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); //This code runs if the form has been submitted if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ".basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['showname'] = addslashes($_POST['showname']); } $showname = $_POST['showname']; $check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the show name '.$_POST['showname'].' is already in use.'); } //now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert,$link) or die(mysql_error()); } echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="uploadedfile" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> ok ive got rid of the comments so the db should work http://www.thedesignmonkeys.co.uk/portfolio/test.php its there so i know it works Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654160 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Actually I tried it on mine and here's what came up: Warning: move_uploaded_file(home/content/y/a/n/yankeefaninkc/html/images/aggression.jpg): failed to open stream: No such file or directory in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 19 Warning: move_uploaded_file(): Unable to move '/tmp/phpwzy3jd' to 'home/content/y/a/n/yankeefaninkc/html/images/aggression.jpg' in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 19 There was an error uploading the file, please try again! Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 44 Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654167 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 ok we are there all that is wrong now is the target path to where you are putting it i think i have the answer try $target_path = "./images/"; Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654179 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Same thing. However keep in mind that this is how my folders are setup right now. images folder1 folder 2 backstage addshowname.php Warning: move_uploaded_file(/images/aggression.jpg): failed to open stream: No such file or directory in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 19 Warning: move_uploaded_file(): Unable to move '/tmp/phpkn4sLD' to '/images/aggression.jpg' in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 19 There was an error uploading the file, please try again! Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 44 Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654182 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 ohh well thats easy then just do $target_path = "images/"; Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654187 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Same and this is frustrating for me and I'm sure it is for you: <?php /* addshowname.php */ /* This form after submission takes the results of the form and inserts the values into the database as a new show name is created. */ require ('database.php'); // Where the file is going to be placed $target_path = "images/"; /* Add the original filename to our target path. Result is "images/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); //This code runs if the form has been submitted if (isset($_POST['submit'])) { if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ".basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['showname'] = addslashes($_POST['showname']); } $showname = $_POST['showname']; $check = mysql_query("SELECT showname FROM shows WHERE showname = '$showname'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the show name '.$_POST['showname'].' is already in use.'); } //now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert,$link) or die(mysql_error()); } echo '<form enctype="multipart/form-data" action="addshowname.php" method="post">'; echo '<input name="MAX_FILE_SIZE" type="hidden" value="100000">'; echo '<fieldset>'; echo '<legend>Enter the following information to add a show name:</legend>'; echo '<p>Enter Show Name:<input name="showname" type="text"></p>'; echo '<p>Show Type:<select name="type"><option></option><option>Weekly Show</option><option>Pay Per View</option></select></p>'; echo '<p>Upload Show Image:<input name="uploadedfile" type="file"></p>'; echo '<div align="center"><input name="submit" type="submit"><input name="sumbitted" type="hidden" value="TRUE"></div>'; echo '</fieldset>'; echo '</form>'; ?> Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654188 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 try $target_path = "../images/"; Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654193 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Grrr!!!!!!!!! Same thing. Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654196 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 right try $target_path = "../images/"; Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654197 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2008 Author Share Posted September 30, 2008 Only thing is it wasn't uploaded into the images folder. The file aggression.jpg has been uploaded Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/y/a/n/yankeefaninkc/html/backstage/addshowname.php on line 44 Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654201 Share on other sites More sharing options...
gaza165 Posted September 30, 2008 Share Posted September 30, 2008 well i know that works becuase i have just tested it on your site now you have a problem with ur sql query to fix that // now we insert it into the database $insert = "INSERT INTO shows (showname, type, showimage) VALUES ('".$_POST['showname']."','".$_POST['type']."','".$_POST['showimage']."')"; $add_show = mysql_query($insert) or die(mysql_error()); replace your exsiting code with that i uploaded it seems fine to me http://www.kansasoutlawwrestling.com/images/test.txt Link to comment https://forums.phpfreaks.com/topic/126484-upload-images-script-to-certain-directory/#findComment-654202 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.