Running php onClick file
I currently have a php executable:
<a href="test.php?foo=boo">test</a> I would not have to load a new page and do it onClick.
Does anyone know an easy way to do this?
I added a more complete example, including the one suggested by ajax. I still have problems getting it to work.
<script type="text/javascript"> $('li').click(function() { $.ajax({ type: "GET", url: "test.php", data: { foo: 'boo' }, success: function(data){ // use this if you want to process the returned data alert('complete, returned:' + data); }}); }); </script> </head> <body> <div id="header"> <h1>Title</h1> </div> <ul> <li><a href="#">Test</a></li> </ul> </body> </html> you can use jquery and do something like this:
$.ajax({ url: "test.php", data: { foo: 'boo' }, success: function(data){ // use this if you want to process the returned data // alert('complete, returned:' + data); }}); for more information see jquery-documentation
In your firl say for example try.html write this code
<meta http-equiv="refresh" content="2;url=test.php?foo=boo"> will it redirect u to test.php? foo = boo after 2 seconds
OR Another way ===========================================
create one php file
<?php header('Location: test.php?foo=boo'); exit; ?> Hope for this help