whaleyb Posted October 1, 2009 Share Posted October 1, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/176219-opening-new-window-problem/ Share on other sites More sharing options...
mikesta707 Posted October 1, 2009 Share Posted October 1, 2009 try urlencode Quote Link to comment https://forums.phpfreaks.com/topic/176219-opening-new-window-problem/#findComment-928690 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.