Jump to content

AndyB

Staff Alumni
  • Posts

    5,465
  • Joined

  • Last visited

    Never

Posts posted by AndyB

  1. You can't pull some html code randomly!

     

    The example below would have California 'pre-selected' in the dropdown

     

    <select size="10" name="menu">
    <option selected value="" >Select A State</option>
    <option value="New York">New York</option>
    <option value="California" select='selected'>California</option>
    <option value="Florida">Florida</option>
    <option value="Rhode Island">Rhode Island</option>
    </select>

     

    I did say

     

    ... add select='selected' to the option value that matches the pre-selected state
  2. Let's fix the first one properly:

     

    <?php
    $host="localhost";
    $username="wowdream_domaine";
    $password="PASS";
    $db_name="wowdream_domaine";
    $tbl_name="maintenance";
    
    mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");
    
    $sql="SELECT * FROM $tbl_name";
    $result=mysql_query($sql);
    
    while($rows=mysql_fetch_array($result)){
        if ($rows['check'] == yes) {
            echo "<a href='turnmaintenanceoff.php'>Turn maintenance mode off</a>";
        } else {
            echo "<a href='turnmaintenanceon.php'>Turn maintenance mode on</a>";
        }
    }
    ?>

     

    Note how proper indentation makes it obvious that you were a closing brace short in your code.

  3. I've gone through most of them....

     

    37000 links. Enjoy.

     

    In 11 minutes you can check most of 37,000 links.  At that rate you could have checked more than a quarter million links since you posted.  If I couldn't find what I wanted after checking a quarter of a million links, it's probable that I'd give up and move on.  Wish you luck in your quest.

  4. Hello,

       Can anyone provide me some javascript code or any standard dom toolkit code?

     

    Thanks!

     

    You checked the google listings in the link I gave and none of them were what you wanted?  That's hard to believe.

  5. $res=mysql_query($sql) or die ("Sorry, it did not work!");

     

    Spectacularly unhelpful!

     

    Instead, try:

    $res=mysql_query($sql) or die ("Error: ". mysql_error(). " with query ". $sql);

     

    Ah! Now you know the error that occurred AND you know the querystring where it failed.  Then you can see what the real problem is.

  6. Understand what I mean?

     

    This is not your personal chat line!!

     

    If you want to learn, you need to start by doing something on your own instead of holding out your hands.  Spend time at www.tizag.com then come back and post some code you have created. Ask a relevant, coherent question and you'll probably get an answer.

     

    This thread is getting very close to being locked.

  7. So we're perfectly clear:

     

    <?php 
    if($nume<0) {
        while ($data = mysql_fetch_assoc($query)) {?>
            <tr bgcolor=#EEEEEE>
            <tr style="background-color:#EAEAEA;" onmouseover="this.style.backgroundColor='#0099FF'" onmouseout="this.style.backgroundColor='#EAEAEA'">
            <td><?php echo "{$data["login"]}"?></td>
            <td><?php echo "{$data["fname"]","{$data["lname"]}"?></td>
            <td><?php echo "{$data["hub"]}"?></td>
            </tr>
            <?php
        } ?>
        </table>
        <?php
    }
    ?>

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