Jump to content
php.lv forumi

chizijs

Reģistrētie lietotāji
  • Posts

    171
  • Joined

  • Last visited

Posts posted by chizijs

  1. Parasts insert kods

    $a1 = $_POST['textBox1'];
    $a2 = $_POST['textBox2'];
    $a3 = $_POST['textBox3'];
    $a4 = $_POST['textBox4'];
    $a5 = $_POST['textBox5'];
     mysql_query("INSERT INTO `tabula`(`a1`, `a2`, `a3`, `a4`, `a5`) VALUES('$a1', '$a2',  '$a3', '$a4', '$a5')") or die(mysql_error());
    

     

    p.s source code (CTRL+U) arī kad ir pievienoti laukumi rada tikai <div id="parah"></div>

  2. Tātad ir lauks kur ir input'i, kad uzspiež uz Add input pievienojas input. Bet kad vajag to input vērtību ielikt DB, viņš nenolasa pievienotos laukums. Kā to var izlabot, lai mysql_query varētu izlasīt?

     

    kods

    
    function display() {
     document.getElementById('parah').innerHTML="";
     for (intI=2;intI<arrInput.length;intI++) {
       document.getElementById('parah').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
     }
    }
    
    
    
    function createInput(id,value) {
       for (i=0;i<2;i++) {
     	return "<p id='heh"+ id +"'>"+ id +". <input type='text' name='textBox"+ id +"' id='textBox"+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"' size='20'> <a href='javascript:;' onclick='javascript:delIn(\"heh"+ id +"\");'>del</a></p>";
    
    }
    }
    

  3. Tātad no *.csv izvelk 10 000 ierakstus

     

    EVLA
    56.520554
    21.112389
    
    EVRA
    56.935066
    23.973078
    ..
    

     

    un man vajadzētu visus 10 000 ierakstus ielikt DB.

     

    Un lai šādi sarindojas

    ICAO | LAN | LOT
    
    EVLA | 56.520554 | 21.112389
    EVRA | 56.935066 | 23.973078

  4. Tātad gribu uztaisīt page pagination lai pārlādetu komentāru lapu bez refresh.

     

    php daļa

    if(!isset($_GET['page'])){
      $lapa = 1;
    } else {
      $lapa = $_GET['page'];
    }
    $max_results = 3;
    $from = (($lapa * $max_results) - $max_results);
    $c_c = mysql_query("SELECT * FROM c_c WHERE n_id = '".stripslashes($_GET['id'])."' ORDER BY id ASC LIMIT $from, $max_results");
    $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM c_c"),0);
    $total_pages = ceil($total_results / $max_results);
    if(mysql_num_rows($c_c) == 0){ echo '<div style="width: 460px; height: auto; background: none repeat scroll 0% 0% rgb(255, 255, 255); float: left; margin: 2px; border: 1px solid rgb(221, 221, 221); -moz-border-radius: 3px 3px 3px 3px;"><div style="padding-left: 10px; margin: 0px auto;"><table><tbody><tr><td style="width: 200px;">No comments about <b>'.$row['title'].'</b>.</td></tr></tbody></table></div></div>'; } else {
    
    while($c = mysql_fetch_array($c_c)){
    $coum = substr_replace($c['com'], '<br/>',65, 66);
    echo '<div id="comm">
    		<div class="title"><div style="float: left;"><a href="/?p=user&id='.$c['a_id'].'">'.$c['who'].'</a> @  '.$c['when'].'</div><div style="float: right;">  </div><br style="clear: both;"></div>
    		<div class="text">'.nl2br($coum).'</div></div><br>
    '; }
    echo "<br/><table width='100%' align='left'><tr><td><div id='news_container'><div id=\"pages\">";
    if($lapa > 1){
      $prev = ($lapa - 1);
      echo '<a href=\'javascript:;\' onclick=\'news_page("'.$prev.'", "")\'>«</a>';
    }
    for($i = 1; $i <= $total_pages; $i++){
      if(($lapa) == $i){
          echo "<span class=\"current\"><b>".$i."</b></span>";
          } else {
              echo "<a href='javascript:;' onclick='news_page(\"".$i."\", \"\")'>$i</a>";
      }
    }
    if($lapa < $total_pages){
      $next = ($lapa + 1);
      echo "<a href='javascript:;' onclick='news_page(\"".$next."\", \"\")'>»</a>";
    }
    echo "</div></div></td></tr></table>
    "; }

     

    js daļa

    function news_page(page, search) {
    $("#news_container").mask("Loading..");
    $.get("/pages/news.php?id=<?php echo $_GET['id']; ?>&page=",
    { page: page
    },
    function(response){
    $("#news_container").html(response);
    $("#news_container").unmask();
    });
    }

     

    Problēma ir tada - kad spiež uz citu lapu neko neielādē..

  5. function valid_email($email) { 
        if( (preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $email)) || 
         (preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email)) ) { 
         $host = explode('@', $email);
         if(checkdnsrr($host[1].'.', 'MX') ) return true;
         if(checkdnsrr($host[1].'.', 'A') ) return true;
         if(checkdnsrr($host[1].'.', 'CNAME') ) return true;
        }
        return false;
       } 
         if (!function_exists('checkdnsrr')) {
        function checkdnsrr($host, $type = '') {
         if(!empty($host)) {
          if($type == '') $type = "MX";
          @exec("nslookup -type=$type $host", $output);
          while(list($k, $line) = each($output)) {
           if(eregi("^$host", $line)) {
            return true;
           }
          }
          return false;
         }
        }
       }
    

  6. if(isset($_GET['page'])){
    $fails = "./lapas/".$_GET['page'];
    if(file_exists($fails)){include($fails);}else{echo'error';}
    }else{
    include('news.php');
    }
    

  7. Chizijs:

    http://php.lv/f/topic/16479-joku-lapas-pardosana/page__view__findpost__p__129015

    Bildes apakšā rakstīts "Izstrādāja chizijs un Kemito". Paskatoties šeit redzam, ka autors ir Toms. Par cik mēs zinam, ka tevi sauc Vladislavs (http://design.gtop.list.lv/kontakti.html), tad Kemito vajadzētu būt vienam no tiem Tomiem. Un lūk, šajā tēmā ir komentējis toms42. Pieļauju domu, ka tas ir viens no tiem tomiem, jo skype niks ir ļoti līdzīgs (toms422). Tātad tam otram Tomam vajadzētu būt Kemito. Pašlaik vienīgā mistika - kur ceturtais cilvēks no jūsu komandas? :) Mistika :D

     

    Pieļauju domu, ka cenšaties visi pārdot to lapeli, bet kā naudu jūs izdalīsit - nav ne jausmas. Tikai pieļauju domu, nesaku ka tā ir 100% patiesība ;)

     

     

    toms42:

    Veiksmi ceļot firmu. Tev tā noderēs ;)

    toms42 ir tikai dizainu izveidojis un Kemito nesauc Toms

     

    un palasi kārtīgi

     

    Valodas:PSD

    Kategorija:Joku lapa

    Lapas: 1

    Adrese: www.yoyocat.id.lv

    Autors: Toms[skyDesign]

    Tarifs: Bezmaksas

×
×
  • Create New...