Jump to content

Badchip

Members
  • Posts

    47
  • Joined

  • Last visited

Badchip's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I have replaced "// Do something with the data here" with "return data;" but I get a blank page. What should I put to see the result? By the way, can I send the content to a text file? Thank you for your help.
  2. Why can't I get the contents of this? <script> function file_get_contents(filename) { fetch(filename).then((resp) => resp.text()).then(function(data) { return data; }); } file_get_contents('https://mediainfo.tf1.fr/mediainfocombo/L_LCI?context=MYTF1&pver=4014002'); </script>
  3. I know some websites have CORS enabled but I'm not sure if this link have CORS too https://www.sony.com/en/top/2021/js/news.js
  4. So there is no other way to get the content from JS?
  5. Based on this tutorial (https://lage.us/Javascript-File-Get-Contents.html) I can't get this to work with JS (like PHP) just get a blank screen: function file_get_contents(filename) { fetch(filename).then((resp) => resp.text()).then(function(data) { return data; }); } file_get_contents('https://www.sony.com/en/top/2021/js/news.js'); I have no problems with PHP: <?php $url = file_get_contents('https://www.sony.com/en/top/2021/js/news.js'); echo $url; Any idea? thanks in advance.
  6. Then I just need to change the PHP name periodically & automatically.
  7. It's to avoid that the PHP path can be used by anyone. What I want to do is change the PHP name often automatically. I want it to change every time I run PHP.
  8. I'm trying to protect a php file to prevent it from being used frequently outside of my web. My idea is to rename it with a 4-digit pin using the code: $pin = mt_rand (1000, 9999); ... but I don't know how to rename the old file/pin with the new one: rename ("old", "new"); ??? Any help will be welcome.
  9. I have solved it. Thank you. $url = file_get_contents('http://web.com'); $url = get_string_between($url, '"file": "http://', '"'); if (empty($url)) $url = file_get_contents('web_url.txt'); else file_put_contents('web_url.txt', $url); header("Location: http://$url");
  10. I think it's almost done. Now I need to skip the 'fopen' and 'fwrite' lines if there are no results between '"file": "http://', '"'); $url = file_get_contents('http://web.com'); $url = get_string_between($url, '"file": "http://', '"'); $file = fopen("web_url.txt", "w"); fwrite($file, $url); $file = file_get_contents('web_url.txt'); header("Location: http://$file"); Any idea?
  11. I want to obtain a URL of a website (it's inside the HTML) and add the URL in the same PHP.
  12. I want to get the url from another site and put it in my php. Something like this: $url = file_get_contents('http://...'); $url = get_string_between($url, 'http://...', '"'); $fopen($url, 'w'); fwrite($url); fclose() header("Location: http://result.here"); If it is not possible, what other alternative do I have?
  13. Badchip

    403 Forbidden

    I get a "430 Forbidden" error from Android/iOS when I click "TEST": http://ver.hol.es However if I click the URL in the address bar (after the error) and then I hit ENTER... it works. Where is the problem? is there any way to paste an URL and hit enter with PHP? (instead the header)
  14. I'm just trying to open this stream from PHP, without changing the URL of the browser. In other words, I want to hide the stream in PHP. (show "stream.php" instead http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8) PS: I use Native HLS Playback to play m3u8 directly from Chrome.
  15. I already tried just what you say to download and save that file: http://int.hol.es/test2.php header('Content-type: application/x-mpegURL'); header('Content-Disposition: inline; filename="video.m3u8"'); readfile('http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8'); However I can't open the stream; just view the content or download the file. The only way I know is using "header" ... but it changes the URL. Please, can someone show me an example for this?
×
×
  • Create New...