Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. the JS file is $("#addrow").click(function(){ $(".item-row:last").after('<tr class="item-row"><td class="item-name"><div class="delete-wpr"><textarea name="Item">Item Name</textarea><a class="delete" href="javascript:;" title="Remove row">X</a></div></td><td class="description"><textarea name="Description">Description</textarea></td><td><textarea class="cost">$0</textarea></td><td><textarea class="qty">0</textarea></td><td><span class="price">$0</span></td></tr>'); if ($(".delete").length > 0) $(".delete").show(); bind(); }); is there a way to random the textarea name?like item2 description2....
  2. Hey guys i have an invoice template the fields are basic..price ,business..... but in the invoice section i have a add field button to add more items..(attached pic.) So how can i insert these extra fields in my database?cause it will insert all in one field.. database:Invoice I_ID Business Client_ID Store Item Description total total_tax
  3. great help man..(your up urly to is see..lol) i will test it it.thx im guessing i got to remove my } at the end iof the block. if(isset($_POST['imgmain'])) $Main = $uploaded_images[ $_POST['imgmain'] ]; // now we insert the uploaded thumnail to database $sql = "INSERT INTO new (Main_Image, Image_2, Image_3, Image_4, Image_5) VALUES ('$Main', '$uploaded_images[0]','$uploaded_images[1]','$uploaded_images[2]','$uploaded_images[3]')"; if( ($result = mysql_query($sql)) ) { echo '<p><img src="images/icons/accept.gif" alt"" /> uploaded!</p>'; $page = "index.php?page=portfolio"; $sec = "1"; //header("Refresh: $sec; url=$page"); } else { echo "ERROR: ".mysql_error(); } }} this one
  4. ya the check is to select the picture that is the main image.
  5. i was thinking like this $Main = $_POST["Main"]. " ". $_POST['imgfile']['name']; but i get nothing
  6. the image name is ok its the part to attache the check box to the image i select
  7. ya i noticed.np.. but how can i put it so it can insert the name of the pic?
  8. nice!works great for insert but still the main image ...now it inserts nothing..but i think it is is missing?
  9. i have to upload 4 diffrent image of the same car.out inside side rear... and i need to make one main image for main thumbnail on index page. so thats were im stuck..it uploads it inserts but not like i need it..
  10. but the name of the image in image_2..3...4..5 and i cant seem to get if i check the check box to insert the name of the pic checked..
  11. think you can help me with my uploader??works good uploads all 4 images and reseizes them,. but it insterts wrong in database??? i get :(capture attached..) code $conn = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($databse_name,$conn); $sql="SELECT * FROM new";$result=mysql_query($sql);$data=mysql_fetch_array($result);$gebruiker=$_SESSION['username'];if(!isset($_GET['x'])){ $aantal=4;}else{ $aantal= $_GET['x'];}?><html><head> </head><body><h3> </h3> <fieldset class="dashboard"><legend class="dashboard">Beheer</legend><?phpif (isset($_REQUEST['submit'])) { $name = $_POST["name"]; $description = $_POST["description"]; $Main = $_POST["Main"]; $fieldname = 'imgfile'; $active_keys = array(); foreach($_FILES[$fieldname]['name'] as $key => $filename) { if(!empty($filename)) { $active_keys[] = $key; } } foreach($active_keys as $key) { $path_thumbs = "upload/thumbs"; $path_big = "upload/images"; //the new width of the resized image. $img_thumb_width = 150; // in pixel //Do you want to limit the extensions of files uploaded (yes/no) $extlimit = "no"; //allowed Extensions $limitedext = array(".gif",".jpg",".png",".jpeg",".bmp"); $file_type = $_FILES['imgfile']['type'][$key]; $file_name = $_FILES['imgfile']['name'][$key]; $file_size = $_FILES['imgfile']['size'][$key]; $file_tmp = $_FILES['imgfile']['tmp_name'][$key]; //check file extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Verkeerde extensie. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); } //get the file extension. $file_ext = end(explode(".", $file_name)); //create a random file name $rand_name = md5(time()); $rand_name= rand(0,999999999); //get the new width variable. $ThumbWidth = $img_thumb_width; //keep image type if($file_size){ if($file_type == "image/pjpeg" || $file_type == "image/jpeg"){ $new_img = imagecreatefromjpeg($file_tmp); }elseif($file_type == "image/x-png" || $file_type == "image/png"){ $new_img = imagecreatefrompng($file_tmp); }elseif($file_type == "image/gif"){ $new_img = imagecreatefromgif($file_tmp); } //list width and height and keep height ratio. list($width, $height) = getimagesize($file_tmp); $imgratio=$width/$height; if ($imgratio>1){ $newwidth = $ThumbWidth; $newheight = $ThumbWidth/$imgratio; }else{ $newheight = $ThumbWidth; $newwidth = $ThumbWidth*$imgratio; } //function for resize image. if (function_exists(imagecreatetruecolor)){ $resized_img = imagecreatetruecolor($newwidth,$newheight); }else{ die("Error: Please make sure you have GD library ver 2+"); } imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); //save image ImageJpeg ($resized_img,"$path_thumbs/$rand_name.$file_ext"); ImageDestroy ($resized_img); ImageDestroy ($new_img); move_uploaded_file ($file_tmp, "$path_big/$rand_name.$file_ext"); foreach($active_keys as $key) { mysql_query("INSERT INTO new (Main_Image,Image_2,Image_3,Image_4,Image_5) VALUES ('$Main','$rand_name.$file_ext','$rand_name.$file_ext','$rand_name.$file_ext','$rand_name.$file_ext')"); } } } // $sql = "INSERT INTO new (Main,description,video) VALUES ('$name','$description','$video')"; if( ($result = mysql_query($sql)) ) { echo '<p><img src="images/icons/accept.gif" alt"" /> uploaded!</p>'; $page = "index.php?page=portfolio"; $sec = "1"; //header("Refresh: $sec; url=$page"); } else { echo "ERROR: ".mysql_error(); } } else { ?> <div id="container"> <form action="" enctype="multipart/form-data" method="post" class="niceform" name="UD"><dl> <dd> <?php for($i=0; $i < $aantal; $i++) { ?> </dd> </dl><dl> <dt><label for="imgfile">Kies foto:</label></dt> <dd><input name="imgfile[]" id="imgfile[]" type="file" /> <input type="checkbox" name="Main" id="Main"> <label for="Main"></label></dd> </dl> <?php } ?><dd><input type="submit" name="submit" id="submit" value="Insert" /></dd> </form></div></fieldset> <?php}?>
  12. huh..i didn't know i can put 2 unlink functions in one script..creat..lol thx for the help
  13. ok..i didnt know it downloaded the full image...that answers why the page takes time to load... i didnt like the thumbnail and big size uploader cause to delete the pic it was complicated.. needed to make like 3 scripts to redirect were the thumbnail is and unlink it the refresh to big folder and unlink....
  14. hey guys for my site i have a script that resizes the image for the correct size of the site...but since i put this script the images and site is really slow to load..guessing cause of the resizing.. the reason why i put this is because if i only put width="" height="" in the img it would distort .. is there a way to put width="" height="" but without distorting the image and slowing down the load time?
  15. Reatail_price ya its a thousand separator.. ok i guess i will..so no decimal or comma's right just plain numeric
  16. it doesn't work if i only put 15000
  17. Hey guys im doing a new dealership site for my buddy .he already has an older script that inserts prices like 15,000 now in my new site i want to make ranges of prices like >= to or <= to... so it is working but half way.. my code SELECT * FROM `cars` WHERE `Retail_price` >= 15.000LIMIT 0 , 30 it works but it also shows cars that do not have a , like 900 or 500.... i put the . cause in the database there is a , is there a way arround this? and what would be the best format? no . just 15000 or 15.000
  18. hey guys when i set the width i seem to be getting a distorded image... <?php echo (empty($info['Image_3'])? "<img src=/images/noimage.jpg >": "<img src=/admin/uploads/thumbs/". $info['Image_3'] ." border=0 width=200 >");?>
  19. would you now how to search in database like price under 5000 over 5000? but the issue is is that the column Retail_Price hase the numbers like 5,000 it has that (,) so when i try <= 5,000 i get a mysql error..
  20. im must of been tired..lol seems to work..thx
  21. Hey guys im going nuts here..i have a car dealership script to do for my budy and i want to do a multiple search for by make.. so i got a litle test script im doing to figure out the results.. $search_string = "'" . implode( "','", $search ) . "'" ;$q3 = "select * from `cars` where Make in ('$search_string') ORDER BY `Make` ASC LIMIT 0 , 30 ";$result = mysql_query($q3); while($info = mysql_fetch_array($result)){ echo $info['Make']; }echo "select * from `cars` where Make in ({$search_string} ) was selected!\n"; So the odd think is i cant get an echo results of it.. so i echo a txt base line to see what the query is. i get (selected Acura and BMW) select * from `cars` where Make in ('Acura','BMW' ) was selected! So if i paste in phpmyadmin select * from `cars` where Make in ('Acura','BMW' ) works perfect.. so why does it not echo?(i just put Make to test for now) thx
  22. Hey guys i have an auto suggest form that i want to show 2 fields in the search box.. echo '<ul>';while ($result = $query ->fetch_object()) { echo '<li onClick="fill(\''.addslashes($result->Nom).'\');">'.$result->Nom-Prenom.'</li>'; }echo '</ul>'; how can i set the results to look in 2 fields? $result->Nom i have tried $result->Nom,Prenom $result->Nom.Prenom....
  23. hey guys i have this ajax autos suggest form and it works but all the suggestions have the same link.. // Query $q = @$_GET['q']; $ql = strlen($q); // Target mode $target = @$_GET['target']; // Limitation of suggestions $limit = "15"; $results = array(); $sql = "SELECT * FROM $Fiscale WHERE LEFT(Nom, $ql)='$q' ORDER BY `Nom` LIMIT $limit"; $res = mysql_query($sql) or die (mysql_error()); while ($row = mysql_fetch_assoc ($res)) { $results[] = $row["Nom"]."-".$row["Prenom"]; $E_ID = $row["N_Fiche"]; } if(!empty($results)) { echo "<ul>"; for($i=0;$i<count($results);$i++){ $url = @str_ireplace("%s", urlencode($results[$i]), $_GET['E_ID']); echo "<li><a href='V.php?N_F=".$E_ID."' target='".$target."'>".str_ireplace($q, $q."<b>", $results[$i])."</b></br></a></li>"; } echo "</ul>"; } }
×
×
  • 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.