johnyp Posted July 13, 2012 Share Posted July 13, 2012 Hello i have this code: <?php include "config.php"; ?> <?php foreach($_GET as $var => $value) { $out.= $var . '=' . $value . "&"; } $out = substr_replace($out,"",-1); $out = str_replace("(","[",$out); $out = str_replace(")","]",$out); $out = "http://server.softgr.com/scripts/mycarexpo/index.php?" . $out . "&submit1=1&first=1&p=advsearch"; //echo $out; ?> </br> <center> <a href="" name="bikes" onClick="sendSubmit('<?php echo($out); ?>')">Search...</a> </center and all i need is after creating the $out variable to auto call the function sendSubmit('<?php echo($out); ?>') that now is at the href. Is it possible? Thank you. Link to comment https://forums.phpfreaks.com/topic/265620-auto-call-function/ Share on other sites More sharing options...
Jessica Posted July 13, 2012 Share Posted July 13, 2012 <script type="text/javascript"> sendSubmit('<?php echo($out); ?>'); </script> Link to comment https://forums.phpfreaks.com/topic/265620-auto-call-function/#findComment-1361298 Share on other sites More sharing options...
johnyp Posted July 13, 2012 Author Share Posted July 13, 2012 Thank you jesirose very much. That was pretty simple... Maybe you know how to place two divs in same position so i can hide the one i want... Thank you Link to comment https://forums.phpfreaks.com/topic/265620-auto-call-function/#findComment-1361340 Share on other sites More sharing options...
Mahngiel Posted July 13, 2012 Share Posted July 13, 2012 You could use z-index and positioning, but if you're after hiding / showing elements you can use $('#id _of_element').hide(); $('#id_of_element').show(); // coupled with $('#id_of_clickable').on('click', function({ $('#id _of_element').toggle(); $('#id_of_element').toggle(); }); [/code] Link to comment https://forums.phpfreaks.com/topic/265620-auto-call-function/#findComment-1361345 Share on other sites More sharing options...
johnyp Posted July 13, 2012 Author Share Posted July 13, 2012 Thank you very much all of you. Link to comment https://forums.phpfreaks.com/topic/265620-auto-call-function/#findComment-1361391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.