Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by petenaylor

  1. Hi all I have a php form as follows: <form action="basket.php?action=add&id=1&qty=1" method="post" name="buy-product"> <input name="initial_1" id="initial_1" type="text" size="8" maxlength="1" /> <input name="initial_2" id="initial_2" type="text" size="8" maxlength="1" /> <input name="initial_3" id="initial_3" type="text" size="8" maxlength="1" /> <input name="send" type="submit" class="contact-form-button" id="send" value="Submit" /> Basically I need to add the three initials into a session so that they can be shown in the shopping cart next to the product. How do I add the initials to the session and how do I output them to the shopping cart? At the start of my basket.php script I have: $cart = $_SESSION['cart']; $action = $_GET['action']; $id = $_GET['id']; $qty = $_GET['qty']; $initial_1 = $_POST['initial_1']; $initial_2 = $_POST['initial_2']; $initial_3 = $_POST['initial_3']; I now need to create a table with the cart showing item, price and initials. Cheers Pete.
  2. The actual images show but the file not being on the server means that the placeholder is there but no image shows. So the data is in the database correctly and the page is showing the correct image, but the image isn't physically in the directory on the server so it's not shown.
  3. Hi there That seems to work, but the images aren't being uploaded to the server? The correct image names are being added to the database and they display on the page but the image isn't in the directory. I have made sure the CHMOD is OK on the directory too.
  4. Hi all I am in the middle of a script that enables the user to upload an image via a form and then it changes the size and uploads it to the server and to a mySQL database. The user has the ability to upload three images. I need to know how to bypass part of the script for the images that they don't upload. For example of they only upload one via the form how do I miss out the section of the script that does the other two images? Here's my code: $left_title = stripslashes($_POST['left_title']); $left_text = stripslashes($_POST['left_text']); $image1 = $_FILES['image1']['tmp_name']; $image1main = $_FILES['image1']['name']; //image 1 $src = imagecreatefromjpeg($image1); $image2 = $_FILES['image2']['tmp_name']; $image2main = $_FILES['image2']['name']; // image 2 $src2 = imagecreatefromjpeg($image2); $image3 = $_FILES['image3']['tmp_name']; $image3main = $_FILES['image3']['name']; // image 3 $src3 = imagecreatefromjpeg($image3); //image number 1 creation and change --------------------------------------------------------------------------------------------- list($width,$height)=getimagesize($image1); $newwidth=600; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "/home/users/web/b2075/moo.petenaylor/websites/d/dogs/images/front/". $_FILES['image1']['name']; imagejpeg($tmp,$filename,100); imagedestroy($src); imagedestroy($tmp); //end of image 1 manipulation ---------------------------------------------------------------------------------------------------- //image number 2 creation and change --------------------------------------------------------------------------------------------- list($width,$height)=getimagesize($image2); $newwidth=600; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src2,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "/home/users/web/b2075/moo.petenaylor/websites/d/dogs/images/front/". $_FILES['image2']['name']; imagejpeg($tmp,$filename,100); imagedestroy($src2); imagedestroy($tmp); //end of image 2 manipulation ---------------------------------------------------------------------------------------------------- //image number 3 creation and change --------------------------------------------------------------------------------------------- list($width,$height)=getimagesize($image3); $newwidth=600; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$src3,0,0,0,0,$newwidth,$newheight,$width,$height); $filename = "/home/users/web/b2075/moo.petenaylor/websites/d/dogs/images/front/". $_FILES['image3']['name']; imagejpeg($tmp,$filename,100); imagedestroy($src3); imagedestroy($tmp); //end of image 3 manipulation ---------------------------------------------------------------------------------------------------- // Validation //saving record to MySQL database //(\"$item_category\",\"$title\",\"$description\",\"$price\",\"$postage\",\"$condition\",\"$item_code\",\"$image1main\",\"$image2main\",\"$image3main\",\"$image4main\")" ; @$pfw_strQuery = "INSERT INTO `front_page_text`(`left_title`,`left_text`,`image1`,`image2`,`image3`)VALUES (\"$left_title\",\"$left_text\",\"$image1main\",\"$image2main\",\"$image3main\")" ; Many thanks for you help. Pete
  • 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.