Jump to content

how it works? "onclick"


Yohanne

Recommended Posts

Hi all,

 

Could you help if what is the correct syntax for this?

 

<a href="javascript:void(0)" onclick = "window.open('newaccount.php?admin32=<?php echo substr(sha1($rows['a_id']),4,30) ?>','','top=60,left=250,right=200,width=300, height=500,menubar=no,alignment=center')">Account</a>

 

and when i remove line below the code is working.

?admin32=<?php echo substr(sha1($rows['a_id']),4,30) ?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/276118-how-it-works-onclick/
Share on other sites

Instruction separation

As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement. The closing tag of a block of PHP code automatically implies a semicolon; you do not need to have a semicolon terminating the last line of a PHP block.

 

PS Forget my previous comment

Your onclick event code doesn't look like having any problem.

 

I believe it was your php code. Try load the page and view the source, look for the line. Because sometime if PHP throw an error inside the HTML tag, you can't view it on your page. Verify the PHP code before troubleshooting your javascript =)

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.