Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Grok 🤖

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by Grok 🤖

  1. Hello, I just try to modify a script and I have this problem My Javascript code: My Template Code: <select name="category" size="1" > <option value="-1">{$lang.select}</option> {foreach from=$categories_list key=k item=v} <option value="{$k}" {if $smarty.post.category == $k}selected{/if}>{$v}</option> {/foreach} </select> <select name="" id="pm_sources" size="1" > <option selected="selected">{$lang.select}</option> {foreach from=$sources key=k item=v} <option value="{$v.url_example}">{$v.source_name|capitalize}</option> {/foreach} </select> <input type="text" name="yt_id" value="{$smarty.post.yt_id}" size="60" class="inputtext" /> <br /><small>Example: <span id="pm_sources_ex"></span></small> My problem is when I put pm_sources before the category it works fine, but like I want to have it like this order it takes for pm_sources_ex the -1 from categories
  2. Thanks a lot premiso damn my second function get_flv() is not working this warning : Warning: preg_match() expects parameter 2 to be string, never seen before...
  3. Hello it's me again, I'm learning functions at the moment, but have problems to test them, so that's what I have written so far: <?php function get_info($url) { $video_data = array(); preg_match('/.{13}$/i', $url, $matches); $video_id = $matches[0]; $target_url = 'http://www.novamov.com/video/'. $video_id; $error = 0; if(function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $target_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0'); $video_data = curl_exec($ch); $errormsg = curl_error($ch); curl_close($ch); if($errormsg != '') { echo $errormsg; return false; } } else if(ini_get('allow_url_fopen') == 1) { $video_data = @file($target_url); if($video_data === false) $error = 1; } if(!is_array($video_data)) { $video_data = explode("\n", $video_data); } return $video_data; } function get_flv($video_data) { $movie_url = ''; preg_match('/file",.*/', $video_data, $matches); $split = $matches[0]; $split = explode('"', $split); $movie_url = $split[2]; return $movie_url; } $url = 'http://www.novamov.com/video/dfre8qs9n4yas'; get_info($url); print_r(get_flv($video_data)); the get_info() works fine, but how can I now give the $video_data to get_flv() to test if it's working?
  4. Thanks a lot kenrbnsn
  5. Hello I just try to read a script and I have this function do_main(&$video_details, $url) what's this & meaning before video_details?
  6. Hi I'm still working at my video grabber, now I have a question if there is a possibility to read the length of a embed movie? Embed Code: I think it's not possible and if it's very difficult.
  7. wow, thanks a lot, looks like a miracle for me
  8. Hello, the ultra beginner is back and I try to write a little grabber, that's what I did <? $url = "http://www.novamov.com/search.php?q=Alice+in+wonderland&submit="; $data = file_get_contents($url); $searchterm = 'Alice in Wonderland'; preg_match_all('/<a href[^>]*>'.$searchterm.'/i', $data, $match); var_dump($match); ?> and that's what I got source code: I'm pretty new with arrays, but it looks like a double array and I just wanted to have the urls, no idea what to make with...
  9. Hello I don't know for what's the variable $this, it has an other colour in my editor, is it for objects?
  10. Cool, thanks a lot JAY6390, that works
  11. Hello I'm learning a bit PHP I made a print_r that what I got My question: Is this possible now with echo to show the url of array 0 ?
  12. Hi all I decided now to learn PHP, I hope it's a good decision.
×
×
  • 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.