Jump to content

ki

Members
  • Posts

    208
  • Joined

  • Last visited

Posts posted by ki

  1. okay im not really good with javascript but im attempting to make a birthday thing setup

     

    function changeRegisterBirthday(e) {
        var bday = document.getElementById('registerBirthdayDay');
        var bmonth = document.getElementById('registerBirthdayMonth');
        var smonth = registerBirthdayMonth.options[registerBirthdayMonth.selectedIndex].value;
    
    if(e == "1") {
      if ((registerBirthdayMonth.options[registerBirthdayMonth.selectedIndex].value == "6") || (smonth == "9") || (smonth == "4") || (smonth == "11")) {
        for (var i=0; i < 30; i++) {
           registerBirthdayDay.options[i] = new Option (i, i);
      }
    }

     

    Thats what I got (the rest of the code is cut off because its doing the same thing as the first option...)

     

    But what my script is attempting to do is get the value of the selected option in the combobox of the months then go by the value of that to get their number then are sorted. What I would like to do is make it so it creates a combo box for the days of the month meaning like june = 6 = 30 so it would come out but im not getting how to do this, i even made a combo box on the page and still doesnt work.... Any ideas? Thanks for any help given.

  2. My code:

     

        <select onChange="checkDest(this, 'trucks');" name="trucks">
    <?
      $getSKATECOMPANYS = mysql_query("SELECT * FROM `skateboard_company`");
      while($getSKATECOMPANY = mysql_fetch_row($getSKATECOMPANYS)) {
        echo "<option value=\"".$getSKATECOMPANY->company."\">".$getSKATECOMPANY->company."</option>";
    }
    ?>
         <option value="-1">Other</option>
        </select>

    isnt working for some reason? anyone have any ideas on what might be the problem?

  3. How would I upload a file to a different server? like say I have like 4 different servers, and i want to upload it to one of them, but first detect if the server memory is full... and then if its clear upload it?

  4. Okay im setting up a user avatar thing for my site kinda like how this one is. How does php react to choices? I use isset(empty(!$_POST['check'])) to check is check box is checked, idk if its the same format or not? Any help?

  5. Okay everything works except my [ code tag ]

     

    it doesnt do the highlight ;/

     

    heres the code:

     

       $search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', '/\[flash\](.*?)\[\/flash\]/is');
    
       $replace = array('<b>$1</b>', '<i>$1</i>', '<font color="$1">$2</font>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', '<table align="center" cellpadding="1" cellspacing="1" width="98%" class="code"><tr><td valign="top">'.highlight_string(stripslashes('$1'), true).'</td></tr></table>', '<br><table align="center" cellpadding="1" cellspacing="1" width="98%" class="quote"><tr><td><b>$1 said...</b></td></tr><tr><td>$2</tr></td></table><br>', '<object width="425" height="350"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>');
    
       $var = preg_replace ($search, $replace, $var);

  6. Can someone tell me whats wrong with this script? The only thing that errors is my code BBCode.

     

    ERROR:

    Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/tragical/public_html/index.php on line 54

     

    CODE:

      function bbcode_format($var) {
       $var = str_replace('<','<',$var);
       $var = str_replace('>','>',$var);
       $search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', '/\[flash\](.*?)\[\/flash\]/is');
    
       $replace = array('<b>$1</b>', '<i>$1</i>', '<font color="$1">$2</font>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', '<table align="center" cellpadding="1" cellspacing="1" width="98%" class="code"><tr><td valign="top" width="12" class="code_Side"><img src="images/code.png"></td><td valign="top">'.highlight_string($1).'</td></tr></table>', '<br><table align="center" cellpadding="1" cellspacing="1" width="98%" class="quote"><tr><td><b>$1 said...</b></td></tr><tr><td>$2</tr></td></table><br>', '<object width="425" height="350"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>');
    
       $var = preg_replace ($search, $replace, $var);
       return $var;
      }

  7. SAMPLE:

    if ($_SESSION['logged_in'] == 0) { include("login.php.inc"); } else {
    $forum_id = $_GET['forum']; }
    

     

    LOGIN.PHP.INC

    <? ob_start();
    require_once('config.php'); 
    session_start();
    
    if(isset($_POST['submit'])) {
    mysql_crap_here
    
    
    $_SESSION['logged_in'] = 1;
    $_SESSION['username'] = $_POST['username']; 
    $_SESSION['password'] = $_POST['password']; 
    session_write_close();
    } else {
    echo "INPUT HERE";
    }
    ?>

  8. Thanks, also, its for a forum I used like

    if (!$_SESSION[logg] == 0) or something { include(file.login) } else { display forum crap } but when i post it it goes to a blank screen, buit it set the variables i needed to logon but i need it to display the other page contents? any suggestions?

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