PHP Parse Error

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch
Impact
66
ok now this is a really weird parse error. what im trying to do is to input a number and then make a dynamic hyperlink that (if exists) will be downloaded. to my PC. i also put an auto refresh in there so that if it wasnt there, it wud refresh in half an hour and run the script again. now whenever i run my script, it comes up with a parse error on line 28, unexpected $, which is weird because i close my </html> tags on line 27 and there's nothing after it. why is it doing this? here's my whole script:

HTML:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
$source = array();
$source[0] = "http://abc.com/xyz/123";
$source[1] = $_POST['url'];
$source[2] = ".txt";
$dest="C:\\Documents and Settings\Admin\Desktop\";
$fullsource=$source[0].$source[1].$source[2];
$open=fopen($fullsource, 'r');
$copy=copy($fullsource, $dest);
if (!$copy)
{
echo('File not found');
}
fclose($open);
?>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,1800000);
</script>
</body>
</html>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Your problem is on your $dest line. The \ is the escape for the next character, so it's escaping the second quotation mark instead of closing the string.

Try
$dest="C:\\Documents and Settings\\Admin\\Desktop\\";

or use apostrophes instead of quotation marks,

$dest='C:\Documents and Settings\Admin\Desktop\';
 
0
Close
ok i changed that, but now its showing a new error:

HTML:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
$source = array();
$source[0] = "http://yhbt.mine.nu/t/n";
$source[1] = $_POST['url'];
$source[2] = ".torrent";
$dest='C:\Documents and Settings\Tanay\Desktop\';
$fullsource=$source[0]
$fullsource.=$source[1]
$fullsource.=$source[2];
$open=fopen($fullsource, 'r');
$copy=copy($fullsource, $dest);
if (!$copy)
{
echo('Episode not released');
}
fclose($open);
?>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,1800000);
</script>
</body>
</html>

now it errors on line 17, where i define $open. what did i do wrong?
 
0
Close
PHP:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
$source = array();
$source[0] = "http://yhbt.mine.nu/t/n";
$source[1] = $_POST['url'];
$source[2] = ".torrent";
$dest='C:\Documents and Settings\Tanay\Desktop\';
$fullsource=$source[0];
$fullsource.=$source[1];
$fullsource.=$source[2];
$open=fopen($fullsource, 'r');
$copy=copy($fullsource, $dest);
if (!$copy)
{
echo('Episode not released');
}
fclose($open);
?>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,1800000);
</script>
</body>
</html>

$fullsource=$source[0]
$fullsource.=$source[1]

Those lines were your prob, ";" ;)
 
0
Close
SecondVersion said:
PHP:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
$source = array();
$source[0] = "http://yhbt.mine.nu/t/n";
$source[1] = $_POST['url'];
$source[2] = ".torrent";
$dest='C:\Documents and Settings\Tanay\Desktop\';
$fullsource=$source[0];
$fullsource.=$source[1];
$fullsource.=$source[2];
$open=fopen($fullsource, 'r');
$copy=copy($fullsource, $dest);
if (!$copy)
{
echo('Episode not released');
}
fclose($open);
?>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,1800000);
</script>
</body>
</html>

$fullsource=$source[0]
$fullsource.=$source[1]

Those lines were your prob, ";" ;)

PHP:
$dest='C:\\Documents and Settings\\Tanay\\Desktop\\';
 
0
Close
>> now it errors on line 17, where i define $open. what did i do wrong?

Can you share the error message?
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back