Jump to content

Dumb noob struggling with syntax


MarkRogers

Recommended Posts

Hi all, this is my first post. Be gentle!

 

I'm trying to peform a small hack on a Joomla component to better suit by needs... Currently the 'trigger' has an event attached to it, that opens a browser window, the event looks like this (it works fine):

$eventprnt = 'onclick="window.open(\'index.php?myurl ='.$item->id.'\')" ';

I want to change the function from 'window.open' to 'window.location.href', but the quotes and semicolons thing is killing me (I keep getting T_STRING errors). I've included an example of one of my attempts to give you all a good laugh:

$eventprnt = 'onclick="window.location.href ='$index.php?myurl ='.$item->id.'"';

As you can probably see, I could be here for a while unless I ask for help... I've done a lot of reseacrh, and it sounds like I need backslashes, quotes... All sorts of stuff. Unfortunately it's all Chinese to me.

 

If you can give me a pointer, that would be a real help.

 

Mark

Link to comment
https://forums.phpfreaks.com/topic/284404-dumb-noob-struggling-with-syntax/
Share on other sites

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.