alapimba Posted July 18, 2007 Share Posted July 18, 2007 Hello what is wrong here? i want to do one action if on the url theres any anchor=... example.. i have a link to index.php and i have another link to index.php?anchor=roger in one link i don't want to do nothing on the second i want to echo roger. What is wrong in if($_GET['anchor'] != null) { ? And by the way... how to use this GET command if it's inside an iframe? It's not getting the url from the top page Thanks in advance Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/ Share on other sites More sharing options...
The Little Guy Posted July 18, 2007 Share Posted July 18, 2007 Does this work? <?php if($_GET['anchor'] != null) { echo $_GET['anchor']; } ?> Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/#findComment-301397 Share on other sites More sharing options...
alapimba Posted July 18, 2007 Author Share Posted July 18, 2007 nop just found the solution. isset($_GET(['anchor']))... but i don't know yet how to solve the issue with the $_GET inside the iframe Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/#findComment-301447 Share on other sites More sharing options...
rlindauer Posted July 18, 2007 Share Posted July 18, 2007 Pass the $_GET variable to the page in the iframe via the iframe src value: <iframe src="example.com/index.php?anchor=whatever"></iframe> Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/#findComment-301487 Share on other sites More sharing options...
alapimba Posted July 19, 2007 Author Share Posted July 19, 2007 humm.. do you mean on the index.php put the iframe src as a variable? Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/#findComment-302169 Share on other sites More sharing options...
alapimba Posted July 19, 2007 Author Share Posted July 19, 2007 solved, iframe with the link as a variable is working fine. thanks for your help Link to comment https://forums.phpfreaks.com/topic/60585-solved-this-make-sense-if_getanchor-null/#findComment-302356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.