0

I having some problem to open page in a new tab using php. Actually once a button is clicked on the menu bar it should open in a new tab. Can anyone tell me how to do this.

Sverri M. Olsen
  • 13,055
  • 3
  • 36
  • 52
raaj5671
  • 15
  • 5

3 Answers3

2

There is nothing about PHP.

Example for links:

<a href="page.html" target="_blank">Click</a>

Example for button:

<input type="button" value="Click" onClick="javascript:window.open('page.html', '_blank');" />
Paul Denisevich
  • 2,329
  • 14
  • 19
  • should i add the javascript coding? – raaj5671 Apr 23 '14 at 03:57
  • Show me your full code, upload it to jsfiddle or so – Paul Denisevich Apr 23 '14 at 03:58
  • @user3536613 I've updated your code, it works, take a look: http://jsfiddle.net/UL6zu/1/ - top links are now okay and active – Paul Denisevich Apr 23 '14 at 04:13
  • can you tell me which part of the code did you update – raaj5671 Apr 23 '14 at 04:16
  • @user3536613 look at the links stored in – Paul Denisevich Apr 23 '14 at 04:17
  • well i have tried but still i have to right click on it then only it opens in a new tab.. if i click on it nothing happens – raaj5671 Apr 23 '14 at 04:20
  • So the problem is in the rest of your code. It jsFiddle works for you then my code is OK. – Paul Denisevich Apr 23 '14 at 04:31