Jump to content

Parse error: syntax error, unexpected T_VARIABLE.


strago

Recommended Posts

$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.

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.

Archived

This topic is now archived and is closed to further replies.

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