Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About techker

  • Rank
    Prolific Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. hey guys thx for the help.i will test with var dump and see. So its an array....
  2. Hey guys i got an api and it returns : [ { "id":"1", "package_name":"1 Month Full + Adult - 2 Devices", "is_trial":"0", "is_official":"1", "trial_credits":"0", "official_credits":"1", "trial_duration":"24", "trial_duration_in":"hours", "official_duration":"1", "official_duration_in":"months", "groups":"[4,5,6,8]", "bouquets":"[27]", "can_gen_mag":"1", "only_mag":"0", "output_formats":"[1,2,3]", "is_isplock":"0", "max_connections":"2", "is_restreamer":"0", "force_server_id":"0", "can_gen_e2":"1", "only_e2":"0", "forced_country":"", "lock_device":"0" },......] $json = file_get_contents(URL); $data = json_decode($json,true); $Decoded = $data['id'][0]; HERE no mater what i put i get and error Undefined index: id in /home/handshak/public_html/XC/get2.php on line 9 echo "<pre>"; print_r($Decoded); exit; What type of json structure is that? EDIT: if i use: $contents = file_get_contents($json); $contents = utf8_encode($contents); $results = json_decode($contents); i get: [14-Apr-2019 15:38:32 UTC] PHP Warning: file_get_contents([{&quot;id&quot;:&quot;1&quot;,&quot;package_name&quot;:&quot;1 Month Full + Adult - 2 Devices&quot;,&quot;is_trial&quot;:&quot;0&quot;,&quot;is_official&quot;:&quot;1&quot;,&quot;trial_credits&quot;:&quot;0&quot;,&quot;official_credits&quot;:&quot;1&quot;,&quot;trial_duration&quot;:&quot;24&quot;,&quot;trial_duration_in&quot;:&quot;hours&quot;,&quot;official_duration&quot;:&quot;1&quot;,&quot;official_duration_in&quot;:&quot;months&quot;,&quot;groups&quot;:&quot;[4,5,6,8]&quot;,&quot;bouquets&quot;:&quot;[27]&quot;,&quot;can_gen_mag&quot;:&quot;1&quot;,&quot;only_mag&quot;:&quot;0&quot;,&quot;output_formats&quot;:&quot;[1,2,3]&quot;,&quot;is_isplock&quot;:&quot;0&quot;,&quot;max_connections&quot;:&quot;2&quot;,&quot;is_restreamer&quot;:&quot;0&quot;,&quot;force_server_id&quot;:&quot;0&quot;,&quot;can_gen_e2&quot;:&quot;1&quot;,&quot;only_e2&quot;:&quot;0&quot;,&quot;forced_country&quot;:&quot;&quot;,&quot;lock_device&quot;:&quot;0&quot;},{&quot;id&quot;:&quot;2&quot;,&quot;package_name&quot in /home/handshak/public_html/XC/get2.php on line 7
  3. Ok i think i got it.. $result= str_replace('\\', '', $stream_source); $result = str_replace("'", "", $result); //remove single quotes so i remove the \ all i need to do is reverse that to save
  4. odd so how come it is inserted like that.. how can i make a function to edit this: "http:\/\/streams.com:\/live\/A245\/23424\/6207.ts","http:\/\/streams\/live\/123\/43r3222\/27357.ts"] guessing i need to remove the\/ and replace by // . and when i save i need to re add the \/ im messing around with SELECT streams_source REPLACE(streams_source,'\/','//') as output FROM Stream WHERE 1; but getting mysql errors ..
  5. ok i found that just the simple loop works..lol $dataArray = json_decode($groups,true); foreach($dataArray as $key => $value){ echo $value; }
  6. odd cause no matter what i try i get an error like SELECT * FROM `packages` WHERE JSON_CONTAINS (groups , "4") ; MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 PHP/5.5.9-1ubuntu4.27 mysql 5.5.62
  7. last question..maybe..lol sorry LEGEND: 1-admin 2 user ,3 user level 1 ,4 user level4 .... in my table i have a column groups with [1,2,4] how can i make a query to select the tables associated to groups [1] only cause i have some that i tried..also tried JSON_CONTAINS but the mysql error said does not exist? SELECT * FROM `packages` WHERE 2 IN (".implode(',','groups').")LIMIT 0 , 30
  8. that explains it ..json..hmm its the panel that was made like that..im just connecting to the backend of it .. ya the Mysql is the latest.. so how can i show that text in a way that we can modify and resave?
  9. Hey guys i have a database set up and im trying to figure out how to show and edit the content in a table that has ["http:\/\/streams.com:\/live\/A245\/23424\/6207.ts","http:\/\/streams\/live\/123\/43r3222\/27357.ts"] so when i eco this i get that? is this stored as an array? and why the \/ is that separate values?
  10. ya i think just need to unlink the old file
  11. hmm ya i tried htaccess with success..il try a script
  12. Hey guy's im going nuts on this... i have a linux server(centos 7) i have a directory /home/abc/files... i want to share that or be able to create a link to that file... but seems like the home is not available... is it possible to link to that?
  13. Hey guy's i have a script i did a few months ago and now noticed that it is doing its job but keeps the old file ..so i got the image a few times but on a different angle... how can i optimize this code to delete the old image when doing the rotation? <?php session_start(); include_once 'dbconnect.php'; if (!isset($_SESSION['userSession'])) { header("Location: index.php"); } $degrees = -270; $path = $_GET['Folder']; $file =$_GET['Pic']; $fileid =$_GET['id']; $image = $path.'/'.$file; $imageN = $path.'/New_'.$file; //load the image $source = imagecreatefromjpeg($image); //rotate the image $rotate = imagerotate($source, $degrees, 0); $NewImg='New_'.$file ; //set the Content type //header('Content-type: image/jpeg'); //display the rotated image on the browser //imagejpeg($rotate); imagejpeg($rotate,$imageN,100); //free the memory imagedestroy($source); imagedestroy($rotate); $sql = "UPDATE Coupon_list SET product_image_thumb = '$NewImg' WHERE id = '$fileid'"; if (mysqli_query($DBcon, $sql)) { echo "Rotation ok"; echo('<script language="Javascript">opener.window.location.reload(false); window.close();</script>'); } else { echo "Error Rotating: " . mysqli_error($DBcon); } mysqli_close($DBcon); ?> <img src="gears.gif" alt="" />
  • 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.