Boss decided he wanted my PHP form to be a JS popup. Now my problem is in passing a var (again). I've made a link to launch the popup and the var (category_code) shows in the link, but doesn't appear in the PHP page that's launched by the JS. <a href=\"http://some_page.php?category_code=" . $category_code . "\" onclick=\"window.open(this.href, 'popupwindow', 'width=650,height=500,left=50,top=50,scrollbars,resizable'); return false;\">Wrap Link Around This Text</a>"; Help?
Are you fetching the variable in the php using $_GET? When you say it "doesn't appear", do you mean the url doesn't have the variable in it?
It's not showing in the url when queried thusly: $loc_url=$_SERVER['SCRIPT_NAME']; echo $loc_url; // should show category_code=whatever but only folder and page name show up Yes, trying to GET category_code, too: $trim_url=$_GET['category_code'];
Sorry guys, I had the GET in a conditional statement, which wasn't run till the form was submitted (so the var was gone by then). Sorry to have wasted your time again, but thanks for trying to help.
Oh, forgot to mention that I had to use REQUEST to make it work, too. GET wouldn't do it. If anyone has the reason (and would share it with me), I'd love to know. Thanks.
Ok, tested it to see if maybe it was a $_POST var (even though the url is assembled like a $_GET), and it didn't work. Neither $_POST nor $_GET work, but $_REQUEST does. Why? I must have done something wrong, right?