Jump to content
Old threads will finally start getting archived ×

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Posts posted by techker

  1. Hey guy's im stock on this issue..

     

    my image up loader works good , it uploads and resizes ok

     

    on my PC i select a picture and it uploads correctly, My girlfriends PC uploads the image sideways??

     

    on cell same issue?Sideways?

    <?php
    function resizeImage($resourceType,$image_width,$image_height,$resizeWidth,$resizeHeight) {
    
        $imageLayer = imagecreatetruecolor($resizeWidth,$resizeHeight);
        imagecopyresampled($imageLayer,$resourceType,0,0,0,0,$resizeWidth,$resizeHeight, $image_width,$image_height);
        return $imageLayer;
    }
    
    if(isset($_POST["form_submit"])) {
    	$imageProcess = 0;
        if(is_array($_FILES)) {
            $new_width = $_POST['new_width'];
            $new_height = $_POST['new_height'];
            $fileName = $_FILES['upload_image']['tmp_name'];
            $sourceProperties = getimagesize($fileName);
            $resizeFileName = time();
            $uploadPath = "./uploads/";
            $fileExt = pathinfo($_FILES['upload_image']['name'], PATHINFO_EXTENSION);
            $uploadImageType = $sourceProperties[2];
            $sourceImageWidth = $sourceProperties[0];
            $sourceImageHeight = $sourceProperties[1];
            switch ($uploadImageType) {
                case IMAGETYPE_JPEG:
                    $resourceType = imagecreatefromjpeg($fileName); 
                    $imageLayer = resizeImage($resourceType,$sourceImageWidth,$sourceImageHeight,$new_width,$new_height);
                    imagejpeg($imageLayer,$uploadPath."thump_".$resizeFileName.'.'. $fileExt);
                    break;
    
                case IMAGETYPE_GIF:
                    $resourceType = imagecreatefromgif($fileName); 
                    $imageLayer = resizeImage($resourceType,$sourceImageWidth,$sourceImageHeight,$new_width,$new_height);
                    imagegif($imageLayer,$uploadPath."thump_".$resizeFileName.'.'. $fileExt);
                    break;
    
                case IMAGETYPE_PNG:
                    $resourceType = imagecreatefrompng($fileName); 
                    $imageLayer = resizeImage($resourceType,$sourceImageWidth,$sourceImageHeight,$new_width,$new_height);
                    imagepng($imageLayer,$uploadPath."thump_".$resizeFileName.'.'. $fileExt);
                    break;
    
                default:
                    $imageProcess = 0;
                    break;
            }
            move_uploaded_file($fileName, $uploadPath. $resizeFileName. ".". $fileExt);
            $imageProcess = 1;
        }
    
    	if($imageProcess == 1){
    	?>
    
  2. Ok np

     

    table users contain knly user information

    name , email...

     

    tables codes have all the codes lime 100 codes.

    in this table

    id

    code value

    status(used or not)

    UserId this is were j want to assign a user to the code

     

    so i have one database and in my query i filter the codes according to the userId

  3. ok its for an iptv business

     

    they buy credits in codes lets say he buys 100

     

    drop them in the database.with his pannel he could have resellers.

     

    so that is why when he regiaters a reseller they get 25 credits.

     

    when they run low there is a warning and they can't sell to clients if they are under 5.

     

    in the main admin he see's the total amount of credits and reseller credits.

     

    when is database of 100 codes get low he need to buy more and fill it up.

     

    so that is why i want to be able to when he registers a reseller to assign 25 codes in the database automatic , not mannuelly go to the database and and do one by one.

     

    is this more clear?

  4. i have my table

     

    User                                             Table Codes  

     

     

    id                                                         id

    username                                            Codes

    pass                                                     Status 

    dateIn                                                   UserID

    Credits

     

    So your saying to create a table to have the user codes?

     

    can't i just update the codes datbase and add the userID to all 25 codes?

     

    so when i select codes i filter UserID

  5. Hey guys i have a database User and a database Codes (all codes)

     

    When we add a new user i would like to be able to put the amount of codes needed it would select in the codes database and put his userID

     

    so add User assign 25 codes to user

     

    in database user it would automatically add the UserID to 25 codes..

     

    it's clear in my head..lol but is this clear?

     

     

     

     

  6. Hey guy's im calling an api and getting back 

     

    {

        "user_info": {
            "username": "u",
            "password": "p",
            "message": "",
            "auth": 1,
            "status": "Active",
            "exp_date": "1521306691",
            "is_trial": "0",
            "active_cons": "0",
            "created_at": "1518887491",
            "max_connections": "1",
            "allowed_output_formats": [
                "m3u8",
                "ts",
                "rtmp"
            ]
        },
        "server_info": {
            "url": "server",
            "port": "25461",
            "rtmp_port": "8001",
            "timezone": "Europe/London",
            "time_now": "2018-03-06 14:05:59"
        }
    }
     
    im trying to parse in ph to get username and password.
     
    I have tried lots of ways but no success?
     
    example :
      $data = json_decode(file_get_contents($url), true);
            echo "id: ", $data['user_info']['username'];
            echo '<br>';
            echo "Name: ", $data['password'];
            echo '<br>';
           
    

    or

    $obj = json_decode($url2);
    print $obj->{'username'};
    

    or

    $jfo = file_get_contents($json_file);
    // read the title value
    $title = $jfo->server_info->url;
    // copy the posts array to a php var
    $posts = $jfo->user_info->username;
    

    no luck?do I have to use like a multilevel son method? 

     

  7. I know they change bot the boxes are always in the house unless the house ip changes also..would like to log mac but can't seem to get that going due to routers blocking it..

     

    i check in my login page if it is not in my database i register it.

    $DateIn = date("Y-m-d");
    
    $result1 = $DBcon->query("SELECT * FROM AuthIp WHERE IP = $ip LIMIT 1");
    $nrowsx  = mysql_num_rows($result1);
    	
    
    if (nrowsx == 0) {
    
    $result1 = $DBcon->query("INSERT INTO AuthIp (IP,Name,Email,Status,DateLocked) VALUES ('$ip','','','$Status','$DateIn')")or die(mysql_error());
    
    $Msg = 'Your IP address  is now Set to :' .$ip . '<br />';
    } else {
    	
    $Msg = 'Your IP address  is in Database';	
    //in db already';
    }
    

    but it always enters it when i logout out and login..

  8. Hey guy's i have an app that im building with a webview that points to my servers.

     

    the app is made to check status of services and renew.

     

    i did a login just by email and would like to add ip restriction

     

    so on first boot of the app it would log the ip only once and lock it.

     

    so when i look for email on login i can check to see if the email is the same..

     

    it's the first insert that im stock on.

     

    once that is done the rest is ok.

     

     

  9. Hey guy's have a few friends that need an admin panel to manage there clients and information

     

    So i created a script and did the panel ..but im debating on how do i share this.

     

    i created a domaine

     

    and database

     

    but if i have 3 guy's that need it for there own clients.Do i create sub domains for each and individuel databases or one database with like a RepID field in the tables to filter each login's and clients that are associated to this admin...

     

    or do i create a database for each so it can be safer and less heavy in long terme..

     

    if so is there like a script that i can do that can create a sub domain and database and insert all the tables and files...lol or is it pushing it..

     

    Thx Guy's

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