Jump to content

Dave2136

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dave2136's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The form asks pick A pick B or pick C, or...pick any combination of the three. Then if they pick one two or three of the choices then I wanted the php to take the choices and to upload that data to mySql. So if they picked A and C to have my SQL have the letters A and C marked and to have B left blank.
  2. Hi. My form involves a checkbox. Below is the code. The problem is that when I am not sure what to put on the php. I need for people to be able to check one box tow boxes or all three boxes. On the form side I have this: type="checkbox" name="formcheck[]" value="C". Not sure what to put on the php side and need some assistance <label style="display: block; padding-left: 15px; text-indent: -15px; width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="A" /> Directory Listing </label> <label style="display: block; padding-left: 15px; text-indent: -15px;width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="B" /> Full page listing </label> <label style="display: block; padding-left: 15px; text-indent: -15px;width:650px;"> <input style="width: 45px; height: 45px; padding: 0; margin:0; vertical-align: bottom; position: relative; top: -1px; *overflow: hidden;" type="checkbox" name="formcheck[]" value="C" /> Receive a link to your website </label>
  3. Hi I am really frustrated because I got my php code working fine and then I had to make some minor changes to my html form and now the php is not working. I am reciec=ving this message: Warning: move_uploaded_file(upload/carey.bmp) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/content/19/6550319/html/ipad/listing.php on line 35 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpIEUQLo' to 'upload/carey.bmp' in /home/content/19/6550319/html/ipad/listing.php on line 35 Sorry, there was a problem uploading your file.03/10/11 : 20:50:08 I wrote it twice because it keeps coming out twice. I guess it means that it cant upload the image because there is no image but I really dont understand why. I havent changed the image part of the form. Does anyone have any ideas? It is much appreciated. Here is the code <?php //This is the directory where images will be saved $target = "upload/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $price=$_POST['price']; $pic=($_FILES['photo']['name']); $pic2=($_FILES['phototwo']['name']); $pic3=($_FILES['photothree']['name']); $pic4=($_FILES['photofour']['name']); $description=$_POST['iPadDescription']; $condition=$_POST['condition']; $gig=$_POST['giga']; $yesg=$_POST['yesg']; $fname=$_POST['firstName']; $lname=$_POST['lastName']; $email=$_POST['email']; // Connects to your Database mysql_connect ("taken out for security", "taken out", "taken out") or die(mysql_error()) ; mysql_select_db("taken out") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO ipadlist (price,photo,phototwo,photothree,photofour,iPadDescription,condition,giga,yesg,firstName,lastName,email) VALUES ('$price', '$pic', '$pic2', '$pic3', '$pic4', '$description', '$condition', '$gig', '$yesg', '$fname', '$lname', '$email')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } echo date("m/d/y : H:i:s", time()) ?>
  4. Thank you so much! I was pulling my hair out and getting upset to the point of wanting to just give up. I read the code probably 50 times yesterday and I cant believe I missed that! It now works. It is funny how we sometimes need someone elses eyes to see things.
  5. I have been trying to get my files to upload onto a computer and I receive this message: Parse error: syntax error, unexpected T_STRING in /home/content/19/6550319/html/listing.php on line 27. Line 27 is how the php logs into my SQL. The problem is that I was able to log in before. I just made changes to the form by adding a dropdown menu and price and now it says it doesnt parse. Can anyone figure this out. I will include the code without the login information because the forum is public but I did put the words left out for you to see where I took out the passcodes. <?php //This is the directory where images will be saved $target = "potofiles/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $price=$_POST['price']; $gig=$_POST['giga']; $yesg=$_POST['yesg']; $pic=($_FILES['photo']['name']); $pic2=($_FILES['phototwo']['name']); $pic3=($_FILES['photothree']['name']); $pic4=($_FILES['photofour']['name']); $description=$_POST['iPadDescription']; $condition=$_POST['condition']; $fname=$_POST['firstName']; $lname=$_POST['lastName']; $email=$_POST['email'] // Connects to your Database mysql_connect ("left out", "left out", "left out") or die(mysql_error()) ; mysql_select_db("left out") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO listing (price,giga,yesg,photo,phototwo,photothree,photofour,iPadDescription,condition,firstName,lastName,email) VALUES ('$price', '$gig', '$yesg', '$pic', '$pic2', '$pic3', '$pic4', '$description', '$condition', '$fname', '$lname', '$email')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } echo date("m/d/y : H:i:s", time()) ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.