Jump to content

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

Edited by Barand

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 =)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.