Jump to content

notclive

Members
  • Posts

    103
  • Joined

  • Last visited

Posts posted by notclive

  1. //write text in text boxdocument.getElementById("info").innerHTML="Your turn - You are the red team";//set square type as variablevar sqtype = "enemy";//creat three lines of 8 imagesfor (r=1;r<=3;r++){for (c=1;c<=8;c++){document.write('<img src="'+sqtype+'.png" onMouseDown="turn(gridRef'+r+c+')" id="gridRef'+r+c+'" alt="'+sqtype+'" />');//alternate image typeif(sqtype=="enemy"){sqtype="vacant2"}else{sqtype="enemy"};}//alternate image every line alsoif(sqtype=="enemy"){sqtype="vacant2"}else{sqtype="enemy"};}//do the same for 2 more linesvar sqtype = "vacant2";for (r=4;r<=5;r++){for (c=1;c<=8;c++){document.write('<img src="'+sqtype+'.png" onMouseDown="turn(gridRef'+r+c+')" id="gridRef'+r+c+'" alt="'+sqtype+'" />');if(sqtype=="vacant2"){sqtype="vacant1"}else{sqtype="vacant2"};}if(sqtype=="vacant2"){sqtype="vacant1"}else{sqtype="vacant2"};}//and same for three more linesvar sqtype = "vacant2";for (r=6;r<=8;r++){for (c=1;c<=8;c++){document.write('<img src="'+sqtype+'.png" onMouseDown="turn(gridRef'+r+c+')" id="gridRef'+r+c+'" alt="'+sqtype+'" />');if(sqtype=="vacant2"){sqtype="player"}else{sqtype="vacant2"};}if(sqtype=="vacant2"){sqtype="player"}else{sqtype="vacant2"};}//function to happen when user clicks imagefunction turn(grid){if (document.getElementById(grid).alt=="enemy"){document.getElementById("info").innerHTML="Your turn - This is not your piece";}}

    whats supposed to happen; when the user clicks the image the function turn() will happen this gets the id of the image and see's if this image has the alt of enemy and if so writes Your turn - This is not your piece in the info box.what happens; nothing, the images appear fine, but when i click i get this error in the javascript console

    Event thread: mousedownError:name: TypeErrormessage: Statement on line 3: Could not convert undefined or null to objectBacktrace:  Line 3 of linked script http://coding.notclive.co.uk/draughts.js    if ((document.getElementById(grid)).src == "enemy.png")      Line 1 of  script     turn(gridRef51);  At unknown location    [statement source code not available]

  2. Well what's the problem, why can't you put a PHP page on the same server as the forum and do that?
    aokforums host phpbb forums for free i havent got access to the files or anything i just sign up for a forum
  3. well ive got a forum at aokforums.com/notclive.and I'm trying to use frames on my site so i have a bar at the top and the forum at the botom, this works see http://forum.notclive.co.uk to see what im trying to do. I was hoping to get the information off the main page of the forum to display statistics in the bar so i could use php to find "our users have posted XXXX posts" and echo that and also find out whos online, so that users could see these stats wherever they where on the forum.Also i was hoping to put a log in system on the site in the future and i could use the bar for that but thats not connected with what im trying to do now

  4. still nothing

    <?phpini_set('allow_url_fopen',true);$page=file_get_contents("http://www.aokforums.com/notclive/index.php");echo $page;?>

    anybody understand what this error message means

    Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/www/forum.notclive.co.uk/bar.php on line 3Warning: file_get_contents(http://www.aokforums.com/notclive/index.php): failed to open stream: Address family not supported by protocol in /home/www/forum.notclive.co.uk/bar.php on line 3

  5. still nothing

    <?phpini_set('allow_url_fopen',true);$page=file_get_contents("http://www.aokforums.com/notclive/index.php");echo $page;?>

    anybody understand what this error message means

    Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/www/forum.notclive.co.uk/bar.php on line 3Warning: file_get_contents(http://www.aokforums.com/notclive/index.php): failed to open stream: Address family not supported by protocol in /home/www/forum.notclive.co.uk/bar.php on line 3

  6. Ive tried lots of methods and keep getting a similar error message heres my current php file

    <?phphighlight_file('http://www.aokforums.com/notclive/index.php');?>

    and heres the error message

    Warning: highlight_file(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/www/forum.notclive.co.uk/bar.php on line 2Warning: highlight_file(http://www.aokforums.com/notclive/index.php): failed to open stream: Address family not supported by protocol in /home/www/forum.notclive.co.uk/bar.php on line 2Warning: highlight_file(): Failed opening 'http://www.aokforums.com/notclive/index.php' for highlighting in /home/www/forum.notclive.co.uk/bar.php on line 2

×
×
  • Create New...