chronister Posted January 22, 2008 Share Posted January 22, 2008 Actually I knew that is what you would get. I wanted to give you a basic lesson here. When you look at this code, you are calling mysql_query with $query as an argument. mysql_query("INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"); // setup our query $result=mysql_query($query) or die(mysql_error()); // run our query // set our message to say it was successful $message='Successfully added info to database'; I try to structure my query as $query = ''; $result = msyql_query($query); I can echo query and make sure I am passing a proper query to the db. My number 1 tip to all newer php coders, is echo echo echo.... when things are not going the way you want then start echoing things out. Echo variables, echo statements like 'First if statement passed true';. This gives you an idea as to where your script is stopping and you can correct it at that point. change the query line into $query = "INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name'); // setup our query instead of mysql_query("INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"); // setup our query Nate Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-446265 Share on other sites More sharing options...
Dada78 Posted January 22, 2008 Author Share Posted January 22, 2008 Ok I tried that but I am still not getting it to insert it just refreshes the page on insert and empty's the fields. I also am not getting any errors for leaving fields empty which I should be getting if a field has been left empty. Here is the entire code for that file <?php // here, we check if the form has been submitted, because we need to handle // redirection before we handle outputting the HTML stuff. if (isset($_POST['submit'])) { if (!empty($_REQUEST['displayname'])) $displayname = $_REQUEST['displayname']; else $error = 'Please enter a name for your display.'; if (!empty($_REQUEST['displaytype'])) $displaytype = $_REQUEST['displaytype']; else $error = 'Please select a display type.'; if (!empty($_REQUEST['description'])) $description = $_REQUEST['description']; else $error = 'Please include a brief description about your display.'; if (!empty($_REQUEST['address'])) $address = $_REQUEST['address']; else $error = 'Please enter your display address.'; if (!empty($_REQUEST['city'])) $city = $_REQUEST['city']; else $error = 'Please enter your city.'; if (!empty($_REQUEST['state'])) $state = $_REQUEST['state']; else $error = 'Please enter your state.'; if (!empty($_REQUEST['postal'])) $postal = $_REQUEST['postal']; else $error = 'Please enter your zipcode.'; if (!empty($_REQUEST['country'])) $country = $_REQUEST['country']; else $error = 'Please enter your country.'; if (!empty($_REQUEST['image'])) $image = $_REQUEST['image']; else $error = 'Please upload an picture of your display.'; if (empty($errors)) { // MAKE CONNECTION include ('db_connect.php'); $displayname = $_POST['displayname']; $displaytype = $_POST['displaytype']; $description = $_POST['description']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $postal = $_POST['postal']; $country = $_POST['country']; $website = $_POST['website']; $file=$_FILES['image']['tmp_name']; // its an image, get its temp name $type = $_FILES['image']['type']; if(is_uploaded_file($file)) // make sure the file is uploaded before we proceed { if($type == 'image/gif' || $type == 'image/jpeg') // check and see if the file type is an image { $image_name=$_FILES['image']['name']; // get image name $uploaddir='/local/submitted/'; // set the path to the image dir $uploaddir.=$image_name; // set upload path including the filename } else { // set error message because file was not an image $error='The file you have attempted to upload is not an image. For security reasons, only images are allowed'; } if(move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir)) { // if file was moved into the directory $message.= 'Successfully uploaded file '.$image_name ; } else { // set error message saying that file was not uploaded $error='There was a problem uploading the file'; } $query = "INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"; // setup our query echo $query; $result=mysql_query($query) or die(mysql_error()); // run our query // set our message to say it was successful $message='Successfully added info to database'; header('Location: user.php'); exit(); } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" /> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="Mesquite Texas Country Christmas" /> <meta name="keywords" content="Mesquite, Texas, Country Christmas" /> <meta name="author" content="NA" /> <link rel="stylesheet" type="text/css" href="/stylesheet.css" media="screen" title="FBC" /> <script type="text/javascript" src="drop_down.js"></script> <title>A Mesquite Country Christmas</title> </head> <body> <div id="wrap"> <a href="/index.html"> <img id="frontphoto" src="/images/header.png" width="760" height="237" alt="Mesquite Country Christmas" border="0"></a> <div id="menu"> <h2 class="hide">Menu:</h2> <ul id="avmenu"> <li><a href="/index.html">Home</a></li> <li><a href="/christmasstory.html">The Christmas Story</a></li> <li><a href="/directions.html">Directions</a></li> <li><a href="#">Information</a><ul> <li><a href="/information.html">Display Facts & Info</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/playlist.html">2008 Playlist</a></li> <li><a href="#">Christmas History</a></li> </ul></li> <li><a href="#">Photos</a> <ul> <li><a href="/2007photos.html">2007</a></li> </ul></li> <li><a href="#">Videos</a> <ul> <li><a href="/2007videos.html">2007</a></li> </ul></li> <li><a href="/guestbook.php">Guestbook</a></li> <li><a href="/webcam.html">Web Cam</a></li> <li><a href="/webradio.html">Internet Radio</a></li> <li><a href="http://www.noradsanta.org/" TARGET="_blank">Track Santa</a></li> <li><a href="/projects.html">Projects & How Tos</a></li> <li><a href="/links.html">Links</a></li> <li><a href="/contact_us.html">Contact Us</a></li> </ul> <center><a href="http://www.toysfortots.org/" TARGET="_blank"><img src="/images/toys_for_tots.jpg" border="0" width="110" height="153" vspace="10"></a></center> <center><a href="http://christmas.bronners.com/2007/house/534.html"><img src="http://christmas.bronners.com/voteforme/vote.jpg" border="0" width="110" height="153" alt="christmas decorations" vspace="10"></a></center> </div> <div id="content"> <div class="fadebox"> <h2> Submit your Lights</h2> <hr /> <p><img src="/images/christmas-lights.jpg" width="153" height="208" alt="Submit Lights" align="left" border="0" hspace="10"> Thank you for submitting your home to the Mesquites Country Christmas display finder database. There are some things you should know before submitting to make your experience a pleasant one.</p><p>First of all, we do not release your personal information to anyone for any reason. The only exception to this, obviously, is the address of the display, the website (if it has one), and a picture of the display.</p><p>Secondly, please have a picture available to use for your display. You won't be able to submit your display without one. When submitting a picture, please make sure that the file is less than one megabyte (1 Meg or 1024k), and if possible, resize it to 640x480. Please also be sure your picture is in JPG format.</p><p>Your display will not immediately be entered into the Christmas Light Finder database. We will first have to approve your submission. This is so that those unscrupulous folks out there can't submit unacceptable pictures (not family friendly). Please allow up to 48 hours to be included into the database, though, the time before insertion is usually much shorter than that.</p> </div> <div class="fadebox"> <h2> Ready to submit? Fill out the form below:</h2> <hr /> <br /> <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table> <tr> <td>Display Name*</td><td><input name="displayname" size="40" type="text"></td></tr> <tr> <td>Display Type*</td><td><select name="displaytype"><option value="Residential">Residential</option><option value="Neighborhood">Neighborhood</option><option value="Commercial">Commercial</option><option value="City/Government">City/Government</option><option value="Sponsored">Sponsored</option></select></td></tr> <tr><td>Description*</td><td><textarea name="description" cols="30" rows="5"></textarea></td></tr> <tr><td>Address*</td><td><input name="address" size="40" type="text"></td></tr><tr><td>Address 2</td><td><input name="address2" size="40" type="text"></td></tr> <tr><td>City*</td><td><input name="city" size="30" type="text" value="Mesquite"></td></tr> <tr><td>State/Province*</td><td><input name="state" size="30" type="text" value="Texas"></td></tr> <tr><td>Postal Code*</td><td><select name="postal"><option value="75149">75149</option><option value="75150">75150</option><option value="75180">75180</option><option value="75181">75181</option><option value="75185">75185</option><option value="75187">75187</option></select></td></tr> <tr><td>Country*</td><td><input name="country" size="30" type="text" value="United States"></td></tr> <tr><td>Website</td><td><input name="website" size="50" value="http://" type="text"></td></tr> <tr><td>Picture*</td><td><input type="file" name="image" id="image" size="35"></td></tr> <tr> <td colspan="2" align="right" class="errorText"> <?PHP // then we check for the error message if (isset($error)) { echo $error . '<br />'; } ?> </td> </tr> <tr> <td colspan="2" style="border-top: 1px solid black;"> </td> </tr> <tr> <td align="left"> * Fields are required.</td> <td align="right"> <input name="submitted" value="Submit Now" type="submit"></td></tr> </tbody></table></form> </div> </div> <div id="footer"> © 2007 Mesquite Country Christmas <br /> <br /> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; //468x60, created 1/8/08 google_ad_slot = "0360766123"; google_ad_width = 468; google_ad_height = 60; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-446488 Share on other sites More sharing options...
chronister Posted January 23, 2008 Share Posted January 23, 2008 <?php ini_set('error_reporting', E_ALL; // here, we check if the form has been submitted, because we need to handle // redirection before we handle outputting the HTML stuff. if (isset($_POST['submit'])) { if (!empty($_REQUEST['displayname'])) $displayname = $_REQUEST['displayname']; else $error = 'Please enter a name for your display.'; if (!empty($_REQUEST['displaytype'])) $displaytype = $_REQUEST['displaytype']; else $error = 'Please select a display type.'; if (!empty($_REQUEST['description'])) $description = $_REQUEST['description']; else $error = 'Please include a brief description about your display.'; if (!empty($_REQUEST['address'])) $address = $_REQUEST['address']; else $error = 'Please enter your display address.'; if (!empty($_REQUEST['city'])) $city = $_REQUEST['city']; else $error = 'Please enter your city.'; if (!empty($_REQUEST['state'])) $state = $_REQUEST['state']; else $error = 'Please enter your state.'; if (!empty($_REQUEST['postal'])) $postal = $_REQUEST['postal']; else $error = 'Please enter your zipcode.'; if (!empty($_REQUEST['country'])) $country = $_REQUEST['country']; else $error = 'Please enter your country.'; if (!empty($_REQUEST['image'])) $image = $_REQUEST['image']; else $error = 'Please upload an picture of your display.'; if (empty($errors)) { // MAKE CONNECTION include ('db_connect.php'); $displayname = $_POST['displayname']; $displaytype = $_POST['displaytype']; $description = $_POST['description']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $postal = $_POST['postal']; $country = $_POST['country']; $website = $_POST['website']; $file=$_FILES['image']['tmp_name']; // its an image, get its temp name $type = $_FILES['image']['type']; if(is_uploaded_file($file)) // make sure the file is uploaded before we proceed { if($type == 'image/gif' || $type == 'image/jpeg') // check and see if the file type is an image { $image_name=$_FILES['image']['name']; // get image name $uploaddir='/local/submitted/'; // set the path to the image dir $uploaddir.=$image_name; // set upload path including the filename } else { // set error message because file was not an image $error='The file you have attempted to upload is not an image. For security reasons, only images are allowed'; } if(move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir)) { // if file was moved into the directory $message.= 'Successfully uploaded file '.$image_name ; } else { // set error message saying that file was not uploaded $error='There was a problem uploading the file'; } $query = "INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"; // setup our query echo $query.'<br>'.$message; $result=mysql_query($query) or die(mysql_error()); // run our query // set our message to say it was successful $message='Successfully added info to database'; header('Location: user.php'); exit(); } else { echo 'File was not uploaded'; } } } ?> Try that and tell me if you get anything. I would always do my if/else statements as if(){}else{}. You will probably get a bunch of errors here, so just post them all Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-447007 Share on other sites More sharing options...
Dada78 Posted January 25, 2008 Author Share Posted January 25, 2008 That didn't do anything, it just refreshes the page once you hit submit and nothing is inserted. http://mesquitechristmas.com/local/submit.php You can try and see with the link above. Also I had to fix ini_set('error_reporting', E_ALL; to ini_set('error_reporting', E_ALL); Because it was throwing an error. Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-448435 Share on other sites More sharing options...
max_w1 Posted January 25, 2008 Share Posted January 25, 2008 try this AJAX uploader with Progress bar! http://extjs.com/learn/Extension:UploadForm Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-448508 Share on other sites More sharing options...
Dada78 Posted January 25, 2008 Author Share Posted January 25, 2008 Thanks I will have to keep that in mind for my other page but I don't think that will work since this is apart of a form and I don't want to break the layout of the form. Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-448509 Share on other sites More sharing options...
max_w1 Posted January 25, 2008 Share Posted January 25, 2008 you can also try using a DHTML pop-up for the AJAX image uploader... in this way you will not break the layout of your form... Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-448837 Share on other sites More sharing options...
chronister Posted January 25, 2008 Share Posted January 25, 2008 With the ini_set line there, you should be getting some kind of error. If not, then I would suggest going through and echo'ing out stuff along the way to see where it is breaking. Did you run the script again once you fixed the ini_set, E_ALL line? nate Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-449123 Share on other sites More sharing options...
Dada78 Posted January 26, 2008 Author Share Posted January 26, 2008 Did you run the script again once you fixed the ini_set, E_ALL line? nate Yes I did and still nothing was showed, no errors or nothing. Here is the current code <?php ini_set('error_reporting', E_ALL); // here, we check if the form has been submitted, because we need to handle // redirection before we handle outputting the HTML stuff. if (isset($_POST['submit'])) { if (!empty($_REQUEST['displayname'])) $displayname = $_REQUEST['displayname']; else $error = 'Please enter a name for your display.'; if (!empty($_REQUEST['displaytype'])) $displaytype = $_REQUEST['displaytype']; else $error = 'Please select a display type.'; if (!empty($_REQUEST['description'])) $description = $_REQUEST['description']; else $error = 'Please include a brief description about your display.'; if (!empty($_REQUEST['address'])) $address = $_REQUEST['address']; else $error = 'Please enter your display address.'; if (!empty($_REQUEST['city'])) $city = $_REQUEST['city']; else $error = 'Please enter your city.'; if (!empty($_REQUEST['state'])) $state = $_REQUEST['state']; else $error = 'Please enter your state.'; if (!empty($_REQUEST['postal'])) $postal = $_REQUEST['postal']; else $error = 'Please enter your zipcode.'; if (!empty($_REQUEST['country'])) $country = $_REQUEST['country']; else $error = 'Please enter your country.'; if (!empty($_REQUEST['image'])) $image = $_REQUEST['image']; else $error = 'Please upload an picture of your display.'; if (empty($errors)) { // MAKE CONNECTION include ('db_connect.php'); $displayname = $_POST['displayname']; $displaytype = $_POST['displaytype']; $description = $_POST['description']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $postal = $_POST['postal']; $country = $_POST['country']; $website = $_POST['website']; $file=$_FILES['image']['tmp_name']; // its an image, get its temp name $type = $_FILES['image']['type']; if(is_uploaded_file($file)) // make sure the file is uploaded before we proceed { if($type == 'image/gif' || $type == 'image/jpeg') // check and see if the file type is an image { $image_name=$_FILES['image']['name']; // get image name $uploaddir='/local/submitted/'; // set the path to the image dir $uploaddir.=$image_name; // set upload path including the filename } else { // set error message because file was not an image $error='The file you have attempted to upload is not an image. For security reasons, only images are allowed'; } if(move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir)) { // if file was moved into the directory $message.= 'Successfully uploaded file '.$image_name ; } else { // set error message saying that file was not uploaded $error='There was a problem uploading the file'; } $query = "INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"; // setup our query echo $query.'<br>'.$message; $result=mysql_query($query) or die(mysql_error()); // run our query // set our message to say it was successful $message='Successfully added info to database'; header('Location: user.php'); exit(); } else { echo 'File was not uploaded'; } } } ?> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-449615 Share on other sites More sharing options...
Dada78 Posted January 27, 2008 Author Share Posted January 27, 2008 Ok I reworked the code and this is the errors I am getting. Notice: Undefined index: displayname in /home/mesquit1/public_html/local/submit.php on line 54 Notice: Undefined index: displaytype in /home/mesquit1/public_html/local/submit.php on line 55 Notice: Undefined index: description in /home/mesquit1/public_html/local/submit.php on line 56 Notice: Undefined index: address in /home/mesquit1/public_html/local/submit.php on line 57 Notice: Undefined index: address2 in /home/mesquit1/public_html/local/submit.php on line 58 Notice: Undefined index: city in /home/mesquit1/public_html/local/submit.php on line 59 Notice: Undefined index: state in /home/mesquit1/public_html/local/submit.php on line 60 Notice: Undefined index: postal in /home/mesquit1/public_html/local/submit.php on line 61 Notice: Undefined index: country in /home/mesquit1/public_html/local/submit.php on line 62 Notice: Undefined index: website in /home/mesquit1/public_html/local/submit.php on line 63 Notice: Undefined index: image in /home/mesquit1/public_html/local/submit.php on line 65 Notice: Undefined index: image in /home/mesquit1/public_html/local/submit.php on line 66 File was not uploaded Here is the code for the entire file. <?php ini_set('error_reporting', E_ALL); // here, we check if the form has been submitted, because we need to handle // redirection before we handle outputting the HTML stuff. if (isset($_POST['submit'])) { if (empty($_POST['displayname'])) { $error = 'Please enter a name for your display.'; } if (empty($_POST['displaytype'])) { $error = 'Please select a display type.'; } if (empty($_POST['description'])) { $error = 'Please include a brief description about your display.'; } if (empty($_POST['address'])) { $error = 'Please enter your display address.'; } if (empty($_POST['city'])) { $error = 'Please enter your city.'; } if (empty($_POST['state'])) { $error = 'Please enter your state.'; } if (empty($_POST['postal'])) { $error = 'Please enter your zipcode.'; } if (empty($_POST['country'])) { $error = 'Please enter your country.'; } if (empty($_POST['image'])) { $error = 'Please upload an picture of your display.'; } } else { // MAKE CONNECTION include ('db_connect.php'); $displayname = $_POST['displayname']; $displaytype = $_POST['displaytype']; $description = $_POST['description']; $address = $_POST['address']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $postal = $_POST['postal']; $country = $_POST['country']; $website = $_POST['website']; $file=$_FILES['image']['tmp_name']; // its an image, get its temp name $type = $_FILES['image']['type']; if(is_uploaded_file($file)) // make sure the file is uploaded before we proceed { if($type == 'image/gif' || $type == 'image/jpeg') // check and see if the file type is an image { $image_name=$_FILES['image']['name']; // get image name $uploaddir='/local/submitted/'; // set the path to the image dir $uploaddir.=$image_name; // set upload path including the filename } else { // set error message because file was not an image $error='The file you have attempted to upload is not an image. For security reasons, only images are allowed'; } if(move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir)) { // if file was moved into the directory $message.= 'Successfully uploaded file '.$image_name ; } else { // set error message saying that file was not uploaded $error='There was a problem uploading the file'; } $query = "INSERT INTO users (displayname, displaytype, description, address, address2, city, state, postal, country, website, image_path) VALUES ('$displayname', '$displaytype', '$description', '$address', '$address2', '$city', '$state', '$postal', '$country', '$website', '$image_name')"; // setup our query echo $query.'<br>'.$message; $result=mysql_query($query) or die(mysql_error()); // run our query // set our message to say it was successful $message='Successfully added info to database'; header('Location: user.php'); exit(); } else { echo 'File was not uploaded'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" /> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="Mesquite Texas Country Christmas" /> <meta name="keywords" content="Mesquite, Texas, Country Christmas" /> <meta name="author" content="NA" /> <link rel="stylesheet" type="text/css" href="/stylesheet.css" media="screen" title="FBC" /> <script type="text/javascript" src="drop_down.js"></script> <title>A Mesquite Country Christmas</title> </head> <body> <div id="wrap"> <a href="/index.html"> <img id="frontphoto" src="/images/header.png" width="760" height="237" alt="Mesquite Country Christmas" border="0"></a> <div id="menu"> <h2 class="hide">Menu:</h2> <ul id="avmenu"> <li><a href="/index.html">Home</a></li> <li><a href="/christmasstory.html">The Christmas Story</a></li> <li><a href="/directions.html">Directions</a></li> <li><a href="#">Information</a><ul> <li><a href="/information.html">Display Facts & Info</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/playlist.html">2008 Playlist</a></li> <li><a href="#">Christmas History</a></li> </ul></li> <li><a href="#">Photos</a> <ul> <li><a href="/2007photos.html">2007</a></li> </ul></li> <li><a href="#">Videos</a> <ul> <li><a href="/2007videos.html">2007</a></li> </ul></li> <li><a href="/guestbook.php">Guestbook</a></li> <li><a href="/webcam.html">Web Cam</a></li> <li><a href="/webradio.html">Internet Radio</a></li> <li><a href="http://www.noradsanta.org/" TARGET="_blank">Track Santa</a></li> <li><a href="/projects.html">Projects & How Tos</a></li> <li><a href="/links.html">Links</a></li> <li><a href="/contact_us.html">Contact Us</a></li> </ul> <center><a href="http://www.toysfortots.org/" TARGET="_blank"><img src="/images/toys_for_tots.jpg" border="0" width="110" height="153" vspace="10"></a></center> <center><a href="http://christmas.bronners.com/2007/house/534.html"><img src="http://christmas.bronners.com/voteforme/vote.jpg" border="0" width="110" height="153" alt="christmas decorations" vspace="10"></a></center> </div> <div id="content"> <div class="fadebox"> <h2> Submit your Lights</h2> <hr /> <p><img src="/images/christmas-lights.jpg" width="153" height="208" alt="Submit Lights" align="left" border="0" hspace="10"> Thank you for submitting your home to the Mesquites Country Christmas display finder database. There are some things you should know before submitting to make your experience a pleasant one.</p><p>First of all, we do not release your personal information to anyone for any reason. The only exception to this, obviously, is the address of the display, the website (if it has one), and a picture of the display.</p><p>Secondly, please have a picture available to use for your display. You won't be able to submit your display without one. When submitting a picture, please make sure that the file is less than one megabyte (1 Meg or 1024k), and if possible, resize it to 640x480. Please also be sure your picture is in JPG format.</p><p>Your display will not immediately be entered into the Christmas Light Finder database. We will first have to approve your submission. This is so that those unscrupulous folks out there can't submit unacceptable pictures (not family friendly). Please allow up to 48 hours to be included into the database, though, the time before insertion is usually much shorter than that.</p> </div> <div class="fadebox"> <h2> Ready to submit? Fill out the form below:</h2> <hr /> <br /> <form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table> <tr> <td>Display Name*</td><td><input name="displayname" size="40" type="text"></td></tr> <tr> <td>Display Type*</td><td><select name="displaytype"><option value="Residential">Residential</option><option value="Neighborhood">Neighborhood</option><option value="Commercial">Commercial</option><option value="City/Government">City/Government</option><option value="Sponsored">Sponsored</option></select></td></tr> <tr><td>Description*</td><td><textarea name="description" cols="30" rows="5"></textarea></td></tr> <tr><td>Address*</td><td><input name="address" size="40" type="text"></td></tr><tr><td>Address 2</td><td><input name="address2" size="40" type="text"></td></tr> <tr><td>City*</td><td><input name="city" size="30" type="text" value="Mesquite"></td></tr> <tr><td>State/Province*</td><td><input name="state" size="30" type="text" value="Texas"></td></tr> <tr><td>Postal Code*</td><td><select name="postal"><option value="75149">75149</option><option value="75150">75150</option><option value="75180">75180</option><option value="75181">75181</option><option value="75185">75185</option><option value="75187">75187</option></select></td></tr> <tr><td>Country*</td><td><input name="country" size="30" type="text" value="United States"></td></tr> <tr><td>Website</td><td><input name="website" size="50" value="http://" type="text"></td></tr> <tr><td>Picture*</td><td><input type="file" name="image" id="image" size="35"></td></tr> <tr> <td colspan="2" align="right" class="errorText"> <?PHP // then we check for the error message if (isset($error)) { echo $error . '<br />'; } ?> </td> </tr> <tr> <td colspan="2" style="border-top: 1px solid black;"> </td> </tr> <tr> <td align="left"> * Fields are required.</td> <td align="right"> <input name="submitted" value="Submit Now" type="submit"></td></tr> </tbody></table></form> </div> </div> <div id="footer"> © 2007 Mesquite Country Christmas <br /> <br /> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; //468x60, created 1/8/08 google_ad_slot = "0360766123"; google_ad_width = 468; google_ad_height = 60; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div> </body> </html> -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-450252 Share on other sites More sharing options...
chronister Posted February 5, 2008 Share Posted February 5, 2008 Sorry I have been out of the state for work and have not had time to check this. Are you still needing help on this or did you figure it out? Quote Link to comment https://forums.phpfreaks.com/topic/86842-insert-images-into-mysql/page/2/#findComment-458728 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.