phpmash Posted March 29, 2008 Share Posted March 29, 2008 When click on a particular category, the corresponding products need to be opened in new window with file name products.php (Link will be http://mysite.com/products.php?catname=cat1). In this template products will be listed in an inline frame which loads the php file listproducts.php. In listproducts.php the $_REQUSET['catname'] is not available. How can I get the catname in to inline frame php page Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/ Share on other sites More sharing options...
papaface Posted March 29, 2008 Share Posted March 29, 2008 You should be using $_GET['catname'] Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-503913 Share on other sites More sharing options...
wildteen88 Posted March 29, 2008 Share Posted March 29, 2008 Make sure you are targeting the iframe with your links, eg: <a href="products.php?catname=cat1" target="your_iframe_name">Cat One</a> <iframe name="your_iframe_name" id="your_iframe_name" ... etc ... /> Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-503914 Share on other sites More sharing options...
phpmash Posted March 29, 2008 Author Share Posted March 29, 2008 My code is like as follows:  $url="products.php?cat=$row[0]"; <?php echo "<a href=\"$url\" target=\"mlist\">.$row[0]."</a>"; ?>  Here "mlist" is the name of iframe used in "products.php" This frame loads the php file "listproducts.php". In listproducts.php I have the query like SELECT * FROM products WHERE category='$catname' $catname needs to be passed from previous page  Still the problem exists  Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-503955 Share on other sites More sharing options...
ucffool Posted March 29, 2008 Share Posted March 29, 2008 Yeah, if you are using the iframe to call the page it is not included as part of the current page or script. You should be setting the iframe and then using include() to bring in products.php, which should be able to process it properly. Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-503961 Share on other sites More sharing options...
phpmash Posted March 29, 2008 Author Share Posted March 29, 2008 Where to include it? If it is in begining the entire page is displayed in the begining or is it part of iframe please provide the statement Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-503983 Share on other sites More sharing options...
ucffool Posted March 29, 2008 Share Posted March 29, 2008 include('products.php'); Wherever in the page you want the contents of the page to be evaluated and included. Quote Link to comment https://forums.phpfreaks.com/topic/98467-inline-frame-and-_request-variable/#findComment-504000 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.