Jump to content

rawb

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Posts posted by rawb

  1. Nothing jumps out at me, but it would be helpful to the debugging process if you would echo that query back before you insert it into the database so you can ensure that your query is what you intended.

     

    i.e.

    $sql="INSERT INTO articles (id, date, artist, title, label, short_text, long_text, thumbnail, image, tracklisting, vendor_1, vendor_1_url, vendor_2, vendor_2_url, vendor_3, vendor_3_url )
    VALUES
    ('$_POST[id]','$_POST[date]','$_POST[artist]','$_POST[title]','$_POST[label]','$_POST[intro_text]','$_POST[long_text]','$_POST[thumb]','$_POST[image]','$_POST[tracklisting]',
    '$_POST[vendor1]','$_POST[vendor1Url]','$_POST[vendor2]','$_POST[vendor2Url]','$_POST[vendor3]','$_POST[vendor3Url]')";
    
    echo $sql . "<br />";
    

  2. My problem is that three input boxes on my form, each of which have { width: 33% }, are displayed on different lines.. up to 666px (scarily enough).  When the width is 667px, all three fit on the same line (which is what I want, but at any width)..

     

    The file is here (simplified, obviously):

    http://rawbwk.com/test.html

     

    The CSS:

    * {
      padding: 0;
      border: 0;
      margin: 0;
    }
    
    #container {
      width: 666px;
      margin: auto;
      border: 1px solid black;
    }
    
    #t1 {
      width: 100%;
    }
    
    .t2 {
      width: 100%;
    }
    
    .t2 input {
      width: 33%;
      background-color: red;
    }

     

     

    The HTML:

    <div id="container">
    
      <div id="t1">Test
    
      <div class="t2">
    
        <input name="test1"></input>
        <input name="test2"></input>
        <input name="test3"></input>
    
        </div>
    
    </div>
    </div>

     

    Thanks in advance...

  3. I've got a simple problem really.. I've got a background image that is centered and repeates vertically across the page as a property of my page's <body>, and then I've got a div that will contain my content and is centered (using margin: auto).

     

    In IE it works exactly as intended.  My problem is that in Firefox, the container div is one px to the left of the center of the background.  So either the { background: center } renders 1px to the right in FF relative to IE, or the { margin: auto } renders 1px to the left in FF relative to IE.

     

    the css

    * {
      margin: 0;
    padding: 0;
    border: 0;
    }
    
    body {
      background-color: #b0b7bb;
    background-image: url("../img/bg.gif");
    background-position: center;
    background-repeat: repeat-y;
    }
    
    #container {
      background-color: red;
    margin: auto;
    width: 885px;
    }

     

    the html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>test</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="css/style.css" rel="stylesheet" type="text/css" /> 
    </head>
    <body>
    <div id="container">
    test
    </div>
    </body>
    </html>

     

    the product (it's very hard to see the problem unless you zoom in because it's just a 1px difference.. but it's there and an annoyance):

    http://rawbwk.com/test/

  4. This is probably really dumb and easy but here goes.

     

    Basically, I have a bunch of floated divs inside of a container div.  In IE it looks fine, but in firefox the container div doesn't stretch to contain the floated divs.. it simply appears as though there is no content in it.

     

    For a visual, check this link in both browsers: http://www.rawbk.com/tournament/displaytourney.php?id=12 .

     

    Could anyone possibly explain why mozilla does this and how I can fix it?

  5. I just wanted to get some advice from you experts before I embarked on a little project.. I'm trying to make an application that will manage a series of 1v1 tournaments for a video game (any of you ever played TFC?).

     

    Anyways, the best way I could think of doing it was creating the following tables.. I'm a little new at this whole relational database thing so don't laugh if this is amateur..

     

    users

    id, name, etc.

     

    tournies

    id, date, etc.

     

    teams[tourneyID]

    userId, seed, etc.

     

    matches[tourneyID]

    id, winnerId, loserId, winnerScore, loserScore, etc.

     

    As you can see, I would need two arrays of tables (one for teams and one for matches).. one table of each for each corresponding tourney.

     

    I realize that I could just put another field in each of these tables to correspond to the tourneyID but that just doesn't seem like a great solution to me.  Also, I could just name the tables teams1, teams2, etc. and matches1, matches2, etc. and that would probably work just fine.. but I was wondering if there is a better/more accepted way to do this in mysql?  I hope I explained that so it makes sense.  Any advice before I begin?

  6. [!--quoteo(post=387318:date=Jun 23 2006, 06:56 PM:name=nogray)--][div class=\'quotetop\']QUOTE(nogray @ Jun 23 2006, 06:56 PM) [snapback]387318[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    The error happens because you are calling the script in the setTimeout instead of using a string type.

    All you need is to change your setTimeout like this
    [code]
    setTimeout("changediv(imagearray, textarray, "+i+")", 2000);
    [/code]
    [/quote]


    Works like a charm. Thanks a million man, I really appreciate it.
  7. Hello! I have a script written to change the information in a div every few seconds (via innerhtml), but for some reason it keeps giving me a "Stack overflow at line: 33" error. I really don't know what this means and could use some help.. if anyone could tell me what is wrong here I would appreciate it a lot. It's probably something really dumb and simple but I just need a fresh pair of eyes to look it over. Thanks in advance!

    Oh.. the onClick buttons work like a charm, so there's nothing wrong with the 'tick' function.. I think...

    [code]
    <script>

    //create two parallel arrays
    imagearray = new Array(3);
    textarray = new Array(3);

    imagearray[0] = "corporate.gif";
    imagearray[1] = "hosting.gif";
    imagearray[2] = "community.gif";

    textarray[0] = "corp";
    textarray[1] = "host";
    textarray[2] = "commute?";



    function tick(newimage, newtext, div) {
    //takes three string arguments, div being a reference to the div to be changed

    var replacement = "image: " + newimage + "<br>text: " + newtext + "<br>";

    document.getElementById(div).innerHTML = replacement;

    }



    function changediv(imagearray, textarray, i) {
    //takes two array arguments and one number (the number in the parallel arrays on which to begin)


    //change the image!
    tick(imagearray[i], textarray[i], 'change');

    //calculate the next number in the array, or start over...
    i++;
    if (i >= imagearray.length) {
      i = 0;
    }

    // call this function again with a new number after so many seconds...
    setTimeout(changediv(imagearray, textarray, i), 2000);

    }

    </SCRIPT>

    <body onLoad="changediv(imagearray, textarray, 2);">

    <a href=# onclick="tick(imagearray[1], textarray[1], 'change'); return false;">test</a>
    <a href=# onclick="tick(imagearray[2], textarray[2], 'change'); return false;">test2</a>

    <div id="change">


    image: none<br>
    text: none<br>


    </div>
    [/code]

    By the way, these are lines 32 and 33 (it says the 'stack overflow' error is on 33).

    [code]
    //change the image!
    tick(imagearray[i], textarray[i], 'change');
    [/code]
  8. [!--quoteo(post=356814:date=Mar 20 2006, 09:29 PM:name=ReVeR)--][div class=\'quotetop\']QUOTE(ReVeR @ Mar 20 2006, 09:29 PM) [snapback]356814[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    Hello.
    I need to make an inpute box that can select files on the server.How can that be done?
    Thx
    [/quote]

    If you mean you want to list out the files in the server's directory so that the user can select one:

    You can use PHP to get an array of the files on the server, and then use a loop to echo them back out...
    ( EXAMPLE: [a href=\"http://www.phpfreaks.com/phpref/90.php\" target=\"_blank\"]http://www.phpfreaks.com/phpref/90.php[/a] )

    I don't know of any HTML that would be able to do this, you need a script to read the contents of a directory.. perhaps I'm wrong though - wouldn't be the first time.

    If you mean that you want the user to be able to select a file on his/her PC:

    <input type=file> is the HTML. Again, you really need PHP or another scripting language to be able to do anything but allow the user to browse his/her own computer..

    ( TUTORIAL: [a href=\"http://www.phpfreaks.com/tutorials/36/0.php\" target=\"_blank\"]http://www.phpfreaks.com/tutorials/36/0.php[/a] )
    ( TUTORIAL: [a href=\"http://www.tipsntutorials.com/tutorials/PHP/67\" target=\"_blank\"]http://www.tipsntutorials.com/tutorials/PHP/67[/a] )


    I know it's not a great reply or a good answer, but I hope it helps point you in the right direction a bit. Good luck!
  9. [!--quoteo(post=352021:date=Mar 6 2006, 04:46 AM:name=Genzoshen)--][div class=\'quotetop\']QUOTE(Genzoshen @ Mar 6 2006, 04:46 AM) [snapback]352021[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    I would like to make something like this:

    [a href=\"http://www.aerogaming.net\" target=\"_blank\"]aerogaming.net[/a]

    wherin, the website has only one page to display, but when you click on a link it has an "?action=" and goes to the specific page. Sorry I could not explain it better, but I hope you guys get the point. Thanks in advance!
    [/quote]


    This is done with a switch statement..

    This following tutorial made a news update on phpfreaks and looks like it covers exactly what you want to know..

    [a href=\"http://phpmac.com/articles.php?view=241\" target=\"_blank\"]http://phpmac.com/articles.php?view=241[/a]

    Good luck!
  10. Feel free to copy/paste.

    function trimString($str, $newlength) {
    if (strlen($str) > $newlength) {
    $newlengthwithdots = $newlength - 3;
    $newstring = substr($str, 0, $newlengthwithdots);
    $newstring .= "...";
    } else {
    $newstring = $str;
    }
    return $newstring;
    }

    *edit*
    Sorry if the indent is confusing, I'm not sure how to indent on these forums.
×
×
  • 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.