Jump to content

Opening new window problem


whaleyb

Recommended Posts

Here is the code:

 

<a href=\"javascript:open_window('$php_self?action=view_record&aug=$augname');\">Edit</a>

 

When the variable $augname contains no special characters, the new window opens flawlessy.  When the variable contains text with an ' like that's, the window does not even open and I get a javascript error stating "Expected ")".

 

I know it's a javascript error, but I'm dealing with PHP and either way, I can't for the life of me figure out how to get the variable to work when a special character is involved.  I've tried str_replace and escape characters in PHP and Javascript, but to no avail.

 

Hoping an expert can help me out here.  I know it's probably something simple I'm overlooking.

 

Thanks,

 

Bryan

Link to comment
https://forums.phpfreaks.com/topic/176219-opening-new-window-problem/
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.