Jump to content

budimir

Members
  • Posts

    522
  • Joined

  • Last visited

Posts posted by budimir

  1. Hey guys,

     

    I have an image upload script and it's working fine. But for some files it will not work. It says it can't get the filesize and it can't copy that file. I have tried to change the file format of that file, but with no result. So it's not the file format. Is there anything else that could confuse getfilesize and copy commands in PHP? Can you please tell me what is wrong?

     

    include ("include/session.php");
    
    //Pohranjivanje podataka za 1. sliku
    
    $naziv1 = mysql_real_escape_string($_POST["naziv1"],$veza);
    $opis1 = mysql_real_escape_string($_POST["opis1"],$veza);
    $album_id = mysql_real_escape_string($_POST["album_id"],$veza);
    $datum1 = date("Y-m-d H:i:s");
    
    
    //Upload slike i thumba
    //define a maxim size for the uploaded images 
    define ("MAX_SIZE","10000000000"); 
    
    // define the width and height for the thumbnail 
    // note that theese dimmensions are considered the maximum dimmension and are not fixed, 
    // because we have to keep the image ratio intact or it will be deformed 
    define ("WIDTH","200"); 
    define ("HEIGHT","150");   
    
    // this is the function that will create the thumbnail image from the uploaded image 
    // the resize will be done considering the width and height defined, but without deforming the image 
    
    function make_thumb($img_name,$filename,$new_w,$new_h) { 
    
    //get image extension. 
    $ext=getExtension($img_name); 
    //creates the new image using the appropriate function from gd library 
    
    if(!strcmp("jpg",$ext) || !strcmp("jpeg",$ext)) $src_img=imagecreatefromjpeg($img_name);   
    if(!strcmp("png",$ext)) $src_img=imagecreatefrompng($img_name);  
    if(!strcmp("gif",$ext)) $src_img=imagecreatefromgif($img_name);
    
    //gets the dimmensions of the image 
    
    $old_x=imageSX($src_img); $old_y=imageSY($src_img);   
    
    // next we will calculate the new dimmensions for the thumbnail image 
    // the next steps will be taken: 
    // 1. calculate the ratio by dividing the old dimmensions with the new ones 
    // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable 
    // and the height will be calculated so the image ratio will not change 
    // 3. otherwise we will use the height ratio for the image 
    // as a result, only one of the dimmensions will be from the fixed ones 
    
    $ratio1=$old_x/$new_w; $ratio2=$old_y/$new_h;
    
    if($ratio1>$ratio2) { $thumb_w=$new_w; $thumb_h=$old_y/$ratio1; } else { $thumb_h=$new_h; $thumb_w=$old_x/$ratio2; }   
    
    // we create a new image with the new dimmensions 
    
    $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);   
    
    // resize the big image to the new created one 
    
    imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);   
    
    // output the created image to the file. Now we will have the thumbnail into the file named by $filename
    
    if(!strcmp("png",$ext)) imagepng($dst_img,$filename); else imagejpeg($dst_img,$filename);   
    
    //destroys source and destination images. 
    imagedestroy($dst_img); imagedestroy($src_img); }   
    
    // This function reads the extension of the file. 
    // It is used to determine if the file is an image by checking the extension. 
    
    function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; }   
    
    // This variable is used as a flag. The value is initialized with 0 (meaning no error found) 
    //and it will be changed to 1 if an errro occures. If the error occures the file will not be uploaded. 
    
    $errors=0; 
    
    // checks if the form has been submitted 
    
    if(isset($_POST['spremi'])) { 
    
    //reads the name of the file the user submitted for uploading 
    
    $image=$_FILES['slika1']['name']; 
    
    // if it is not empty 
    
    if ($image) { 
    
    // get the original name of the file from the clients machine 
    
    $filename = stripslashes($_FILES['slika1']['name']); 
    
    // get the extension of the file in a lower case format 
    
    $extension = getExtension($filename); $extension = strtolower($extension); 
    
    
    // if it is not a known extension, we will suppose it is an error, print an error message 
    //and will not upload the file, otherwise we continue 
    
    if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { echo '<h1>Unknown extension!</h1>'; $errors=1; } else { 
    
    // get the size of the image in bytes 
    // $_FILES[\'image\'][\'tmp_name\'] is the temporary filename of the file in which the uploaded file was stored on the server 
    
    $size=getimagesize($_FILES['slika1']['tmp_name']); 
    $sizekb=filesize($_FILES['slika1']['tmp_name']);   
    
    
    //compare the size with the maxim size we defined and print error if bigger 
    
    if ($sizekb > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; }   
    
    //we will give an unique name, for example the time in unix time format 
    
    $image_name1=mt_rand(0,9999999).'.'.$extension; 
    
    //the new name will be containing the full path where will be stored (images folder) 
    
    $newname="slike_natjecanja/".$image_name1; 
    $copied = copy($_FILES['slika1']['tmp_name'], $newname); 
    
    //we verify if the image has been uploaded, and print error instead 
    
    if (!$copied) { echo '<h1>Copy unsuccessfull!</h1>'; $errors=1; } else { 
    
    // the new thumbnail image will be placed in images/thumbs/ folder 
    
    $thumb_name='slike_natjecanja/thumbs/thumb_'.$image_name1; 
    $thumb_name1 = 'thumb_'.$image_name1;
    
    // call the function that will create the thumbnail. The function will get as parameters 
    //the image name, the thumbnail name and the width and height desired for the thumbnail 
    
    $thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT); }} }} 
    
    //If no errors registred, print the success message and show the thumbnail image created 
    if(isset($_POST['Submit']) && !$errors) { echo "<h1>Thumbnail created Successfully!</h1>"; echo '<img src="'.$thumb_name.'">'; }
    
    
    if (empty($_FILES['slika1']['name'])) {
        
        echo "Prazno je!";
        die;
        
        } else {
                 
        //Ubacivanje u bazu
        $upit = "INSERT INTO natjecanja_slike_sve (album_id, naziv_slike, opis_slike, datum_dodavanja_slike, slika_nat_mala, slika_nat_velika) VALUES ('$album_id', '$naziv1', '$opis1', '$datum1', '$thumb_name1', '$image_name1')";
        echo "$upit";
        die;
        $rezultat = mysql_query($upit) or die (mysql_error());
        
    }

  2. Thanks litebearer,

     

    You're code worked like a charm, atlhough I would like to know what I messed up with my code. I'm realy curious!!!!

     

    I had to correct one mistake in you're code, but it worked perfectly.

     

    Thanks for you're effort. Thanks. Thanks. Thanks. You made my day. I spent whole day trying to figure out what's wrong with my code, because the same one is working on antoher page I have, so that's why I don't understand!!! If you could clarify that for me I would appreciate I lot. I need to understand.

     

    :D

  3. :( Not working correctly.

     

    Now I have a situation that images are display horizontally, but for indefinite. What ever I do, it will not go to new row after 4 images.

     

    Please help. This is the code.

     

            <table width="100%" border="1" cellspacing="4" cellpadding="4" align="center">
                <tr>
            <?php
            $slika_velika = "slike_medalja/";
            $slika_mala = "slike_medalja/thumbs/";
            $upit = "SELECT * FROM medalje_slike ORDER BY datum_dodavanja ASC";
            $rezultat = mysql_query($upit,$veza) or die (mysql_error());
                    while($row = mysql_fetch_array($rezultat)){
                            $slika_v = $row["slika_velika"];
                            $slika_m = $row["slika_mala"];
                            $mjesto = $row["mjesto_osvajanja"];
                            $naziv = $row["naziv_natjecanja"];
                            $vrsta = $row["vrsta_medalje"];
                            
                            if ($vrsta == 1) { $medalja = "Zlato"; } elseif ($vrsta == 2) { $medalja = "Srebro";} elseif ($vrsta == 3) { $medalja = "Bronca"; }
    
            $i = 0;
            if($i % 4 == 0){
                            
                            echo '
                            <td width="25%" align="center" valign="top">
                            <a href= "'.$slika_velika.''.$slika_v.'" rel="lytebox" title="'.$naziv.' - '.$mjesto.' - '.$medalja.'" target="_blank"><img src="'.$slika_mala.''.$slika_m.'" border="0"></a><br />
                            '.$naziv.' - '.$mjesto.' <strong>'.$medalja.'</strong>
                            </td>';
                            }
                            
                            #echo '</tr><tr>';
                            $i++;    
    
                        }
              ?>
                      </tr>
                  </table>

  4. Hey guys,

     

    Thanks for you're effort, but I made it. I tried to play with code and this is what it acctualy made it work.

     

            <table width="100%" border="1" cellspacing="4" cellpadding="4" align="center">
                <tr>
            <?php
            $slika_velika = "slike_medalja/";
            $slika_mala = "slike_medalja/thumbs/";
            $upit = "SELECT * FROM medalje_slike ORDER BY datum_dodavanja ASC";
            $rezultat = mysql_query($upit,$veza) or die (mysql_error());
                    while($row = mysql_fetch_array($rezultat)){
                            $slika_v = $row["slika_velika"];
                            $slika_m = $row["slika_mala"];
                            $mjesto = $row["mjesto_osvajanja"];
                            $naziv = $row["naziv_natjecanja"];
                            $vrsta = $row["vrsta_medalje"];
                            
                            if ($vrsta == 1) { $medalja = "Zlato"; } elseif ($vrsta == 2) { $medalja = "Srebro";} elseif ($vrsta == 3) { $medalja = "Bronca"; }
    
            $i = 0;
            if($i % 4 == 0){
                            
                            echo '
                            <td width="25%" align="center" valign="top">
                            <a href= "'.$slika_velika.''.$slika_v.'" rel="lytebox" title="'.$naziv.' - '.$mjesto.' - '.$medalja.'" target="_blank"><img src="'.$slika_mala.''.$slika_m.'" border="0"></a><br />
                            '.$naziv.' - '.$mjesto.' <strong>'.$medalja.'</strong>
                            </td>';
                            }
                            $i++;
    
                            #echo '</tr><tr></tr><tr>';
                                
    
                        }
              ?>
                  </table>

     

    I hope someone will make a use of this.

     

    Again, thanks!!!

  5. Hey revraz,

     

    I did it like this, now, but still not working

     

            <?php
            $slika_velika = "slike_medalja/";
            $slika_mala = "slike_medalja/thumbs/";
            $upit = "SELECT * FROM medalje_slike ORDER BY datum_dodavanja ASC";
            $rezultat = mysql_query($upit,$veza) or die ("Nije uspilo");
                    while($row = mysql_fetch_array($rezultat)){
                            $slika_v = $row["slika_velika"];
                            $slika_m = $row["slika_mala"];
                            $mjesto = $row["mjesto_osvajanja"];
                            $naziv = $row["naziv_natjecanja"];
                            $vrsta = $row["vrsta_medalje"];
                            
                            if ($vrsta == 1) { $medalja = "Zlato"; } elseif ($vrsta == 2) { $medalja = "Srebro";} elseif ($vrsta == 3) { $medalja = "Bronca"; }
    
    $i = 0;
    if($i % 4 == 0){
                            echo '<tr>
                            <td width="25%" align="center" valign="top">
                            <a href= "'.$slika_velika.''.$slika_v.'" rel="lytebox" title="'.$naziv.' - '.$mjesto.' - '.$medalja.'" target="_blank"><img src="'.$slika_mala.''.$slika_m.'" border="0"></a><br>
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$naziv.' - '.$mjesto.'
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$medalja.'
                            </td><br />
                            ';
                            echo '</tr>';
                                }
                            $i++;
                        }
            ?>

     

    I would like to display the images horizontaly in columns, but I'm getting them verticly in rows??? What am I doing wrong?

  6. This is the complete code I'm using

     

            <?php
            $slika_velika = "slike_medalja/";
            $slika_mala = "slike_medalja/thumbs/";
            $upit = "SELECT * FROM medalje_slike ORDER BY datum_dodavanja ASC";
            $rezultat = mysql_query($upit,$veza) or die ("Nije uspilo");
                    while($row = mysql_fetch_array($rezultat)){
                            $slika_v = $row["slika_velika"];
                            $slika_m = $row["slika_mala"];
                            $mjesto = $row["mjesto_osvajanja"];
                            $naziv = $row["naziv_natjecanja"];
                            $vrsta = $row["vrsta_medalje"];
                            
                            if ($vrsta == 1) { $medalja = "Zlato"; } elseif ($vrsta == 2) { $medalja = "Srebro";} elseif ($vrsta == 3) { $medalja = "Bronca"; }
    
    $i = 0;
    if($i % 4 == 0){
                            echo '
                            <td width="25%" align="center" valign="top">
                            <a href= "'.$slika_velika.''.$slika_v.'" rel="lytebox" title="'.$naziv.' - '.$mjesto.' - '.$medalja.'" target="_blank"><img src="'.$slika_mala.''.$slika_m.'" border="0"></a><br>
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$naziv.' - '.$mjesto.'
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$medalja.'
                            </td><br />
                            ';
                            echo '</tr><tr>';
                                }
                            $i++;
                        }
            ?>

  7. Hey guys,

     

    I wrote a code for displaying images in columns, but for some reason it's not working. Can you take a look and tell me what I'm doing wrong?

     

    $i = 0;
    if($i % 4 == 0){
                            echo '
                            <td width="25%" align="center" valign="top">
                            <a href= "'.$slika_velika.''.$slika_v.'" rel="lytebox" title="'.$naziv.' - '.$mjesto.' - '.$medalja.'" target="_blank"><img src="'.$slika_mala.''.$slika_m.'"width="200" height="150" border="0"></a><br>
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$naziv.' - '.$mjesto.'
                            </td>
                            <td width="25%" align="center" valign="top">
                            '.$medalja.'
                            </td><br />
                            ';
                            echo '</tr><tr>';
                                }
                            $i++;
                        }

     

    The output I'm getting now is one image below another. I would like to display them one next to another.

     

    Please help!!!

     

  8. Hey guys,

     

    I have stored a google map link into a database. When I try to display it from database using the command below

    <?php echo $google_map; ?>

     

    I get this output, but I can't display a map.

     

         
    
    <iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=hr&geocode=&q=smi%C4%8Diklasova+3,+karlovac,+croatia&sll=37.0625,-95.677068&sspn=50.910968,135.263672&ie=UTF8&hq=&hnear=Tadije+Smi%C4%8Diklasa,+Karlovac,+Republika+Hrvatska&t=h&ll=45.487155,15.55089&spn=0.028883,0.054932&z=14&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=hr&geocode=&q=smi%C4%8Diklasova+3,+karlovac,+croatia&sll=37.0625,-95.677068&sspn=50.910968,135.263672&ie=UTF8&hq=&hnear=Tadije+Smi%C4%8Diklasa,+Karlovac,+Republika+Hrvatska&t=h&ll=45.487155,15.55089&spn=0.028883,0.054932&z=14&iwloc=A" style="color:#0000FF;text-align:left">Prikaz veće karte</a></small>

     

    Can you tell me why?? When  try to copy that directly to HTML it works perfectly!!! I'm confused!

  9. Hey guys,

     

    I'm trying to run two javascripts on same page. One javascript is for the dropdown menu and second one is for the image gallery. I can't get them both to work in the same time. Only one of them is working. Either a dropdown menu or image gallery. Is it possible to have both javascripts on the same page???

     

    Dropdown Navigation Menu code is:

    <script type="text/javascript" src="js/mootools-for-dropdown.js"> </script>
        <script type="text/javascript" src="js/UvumiDropdown-compressed.js"> </script>
        <link rel="stylesheet" type="text/css" media="screen" href="css/uvumi-dropdown.css" />

     

    Image gallery code is:

        <script type="text/javascript" src="/high/highslide/highslide.js"></script>
    <link rel="stylesheet" type="text/css" href="/high/highslide/highslide.css" />

     

    I'm not so good with javascript. I'm just following the instructions from the website.

     

    Thanks in advance!!!

  10. OK, so,

     

    When I click view source, this is what I get, but when I try to click on it, nothing happens.

     

    <p align="center">
            <a href="korisnici.php"><img src="images/korisnici.gif" width="118" height="13" alt="korisnici"></a><a href='clanovi.php'><img src='images/clanovi.gif' width='118' height='13' alt='clanovi'></a><a href='upload.php'><img src='images/upload.gif' width='118' height='13' alt='upload'></a><a href='vijesti.php'><img src='images/vijest.gif' width='118' height='13' alt='vijest'></a><a href='natjecanja.php'><img src='images/natje.gif' width='118' height='13' alt='natjecanja'></a><a href='newsletter.php'><img src='images/newsletter.gif' width='118' height='13' alt='newsletter'></a>           </p>

     

    Any ideas?

  11. Because I'm using a href link inside PHP tags and they are not working in some browsers! When I'm using a href as plain HTML everything is OK. That's why I'm showing the PHP peace of code. That peace of code is failing for some reason. I can see the pictures, but there is no link when you try to click on them...

  12. Hi thorpe,

     

    Ihave went through it once again, but I don't understand. The compelt code is below...

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <?php include("include/session.php");?>
    <title>Werdum Combat Team Karlovac</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="style.css" />
    
    <script type="text/javascript" src="js/mootools-for-dropdown.js"> </script>
    <script type="text/javascript" src="js/UvumiDropdown-compressed.js"> </script>
    <link rel="stylesheet" type="text/css" media="screen" href="css/uvumi-dropdown.css" />
    <style type="text/css">
    	body1,html1{
    		background-color:#333;
    		margin:0;
    		padding:0;
    		font-family: "Times New Roman", Times, serif;
    	}
    
    	#main{
    		margin:0% auto;
    		width:824px;
    		height:500px;
    		position:relative;
    		overflow:auto;
    		color:#aaa;
    		padding:20px;
    		border:0px solid #888;
    	}
    </style>
    
    <script type="text/javascript">
    	var menu = new UvumiDropdown('dropdown-demo');
    </script>
    
    </head>
    
    <body>
    <div id="top">
    	<div id="main">
    		<ul id="dropdown-demo" class="dropdown">
    			<li><a href="index.html">Home</a></li>
    			<li><a >BJJ</a>
                        <ul>
                        	<li><a href="bjj.html">O BJJ</a></li>
                            <li><a href="oklubu.html">O Klubu</a></li>
                            <li><a href="treninzi.html">Treninzi</a></li>
                            <li><a href="kimono.html">Kimono</a></li>
                            <li><a href="pravila.html">Pravila</a></li>
                            <li><a href="natjecanja.html">Natjecanja</a></li>
                        </ul>
                  </li>
    			<li><a href="index2.html">Galerija</a></li>
    			<li><a href="index2.html">Vijesti</a></li>
    			<li><a href="index2.html">Forum</a></li>
    			<li><a href="index2.html">Kontakt</a></li>
    			<li><a href="index2.html">Ostalo</a></li>
    		</ul>																																																																																															
      </div>
    </div>
    <div id="header" class="home">
        </div>
    
    <div id="wrapper" class="style1">
    	<div id="content">
            <table border="1" width="100%">
            <td>
            <p><?php echo "Dobrodošao $ime $prezime, <br /> Ovdje se nalaze informacije samo za članove WTC Karlovac. Sve informacije vezane za tebe, kao korisnika ove stranice su vidljive samo tebi i administratoru ove stranice. Sve osobne informacije neće biti vidljive ostalim članovima ili posjetiteljima ove stranice. Ukoliko imate pitanja ili želite da se neke informacije ne prikazuju, slobodno obavijestite administratora."; ?></p>
            </td>
            </table>
            <p> </p>
            <p align="center">
    	<?php 
    		if ($a_korisnici == 1) { echo '<a href="korisnici.php"><img src="images/korisnici.gif" width="118" height="13" alt="korisnici"></a>'; } else { echo "";}
    		if ($a_clanovi == 1) { echo "<a href='clanovi.php'><img src='images/clanovi.gif' width='118' height='13' alt='clanovi'></a>"; } else { echo ""; } 
    		if ($a_slike == 1) { echo "<a href='upload.php'><img src='images/upload.gif' width='118' height='13' alt='upload'></a>"; } else { echo ""; } 
    		if ($a_vijesti == 1) { echo "<a href='vijesti.php'><img src='images/vijest.gif' width='118' height='13' alt='vijest'></a>"; } else { echo ""; } 
    		if ($a_natjecanja == 1) { echo "<a href='natjecanja.php'><img src='images/natje.gif' width='118' height='13' alt='natjecanja'></a>"; } else { echo ""; } 
    		if ($a_newsletter == 1) { echo "<a href='newsletter.php'><img src='images/newsletter.gif' width='118' height='13' alt='newsletter'></a>"; } else { echo ""; } ?>
               </p>
            <p align="center"> </p>
    		<div id="left">
    			<a href="b.php"><img src="images/big_pic.jpg" alt="" width="442" height="200" /></a><br />
    <div>
    				<img src="images/title3.gif" alt="" width="81" height="16" /><br />
    				<p>Lorem ipsum dolor sit amet, sectetu adip scing varius interdum incid unt quis, libero. Aenean mturpis. Maecenas hendrerit masa laoreet iaculipede mnisl ulamcorper.Tellus er sodales enim, in tincidunt mauris in odio. Massa ac laoreet iaculipede nisl ullamcorper- massa, ac consectetuer feipsum eget pede.  Proin nunc. </p>
    				<a href="#" class="more">more info</a>
    			</div>
    			<div>
    				<img src="images/title4.gif" alt="" width="102" height="16" /><br />
    				<p>Lorem ipsum dolor sit amet, sectetu adip scing varius interdum incid unt quis, libero. Aenean mturpis. Maecenas hendrerit masa laoreet iaculipede mnisl ulamcorper.Donec massa. Nulla pulvinar, nisl ac convallis nonummy, tellus eros sodales enim, in tincidunt mauris in omassa ac laoreet iaculipede nisl ullamcorpermassa,consectetuer.</p>
    				<a href="#" class="more">more info</a>		  
    			</div>
    		</div>
    		<div>
    
    		    <p> </p>
    
    		  <p> </p>
    		  <p><img src="images/title5.gif" alt="" width="368" height="37" /><br />
    </p>
    			<div class="block">
    				<img src="images/pic7.jpg" alt="" width="150" height="100" />
    				<span>17 december</span><br />
    				<p>Lorem ipsum dolor sit amet, sectetu adip scing varius interdum incid unt quis, libero. Aenean mturpis. Maecenas hendrerit masa laoreet iaculipede mnisl ulamcorper. 
    				<a href="#" class="more">more info</a></p>
    		  </div>
    			<div class="block">
    				<img src="images/pic8.jpg" alt="" width="150" height="100" />
    				<span>17 december</span><br />
    				<p>Lorem ipsum dolor sit amet, sectetu adip scing varius interdum incid unt quis, libero. Aenean mturpis. Maecenas hendrerit masa laoreet iaculipede mnisl ulamcorper.Tellus er sodales enim, in tincidunt mauris in odio. Massa ac laoreet iaculipede nisl ullamcorpermassa, ac consectetuer feipsum eget pede.  Proin nunc. Donec massa. Nulla pulvinar, nisl ac convallis nonummy, tellus eros sodales enim, in tincidunt mauris in odio.  
    				<a href="#" class="more">more info</a></p>
    			</div>
    	  </div>
    	</div>
    </div>
    <div id="footer">
        <p> </p>
          <form name="form1" method="post" action="">
    	<table width="863" border="0">
    	  <tr>
    	    <td colspan="8"><div align="center">Ulaz za &#269;lanove Werdum Combat Team Karlovac</div></td>
          </tr>
    	  <tr>
    	    <td width="273"><div align="right">Korisni&#269;ko ime</div></td>
    	    <td width="144"><input type="text" name="ki" id="ki" tabindex="1"></td>
    	    <td width="22"> </td>
    	    <td width="33"><div align="right">Lozinka</div></td>
    	    <td width="144"><input type="password" name="lo" id="lo" tabindex="2"></td>
    	    <td width="45"><div align="right">
    	      <input type="submit" name="ulaz" id="ulaz" value="Ulaz" tabindex="3">
            </div></td>
    	    <td width="83"> </td>
    	    <td width="85"> </td>
          </tr>
         </table>
          </form>
    	<p> </p>
    	<p>Werdum Combat Team Karlovac |  Dizajn by B&D | Webmaster: bjjkarlovac@gmail.com</p>
            <p> </p>
    </div>
    </body>
    </html>
    

  13. Guys,

     

    i don't understand why this code is working under IE8, but not under Firefox 3.1 or Chrome 8. Can you please help? I don't see what's wrong.

     

    <?php 
                if ($a_korisnici == 1) { echo '<a href="korisnici.php"><img src="images/korisnici.gif" width="118" height="13" alt="korisnici"></a>'; } else { echo "";}
                if ($a_clanovi == 1) { echo "<a href='clanovi.php'><img src='images/clanovi.gif' width='118' height='13' alt='clanovi'></a>"; } else { echo ""; } 
                if ($a_slike == 1) { echo "<a href='upload.php'><img src='images/upload.gif' width='118' height='13' alt='upload'></a>"; } else { echo ""; } 
                if ($a_vijesti == 1) { echo "<a href='vijesti.php'><img src='images/vijest.gif' width='118' height='13' alt='vijest'></a>"; } else { echo ""; } 
                if ($a_natjecanja == 1) { echo "<a href='natjecanja.php'><img src='images/natje.gif' width='118' height='13' alt='natjecanja'></a>"; } else { echo ""; } 
                if ($a_newsletter == 1) { echo "<a href='newsletter.php'><img src='images/newsletter.gif' width='118' height='13' alt='newsletter'></a>"; } else { echo ""; } ?>

  14. Hi guys,

     

    I'm using phpMailer to send emails. The way of sending pictures with it is that I put a picture somewhere on the net and then just send the link in email. So when someone opens the email it connects to that adress and it shows the picture.

     

    My problem is, I need to embed the picture within the email and I don't know how. Can you help me? How can I embed a picture and send it together with email?

     

    Thanks a lot!

  15. OK, so here is the code I'm using:

     

    <?php
    include ("../admin/servis/include/session.php");
    
    $baza = "servis";
    $tablica = "kalkulacija";
    
    $upit = "SELECT kataloski_broj, VPC, MPC FROM kalkulacija";
    $rezultat = mysql_query($upit,$veza) or die (mysql_error());
    
    $out = '';
    
    //Dohvačanje naziva svih kolona
    $fields = mysql_list_fields($baza,$tablica);
    
    //Brojanje polja tablice i ubacivanje u $columns
    $columns = mysql_num_fields($fields);
    
    //Stavljanje imena svih polja u $out
    for($i = 0; $i < $columns; $i++) {
    
    $l = mysql_field_name($fields,$i);
    
    $out .= "".$l."\t";
    }
    
    $out .= "\n";
    
    //Dodavanje svih vrijednosti iz tablice u $out
    while($l = mysql_fetch_array($rezultat)) {
    
    //for($i = 0; $i < $columns; $i++) {
    //$out .= '"'.$l["$i"].'"\t';
    //}
    $out .= $row[0] . "\t" . $row[1] . "\t" . $row[2] . "\t";
    
    $out .= "\n";
    
    }
    
    //Otvori file export.csv
    $f = fopen('export.csv','w');
    
    //Stavljanje svih vrijednosti u CSV
    fputs($f,$out);
    fclose($f);
    
    header('Content-type:application/csv');
    header('Content-Disposition:attachment; filename="export.csv"');
    readfile('export.csv');
    
    mysql_close($veza);
    
    //header("Location:kalkulacija.php");
    exit;
    ?>

     

    But the result is put in one column. I want to separate every column for itself.

  16. Something like that, but I'd like to export it to Excel CSV file format.

     

    Every column from MySQL should be in separate column in CSV.

     

    This is the example:

     

    MySQL columns: Part Number      Description      Location

    to                          |                    |                    |

                                ˅                    ˅                  ˅

    Excel columns:  Column A          Column B        Column C

     

    Right now, the code from above is putting everything to Column A.

  17. This is the result:

     

    "kalkulacija_id kataloski_broj VPC MPC datum_kalkulacije naziv klasifikacija marza banka spedicija carina tecaj prosjecni_rabat max_rabat nabavana "

     

    But, everything is generated in column A. I would like it to be :

     

    kalkulacija_id - Column A

    kataloski_broj - Column B

    VPC - Column C

    ...

  18. Hey guys,

     

    How can I put 5 columns form MySQL to 5 columns in CSV? Not comma separated, but each every column for itself.

     

    like this:

     

    Column 1    Column 2    Column 3    Column 4    Column 5

    Data 1      Data 2        Data 3      Data 4      Data 5

×
×
  • 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.