1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript/PHP Help

Discussion in 'HTML, Graphics & Programming' started by PiKe, 16 Jan 2006.

  1. PiKe

    Caporegime

    Joined: 18 Oct 2002

    Posts: 25,122

    Location: Lake District

    I'm trying to parse a variable when clicking a checkbox on a page, I'm trying to do it using this code but it isn't working.
    Code:
    function returns(filename) {
    	var x = new Image(1,1);
    	x.src='http://database/othering/returns.php?filename='+filename+'&x='+new Date().valueOf();
    	return false;
    }
    Can anyone advise?
     
  2. Dj_Jestar

    Caporegime

    Joined: 18 Oct 2002

    Posts: 29,065

    Location: Back in East London

    Not sure if this is the best way to go about this.. it just seems.. wrong.

    Have you tried AJAX?

    Anyway, try:
    Code:
    function returns (filename) {
        var x = new Image(1,1);
        var d = new Date();
    
        x.src = 'http://database/othering/returns.php?filename='+filename+'&x='+d.valueOf();
        return false;
    }
     
  3. PiKe

    Caporegime

    Joined: 18 Oct 2002

    Posts: 25,122

    Location: Lake District

    I found the problem, my onclick didnt have ' ' inside the brackets.