Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by sasa

  1. change this part of code

    <?php
    if(isset($_POST['godate'])){
    $today=$_POST['today'];
    $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC";
    $result=mysql_query($query);
    while($row=mysql_fetch_array($result)){
    $tcl=$row['tcl'];
    $today=$row['today'];
    ?>
    <input type="hidden" name="tcl" value="<?php echo $tcl;?>">
    <input type=submit name="tcl" value="<?php echo $tcl; ?>">
    <?php } }
    ?>

    with

    <?php
    if(isset($_POST['godate'])){
    $today=$_POST['today'];
    $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC";
    $result=mysql_query($query);
    echo '<form method="POST"><input type="hidden" name="today" value="', $today, '">';
    while($row=mysql_fetch_array($result)){
    $tcl=$row['tcl'];
    $today=$row['today'];
    ?>
    
    <input type="submit" name="tcl" value="<?php echo $tcl; ?>">
    
    <?php } }
    ?>
    </form>

  2. ttry

    <?php
    $test = '/holdcroft-renault-hanley/used-cars/2/4/price-asc/';
    $a = perm($test);
    print_r($a);
    
    function perm($a){
        $out = array();
        $a = explode('/', trim($a, '/'));
        $a1 = $a;
        if ($a[0] ){
            while (count($a)){
                $out[] = '/'. implode('/', $a).'/';
                array_pop($a);
            }
            array_shift($a1);
            $c = perm(implode('/', $a1));
            $out = array_merge($out, $c);
        }
        return $out;
    }
    ?>

  3. try

    <?php
    // Print out result
    while($row = mysql_fetch_array($result)){
    echo "There are ". $row['COUNT(biddersId)'] ." bidders logged.";
    echo "<br />";
    }
    
    
    
    $query = "SELECT * FROM bidders ORDER BY biddersId"; 
    
    $result = mysql_query($query) or die(mysql_error());
    
    echo "<table border='1'>";
    echo "<tr>",  str_repeat("<td>Bidders</td>",3), "</tr>\n";
    // keeps getting the next row until there are no more to get
    $i=0;
    while($row = mysql_fetch_array( $result )) {
            if ($i == 0) echo "<tr>";
            $i++;
    // Print out the contents of each row into a table
    echo "<td>"; 
            echo"<font face= \"calibri\" size=\"3\">";
    echo $row['biddersId'];
    echo "</font>";
            echo "</td>";
            if ($i == 3){
                echo "</tr>\n";
                $i=0;
            }
    
    } 
    if ($i>0){
        while ($i++ <3) echo '<td> </td>';
        echo "</tr>\n";
    }
    echo "</table>";
    
    ?>

  4. <?php	
    
    //let's start our session, so we have access to stored data
    session_start();	
    
    include 'db.inc.php';
    
    $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or 
        die ('Unable to connect. Check your connection parameters.');
    mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db));
    
    //let's create the query
    $query = 'INSERT INTO subscriptions (name, email_address, membership_type, terms_and_conditions,
    			name_on_card,
    			credit_card_number, credit_card_expiration_data)
    		VALUES (
    			"' . $_SESSION[$name] . '",
    			' . $_SESSION[$email_address] . '",
    			' . $_SESSION[$membership_type] . '",
    			' . $_SESSION[$terms_and_conditions] . '",
    			' . $_POST[$name_on_card] . '",
    			' . $_POST[$credit_card_number] . '",
    			' . $_POST[$credit_card_expiration] . ')';
    
    if (isset($query)) {
            $result = mysql_query($query, $db) or die(mysql_error($db));
    }
    ?>
    <p>Done!</p>
    </body>
    </html>
    
    ?>

  5.  $message = "This is to confirm that the following message was sent to our sales department:\n\n" + $message;

    you mean dot not plus

     $message = "This is to confirm that the following message was sent to our sales department:\n\n" . $message;

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