Jump to content

landavia

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Posts posted by landavia

  1. <?php
    
    $folders = array ( 'images' );
    
    if ( ! empty ( $_GET['s'] ) && in_array ( $_GET['s'], $folders ) )
    {
    $folder = glob ( './' . $_GET['s'] . '/*' );
    
    header ( 'Content-Type: application/xml' );
    echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
    echo '	<filedata>';
    echo '		<filecontents>';
    echo implode ( "\r\n", $folder );
    echo '		</filecontents>';
    echo '	</filedata>';
    }
    else
    {
    echo 1;
    }
    
    ?>

    your wish is my command

    sry.. copy-paste

  2. $sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled = 'Y'") or die ('Error: '.mysql_error ());

    u have problem in here

    you should type

    $sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled like '%Y%'") or die ('Error: '.mysql_error ());
    

     

  3. Landavia, i did not got your point.

    <?php
            if(isset($_POST['submit'])){
              if (isset ($_FILES['new_image'])){
                  $imagename = $_FILES['new_image']['name'];
                  $source = $_FILES['new_image']['tmp_name'];
                  $target = "images/".$imagename;
                  move_uploaded_file($source, $target);
                  
                  $imagepath = $imagename;
                  $save = "images/" . $imagepath; //This is the new file you saving
                  $file = "images/" . $imagepath; //This is the original file
    
                  list($width, $height) = getimagesize($file) ; 
                                                             
                  $modwidth = 1024; 
                                                             
                  $diff = $width / $modwidth;
                                                            
                  $modheight = $height / $diff; 
                  $tn = imagecreatetruecolor($modwidth, $modheight) ; 
                  $image = imagecreatefromjpeg($file) ; 
                  imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; 
                                                            
                  imagejpeg($tn, $save, 100) ; 
    
                  $save = "images/sml_" . $imagepath; //This is the new file you saving
                  $file = "images/" . $imagepath; //This is the original file
    
                  list($width, $height) = getimagesize($file) ; 
                                                             
                  $modwidth = 800; 
                                                             
                  $diff = $width / $modwidth;
                                                            
                  $modheight = $height / $diff; 
                  $tn = imagecreatetruecolor($modwidth, $modheight) ; 
                  $image = imagecreatefromjpeg($file) ; 
                  imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; 
                                                            
                  imagejpeg($tn, $save, 100) ; 
    
    
    
    
    
                
            
              }
            }
    ?><form action="<?php echo $_server['php-self'];  ?>" method="post" enctype="multipart/form-data" id="something" class="uniForm">
            <input name="new_image" id="new_image" size="30" type="file" class="fileUpload" />
            <button name="submit" type="submit" class="submitButton">Upload/Resize Image</button>
    </form>
    <?php
    if(isset($_POST['submit'])){
    echo "Large image: <img src='images/".$imagepath."'><br>"; 
                echo "Thumbnail: <img src='images/sml_".$imagepath."'>"; 
    }
    ?>
    

    about the script

    u combine all form and resize script on 1 file.. well that's nice

    but good..

     

    btw.. u ask

    >>What additional code in need to put in it.

    u already built it.. u just change the value into 640 like below

     

    list($width, $height) = getimagesize($file) ; 
                                                             
                  $modwidth = 640; 
                                                             
                  $diff = $width / $modwidth;
                                                            
                  $modheight = $height / $diff; 
                  $tn = imagecreatetruecolor($modwidth, $modheight) ; 
                  $image = imagecreatefromjpeg($file) ; 
                  imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; 
                                                            
                  imagejpeg($tn, $save, 100) ; 

  4.   each send button isn't assigned to their respective vehicle name.  In other words, when I click send, the same vehicle name is filled in for the name field on the form (the last vehicle name in the table).
    i don't take the word same vehicle name

     

    1. plz add ENTER to your topic..

     

    2. instead using button.. try link

    while($row=mysql_fetch_assoc($sql_res)){
       //echo all the names.
       echo "<a href=add_repair.php?name=$row["a_id"]>$row["a_name"]</a>";
       //echo the send buttons
        
      }

     

    btw.. i kinda confuse.. can you zip your php work and database (export it)? so we can analyze

  5. <?php
    if ($route==London To Moscow)
      {
    
    //RUN A QUERY TO FIND DETAILS OF A PARTICULAR JOURNEY
    $query = "
    SELECT  journey.journey_id
    FROM    shuttle, journey
    WHERE    shuttle.id = journey.shuttle_id
    and    shuttle.depart_dttm = '$depart_dttm'
    and   journey.route_id = 1
    ";
    
    mysql_query($query);
    
    //GET THE JOURNEY ID
    $journey_id = mysql_insert_id(); //$row[journey_id ]
    
    /*
    PUT THE JOURNEY ID INTO THE PASSNGER TABLE TO SHOW 
    THEY WILL BE ON THIS PART OF THE JOURNEY 
    INSERT INTO passengers ($name, $journey_id)
    */
    
    /*RUN A QUERY TO FIND DETAILS OF THE NEXT 
    JOURNEY THAT MAKES UP THE COMPLETE TRIP*/
    $query = "
    SELECT  journey.journey_id
    FROM    shuttle, journey
    WHERE    shuttle.id = journey.shuttle_id
    and    shuttle.depart_dttm = '$depart_dttm'
    and   journey.route_id = 2
    ";
    mysql_query($query);
    $journey_id = mysql_insert_id(); 
    INSERT INTO passengers ($name, $journey_id)
       
    }
    
    ?>

    like that?

    but this is not finish yet..

    u must have control 4 above query.

    if the 1st query FAIL is fine.. the data will not insert

    if the 2nd query FAIL.. u must FAIL the 1st too

  6. oot ..

    catch(e)
       {
          //Internet Explorer
          try
          {
             xmlHttp = new ActiveXObject("Msxml2.HMLHTTP");
          }
          catch(e)
          {
             xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
       }

    are this js work?

    >>xmlHttp = new ActiveXObject("Msxml2.HMLHTTP");

    ????

  7. <?php
    $Site = file_get_contents('http://forum.tibia.com/forum/?subtopic=worldboards');
    $boardArray[0] = "";
    $splitA = explode('</a><br><font class="ff_info">This board is for general discussions related to', $Site);
    for ($i = 1; $i <= 74; $i++) {     
         $splitB=explode('<td bgcolor="#D4C0A1" class="ff_std">',$splitA[$i]);
         $forum=strip_tags($splitB[1]);
        echo "<br/>$forum \n";
    }
    ?>

    try this

     

  8. is like you need to use <div> but i don't get it either..

    well.. hope someone able to solve your problem

     

    fyi: i notice pic no 1 are shown image (blank) size about 100? and put before title

    and pic no 2.. don't have image?

     

    is this a image position problem?

  9. allright.. that's my fault

     

    foreach($_POST['POLL'] As $PollItem=>$PollValue){
       mysql_query('UPDATE `secrett1_artgallery`.`beloved_sonic_charac`
          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` =\'$PollValue\' LIMIT 1');
    }

    lets explain about the inside mysql_query which is

    'UPDATE `secrett1_artgallery`.`beloved_sonic_charac`

          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` =\'$PollValue\' LIMIT 1'

     

    if you use this query.. the real query u execute are not (pretended $PollValue=5)

    'UPDATE `secrett1_artgallery`.`beloved_sonic_charac`

          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` =\'5\' LIMIT 1'

    but

    'UPDATE `secrett1_artgallery`.`beloved_sonic_charac`

          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` ='$PollValue' LIMIT 1'

     

    why?

     

    how about type code

    <?php
    $PollValue=5;
    echo 'UPDATE `secrett1_artgallery`.`beloved_sonic_charac`
          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` =\'$PollValue\' LIMIT 1';
    
    echo "UPDATE `secrett1_artgallery`.`beloved_sonic_charac`
          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` ='$PollValue' LIMIT 1";
    
    ?>

    which above this will return

    UPDATE `secrett1_artgallery`.`beloved_sonic_charac`

          SET `like` = (like +1) WHERE `beloved_sonic_charac`.`id` =\'5\' LIMIT 1

  10. ehem.. u said in top to build menu ?

     

    <?php
    ...... 
    /*just header etc*/
    $query = "SELECT cat.cat FROM cat order by cat";
           $result = mysql_query($query) or die(mysql_error());
    
          while($row = mysql_fetch_array($result)){
             echo $row['cat'];
          }
    
    
    ?>
    

    this menu you wish ^^

    hehehe.. rokie mistake..

     

    well.. before leave..

    try to give a better name for field ex:

    table Category:

    field: catid, catname, catdesc

     

    this will give you a better understanding about the table/field u use.. btw..

    cat can mean an animal cat ^^

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