Hey guys...
I'm working on a small PHP file
That code is giving me a Parse error "Unexpected T_String...." on index.php line 44.
Line 44 in the code is
I know the syntax for that line is correct... I tested with
And that prints http://www.gonzolicious.com/redir.php?rid=111" to the browser.
I've been going crazy trying to find where the error is coming from.
Any assistance would be greatly appreciated.
Thanks
Sebastian (RoTE)
I'm working on a small PHP file
PHP:
<?php
include ("config.php");
function TextBetween($s1,$s2,$s)
{
$s1 = strtolower($s1);
$s2 = strtolower($s2);
$L1 = strlen($s1);
$scheck = strtolower($s);
if($L1>0)
{$pos1 = strpos($scheck,$s1);}
else
{$pos1=0;}
if($pos1 !== false)
{
if($s2 == '') return substr($s,$pos1+$L1);
$pos2 = strpos(substr($scheck,$pos1+$L1),$s2);
if($pos2!==false) return substr($s,$pos1+$L1,$pos2);
}
return $result;
}
if ($_POST[submit])
{
$find = array("\n", "\r", "[/url]");
$replace = array("", "", "[/url]\n");
$finalreplace = array("", "", "[/url]");
$urls = $_POST['urls'];
$large = array("[URL=", "[IMG]", "[/IMG]", "[/URL]");
$small = array("[url=", "[img]", "[/img]", "[/url]");
$urls = str_replace($large, $small, $urls);
$urls = str_replace($find, $replace, $urls);
for ($i = 0; $i <= sizeof($urls)-1; $i += 1)
{
$newurl = TextBetween("[url=","][img]",$urls[$i]);
$thumburl = TextBetween("[img]","[/img]",$urls[$i]);
if ($newurl != '')
{
$addtodb = @mysql_query("INSERT into redirects (link,thumb) VALUES ('".$newurl."','".$thumburl."');
$usedid = @mysql_insert_id();
$yoururl = "http://www.gonzolicious.com/redir.php?rid=".$usedid;
$newurls = $newurls."".trim($urls[$i]);
$newurls = str_replace($newurl, $yoururl, $newurls);
if ($break == '3')
{
$newurls = $newurls."\n";
$break = 0;
}
else
{
$break = $break + 1;
}
}
}
echo "<form action='index.php' method='post' name='mainform'>
<textarea rows='20' cols='90' name='urls' readonly>".$newurls."</textarea>
</form>";
}
else
{
echo "<form action='index.php' method='post' name='mainform'>
<textarea rows='20' cols='90' name='urls'></textarea><br />
<input type='submit' name='submit' id='submit' value='Submit'></form>";
}
?>
That code is giving me a Parse error "Unexpected T_String...." on index.php line 44.
Line 44 in the code is
PHP:
$yoururl = "http://www.gonzolicious.com/redir.php?rid=".$usedid;
I know the syntax for that line is correct... I tested with
PHP:
<html>
<head></head>
<body>
<?php
$usedid = 111;
$yoururl = "http://www.gonzolicious.com/redir.php?rid=".$usedid;
echo $yoururl;
?>
</body>
</html>
I've been going crazy trying to find where the error is coming from.
Any assistance would be greatly appreciated.
Thanks
Sebastian (RoTE)





