Announcement

Collapse
No announcement yet.

Unconfigured Ad Widget

Collapse

Web Experts Help Need urgent.......

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Experts Help Need urgent.......

    Assalam-o-alaikum

    Bothers main nay aik dynamic website create ki hay. us main sub kuch theik ja reha hay. her article save ho reha hay laikun images save nehan ho rehay. Aur database file main picture ka link bhi save nehain ho reha shaid issi waja say picture na to save hoti hay aur na hi load hoti hay... (FILE IS ATTACHED UNDER)

    plz meri rehnmai karain.

    Thanks in advance for help

    Almuez



    FILE IS ATTACHED

    <?PHP
    error_reporting(0);
    //****************************************
    $thumbx="150"; //X dimension of thumbnail in px
    $thumby="150"; //Y dimension of thumbnail in px

    $mainimx="390";//X dimension of large image in px
    $mainimy="440";//Y dimension of large image in px

    $bigimx="500";//X dimension of big image in px
    $bigimy="500";//Y dimension of big image in px
    //****************************************

    function improcmain($img,$mainimx,$mainimy,$thumbx,$thumby, $prodid){
    global $bigimx,$bigimy;
    // mysql_query("insert into prodimgs (prodid) values ('$prodid')") or die(mysql_error());
    // $imgid=mysql_insert_id();
    $imgid=$prodid;
    $base_img_dir = "../../prodimages/";
    $base_thumb_dir = "../../prodimages/Thumbs/";
    $base_bigim_dir = "../../prodimages/bigim/";
    imageresize ($img,$mainimx,$mainimy,$imgid,$base_img_dir);
    imageresize ($img,$thumbx,$thumby,$imgid,$base_thumb_dir);
    imageresize ($img,$bigimx,$bigimy,$imgid,$base_bigim_dir);
    imagedestroy($img);
    return($imgid);
    }

    function imageresize($img, $maxwidth, $maxheight, $imgid,$base_img_dir){
    $width = imagesx($img);
    $height = imagesy($img);
    $scale = min($maxwidth/$width, $maxheight/$height);
    if ($scale < 1) {
    $new_width = floor($scale*$width);
    $new_height = floor($scale*$height);
    $tmp_img = imagecreatetruecolor($new_width, $new_height);
    imagecopyresampled($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
    $img = $tmp_img;
    }
    $filename=$base_img_dir.$imgid.".jpg";
    imagejpeg($img, $filename, 100);
    }

    function getuploads($prodid,$mainimx,$mainimy,$thumbx,$thum by){
    while (list($key,$val)=each($_FILES)){
    $file_name=str_replace("'","",stripslashes($_FILES[$key]['name']));
    if ($file_name){
    $tmp_name=$_FILES[$key]['tmp_name'];
    $imginfo= @getimagesize($tmp_name);
    switch ($imginfo[2]) {
    case 1: //gif
    $img=imagecreatefromgif($tmp_name);
    $imgid=improcmain($img,$mainimx,$mainimy,$thumbx,$ thumby,$file_name);
    break;
    case 2: //jpg
    $img=imagecreatefromjpeg($tmp_name);
    $imgid=improcmain($img,$mainimx,$mainimy,$thumbx,$ thumby,$file_name);
    break;
    case 3: //png
    $img=imagecreatefrompng($tmp_name);
    $imgid=improcmain($img,$mainimx,$mainimy,$thumbx,$ thumby,$file_name);
    break;
    default:
    break;
    }
    }
    }
    return($file_name);
    // print "All images successfully uploaded. You can now close this window.";
    }

    if ($_POST['id']!='' or $_GET['isupload']){
    function drawupload($optionid,$image){

    $base_img_dir = "prodimages/";
    $base_thumb_dir = "prodimages/Thumbs/";
    ?>
    <script language="javascript" type="text/javascript">
    function upload(){
    document.imageform.submit();
    document.getElementById('uploadbody').innerHTML='
    <img src=".. /../images/indicator.gif"><span valign=middle style="font:12px Verdana,Arial,Helvetica Sans-Serif;"> Please wait - uploading</span>';

    }
    </script>
    <form name="imageform" action="ajaxim.php" method="post" enctype="multipart/form-data"><div id="uploadbody">
    <input type=hidden id="id" name="id" value="<?php echo $optionid; ?>">
    <input type="file" name="image" onchange="upload();"/>
    </div><?php if ($image and $image!='.jpg') {
    echo "<img src=\"../../prodimages/Thumbs/$image\">";
    ?><input type=button value="Delete image" name="Delete" onclick="upload();">
    <?php
    }?></form>
    <script language="javascript" type="text/javascript">
    function updateimageform(){
    parent.document.getElementById('pLargeImage').valu e='<? if ($image=='.jpg') {echo "";} else echo $base_img_dir.$image;?>';
    parent.document.getElementById('pImage').value='<? if ($image=='.jpg') {echo "";} else echo $base_thumb_dir.$image;?>';}
    onLoad=updateimageform();
    </script>

    <?php
    }}
    if ($_POST['id']!=''){
    $id=$_POST['id'];
    $file_name=getuploads($id,$mainimx,$mainimy,$thumb x,$thumby);

    // include("../db_conn_open.php");
    // mysql_query("update products set optAJAXIM='$file_nameshort' where optID='$id'") or die(mysql_error());
    // $ogrpq=mysql_query("select optGroup from options where optID='$id'") or die(mysql_error());
    // $ogrp=mysql_result($ogrpq,0,0);
    // mysql_query("update prodoptions set poAJAXIM='1' where poOptionGroup='$ogrp'") or die(mysql_error());
    drawupload($id,$file_name.".jpg");
    }

    $isupload=$_GET['isupload'];
    if ($isupload) {
    $optionid=$_GET['productid'];
    if ($optionid!='' && $optionid!='undefined'){
    include("../db_conn_open.php");
    $imager=@mysql_query("select pImage from products where pID='$optionid'");
    $image=@mysql_result($imager,0,0);
    $imagestripped=split("/",$image);
    $last=count($imagestripped);
    $image=$imagestripped[($last-1)];
    drawupload($optionid,$image);
    }
    else { echo "<span style=\"color: red; font:12px Verdana,Arial,Helvetica Sans-Serif;font-weight:bold;\"><br><br><br><br><br><br>Please enter a Reference/Product ID in order to activate the image selector.</span>"; }
    }
    ?>

  • #2
    Re: Web Experts Help Need urgent.......

    وعلیکم السلام ورحمتہ اللہ
    محترم آپ اس تھریڈ میں رابطہ کریں
    http://www.pegham.com/showthread.php?t=78328
    اُمید ہے کہ آپ کا مسلہ حل ہوجائے گا
    :star1:

    Comment


    • #3
      Re: Web Experts Help Need urgent.......

      بھائی اگر سائٹ اپلوڈ ہے تو اس کا لنک دیں

      Comment


      • #4
        Re: Web Experts Help Need urgent.......

        password: changemewww.ctc-enterprises.com/vsadmin/login.php
        username: mystore
        password: changeme

        Comment


        • #5
          Re: Web Experts Help Need urgent.......

          http://www.ctc-enterprises.com/
          دیکھیں امیج تو اب سیو ہو رہا ہے
          امیج کا پاتھ ٹھیک نہیں دیا جا رہا

          Comment


          • #6
            Re: Web Experts Help Need urgent.......

            Meray bhai products feed karkay check karein۔ na to tasveer products images kay folder main save hoti hay aur na hi us us path database file mein yeh hi assal problem hay.

            Comment


            • #7
              Re: Web Experts Help Need urgent.......

              میں دیکھ کر بتاتا ہوں۔

              Comment


              • #8
                Re: Web Experts Help Need urgent.......

                ji Zaroor Bhai Bari Meharbani Ho gi............

                Comment


                • #9
                  Re: Web Experts Help Need urgent.......

                  تھم نیل بھی نہیں بن رہا آپ کا۔
                  اور مائی سیقل میں لگتا ہے کوئی پرابلم ہے۔ وہ دیکھنے پر بھی پتا چلے گی۔

                  Comment


                  • #10

                    Comment


                    • #11
                      Re: Web Experts Help Need urgent.......

                      بھائی جان بظاہر کوئی خامی نہیں کوڈ میں۔
                      اگر سی پینل دے تو شاہد میں چیک کر سکوں۔

                      Comment


                      • #12
                        Re: Web Experts Help Need urgent.......

                        ok brother cpanel information is under
                        UserName: ctcenter
                        PassWord: Qcr@tSlNG[TL

                        aur bhai jan mujhay yeh zaroor batana hay kay mujh say kya aur kehan par mistake hoye hay.

                        Comment


                        • #13
                          Re: Web Experts Help Need urgent.......

                          بھائی جان سب کچھ ٹھیک ہے۔۔۔
                          ڈیٹا بیس ٹھیک کام کر رہا ہے مجھے نہیں سمجھ آ رہی ۔ ایک دوسٹ سے مشورہ کیا ہے وہ بھی دیکھ رہا ہے

                          Comment


                          • #14
                            Re: Web Experts Help Need urgent.......

                            میرا خیال سے آپ نے ڈیٹا بیس کسی شاپنگ کارٹ کا استعمال کیا ہے اس لیے وہ مسئلہ کر رہا ے

                            Comment


                            • #15
                              Re: Web Experts Help Need urgent.......

                              Bhai main nay to databse khud banai hay agar app samjtay hain to databse amend karkay update kar dain takey problem solve ho sakay aur products save ho sakain.

                              Comment

                              Working...
                              X