Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to post a link to a javascript popup on my PHP driven website. I have a code snippet, but always receive "syntax error, unexpected T_CONSTANT_ENCAPSED_STRING" error. Can anyone help me?




<pre>


<pre lang="xml">$File2 = &quot;feed.html&quot;;
$msg2 = &quot;A user has uploaded a file. To view it click &lt;a
href=&#39;javascript:download(&#39;http://www.somesite.com/somefile/1/files/&quot; . $filename .
&#39;)&quot;&#39;&gt;Here&lt;/a&gt;&quot;;</pre>


</pre>
Posted
Updated 28-Jun-10 16:55pm
v2
Comments
dawmail333 28-Jun-10 23:03pm    
Make sure you use
 tags effectively in future, that was a pain to decode.

1 solution

$File2 = "feed.html";
$msg2 = "A user has uploaded a file. To view it click Here"';


You had an extra ' where it didn't belong:
')"'>Here"; (before the >)

You might want to use a tool with syntax highlighting, I recommend Netbeans: the price is right :D
 
Share this answer
 
Comments
MicahC 28-Jun-10 23:06pm    
Thanks for the quick reply.. I tried removing the ' before the >, although it did not seem to make a difference.
">Here< / a >";
MicahC 28-Jun-10 23:38pm    
Reason for my vote of 5
Got it! I see what you mean now. Thanks for recommending Netbeans.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900