Jump to content

Can PHP open a link without the user seeing anything?


Snot

Recommended Posts

I have hardware setup to preform an action on camera when i enter a url into the address bar. Pretty much you will be able to feed tarantulas.  I'd like to setup a button that my user can click that will active the url without being moved off of the current page.

 

I can't figure out how to stop the browser from following the link to a blank page. It messes the whole thing up because the feeder only runs for a second and if you get sent to the blank page and have to navigate back the the live video feed page you could miss the feeding.

 

Thanks for the help

All i can think of is AJAX,

 

I just learned it tonight :) maybe have a look at jquery ajax and a tutorial i found: http://articles.sitepoint.com/article/ajax-jquery

 

Could be what our looking for.

So in a nutshell, ajax allows you to do stuff withoutleaving the page

create a function that does what you want and make the button call that function with onclick just make the anchor # and the target _blank

 

ex:

function .......code here

$feed = function();
<a href="#" onclick="$function" target="_blank">Feed Em!</a>

 

syntaxing for this example may be off ... im giving you and idea not the code as i am really tired and have 10000000s of lines of code in my head at the moment.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.