Jump to content

yukafluck

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Posts posted by yukafluck

  1. I have a small form on one of my pages that then calls the page again with a variable.

     

    I have the link set up that when it goes to the page it starts off with:

    vehicles_list.php?yearnarrow=_%

    [code=php:0]

    this way it starts showing all of the vehicles listed, but when it runs, I have it show the year that has been selected, but when it starts it shows the %.

     

    How can I do it so that it shows as "All" instead of the %?

     

    here is the code that I am working with:

     

    [code=php:0]

    <form name="Year" id="Year">

    <select name="YearMenu" onchange="MM_jumpMenu('parent',this,0)">

    <option selected="selected"><?php echo $yearnarrow?></option>

       

            <?php

      include_once "_functions/db_info.php";

      //connect to database

    $dbserver = mysql_connect($hostname, $dbuser, $dbpswd);

    $connection = $dbserver or die ('I cannot connect to the server');

    mysql_select_db ($dbname) or die ('I cannot connect to the database');

      $sqlGetVehicleYear="SELECT COUNT(*) num, vehicle_year  FROM vehicles GROUP BY vehicle_year DESC; ";

      $sqlGetVehicleYearRes = mysql_query($sqlGetVehicleYear,$connection) or die ("could not connect to  sqlGetVehicleYear ");

    While ($row = mysql_fetch_array($sqlGetVehicleYearRes))

    {

    $vehicle_year=$row["vehicle_year"]; 

      ?>

                 

                <option value="vehicles_list.php?makenarrow=%&typenarrow=%&yearnarrow=<?php echo $vehicle_year ?>"><?php echo $vehicle_year ?>  (<?php echo $row['num']; ?>)</option>

     

          <?php }?>

      </select>

        </form>

  2. I have a piece of code that generates a jump to menu, using a group by query.  What I would like to do is be able to have it shows the number of records for each options.

     

    right now the option for 2009 would show "2009", I would like it to show: "2009 (3)".

     

    Here is the code that I have:

    <form name="Year" id="Year">

    <select name="YearMenu" onchange="MM_jumpMenu('parent',this,0)">

      <option selected="selected">Choose</option>

       

            <?php

      include_once "_functions/db_info.php";

      //connect to database

    $dbserver = mysql_connect($hostname, $dbuser, $dbpswd);

    $connection = $dbserver or die ('I cannot connect to the server');

    mysql_select_db ($dbname) or die ('I cannot connect to the database');

      $sqlGetVehicleYear="SELECT *  FROM vehicles GROUP BY vehicle_year DESC; ";

      $sqlGetVehicleYearRes = mysql_query($sqlGetVehicleYear,$connection) or die ("could not connect to  sqlGetVehicleYear ");

    While ($row = mysql_fetch_array($sqlGetVehicleYearRes))

    {

    $vehicle_year=$row["vehicle_year"]; 

      ?>

                 

                <option value="vehicles_list.php?makenarrow=%&yearnarrow=<?php echo $vehicle_year ?>"><?php echo $vehicle_year ?></option>

     

          <?php }?>

      </select>

        </form>

    [code=php:0]

     

    Any help would be greatly appreciated

     

  3. Maybe i should have put this into two posts, let me deal with the first, then I will post a second one for the other issue.

     

    I have in my code

    <?php echo $bday; ?> [code=php:0]

     

    And the output on the page comes as :1968-01-02

     

    but I want it to come out as: January 2, 1968.

  4. Ok I have two things that I want to do:

     

    1.  I have a field in my database that is a birthdate.  It gets displayed as yyyy-mm-dd, and I want to change it to ie*january 1, 2009.  How can this be done.

     

    2.  I want to be able to have that date match today's date without the year coming into effect.

     

    any help or direction to a tutorial on this would be greatly appreciated.

  5. I have a form on one page and when the visitor hits submit, it goes to a sendmail.php, only problem is that it send two emails, one with all the variables, and one with the variables empty, any help would be awesome

     

    <?php 
        
    
    $cus_email = $_POST['cus_email'] ;
      	$lead_message = $_POST['lead_message'] ;
      	$home_number = $_POST['home_number'] ;
      	$cus_name = $_POST['cus_name'];
      	$cell_number = $_POST['cell_number'];
      	$cus_name = $_POST['cus_name'];
      	$date = $_POST['date'];
    $info_type = $_POST['info_type'];
    
    
    
    
    
      
      print "Congratulations your email has been sent ";
      // Include the Mail and Mime_Mail Packages
    include('Mail.php');
    include('Mail/mime.php');
    // Recipient Name and E-mail Address
    $name = $first_name;
    $recipient = "sam@mysite.com";
    // Sender Address
    $from = $cus_email;
    // Message Subject
    $subject = " $cus_name would like more information about financing a $info_type";
    // E-mail Body
    $html = <<<html
    <html><body>
    <h3>Important Email Lead for You!</h3>
    <p>
    Hello<br />
    <p>
    On $date, $cus_name looked at your finance page and is trying to get financed for a $info_type
    <p>Their Home Number is: $home_number</p>
    <p>Their Cell Number is: $cell_number</p>
    <p>Their email is: $cus_email</p>
    </p>
    <p>Additional comments.</p>
    <p>$lead_message</p>
    <p>
    <p>They want to talk with you.</p>
    <p>
    Call them now!!! Jackass!!!
    html;
    // Identify the Relevant Mail Headers
    $headers['From'] = $from;
    $headers['Subject'] = $subject;
    // Instantiate Mail_mime Class
    $mimemail = new Mail_mime();
    // Set HTML Message
    $mimemail->setHTMLBody($html);
    // Build Message
    $message = $mimemail->get();
    // Prepare the Headers
    $mailheaders = $mimemail->headers($headers);
    // Create New Instance of Mail Class
    $email =& Mail::factory('mail');
    // Send the E-mail Already!
    $email->send($recipient, $mailheaders, $message) or die("Can't send
    message!");
      
      
    ?>

     

     

  6. Complete Newbie.

     

    Have a table with a field called viewed for a used car site that I have (I'm one of the salesman).

     

    trying to get it so that when someone either clicks on a link to go to a page on my site or visits a page on my site, that it updates the field by one.

     

    Not sure how to do it or where to start.

     

    I have have a page that lists all the vehicles (vehicles_list.php) and then one that shows the details for the vehicle (vehicle_details.php).

     

    any help would be appreciated or direction to a thread that already shows the answer.

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