Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. hey guys i have tryed it all and i cant get it to work? mysql_connect("localhost", "me", "techker") or die(mysql_error()) ; mysql_select_db("a_me") or die(mysql_error()) ; $Make=$_POST['Make']; $Model=$_POST['Model']; $Year=$_POST['Year']; $Transmission=$_POST['Transmission']; $Full=$_POST['Full']; $Kill=$_POST['Kill']; $Color=$_POST['Color']; $Doors=$_POST['Doors']; $Description_short=$_POST['Description_short']; $Description_long=$_POST['Description_long']; $Location=$_POST['Location']; $Status=$_POST['Status']; $Retail_price=$_POST['Retail_price']; $Nego_price=$_POST['Nego_price']; $Cost_price=$_POST['Cost_price']; $Body=$_POST['Body']; $Image_2=$_POST['Image_2']; $Image_3=$_POST['Image_3']; $Image_4=$_POST['Image_4']; $Image_main=$_POST['Image_main']; $date = date("Y-m-d"); $ID=$_POST['ID']; $query = "UPDATE cars SET Make ='$Make', Model ='$Model',Year ='$Year', Transmission ='$Transmission',Full='$Full' , Kill ='$Kill',Color ='$Color', Doors ='$Doors', Description_short='$Description_short',Description_long ='$Description_long', Location ='$Location', Status ='$Status', Retail_price ='$Retail_price', Nego_Price ='$Nego_price', Cost_price ='$Cost_price', Body ='$Body' WHERE ID = '$ID' "; $result = mysql_query($query);
  2. hey guys is there a way to make a tab (lets says in IE8)bigger? like the title of my page is autosoft admin panel but the tab only shows like autosoft ad..
  3. Hmm.good question i will check that out.maybe the iframe does not use the session..or see the session
  4. techker

    table grid

    Thats what i doing now found a tutorial on net tuts about zebra rows. very cool to,thx!
  5. techker

    table grid

    Hey guys im looking on the net and i find data grid view but asp..and not what i need what i need is that now i have a table with info that replicates depending on how many products i have in he database.. like an online catalogue. i just want the tables to show in a diffrent color.. like first product blue second product white...only like 2 colors..
  6. hey guys is there a way to fix getting an error 500 with unlink? simple script. $file = $_GET['File']; //chdir('/admin/uploads/big/'); $do = unlink($file); if($do=="1"){ echo "The file was deleted successfully."; } else { echo "There was an error trying to delete the file."; }
  7. Hey guys im using an iframe to view a part of my admin . now i have a script that apears in the iframe to upload an image. it works.but the script has when upload is done: echo "<meta http-equiv=Refresh content=1;url=insert.php?ID=$ID&Name=$rand_name.$file_ext>"; but it gives me this.. res://ieframe.dll/http_404.htm#http://mysite.ca/admin/insert.php?ID=26&Name=122097380.gif[code=php:0] the target of my links in my menu is the iframe test.. but whats odd is the my form works(the action)
  8. techker

    if submit

    i just posted the part that i neede to change.sorry. the connection and stuff is in a config file. even if i change to what you posted nothing happens now?
  9. techker

    if submit

    hey guys im trying to make this form i want it to insert in database on submit.. i got if($_POST["submit"] == "Insert"){ $img=$_POST['img']; mysql_query("UPDATE `_users` SET `logo` = '$img' WHERE `userid` = 2"); echo "<meta http-equiv=Refresh content=2;url=main.php>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form action="#" method="post" enctype="multipart/form-data" > <p> <label> <input name="img" type="file" id="img" size="15" /> </label> </p> <p> <label> <input type="submit" name="Insert" value="submit" width="5"/> </label> </p> </form> it does not work?
  10. it uploads the file and creats a thumbnail. it keeps the size of the original and uploads it to images/big and resizes it and uploads the resized image to images/thumbs Now.i want to make the Big images a diffrent size.
  11. Hey guys i have an uploader and resizer script that works a1.the only thing is i would like to resize the original image. see now it resizes for a thumbnail and uplloads it to the image/thumb and the original to image/big //load the config file include("config.php"); //if the for has submittedd if (isset($_POST['upForm'])){ $file_type = $_FILES['imgfile']['type']; $file_name = $_FILES['imgfile']['name']; $file_size = $_FILES['imgfile']['size']; $file_tmp = $_FILES['imgfile']['tmp_name']; $Box = $_POST['Box']; $ID = $_GET['ID']; //check if you have selected a file. if(!is_uploaded_file($file_tmp)){ echo "Error: Please select a file to upload!. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); //exit the script and don't do anything else. } //check file extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Wrong file extension. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); } //get the file extension. $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; //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); //print message // echo "<br>Image Thumb: <a href=\"$path_thumbs/$rand_name.$file_ext\">$path_thumbs/$rand_name.$file_ext</a>"; } //upload the big image move_uploaded_file ($file_tmp, "$path_big/$rand_name.$file_ext"); echo "<meta http-equiv=Refresh content=1;url=insert.php?ID=$ID&Name=$rand_name.$file_ext>"; } ///////////////////////////insert part added echo" </body> </html>"; ?> Is it possible?
  12. the thumbnailing does not work? and on this line $thumb_width = 10; there was a - infront of = is this normal?
  13. nice thx!! its all good but the thumbs dont work? <?php function resize($img, $thumb_width, $newfilename) { $max_width=$thumb_width; //Check if GD extension is loaded if (!extension_loaded('gd') && !extension_loaded('gd2')) { trigger_error("GD is not loaded", E_USER_WARNING); return false; } //Get Image size info list($width_orig, $height_orig, $image_type) = getimagesize($img); switch ($image_type) { case 1:$im = imagecreatefromgif($img);break; case 2: $im = imagecreatefromjpeg($img); break; case 3:$im = imagecreatefrompng($img); break; default: trigger_error('Unsupported filetype!', E_USER_WARNING); break; } /*** calculate the aspect ratio ***/ $aspect_ratio = (float) $height_orig / $width_orig; /*** calculate the thumbnail width based on the height ***/ $thumb_height = round($thumb_width * $aspect_ratio); while($thumb_height>$max_width) { $thumb_width-=10; $thumb_height = round($thumb_width * $aspect_ratio); } $newImg = imagecreatetruecolor($thumb_width, $thumb_height); /* Check if this image is PNG or GIF, then set if Transparent*/ if(($image_type == 1) OR ($image_type==3)) { imagealphablending($newImg, false); imagesavealpha($newImg,true); $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127); imagefilledrectangle($newImg, 0, 0, $thumb_width, $thumb_height, $transparent); } imagecopyresampled($newImg, $im, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig); //Generate the file, and rename it to $newfilename switch ($image_type) { case 1: imagegif($newImg,$newfilename); break; case 2: imagejpeg($newImg,$newfilename); break; case 3: imagepng($newImg,$newfilename); break; default: trigger_error('Failed resize image!', E_USER_WARNING); break; } return $newfilename; } //This stuff is outside of the function. It operates with our images if(isset($_POST[submit])){ $imgNumb=1; //This the "pointer" to images $DestinationDir="upimg/"; //Place the destination dir here $ThumbDir="upimg/thumbs"; //Place the thumb dir here do{ $Unique=microtime(); // We want unique names, right? $destination=$DestinationDir.md5($Unique).".jpg"; $thumb=$ThumbDir.md5($Unique).".jpg"; $IMG=getimagesize($_FILES["img$imgNumb"][tmp_name]); echo resize($_FILES["img$imgNumb"][tmp_name], $IMG[0], $destination); $imgNumb++; } while($_FILES["img$imgNumb"][name]); }?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form action="" method="post" enctype="multipart/form-data" > <input type="file" name="img1"/> <input type="file" name="img2"/> <input type="file" name="img3"/> <input type="submit" name="submit" value="Submit"/> </form> </body> </html>
  14. nice it uploads but it dows not resize?
  15. is this hard?or is it my post?lol
  16. Hey guys i have this image uploader and resize script..it currently only uploads one image..i would like to mod it to upload 3 images.. here is the original code and below it is what i think to change <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <title></title> <?php //load the config file include("config.php"); //if the for has submittedd if (isset($_POST['upForm'])){ $file_type = $_FILES['imgfile']['type']; $file_name = $_FILES['imgfile']['name']; $file_size = $_FILES['imgfile']['size']; $file_tmp = $_FILES['imgfile']['tmp_name']; $Box = $_POST['Box']; $CAR_ID = $_GET['ID']; //check if you have selected a file. if(!is_uploaded_file($file_tmp)){ echo "Error: Please select a file to upload!. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); //exit the script and don't do anything else. } //check file extension $ext = strrchr($file_name,'.'); $ext = strtolower($ext); if (($extlimit == "yes") && (!in_array($ext,$limitedext))) { echo "Wrong file extension. <br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; exit(); } //get the file extension. $getExt = explode ('.', $file_name); $file_ext = $getExt[count($getExt)-1]; //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); //print message echo "<br>Image Thumb: <a href=\"$path_thumbs/$rand_name.$file_ext\">$path_thumbs/$rand_name.$file_ext</a>"; } //upload the big image move_uploaded_file ($file_tmp, "$path_big/$rand_name.$file_ext"); echo "<br>Image Big: <a href=\"$path_big/$rand_name.$file_ext\">$path_big/$rand_name.$file_ext</a>"; echo "<br><br>--<a href=\"$_SERVER[php_SELF]\">back</a>"; } ///////////////////////////insert part added mysql_connect("localhost", "techker_techker", "techker") or die(mysql_error()) ; mysql_select_db("techker_iapps") or die(mysql_error()) ; $DateHeure= date("Y-m-d H:i:s"); $query = "INSERT INTO AddOnImages ( CAR_ID, Box , Name, date ) VALUES ( NULL,'$CAR_ID','$Box','$rand_name.$file_ext','$DateHeure')" ; mysql_query($query) or die('Error, add album failed : ' . mysql_error()); //$id= mysql_insert_id(); //echo "<p>This file has the following Database ID: <b>$id</b>"; echo "You'll be redirected to Home Page after (4) Seconds"; echo "<meta http-equiv=Refresh content=4;url=ViewPost.php?ID=>"; // echo" </body> </html>"; ?> SO for shure in the form i need to add 2 more image file fields.called the imagefile2,imagefile3.since the first one is called imagefile. them im almost shure i need to add this $file_type3 = $_FILES['imgfile2']['type']; $file_name2 = $_FILES['imgfile2']['name']; $file_size2 = $_FILES['imgfile2']['size']; $file_tmp2 = $_FILES['imgfile2']['tmp_name']; $file_type 3= $_FILES['imgfile3']['type']; $file_name 3= $_FILES['imgfile3']['name']; $file_size 3= $_FILES['imgfile3']['size']; $file_tmp3 = $_FILES['imgfile3']['tmp_name']; To get the other images. Afther: $ext = strrchr($file_name,'.'); to $ext = strrchr($file_name,$file_name2,$file_name3,'.'); and $getExt = explode ('.', $file_name); to $getExt = explode ('.', $file_name,$file_name2,$file_name3); Afther im lost...is this good up to know?
  17. all im trying to do is echo money format...
  18. hey guys im trying to echo a money format.. $query3 = "SELECT * FROM `tblCommande` WHERE NoCommande ='$order' " ; $result3 = mysql_query($query3) or die(mysql_error()); while ($row8 = mysql_fetch_array($result3)) { $array['assigned'] = $row8['SousTotal']); } print"$array"
  19. does it matter?cause it works?
  20. ok so i got this going $order=$_GET['order']; $date=$_GET['Date']; $query = "select * from tblCommande right join tblCommandeDetail on tblCommande.NoCommande = $order AND $date " ; $result = mysql_query($query) or die(mysql_error()); <? while($row = mysql_fetch_array($result)){ echo $row['UName']. " - ". $row['IDProduit']; echo "<br />"; }?> works good but not completly..i dont have all the information?
  21. Hey guys i have a litle question.. i have a catalogue database with a order-order details and products tables. now when an order is passt it goes true an xml flash page.. but i need to mode it so i want to drop the flash and only use php. so in the databse in the order table there is orderID and user info.then in orderDetails theres the orderID and a product id so what i did up to know is extract all orders so i get orderID name price.. but know i need details so i linked it to a OrderDetails page that gives me OrderId ProductId QTY.. so thats cool but know i need to get the product details from Product Table.. so Product id gives me a descrition of the products... ahhh is there a way to make it one?lol! or at least to see the order page but when you click more details or print you get the product descritption... thx guys!!
  22. i reuploaded the script and it works now..my vps is acting up!thx
  23. what does this meen? Notice: Undefined index: 2 in /home/open2sha/public_html/new/includes/core/core.session.php on line 0 Notice: Undefined index: 2 in /home/open2sha/public_html/new/includes/core/core.session.php on line 0 Notice: Undefined offset: 2 in /home/open2sha/public_html/new/includes/core/core.session.php on line 0 Warning: Invalid argument supplied for foreach() in /home/open2sha/public_html/new/includes/core/core.session.php on line 0 MySQL ERROR
  24. ah so its the query.not a syntax. it is seing the member since the name is there(techker) thx
  25. Hey guys i activated a addon for a cms and i get this? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/open2sha/public_html/new/prochatrooms/cms.php on line 18 Duplicate entry 'techker' for key 1 i checked in the database and it is only there one time?no duplicate?
×
×
  • 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.