What wrong this code?

Started on the old forum in April 2012 · view the original in the archive · old links redirect here

10 replies · 571 views · started 14 years ago · 1 min read

3 participants
utpal Newbie · 8 posts #1

Any one tell me what wrong this code?

<a href='".$file." ;="" onclick="top()"'>-Download Now-</a>

It show Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/mysite/public_html/a/file.php on line 55 Please any one help me

something else Fellow · 2,296 posts #2

there is quite a lot wrong with it ..... but question is are you trying to print or echo the link in php?

just_m3. Developer · 199 posts #3

utpal wrote: Any one tell me what wrong this code?

<a href='".$file." ;="" onclick="top()"'>-Download Now-</a>

It show Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/mysite/public_html/a/file.php on line 55 Please any one help me

echo"<a href='".$file." onclick=".top()."'>-Download Now-</a>";

onclick="top()" missed dots 😛

onclick=".top()."

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files (x86)\VertrigoServ\www\test.php on line 4

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

something else Fellow · 2,296 posts #4

just_m3. wrote:

echo"<a href='".$file." onclick=".top()."'>-Download Now-</a>";

still wrong :/

echo "<a href='".$file."' onclick='top()'>-Download Now-</a>";

javascript needs to be inside the string

just_m3. Developer · 199 posts #5

something else wrote: still wrong :/

echo "<a href='".$file."' onclick='top()'>-Download Now-</a>";

javascript needs to be inside the string

ooops 😀 m'a bad .. i didn't knew that top() is from js function .. 😝

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

something else Fellow · 2,296 posts #6

just_m3. wrote: ooops 😀 m'a bad .. i didn't knew that top() is from js function .. 😝

if it was a php function your post would be still wrong as your missing two ' eg:

echo "<a href='".$file."' onclick='".top()."'>-Download Now-</a>"; 
just_m3. Developer · 199 posts #7

something else wrote: if it was a php function your post would be still wrong as your missing two ' eg:

echo "<a href='".$file."' onclick='".top()."'>-Download Now-</a>"; 

OMFG i'm so dizzy today 🤣 (nasty day at work) ... missed that too ... 😛

echo "<a href='".$file."' onclick='".top()."'>-Download Now-</a>"; 

how's it now ? 😊

but that's why you are here .. to fix things !

and let me tell ya ' one more thing about another day like this .. i wass so dizzy that i didn't knew why listing all data from database ain't work. (missed while function !)

but that's another part of me .. haha .. 🤣 tnx for that one 😛

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

utpal Newbie · 8 posts #8

just_m3. wrote: OMFG i'm so dizzy today 🤣 (nasty day at work) ... missed that too ... 😛

echo "<a href='".$file."' onclick='".top()."'>-Download Now-</a>"; 

how's it now ? 😊

but that's why you are here .. to fix things !

and let me tell ya ' one more thing about another day like this .. i wass so dizzy that i didn't knew why listing all data from database ain't work. (missed while function !)

but that's another part of me .. haha .. 🤣 tnx for that one :p

My java scripts is

<script type="text/javascript">
function top()
{
window.open("http://google.com","funlive","width=1%, height=1%, toolbar=no,location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes");
}

</script>

and

echo "<a href='".$file."' onclick='".top()."'>-Download Now-</a>"; 

this code also Fatal error.. Please help me.

utpal Newbie · 8 posts #10

something else wrote: use my second post :)

That show

Fatal error: Call to undefined function top() in /home/mysite/public_html/a/file.php on line 55
something else Fellow · 2,296 posts #11

this one:

echo "<a href='".$file."' onclick='top()'>-Download Now-</a>"; 

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close