Jump to content
php.lv forumi

ziedinjsh

Reģistrētie lietotāji
  • Posts

    789
  • Joined

  • Last visited

Posts posted by ziedinjsh

  1. Lab.. tagad ir problēma tāda, ka atbild tikai ja ir pozitīva atbilde.. ja ir kāda kļūda tad atkal tas pats..

    if($data['id']==$message){
      $user = substr_replace($data['firstname'] ,"",-1);
    $reply = "Paldies ".$user."! Tavs kods ir: ".$data['code']." Veiksmigu dienu!";
     }else{
      $reply = "vāks";
     }
    echo ($reply);
    

     

    ja kods ir vienāds ar db esošo tad atbild ar: Paldies ".$user."! Tavs kods ir: ".$data['code']." Veiksmigu dienu!

    bet ja tāds kods nav tad vnk pasaka ka nav response kapēc tā.. viņam taču ir otra iespēja

  2. es nevaru iebraukt!!!!

     

    Te viņi nočeko vai ir pareizās ip:

    if(!in_array($_SERVER['REMOTE_ADDR'],
     	array('81.20.151.38', '81.20.148.122', '79.125.125.1', '209.20.83.207'))) {
    header("HTTP/1.0 403 Forbidden");
    die("Error: Unknown IP");
     }
    

     

    te viņi nočeko signature un secret kodu

    $secret = '0f5c616b4bf25f5f73c77bbcc69fd1fa'; // insert your secret between ''
     if(empty($secret) || !check_signature($_GET, $secret)) {
    header("HTTP/1.0 404 Not Found");
    die("Error: Invalid signature");
     }
    

     

    te kods nofiksē sūtītāju un sūtītāja ziņu kā arī id

    $sender = $_GET['sender'];
     $message = $_GET['message'];
     $message_id = $_GET['message_id'];
    
    

     

    Pie koda kas jāsūta lietotājam.. saucamais $message sanāk lietotāja id.. piem. tagad sanāk PAY LAT 25. Lietotājs nosūta sms.. kods dabon $message = $_GET['message'] kurā ir lietotāja id šinī gadījumā 25

     

    Šeit es pēc message (lietotāja id 25) nolasu lietotāju un unikālo kodu kurš tika izveidot un saglabāts datubāzē reģistrējot informāciju.

    
    $check = mysql_query("select * from peoples where id='$message'") or die(mysql_error());
     $result = mysql_num_rows($check);
    
     if($result==0){
      $reply = "Piedod, bet kods nav pareizs";
     }else{ 
      $data = mysql_fetch_array(mysql_query("select * from peoples where id='$message' limit 1")) or die(mysql_error());
      $reply = "Paldies ".$data['firstname']."! Tavs kods ir: ".$data['code']." Veiksmigu dienu!";
     }
    
    echo $reply;
    

     

    tagad pēc lietotāja id (25) nolasa lietotāju kuram ir id 25 un izvadam ārā unikālo kodu un sūtu reply

    $reply = "Paldies ".$data['firstname']."! Tavs kods ir: ".$data['code']." Veiksmigu dienu!";
    
     // print out the reply
     echo($reply);
    

     

    un tad viņš dara lietas kas viņam būtu jādara laikam

    //customize this according to your needs
     if($billing_reports_enabled
    && preg_match("/Failed/i", $_GET['status'])
    && preg_match("/MT/i", $_GET['billing_type'])) {
      // find message by $_GET['message_id'] and suspend it
     }
    
     function check_signature($params_array, $secret) {
    ksort($params_array);
    
    $str = '';
    foreach ($params_array as $k=>$v) {
     	if($k != 'sig') {
       	$str .= "$k=$v";
     	}
    }
    $str .= $secret;
    $signature = md5($str);
    
    return ($params_array['sig'] == $signature);
     }
    

     

    testējot iekš fortumo dashbord test sadaļas un pie message pievienojot textu 25 vienalga bļauj ka nevar izveidot savienojumu

  3. Fortumo baigi laipnie nav.. aizsūtīju e-pastu ar savu sms.php codu.. Adbildē saņēmtu to lai pārbaudot secret kodu vai viņš ie iekš '' un ip adresēm.. viņi pat kodu nepaskatījās!! ieejot pašā sms.php parāda: Error: Unknown IP tad viņiem ip adreses streiko nevs man kods nav riktīgs..

  4. nū.. fortumo.. meiģināju šādi:

    <?php
    session_start();
    include("misc/dbase.php");
    
    $data = mysql_fetch_array(mysql_query("select * from peoples where email='".$_SESSION['email']."'")) or die(mysql_error());
    
     //set true if you want to use script for billing reports
     //first you need to enable them in your account
     $billing_reports_enabled = false;
    
     // check that the request comes from Fortumo server
     if(!in_array($_SERVER['REMOTE_ADDR'],
     	array('81.20.151.38', '81.20.148.122', '79.125.125.1', '209.20.83.207'))) {
    header("HTTP/1.0 403 Forbidden");
    die("Error: Unknown IP");
     }
    
     // check the signature
     $secret = '0f5c616b4bf25f5f73c77bbcc69fd1fa'; // insert your secret between ''
     if(empty($secret) || !check_signature($_GET, $secret)) {
    header("HTTP/1.0 404 Not Found");
    die("Error: Invalid signature");
     }
    
     $sender = $_GET['sender'];
     $message = $_GET['message'];
     $message_id = $_GET['message_id'];//unique id
    
     //hint:use message_id to log your messages
     //additional parameters: country, price, currency, operator, keyword, shortcode
     // do something with $sender and $message
     $reply = "Hej, ".$data['name']."! Tavs kods ir: ".$data['code'];
    
     // print out the reply
     echo($reply);
    
    //customize this according to your needs
     if($billing_reports_enabled
    && preg_match("/Failed/i", $_GET['status'])
    && preg_match("/MT/i", $_GET['billing_type'])) {
      // find message by $_GET['message_id'] and suspend it
     }
    
     function check_signature($params_array, $secret) {
    ksort($params_array);
    
    $str = '';
    foreach ($params_array as $k=>$v) {
     	if($k != 'sig') {
       	$str .= "$k=$v";
     	}
    }
    $str .= $secret;
    $signature = md5($str);
    
    return ($params_array['sig'] == $signature);
     }
    ?>
    

     

    Our system didn't receive response from your script. Please, check if everything is ok.

  5. nu jau arī uz IE neiet

    biku sajaucu.. tieši kas aiziet uz konkrēto failu ir šis html

    <form method='post' action='process/image.process.php' enctype='multipart/form-data'>
    <p><input type='file' name='photo' class='input' style='padding:0px;'></p>
    <p><input type='submit' name='doupload' value='Augšupielādēt' class='button'></p>
    </form>
    

     

    Interesanti ir tas, ka izvēltoies citu failu viņ to neparādā (vismaz iekš IE) parāda tikai baltu lapu un uz mājas locālo serveri viss strādā!

  6. html:

    <form method="post" action="process/join.process.php?step=1" autocomplete="" id="reg">
    <p><input type="text" name="firstname" placeholder="Vārds" class="input"></p>
    <p><input type="text" name="lastname" placeholder="Uzvārds" class="input"></p>
    <p><input type="text" name="city" placeholder="Pilsēta" class="input"></p>
    <p><input type="text" name="email" placeholder="Epasts" class="input"></p>
    <p><textarea name="bequest" placeholder="Tavs novēlējums Latviešiem" class="textarea"></textarea></p>
    <p><select name="genere" class="button" style="margin-bottom:5px;"><option value="">-- Dzimums --</option><option value="Vīrietis">Vīrietis</option><option value="Sieviete">Sieviete</option></select></p>
    <p><input type="submit" name="add" value="Turpināt" class="button"></p>
    </form>
    

     

    header("location: ../index.php?p=join&step=2"); ceļš uz nākamo soli tu domā kapēc ir ../ tas tapēc ka tas php fails atrodas filderī

  7. Sveiki!

    Esmu saputrojies un vairs nesaprotu kas notiek..

     

    Kad veicu formas postu uz failu image.process.php (bildes augšupielādi) man parāda erroru to ka lapa nav pieejama, bet kad izvēlos cita formāta failu, parāda baltu lapu un viss..

     

    php kods:

    <?php
    session_start();
    include("../misc/dbase.php");
    $change = "";
    $abc = "";
    define ("MAX_SIZE","400");
    function getExtension($str) {
        	$i = strrpos($str,".");
        	if (!$i) { return ""; }
        	$l = strlen($str) - $i;
        	$ext = substr($str,$i+1,$l);
        	return $ext;
    }
    $errors = 0;
    
     $image = $_FILES["photo"]["name"];
    $uploadedfile = $_FILES['photo']['tmp_name'];
    
    
     if ($image) {
    
      $filename = stripslashes($_FILES['photo']['name']);
    
    $extension = getExtension($filename);
      $extension = strtolower($extension);
    
    
    if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) {
    
    $change = "Neatpazīstams bilžu formāts";
    $errors = 1;
      }else{
      $size = filesize($_FILES['photo']['tmp_name']);
    
    if ($size > MAX_SIZE*1024){
    $change = "Tika pārsniegts bilžu izmērs.";
    $errors = 1;
    }
    
    if($extension=="jpg" || $extension=="jpeg" ){
    $uploadedfile = $_FILES['photo']['tmp_name'];
    $src = imagecreatefromjpeg($uploadedfile);
    }else if($extension=="png"){
    $uploadedfile = $_FILES['photo']['tmp_name'];
    $src = imagecreatefrompng($uploadedfile);
    }else {
    $src = imagecreatefromgif($uploadedfile);
    }
    echo $scr;
    list($width,$height) = getimagesize($uploadedfile);
    
    $newwidth = 200;
    $newheight = ($height/$width)*$newwidth;
    $tmp = imagecreatetruecolor($newwidth,$newheight);
    
    $newwidth1 = 70;
    $newheight1 = ($height/$width)*$newwidth1;
    $tmp1 = imagecreatetruecolor($newwidth1,$newheight1);
    imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
    imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height);
    
    $filename = "../wall/". $_FILES['photo']['name'];
    $filename1 = "../wall/small/". $_FILES['photo']['name'];
    $photo = $_FILES['photo']['name'];
    imagejpeg($tmp,$filename,100);
    imagejpeg($tmp1,$filename1,100);
    imagedestroy($src);
    imagedestroy($tmp);
    imagedestroy($tmp1);
    
    $firstname = mysql_real_escape_string($_SESSION['firstname']);
    $lastname = mysql_real_escape_string($_SESSION['lastname']);
    $city = mysql_real_escape_string($_SESSION['city']);
    $email = mysql_real_escape_string($_SESSION['email']);
    $genere = mysql_real_escape_string($_SESSION['genere']);
    $bequest = mysql_real_escape_string($_SESSION['bequest']);
    $ip = mysql_real_escape_string($_SESSION['ip']);
    $date = mysql_real_escape_string($_SESSION['date']);
    $statuss = mysql_real_escape_string($_SESSION['statuss']);
    mysql_query("insert into peoples (firstname, lastname, city, email, genere, bequest, ip, date, statuss, photo) values ('$firstname', '$lastname', '$city', '$email', '$genere', '$bequest', '$ip', '$date', '$statuss', '$photo')") or die(mysql_error());
    $_SEESION['email'] = $email;
     header("location:../index.php?p=join&step=2");
    }
    }
    ?>
    

     

    Kapēc tā notiek!?

    P.S. Paldies jau iepriekš! :)

  8. Meiģinot saglabāt linku vai embed kodu caur textare iekš datubāzes mets ārā:

     

    Forbidden

    You don't have permission to access /adm/process/process.soundcloud.php on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    parastu tektu viņš saglabā.. Bet citā faila es atkal varu saglabāt gan linku gan citu tādu

    kas viņam nepatīk?

    <?php
    include("../../misc/dbase.php");
    $title = mysql_real_escape_string($_POST['title']);
    $code = mysql_real_escape_string($_POST['code']);
    $date = date("d.m.Y");
    if(empty($title) || empty($code)){
    die("Some feild is empty!");
    }else{
    mysql_query("insert into soundcloud (title, code, date) values ('$title', '$code', '$date')") or die(mysql_error());
    mysql_query("insert into updates (title, content, date, category) value ('$title', '$code', '$date', 'music')");
     header("location: ../index.php?page=3");
    }
    ?>
    
  9. Sveiki,

    search.php

    if($_POST){
    $q = $_POST['searchword'];
    $sql_res = mysql_query("select * from midi where title like '%$q%'");
    while($data = mysql_fetch_array($sql_res)){
    $title = $data['title'];
    
    $re_title='<b>'.$q.'</b>';
    $final_title = str_ireplace($q, $re_title, $title);
    ?>
    <div class="display_box" align="left">
    <?php echo $title; ?>
    </div>
    <?php
    }
    }
    else
    {}
    

     

    šādi viņš meklē tikai vienā tabulā, bet kā var panāk lai viņš meklē vēl iekš links table ar to pašu atslēgas vārdu- title??

  10. Īsti nesaprotu kas pa vainu.. man ir div ar display:none; tas ir kā popup un iekšā ir poga. Atverot popup un nospiežot pogu neizpildās jQuery funkcija:

    $(document).ready(function() {
       	$('#download').submit(function() {
           	location.reload;
     });
    });
    

     

    noņemot display:none; tad funkcija izpildās, bet vairs nav kā popup;

     

    $(document).ready(function() {
     	$('a[rel*=facebox]').facebox({
       	loadingImage : 'img/loading.gif',
       	closeImage   : 'img/closelabel.png'
     	})
    });
    

     

    Kas tur pa vainu varētu būt?

  11. Tā problēmu atradu.. paša nolaidība

    if($download=="midi"){
    $id = isset($_GET['id'])?$_GET['id']:'';
    $data = mysql_fetch_array(mysql_query("select midi.id, midi.title, midi.bpm, midi.name, midi.date, midi.code, updates.code from midi, updates where updates.id=".$id." and updates.code=midi.code ")) or die(mysql_error());
    echo $data['title'];
    }
    

×
×
  • Create New...