strago Posted February 16, 2010 Share Posted February 16, 2010 $download_link = $tube->get('http://www.youtube.com/watch/v/' $_GET['url']); Depending on if I use " or ' it spits out Parse error: syntax error, unexpected T_VARIABLE in /public_html/index.php on line 56 Parse error: syntax error, unexpected ':' in /public_html/index.php on line 56 $download_link = $tube->get($_GET['url']); works if I wanted the new form URL to be like hxxp://www.domain.com/index.php?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9lp0IWv8QZY though I wanna keep it short with hxxp://www.domain.com/index.php?url=9lp0IWv8QZY by having most of the URL in the script so I can do mod_rewrite. Link to comment https://forums.phpfreaks.com/topic/192234-parse-error-syntax-error-unexpected-t_variable/ Share on other sites More sharing options...
jl5501 Posted February 16, 2010 Share Posted February 16, 2010 $download_link = $tube->get('http://www.youtube.com/watch/v/'.$_GET['url']); you need a dot Link to comment https://forums.phpfreaks.com/topic/192234-parse-error-syntax-error-unexpected-t_variable/#findComment-1013020 Share on other sites More sharing options...
strago Posted February 16, 2010 Author Share Posted February 16, 2010 Thanks. That did it. Is there any way to make it so that if you enter the full URL in the form, the part of the URL before the ID get's deleted? $v = str_replace($v, "", "http://www.youtube.com/watch?v="); $download_link = $tube->get('http://www.youtube.com/watch?v='.$_GET['v']); doesn't take it out. Link to comment https://forums.phpfreaks.com/topic/192234-parse-error-syntax-error-unexpected-t_variable/#findComment-1013321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.