Jump to content

Ell20

Members
  • Posts

    337
  • Joined

  • Last visited

    Never

Posts posted by Ell20

  1. Thanks for your answer but I dont want to close the popup on the user.

     

    I want them to click the link, then the pop up displays.

     

    Then if they close the popup within 3 seconds then allow it, but display a message saying "Vote not counted you need to vote before closing the window"

     

    Thanks

  2. Hi,

     

    I have been dabbling in PHP/MySQL for a month or two now so I know a little bit about it.

    However I have come across something which I am unsure how to do so I was hoping you guys/girls could help me.

     

    I am helping a friend run a MMORPG (Online Game) and basically we want our users to vote for our site on gamer websites so that we become more popular. Now we have added ourselves to these voting site we are given a direct link to give to our users to vote.

     

    Now I need to:

    1) Count the vote when they vote and add it into the database.

    2) If they dont vote and they just close the pop up then dont count their vote.

     

    I am very unsure on whether number 2 is possible, if its not, would it possible to have a timer, so if they close the window within 3 seconds then they dont get their voted counted?

     

    Appreciate any help with this

     

    Elliot

  3. Hi,

     

    I have the code below, which used to work fine, however I have just changed hosts and now I am getting 2 errors:

     

    <?php
    if (isset($_SESSION['admin'])) {
    
    header ("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "index.php");
    ob_end_clean();
    exit();
    
    } else {
    /* If user is logged in  */
    $_SESSION = array();
    session_destroy();
    setcookie (session_name(), '', time()-300, '/', '', 0);
    }
    ?>
    

     

    Errors:

    Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in /home/prioryfi/public_html/logout.php on line 11

     

    Warning: Cannot modify header information - headers already sent by (output started at /home/prioryfi/public_html/logout.php:11) in /home/prioryfi/public_html/logout.php on line 12

     

    Appreciate any help

  4. I just want to upload the video file to the server but I want to check the file type before I allow it to be uploaded?

     

    It dosent matter want I want to use the video for after its uploaded I just want it to be uploaded but obviously I dont want people uploaded .pdf files etc so I believe there is a php command where you can do something like this:

     

    ($_FILES['moviefile']['type'] == "video/wmv")

     

    But I wanted a list of all the possible types if possible

     

    Cheers

  5. Hi,

     

    Im in the process of creating a video upload script however I wondered if anyone could point me in the direction of a list of the video upload types. By this I mean like for images you have: image/jpeg, image/gif etc. What are the video equivalents?

     

    Thanks for your help

  6. Hi,

     

    I keep getting the following message when I attempt to use CURL:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/streety/public_html/grabbers/grabbers/msnm/msn_contact_grab.class.php on line 372

     

    Can anyone assist?

     

    Thanks

  7. Hey

     

    I have the following code on a drop down box so show a popup warning if the bottom option is selected. It works fine in Mozilla but in IE it dosent appear to do anything at all:

     

    <select name="acctype">
    	  <option selected="selected" disabled="disabled" value="">Select Account Type</option>
    	  <option value="day">1 Day Account (<?=$interest?>%)</option>
    	  <option value="week" onClick="return confirm('Putting your money in a 1 week account means you cannot withdraw\n any cash until the week has passed.\nAre you sure you want to do this?');">1 Week Account (<?=$newinterest?>%)</option>
    	  </select>
    

     

    Thanks for help with this.

  8. Hey,

     

    Thanks for the code, it still works for the first click, in which it turns red.

    However if the cell is already red and you click again it dosent appear to do anything?

     

    Thanks for your help

  9. Thanks for your very helpful response haku.

    If you cant contribute anything useful, dont contribute at all.

     

    I thought it would be a simple case of just adding some kind of if to say if the cell is red turn it white.

     

    Can anyone help with this?

  10. Hi,

     

    Thanks for the reply, it may work, but I am trying to incorporate the additional part in to what I already have as that is working seemlessly.

     

    Is there anyway to add to the script that I already have in place?

     

    Cheers

  11. Hi,

     

    Thanks for the code but it dosent appear to do anything when you click on a already selected (red) cell.

     

    Edit: Just realised that it seems to be making every other cell white. Its suppose to make them red to start with, if the cell is already red and its clicked on again its suppose to go white.

     

    Cheers

  12. Hi,

     

    Thanks for the help, I am not really familiar with Javascript and only no very little.

     

    I wanted to be able to incorporate it into the current javascript I have, here is the full code:

     

    var nums = 1;
    var highlightbehavior="TD"
    
    var ns6=document.getElementById&&!document.all
    var ie=document.all
    
    function changeto(e,pickId){
    
    	source=ie? event.srcElement : e.target
    
    	if (source.tagName=="TABLE"){
    
    		return;
    
    	}
    
    	while(source.tagName!=highlightbehavior && source.tagName!="HTML"){
    
    		source=ns6? source.parentNode : source.parentElement
    
    	}
    
    	if (source.id!="ignore"){
    
    		if(nums <= 10 && (document.getElementById('num' + pickId).style.backgroundColor != 'red') && (document.getElementById('previouslySelected').value == 0)){
    
    			document.getElementById('value' + nums).value=pickId;
    			document.getElementById('num' + pickId).style.backgroundColor='red';
    
    			nums++;
    
    		}
    	}
    
    }
    

  13. Hi,

     

    I have a script which has the following code:

    if(nums <= 10 && (document.getElementById('num' + pickId).style.backgroundColor != 'red') && (document.getElementById('previouslySelected').value == 0)){
    
    			document.getElementById('value' + nums).value=pickId;
    			document.getElementById('num' + pickId).style.backgroundColor='red';
    
    			nums++;
    
    		}

     

     

    The above script basically changes the background colour of the TD cell to red when clicked.

    I wanted to add some code so that if the cell had already been clicked it turned it back to white.

    Here is my attempt, however it dosent appear to do anything, can anyone direct me as to where I am going wrong?

     

     

    if(document.getElementById('num' + pickId).style.backgroundColor == 'red'){
    
    			document.getElementById('value' + nums).value='';
    			document.getElementById('num' + pickId).style.backgroundColor='white';
    
    			nums--;
    
    }
    

     

    Thanks for any help

  14. Hi,

     

    I have a script which has the following code:

     

    if(nums <= 10 && (document.getElementById('num' + pickId).style.backgroundColor != 'red') && (document.getElementById('previouslySelected').value == 0)){
    
    			document.getElementById('value' + nums).value=pickId;
    			document.getElementById('num' + pickId).style.backgroundColor='red';
    
    			nums++;
    
    		}

     

    The above script basically changes the background colour of the TD cell to red when clicked.

    I wanted to add some code so that if the cell had already been clicked it turned it back to white.

    Here is my attempt, however it dosent appear to do anything, can anyone direct me as to where I am going wrong?

     

    if(document.getElementById('num' + pickId).style.backgroundColor == 'red'){
    
    			document.getElementById('value' + nums).value='';
    			document.getElementById('num' + pickId).style.backgroundColor='white';
    
    			nums--;
    
    }

     

    Thanks for any help

×
×
  • 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.