Jump to content

BillyBoB

Members
  • Posts

    630
  • Joined

  • Last visited

    Never

Posts posted by BillyBoB

  1. I figured it out after leaving it and coming back to it in a couple days... and I'm glad to say that cssfreakie was completely wrong. Also just for you to know I didn't post it on more help forums to get my solution either. I actually have skills when it comes to building sites... I wanted not only to change the links when they are hovered to red but to change the current page link back to black. I wanted to change the .cur class to black when the other links are hovered.

     

    So instead of changing #navigation a:hover div I created a new style #insidenav:hover .cur { color: #686868; } Fixed it right up to what I wanted. AKA: when I hover any links in insidenav the .cur changes color.

     

    Thanks for doubting me though.

  2. Thanks for the help but you're the rude one assuming anyone that comes here has a simple problem and that they know nothing. If you don't have the answer don't reply it was obvious that you didn't have a clue of what you were talking about because your answer was completely off. I told you that the second post as clearly and politely as possible.

     

    Also I'm glad you know how little time I've spent trying to fix the problem. I came here to get an answer to a complex problem way over your head and you give me a simple, incorrect answer and then call me stupid.

  3. I have firebug... I'm glad you know what your talking about I'll change that line to the default color and you can go see what happens.... Thanks for trying but you can stop trying to act like you know everything.

     

    Check the page again now none of the links highlight. thats not what I'm trying for I'm trying to change the one div with the class name to color: #686868 when any of the other links in the nav are highlighted.

  4. That would change all of them to a different color when scrolled over.

     

    I want this:

    Home Services About etc. etc.

     

    then you scroll over About:

    Home Services About etc. etc.

     

    You see? right when you first view the page the Services is highlighted because your on one of the pages of that dropdown. but I only want one link red at a time so if you scroll over another link then the link with class name 'cur' needs to be changed to the default color.

  5. Correct me if I'm wrong but wouldn't it work if you just opened the directories in a loop like:

     

    <?php 
    function getRandomFromArray($ar) { 
        mt_srand( (double)microtime() * 1000000 ); 
        $num = array_rand($ar); 
        return $ar[$num]; 
    } 
    
    function getImagesFromDir($path) { 
        $images = array(); 
        while ( $img_dir = @opendir($path) ) { 
            while ( false !== ($img_file = readdir($img_dir)) ) { 
                // checks for gif, jpg, png 
                if ( preg_match("/(\.gif|\.jpg|\.png)$/", $img_file) ) { 
                    $images[] = $img_file; 
                } 
            } 
            closedir($img_dir); 
        } 
        return $images; 
    } 
    
    $root = ''; 
    // If images not in sub directory of current directory specify root  
    //$root = $_SERVER['DOCUMENT_ROOT']; 
    
    $path = 'gallery/topic1/';
    
    // Obtain list of images from directory  
    $imgList = getImagesFromDir($root . $path); 
    
    $img = getRandomFromArray($imgList); 
    
    ?>
    <center><a href="?GoTo=Photo Gallery"><img src="<?php echo $path . $img ?>" alt="" height="267" width="400"/></a></center>
    

  6. ok after looking it over try:

    echo "Select a name: <select name='$name'>";
    $query="select * from PLAYERS";
    $result=mysql_query($query);
    while($row=mysql_fetch_array($result)){
    $name=$row['PLAYER_NAME'];
    echo "<option value='$name'>$name</option>";
    }
    echo "</select>";
    

  7. Other than the name of the select isn't going to be established since $name is further down from line 1 the code is fine. In that small section of code I can't see if you're connecting to a db before it or what tables are listed in the db. I can't help you any further.

  8. lol is your syntax wrong? Just a lil try:

     

    $xml = '<?xml version="1.0" encoding="utf-8"?>' .
           '<LeadImportDatagram>'.
               '<CompanyKey>' . $companyKey . '</CompanyKey>' .
               '<NotificationEmailTo>garysaldutti@gmail.com</NotificationEmailTo>' .
               '<LeadInfo>'.
               '<City>Osweeego</City>'.
              '</LeadInfo>' .
            '</LeadImportDatagram>';
    

  9. After some testing I have come up with a pretty basic way of doing it. The only reason i didn't do it completely with substr is: the day could be entered without the starting zero.

    It does a check for that with strlen and fixes that problem.

    <?php
    $months = array("Jan" => '01', "Feb" => '02', "Mar" => '03', "Apr" => '04', "May" => '05', "Jun" => '06', "Jul" => '07', "Aug" => '08', "Sep" => '09', "Oct" => '10', "Nov" => '11', "Dec" => '12');
    $date = "Jul 4, 2010";
    $year = substr($date, -4);
    $month = substr($date, 0, 3);
    preg_match("/ (\d{1,2}),/", $date, $matches);
    $day = $matches[1];
    if(strlen($day)==1) $day = "0".$day;
    $date = $year.'-'.$months[$month].'-'.$day;
    echo $date;
    ?>
    

     

    Good luck with the rest of your code.

  10. Just change the output from the db to just a variable not an array

     

        $query = mysql_query("SELECT * FROM auto WHERE PolNum = '$PolNum' AND Agency = '$agency' ORDER BY ID DESC LIMIT 1") or die(mysql_error());
      $clientinfo = mysql_fetch_array($query);
      print_r($clientinfo);
    
    echo $clientinfo['Company'];
    echo $clientinfo[7];
    $company = $clientinfo['Company'];
    echo $company;
    

  11. Well you have one error that I can see directly:

    <?php
    ini_set('display_errors',1);
    error_reporting(E_ALL);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="robots" content="noindex" />
    
    <title>Guest Information</title>
    </head>
    
    <body>
    <?php
    $username = "******";
    $password = "******";
    $host = "******.ipowermysql.com";
    $database = "guest_info"
    $rose_connect = mysql_connect($******.ipowermysql.com,$name,$password); or die ('I dunno...' .mysql_error());
    mysql_select_db ($rose_guest_list,$rose_connect) or die('Unable to select DB.');
    
    //build query
    $query = mysql_query ('SELECT * FROM guest_info') or die('Idunno 2...' .mysql_error());
    
    //display results
    while ($row = mysql_fetch_array($query)) 
    { echo   '<br/> Cruise: '.$row['Cruise'].
          '<br/> Date: '.$row['Date'].
          '<br/> Adults: '.$row['No_Adults'].
          '<br/> Kids: '.$row['No_Kids'].
          '<br/> Name: '.$row['Name'].
          '<br/> Email: '.$row['Email'].
          '<br/> Phone: '.$row['Phone'].
          '<br/> Staying: '.$row['Staying'].
          '<br/> Payment: '.$row['Payment'].
          '<br/> Info: '.$row['info'].
          '<br/>';}// you were missing the ' after <br/>
    
    ?>
    </body>
    </html>
    

     

    Good luck

  12. are you putting the error reporting in front of the html code like:

     

    <?php
    ini_set('display_errors',1);
    error_reporting(E_ALL);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="robots" content="noindex" />
    
    <title>Guest Information</title>
    </head>
    
    <body>
    <?php
    // make connection
    mysql_connect ("******.ipowermysql.com", "******", "******") or die ('I dunno...' .mysql_error());
    mysql_select_db ("rose_guest_list");
    
    //build query
    $query = mysql_query ("SELECT * FROM guest_info");
    
    //display results
    while ($row = mysql_fetch_array($query)) 
    { echo   "<br/> Cruise: ".$row['Cruise'].
          "<br/> Date: ".$row['Date'].
          "<br/> Adults: ".$row['No_Adults'].
          "<br/> Kids: ".$row['No_Kids'].
          "<br/> Name: ".$row['Name'].
          "<br/> Email: ".$row['Email'].
          "<br/> Phone: ".$row['Phone'].
          "<br/> Staying: ".$row['Staying'].
          "<br/> Payment: ".$row['Payment'].
          "<br/> Info: ".$row['info'].
          "<br/>";}
    
    ?>
    </body>
    </html>
    

  13. when reading this the only thing i though of was returning the value from the function.

     

    <?php
    
    $returnVal = myfunction1(); //collect data here
    
      $rowCheck = mysql_num_rows($returnVal);
      print $rowCheck;
    while ($row = mysql_fetch_assoc($returnVal)){
    
    echo is_array($row) ? 'Array<br>' : 'not an Array<br>';
    print_r($row);
    
      foreach ($row as $col=>$val){
        //  if ($col == 'name') {
        print " $val, \n";
         // }
       } // end foreach
    
        foreach ($row as$val){
              print " $val, \n";
            } // end foreach
       }// end while
    
    
    function myfunction1() {
        global $gNames;
    
        $db = mysql_connect("blahblahblah", "myname", "mypass") or die ("Error connecting to database.");
    mysql_select_db("databasename", $db) or die ("Couldn't select the database.");
    $result = mysql_query("SELECT * FROM characters WHERE whoschar='1'",$db);   // modified to only show for user 1
    $gNames = $result;
    $rowCheck = mysql_num_rows($result);
    
    if($rowCheck > 0){
        echo 'You do have characters, they should be listed here..<br>';
    
        while ($row = mysql_fetch_assoc($result)){
    
          echo is_array($row) ? 'Array<br>' : 'not an Array<br>';  //debugging
          print_r($row);  //debugging
          echo "<br>";
    
         foreach ($row as $col=>$val){
               if ($col == 'name') {
             print " $val, \n";
               }
          } // end foreach
    
       }// end while
    print "<br><br>";
    
    }
      else {
    
      echo 'You have no characters.  You should create one.';
    
      }
    
      return $gNames; // return value here
      } /////////////////////////////// end function
    
    ?>
    

     

    Good luck and have fun

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