Jump to content

glenelkins

Members
  • Posts

    760
  • Joined

  • Last visited

    Never

About glenelkins

  • Birthday 11/14/1984

Contact Methods

  • MSN
    zorpo@live.co.uk
  • Website URL
    http://thewebsolutionprovider.com

Profile Information

  • Gender
    Male
  • Location
    Bridlington - East Riding of Yorkshire - United Kingdom

glenelkins's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. the forum is not under my control no, not that it's really the concern of this discussion. the forum accounts are mine on the forum, the software is just to make my life easier in writing informative articles and posting them automatically rather than wasting valuable time posting myself. please continue to answer the question in the discussion.
  2. Well basically the issue is I am a PHP, JS etc programmer and im learning C# . I am writing an article submitter and a part of it is to login to a specific forum and post for me. It uses vBulletin but because the password field uses JS to take the value, rather than posting it with the form, it never fills the field in by name... if that makes sense? So i need something of the equivalent of the js: document.getElementById ().value for C#
  3. Hi How can i fill a form on a web page with C# ? Specifically a password field, The field needs to be selected by its ID, not the field name.
  4. looking at your picture, it appears your tables have a right margin, which adds extra invisible width, meaning the container element is not wide enough so the floats are pushed under. it is however hard to tell from the picture. I tested out some floating tables and they work fine. Perhaps you should post your code and a live example.
  5. im sorry about the blog post! im having an issue with wordpress there messing up the code..im going to look at fixing that tomorrow. so you added enctype="multipart/form-data" ?? im also thinking you should check that $_FILES['new_picture']['tmp_name'] is set, just in case no file is being selected: if ( isset ( $_FILES['new_picture'] ) && isset ( $_FILES['new_picture']['tmp_name'] ) ) { could you also maybe past the output of the following code, put this after your check for $_POST['upload'] echo '<pre>'; print_r ( $_FILES ); echo '</pre>';
  6. you need to set the enctype on your form Here is my basic file upload example: http://thewebsolutionprovider.com/php/file-upload-with-php/
  7. change your permalink structure in wordpress to seo friendly urls, perhaps /%category%/%postname%/
  8. Hi, Here is a mysql query: "SELECT * FROM `private_messages` WHERE ( `sender_id` = '$user_id' AND ( `receiver_updated` = '1' || `sender_updated` = '1' ) AND `sender_deleted` = '0' ) || ( `receiver_id` = '$user_id' AND `receiver_deleted` = '0' ) AND `parent_id` = '0'" I want to add an ORDER BY but It needs to evaluate different depending on the fields set. So for example, if the field `sender_updated` = '1' then it needs to order by `sender_updated_datetime` . If `receiver_updated` = '1' then i need to order by `receiver_updated_datetime` Is there a way to put an IF statement on the ORDER BY clause?
  9. Hi I am having trouble getting the value of a hidden field. <input type="hidden" id="test" value="test" /> alert ( $('#test').val() ); the above code alerts NaN ... but if its a visible text element works fine, so how do i actually get the value of the hidden field?
  10. Hi I am trying to have the following as an example: <select name="test[]" multiple="multiple">options here</select> <select name="test[]" multiple="multiple">options here</select> Then using $_POST['test'] to grab the boxes in the array. I want to then loop over each box so for example: $boxes = $_POST['test']; foreach ( $boxes as $box ) // now here i would of expected $box to be an array of the options, } but it's not working like this, all the options from all submitted select boxes come in one array so I cannot distinguish which select box in the array they relate to, is there a way to do this??
  11. Im going to explain this a bit clearer. I have a canvas element on the page. I load up a Tree image using javascript by loading the tree.png file. I place this on the canvas as scenery. After this i have an interval of 100 mil seconds that will load up the bird.png file and place it on the canvas using translate() to move it. Each time this runs I have to clear the canvas and re-draw the new bird position. All well and good. Now the problem, when i clear the canvas obviously the tree vanishes as well. So, i have to again re-draw the tree in the interval with the bird. But by doing so the translate function seems to move the tree as well...as though it applies to every element on the canvas. On the other hand if i move the bird using variables and just drawing it in the new position manually each time the tree just flickers! How can I keep the trees on the scene but allow the bird to move. This can be done without clearing the canvas, but the bird leaves a trail of uncleared images Hope this is clearer !
  12. Hi Here is the updated code. Here you can see the bird is re-drawn by clearing the rectangle, so that it animates the bird moving. The issue i have now is when the bird is cleared it also clears anything else in the scene where the bird currently is. So if you see $.renderScene() draws 3 trees...how can I re-draw the bird without it effecting the trees? Because I have to keep re-drawing the trees as well so it looks like the trees flicker when the bird flies near them...not sure how to stop this so the trees stay on the screen while the bird moves...if i dont clear the canvas the bird will duplicate all over the scene $(document).ready ( function() { // global vars var trees = new Array(); var canvas = null; var bird = null; var birdX = 0; var birdY = 0; var posX = 2; var posY = 4; /* function: renderScene desc: renders the trees and any other objects onto the canvas - clears the canvas first to avoid animation render repeating */ $.renderScene = function() { // draw 3 trees trees[0] = new Image(); trees[1] = new Image(); trees[2] = new Image(); trees[0].onload = function() { canvas.drawImage ( trees[0], 0, 0 ); } trees[1].onload = function() { canvas.drawImage ( trees[1], 700, 10); } trees[2].onload = function() { canvas.drawImage ( trees[2], 350, 100); } trees[0].src = 'tree.png'; trees[1].src = 'tree.png'; trees[2].src = 'tree.png'; } /* function: drawBird desc: draws an animated bird */ $.drawBird = function() { // create bird image object bird = new Image(); // create onload event handler to make sure the bird // image loads - prevents crashing or halting // - this is only called once the bird src is set bird.onload = function() { // clear the canvas canvas.clearRect( birdX - 10, birdY - 10, 90,90 ); // draw the bird on our canvas canvas.drawImage ( bird, birdX, birdY ); if ( birdX + posX > 1024 || birdX + posX < 0 ) { posX = -posX; } if ( birdY + posY > 768 || birdY + posY < 0 ) { posY = -posY; } birdX += posX; birdY += posY; $('#pos').html ( 'X:' + birdX + 'Y:' + birdY ); } // load the actual bird image bird.src = "bird.png"; // Render the trees on top of the bird so the bird goes // behind $.renderScene(); } /* function: init desc: initialise the canvas and interval for bird movement */ $.init = function() { // get reference to the canvas element canvas = $('#canvas')[0].getContext ( '2d' ); // set interval to the drawBird function as 10 milliseconds return setInterval ( $.drawBird, 10 ); } // initialise $.init(); });
  13. Hi Here is the updated code. Here you can see the bird is re-drawn by clearing the rectangle, so that it animates the bird moving. The issue i have now is when the bird is cleared it also clears anything else in the scene where the bird currently is. So if you see $.renderScene() draws 3 trees...how can I re-draw the bird without it effecting the trees? Because I have to keep re-drawing the trees as well so it looks like the bird flickers when it flies near them...not sure how to stop this? $(document).ready ( function() { // global vars var trees = new Array(); var canvas = null; var bird = null; var birdX = 0; var birdY = 0; var posX = 2; var posY = 4; /* function: renderScene desc: renders the trees and any other objects onto the canvas - clears the canvas first to avoid animation render repeating */ $.renderScene = function() { // draw 3 trees trees[0] = new Image(); trees[1] = new Image(); trees[2] = new Image(); trees[0].onload = function() { canvas.drawImage ( trees[0], 0, 0 ); } trees[1].onload = function() { canvas.drawImage ( trees[1], 700, 10); } trees[2].onload = function() { canvas.drawImage ( trees[2], 350, 100); } trees[0].src = 'tree.png'; trees[1].src = 'tree.png'; trees[2].src = 'tree.png'; } /* function: drawBird desc: draws an animated bird */ $.drawBird = function() { // create bird image object bird = new Image(); // create onload event handler to make sure the bird // image loads - prevents crashing or halting // - this is only called once the bird src is set bird.onload = function() { // clear the canvas canvas.clearRect( birdX - 10, birdY - 10, 90,90 ); // draw the bird on our canvas canvas.drawImage ( bird, birdX, birdY ); if ( birdX + posX > 1024 || birdX + posX < 0 ) { posX = -posX; } if ( birdY + posY > 768 || birdY + posY < 0 ) { posY = -posY; } birdX += posX; birdY += posY; $('#pos').html ( 'X:' + birdX + 'Y:' + birdY ); } // load the actual bird image bird.src = "bird.png"; // Render the trees on top of the bird so the bird goes // behind $.renderScene(); } /* function: init desc: initialise the canvas and interval for bird movement */ $.init = function() { // get reference to the canvas element canvas = $('#canvas')[0].getContext ( '2d' ); // set interval to the drawBird function as 10 milliseconds return setInterval ( $.drawBird, 10 ); } // initialise $.init(); });
  14. Hi In the following code i load an image of a bird onto a canvas and make it bounce around. How can i allow this bird object to be clickable so it fires an onclick event? I tried adding bird.onclick = function() inside and outside the onload handler and it does nothing! $(document).ready ( function() { // global vars var canvas = null; var birdX = 0; var birdY = 0; var posX = 2; var posY = 4; /* function: drawBird desc: draws an animated bird */ $.drawBird = function() { // create bird image object var bird = new Image(); // create onload event handler to make sure the bird // image loads - prevents crashing or halting // - this is only called once the bird src is set bird.onload = function() { // clear the canvas // otherwise the bird will get repeated as a trail! canvas.clearRect( 0,0,1024,768 ); // draw the bird on our canvas canvas.drawImage ( bird, birdX, birdY ); if ( birdX + posX > 1024 || birdX + posX < 0 ) { posX = -posX; } if ( birdY + posY > 768 || birdY + posY < 0 ) { posY = -posY; } birdX += posX; birdY += posY; $('#pos').html ( 'X:' + birdX + 'Y:' + birdY ); } // load the actual bird image bird.src = "bird.png"; } /* function: init desc: initialise the canvas and interval for bird movement */ $.init = function() { // get reference to the canvas element canvas = $('#canvas')[0].getContext ( '2d' ); // set interval to the drawBird function as 10 milliseconds return setInterval ( $.drawBird, 10 ); } // initialise $.init(); });
  15. Hi Can anyone see why the drawBird() function is not being called here?? <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready ( function() { // global vars var canvas = null; var birdX = 0; var birdY = 0; /* function: drawBird desc: draws an animated bird */ $.drawBird = function() { alert('bird'); } /* function: init desc: initialise the canvas and interval for bird movement */ $.init = function() { // get reference to the canvas element canvas = $('#canvas')[0].getContext ( '2d' ); // set interval to the drawBird function as 10 milliseconds return setInterval ( 'drawBird', 10 ); } // initialise $.init(); });
×
×
  • 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.