Jump to content

bravo14

Members
  • Posts

    296
  • Joined

  • Last visited

Posts posted by bravo14

  1. Hi Guys

     

    I have the following page

     

     

    <script src="js/jquery-1.9.1.js"></script>
    <script type="text/javascript">
    $(function() {
    
    
    
    $('.load_more').live("click",function() {
    
    
    var last_msg_id = $(this).attr("id");
    
    
    
    if(last_msg_id!='end'){
        
      $.ajax({
    type: "POST",
    url: "facebook_style_ajax_more.php",
    data: "lastmsg="+ last_msg_id,
    beforeSend:  function() {
    $('a.load_more').append('<img src="facebook_style_loader.gif" />');
     
    },
    success: function(html){
        $(".facebook_style").remove();
    $("ol#updates").append(html);
    
    
    }
    });
     
    }
    
    
     
     
     
    
    
    
    return false;
    
    
    });
    });
    
    </script>
    

     

    This ajax is called when a user clicks a link similar to facebook's Show Older Posts code is below

     

     

    <ol class="row" id="updates">
        <?php
    $query ="select * from `tbl_news` ORDER BY `news_date` desc LIMIT 9";
    $result = mysql_query($query);
    while($row=mysql_fetch_assoc($result))
    {
    $msg_id=$row['id'];
    $message=$row['headline'];
    ?>
        <li> <?php echo $message; ?> </li>
        <?php } ?>
      </ol>
    
     
     
      <div class="facebook_style" id="facebook_style">
      <a id="<?php echo $msg_id; ?>" href="#" class="load_more" >Show Older Posts <img src="img/arrow.png" /> </a>
      </div>
    

     

    When I am clicking on the link I am getting the following error showing in Firebug

     

    TypeError: $(...).live is not a function
     

    $('.load_more').live("click",function() {

     

    Where am I goign wrong, I have used th tutorial and source code from the followign page

     

    http://youhack.me/2010/05/14/an-alternative-to-pagination-facebook-and-twitter-style/

     

  2. Hi Guys

     

    I have downloaded the sidr menu from http://www.berriart.com/sidr/, the problem is I can't get it to work on a phone, but if I resize the browser then the css will change and the sidr menu will be start working.

     

    the css in use is below

     

     

     
    body{
    font-family: Arial;
    }
    #header{
    width:100%;
    vertical-align:center;
    height:200px;
    vertical-align:bottom;
    }
    #header img{
    width:330px;
    }
    #header h3{
    height:150px;
    vertical-align:bottom;
    color:#32fa2a;
    font-size:16pt;
    text-align:center;
    }
    #container{
    max-width:100%;
    }
    #main_content{
    width:100%;
    padding-left:200px;
    }
    .strapline{
    float:left;
    margin:300px;
    font-size:16pt;
    }
    #address{
    width:300px;
    float:right;
    text-align:right;
    }
    #side-menu{
    position:fixed;
    top:300px;
    left:0;
    width:200px;
    font-size:9pt;
    background-color:#32fa2a;
    color:#FFFFFF;
    }
     
    #sub{
    font-size:9pt;
    }
     
    #sub li{
    list-style:none;
    }
    #product-list ul{
    list-style:none;
    }
    #product-list li{
    border:solid 3px #32fa2a;
    text-align:center;
    width:210px;
    height:210px;
    display:block;
    float:left;
    vertical-align:middle;
    margin:5px;
    }
     
    #product-list li img{
     
    max-width:200px;
    border:none;
    vertical-align:middle;
    }
    #nav-menu{
    margin:10px;
    background-color:#32fa2a;
    height:40px;
    text-align:center;
    }
    #nav-menu ul{
    list-style:none;
    }
    #nav-menu li{
    border:#ffffff solid 3px;
    padding:5px;
    color:#FFFFFF;
    background-color:#32fa2a;
    width:100px;
    display:block;
    float:left;
    }
    #partners{
    width:100%;
    height:110px;
    text-align:center;
    border:#32fa2a 4px solid;
    }
    #partners ul{
    list-style:none;
    }
    #partners li{
    text-align:center;
    width:210px;
    height:210px;
    display:block;
    float:left;
    vertical-align:middle;
    margin:5px;
    }
    #partners li img{
    max-height:85px;
    border:none;
    vertical-align:middle;
    }
    #prod-detail{
    width:100%;
    }
    #ben-feat{
    width:400px;
    float:left;
    }
    #mobile-header {
    display: none;
    }
    #navigation {
    display:none;
    }
    @media only screen and (max-width: 767px){
    #mobile-header {
    display: block;
    }
    #side-menu{
    display:none;
    width:0;
    }
    #nav-menu, #address{
    display:none;
    }
    #main-content{
    padding:0;
    }
    

     

    The display should change when the screen width is less than 767px, do I need to change the css for the other selectors as well?

     

    Any help would be fantastic.

  3. Hi 

     

    I have a jquery function that is rotating a number of images at the top of the page, the jquery function is below

     

    <script language="javaScript" type="text/javascript">
                $(document).ready(function(){
                    
                    var imgArr = new Array( // relative paths of images
                    'http://176.32.230.29/hmximages.co.uk/photos/5.jpg','http://176.32.230.29/hmximages.co.uk/photos/3.jpg','http://176.32.230.29/hmximages.co.uk/photos/4.jpg','http://176.32.230.29/hmximages.co.uk/photos/2.jpg','http://176.32.230.29/hmximages.co.uk/photos/1.jpg',                '_img/homepage/4.jpg'
                        );
                        
                    var preloadArr = new Array();
                    var i;
                    
                    /* preload images */
                    for(i=0; i < imgArr.length; i++){
                        preloadArr[i] = new Image();
                        preloadArr[i].src = imgArr[i];
                    }
                    
                    var currImg = 1;
                    var intID = setInterval(changeImg, 6000);
                    
                    function changeImg(){
                        $('#header').animate({opacity: 0}, 1000, function(){
                            $(this).css('background','url(' + preloadArr[currImg++%preloadArr.length].src +') bottom center no-repeat');
                        }).animate({opacity: 1}, 1000);
                    }
    
                });
        </script> 
    

     

    However when the background images fade in and out it also fades other items and div tags within the header container.

     

     

    <div id="header">
    <div id="navigation">
                    <ul>
                 <li><a href="http://176.32.230.29/hmximages.co.uk/" class="active">Home</a></li>
                 <li><a href="http://176.32.230.29/hmximages.co.uk/#">Support</a></li>
                 <li><a href="http://176.32.230.29/hmximages.co.uk/checkout.php?step=1">Checkout</a></li>
                 <li><a href="http://176.32.230.29/hmximages.co.uk/cart.php?action=view">Cart</a></li>
    <li><a href="http://176.32.230.29/hmximages.co.uk/profile.php">My Account</a></li>
                 <li><a href="http://176.32.230.29/hmximages.co.uk/#">Contact</a></li>
                </ul>
    </div>
    <img src="files/image/logo.png"/>
    <!-- end #header -->
    </div>
    

     

    How can I change this so that it only fades the background image and not the navigation and the logo image?

     

     

  4. I want to be able to disable a payment option if a user selects Delivery as an option.

     

    the function I have is

     

    function disableCOD(){ 
    if (document.getElementById('optDelivery').value == 'optDel') { 
    document.getElementById('optPaypal').checked = 'true'; 
    document.getElementByName('optPayment').disabled='true'; 
    } 
    else{ 
    document.getElementByName('optPayment').disabled='false'; 
    } 
    } 
    

     

    The form details are

     

     

    <table width="550" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
          <tr>
            <td width="150" class="entryTableHeader">Delivery Method </td>
            <td class="content">
            <input name="optDelivery" type="radio" id="optSwindon" value="Collect from Birmingham" onclick="disableCOD()"/>
            <label for="optBirmingham" style="cursor:pointer">Collect from Birmingham</label>
            <input name="optDelivery" type="radio" id="optSomerset" value="Collect from Somerset" onclick="disableCOD()"/>
            <label for="optSomerset" style="cursor:pointer">Collect from Somerset</label>
            <input name="optDelivery" type="radio" value="Delivery" id="optDel" onclick="disableCOD()"/>
            <label for="optDel" style="cursor:pointer">Delivery</label></td>
          </tr>
        </table>
        <table width="550" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
          <tr>
            <td width="150" class="entryTableHeader">Payment Method </td>
            <td class="content">
            <input name="optPayment" type="radio" id="optPaypal" value="paypal" checked="checked"/>
            <label for="optPaypal" style="cursor:pointer">Paypal</label>
            <input name="optPayment" type="radio" value="cod" id="optCod"  />
            <label for="optCod" style="cursor:pointer">Cash on Delivery</label></td>
          </tr>
        </table>
    

     

    The error I get is document.getElementById(...) is null

     

    where am i going wrong?

  5. I have a form that has some predefined images that are already uploaded, if however the user wants to add a new picture they select other from the form and then the image should be uploaded and added to database.  The upload and add code is below.

     

    It appears that if I select one of the predefined images then the value is added to the db without any problems, the problem arises when a new image is to be uplaoded.

     

    The code to add and uplaoad

     

     

    <?php
      if(isset($_POST['submit'])){
          //set variables from form
          $identifier=$_POST['identifier'];
          $headline=$_POST['headline'];
          $content=addslashes($_POST['content']);
       //echo $content;
          $photo=$_POST['image'];
       echo $photo;
          if($photo!='other'){
              $image=$photo;
          }
          else{
              //upload image
              $filename = $_FILES["file"]["name"];
     $file_basename = substr($filename, 0, strripos($filename, '.')); // get file extention
     $file_ext = substr($filename, strripos($filename, '.')); // get file name
     $filesize = $_FILES["file"]["size"];
     $allowed_file_types = array('.jpg','.png','.gif','.bmp');
        //echo $file_basename;
     //echo $file_ext;
     if (in_array($file_ext,$allowed_file_types)  &&  ($filesize < 200000)) {
      // rename file
      $newfilename = mktime() . $file_ext;
      echo $newfilename;
      if (file_exists("http://www.jasondoyleracing.com/news-images/" . $newfilename)) {
       // file already exists error
       $message= "You have already uploaded this file.";
      } else {
       move_uploaded_file($_FILES["file"]["tmp_name"], "http://www.jasondoyleracing.com/news-images/" . $newfilename);
              $image=$newfilename;
       }
    }
    }
          $today=date("Y-m-d");
       echo $today;
       preg_match("/<p[^>]*>(.*)<\/p>/",$content,$matches);
          //print_r($matches);
          $intro = strip_tags($matches[1]); //removes anchors and other tags from the intro
          //update page content
          echo $image;
       echo $intro;
          $add_news="INSERT INTO `tbl_news`(`identifier`,`headline`,`news_date`,`story`,`image`,`intro`)
    VALUES ('$identifier','$headline','$today','$content','$image','$intro')";
          //echo $add_news;
          $add_news_sql=mysql_query($add_news)or die(mysql_error());
          $message="Your news story has been added";
         
    }
    ?>
     
    

     

    Any idea why the upload isn't working

  6. I am trying to echo a date using the following code

     

     

    <?php echo date(strtotime("d M Y",$order_row['od_date']));?>
    

     

    but I am getting the following error message

     

    Notice: A non well formed numeric value encountered in /Applications/MAMP/htdocs/Nick Morris/admin/invoice.php on line 86

     

    The data type for the field from the database is DateTime, any ideas what is going wrong

  7. Hi Psycho

     

    I have tried to implement the functionyou supplied but am gettign an error in firebug saying TypeError: document.getElementById(...) is null

     

    The source for page is displayed a such on load

     

    Select field

     

    <select name="pd_Size" id="pd_Size" onchange="setSize(this);">
    <option value="Small">Small</option>
    <option value="Medium">Medium</option>
    <option value="Large">Large</option>
    <option value="X-Large">X-Large</option>
    <option value="XX-Large">XX-Large</option>
    <option value="XXX-Large">XXX-Large</option>
    </select>
    

     

    The Add to Cart button says

     

    <input type="button" name="btnAddToCart" value="Add To Cart >" onClick="window.location.href='<?php echo $cart_url; ?>';" class="addToCartButton">
    

     

    The javascript function says

     

    function setSize(pd_Size)
    {
        var sizeVal = pd_Size.options[pd_Size.selectedIndex].value;
        var hrefVal = '<?php echo $cart_url; ?>';
    
        if (sizeVal > 0)
        {
            hrefVal = hrefVal + '&s=' + sizeVal;
        }
        document.getElementById('btnAddToCart').options.onClick = "window.location.href='" + hrefVal + "'"
    }
    

     

    Where am I going wrong?

     

    If you need any more from the page then please let me know, I am not sure what info you would need

  8. Hi Guys

     

    I am trying to set an onclick value based on the value of a select menu.  The function I have at the moment is 

     

     

     
    function setSize() {
        if (document.getElementById('size').value >0) {
    var size= document.getElementByID('size').value;
            document.getElementById('btnAddToCart').options.onClick = "window.location.href='<?php echo $cart_url; ?>&s=';";
        } else {
            document.getElementById('btnAddToCart').options.onClick = "window.location.href='<?php echo $cart_url; ?>';";
        }
    }
    

     

    Basically, if a size is required for an item then the value of the onclick needs to be window.location.href='<?php echo $cart_url; ?>&s=size variable

     

    If no size is required then the value needs to be window.location.href='<?php echo $cart_url; ?>'

     

    I am just not sure how to achieve this.

  9. The error I am getting is

    Notice: Undefined variable: productId in /home/sites/nickmorrisracing.com/public_html/shop/library/cart-functions.php on line 38 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ct_session_id = 'pfp18kvfo13eresqibu4dl9dv2'' at line 3

     

    However exactly the same page has been uploaded onto a different server on a different site and there are no errors.

     

    I have added the exit at the end of each header();, it hasn't made a difference.

  10. Not sure if this is in the right area.

     

    I have uploaded the script below to two sites with the same host, however one works and one doesn't, my host provider has said that the only difference is that the one that doesn't work has a more recent versionof Apache (2.4.4)

     

    The code affected is below

     

    function addToCart()
    {
        // make sure the product id exist
        if (isset($_GET['p']) && (int)$_GET['p'] > 0) {
            $productId = (int)$_GET['p'];
        } else {
            header('Location: http://www.jasondoyleracing.com/shop');
        }
        
        // does the product exist ?
        $sql = "SELECT pd_id, pd_qty
                FROM tbl_product
                WHERE pd_id = $productId";
        $result = dbQuery($sql);
        
        if (dbNumRows($result) != 1) {
            // the product doesn't exist
            header('Location: http://www.jasondoyleracing.com/shop/cart.php');
        }
        }        
        
        // current session id
        $sid = session_id();
        
        // check if the product is already
        // in cart table for this session
        $sql = "SELECT pd_id
                FROM tbl_cart
                WHERE pd_id = $productId AND ct_session_id = '$sid'";
        $result = dbQuery($sql);
        
        if (dbNumRows($result) == 0) {
            // put the product in cart table
            $sql = "INSERT INTO tbl_cart (pd_id, ct_qty, ct_session_id, ct_date)
                    VALUES ($productId, 1, '$sid', NOW())";
            $result = dbQuery($sql);
        } else {
            // update product quantity in cart table
            $sql = "UPDATE tbl_cart
                    SET ct_qty = ct_qty + 1
                    WHERE ct_session_id = '$sid' AND pd_id = $productId";        
                    
            $result = dbQuery($sql);        
        }    
        
        // an extra job for us here is to remove abandoned carts.
        // right now the best option is to call this function here
        //deleteAbandonedCart();
        
        //header('Location: ' . $_SESSION['shop_return_url']);                
    //}
    

     

    How do I make this compatible with with this particular Apache version.

  11. Hi Guys

     

    I have a form that I use to update a table in a database, and if some of the fields are empty I want to set the value of the variable to NULL.  The code I have used is below

     

     

    <?php
    if(isset($_POST['submit'])){
        $fixture_date=date("Y-m-d",strtotime($_POST['fixture-date']));
     echo $fixture_date;
        $club=$_POST['club'];
        if(empty($_POST['team_score'])){ $brummies=NULL;} else {$brummies=$_POST['team_score'];}
     $opposition=$_POST['opposition'];
        if(empty($_POST['opp_points'])){ $opposition_points=NULL;} else {$opposition_points=$_POST['opp_points'];}
     if(empty($_POST['points'])){$points=NULL;} else {$points=$_POST['points'];}
     if(empty($_POST['bonus'])){$bonus=NULL;} else {$bonus=$_POST['bonus'];}
     $homeaway=$_POST['homeaway'];
     $match_id=$_POST['match_id'];
     if(!empty($_POST['team_score'])&&!empty($_POST['opp_points'])){
     if($brummies>$opposition_points){
     $result="Won";
     }
     elseif($brummies<$opposition_points){
     $result="Lost";
     }
     else{
     $result="Draw";
     }
     }
     else{
     $result = NULL;
     }
     echo $result;
     
        //add event to db
        $add_event=("UPDATE `tbl_fixtures`
                                       SET
               `Opposition`='$opposition',
               `match_date`='$fixture_date',
               `HomeAway`='$homeaway',
               `Result`='$result',
               `brummies`='$brummies',
               `opposition_points`='$opposition_points',
               `points`='$points',
               `bonus_points`='$bonus'
                                       WHERE `match_id`='$match_id'");
               echo $add_event;
               $add_event_sql=mysql_query($add_event)or die(mysql_error());
        $message='The fixture/result has been updated.';
    }
    ?>
    

     

    This is the resultant MySQL query

     

    UPDATE `tbl_fixtures` SET `Opposition`='Poole', `match_date`='2013-06-13', `HomeAway`='Away', `Result`='', `brummies`='', `opposition_points`='', `points`='', `bonus_points`='' WHERE `match_id`='14'

     

    I want the fields brummies, opposition_points, bonus_points, and points to be set to NULL if they are blank, it currently sets the field to 0.

     

    Any help would be much appreciated

  12. Hi Guys

     

    I am trying to create an array of results based on a mysql query using the code below:

     

     <?phpif(isset($_POST['submit'])){//set variables from form$home=$_POST['home-team'];$away=$_POST['away-team'];$user_id="2";$meeting_date="2013-05-13";//$meeting_date=date("Y-m-d",strtotim($_POST['meeting-date']));//create score card$new_card_sql=("INSERT INTO `tbl_card` (`user_id`,`meeting_date`,`home`,`away`) VALUES ('$user_id','$meeting_date','$home','$away')");//$new_card=mysql_query($new_card_sql);print $new_card_sql;//find rider information$home_riders_query=("SELECT * FROM `tbl_riders` where `club_id` = '$home'");$home_riders_sql=mysql_query("SELECT * FROM `tbl_riders` where `club_id` = '$home'") or die(mysql_error());if(mysql_num_rows($home_riders_sql)>0){while ($row = mysql_fetch_array($home_riders_sql)){    $data[] = $row;} foreach ($data as $row){echo $row;   } } //redirect to score-card.php//header("location:score-card.php");}?>
     
    

     

    However I only get the following result

     

    INSERT INTO `tbl_card` (`user_id`,`meeting_date`,`home`,`away`) VALUES ('2','2013-05-13','1','4')ArrayArrayArrayArrayArrayArrayArray

     

    I am wanting to see an array with the following fields in from the table tbl_riders --> rider_name rider_number

     

    What am I doing wrong and how would I go about getting my desired result?

     

     

  13. Hi Guys

     

    I have got a datepicker on a site and have set the minDate to be tomorrow.

     

     

    <script>
     $(function() {
      $( "#delDate" ).datepicker({
                dateFormat: 'd MM yy',
                changeMonth: true,
       changeYear: true,
       minDate: "+1D",
       constrainInput: true,
          beforeShowDay: noWeekendsOrHolidays
      });
     });
     </script>
    

     

    What I want to do is set the minDate to +2 if the time is after 5pm, anybody got any guidance on how to achieve this.

     

  14. Hi Guys

     

    I have checked the code over and over and have probably become word blind at the moment, I am getting an error saying

     

    Parse error syntax error, unexpected T_VARIABLE in /home/sites/Lucyslunchbox.co.uk/public_html/success.php on line 47

     

     

     

     

    from the following code

     

     

     
    <?php
    require_once 'library/config.php';
    require_once 'library/cart-functions.php';
    require_once 'library/checkout-functions.php';
    // if no order id defined in the session
    // redirect to main page
    if (!isset($_SESSION['orderId'])) {
    header("Location: http://www.lucyslunchbox.co.uk");
    exit;
    }
     
    $pageTitle   = 'Checkout Completed Successfully';
    //require_once 'include/header.php';
    //get order details
    $order_id=$_SESSION['order_id'];
    $order_sql=mysql_query("SELECT * FROM `tbl_order` where `od_id` = '$order_id'");
    $order_row=mysql_fetch_assoc($order_sql);
    $message_intro="Dear ".$order_row['od_shipping_first_name']."\n\n
    Thank you for your order\n\n
    Your order will be delivered to:\n"
    .$order_row['od_shipping_address1']."\n"
    .$order_row['od_shipping_address2']."\n"
    .$order_row['od_shipping_city']."\n"
    .$order_row['od_shipping_state']."\n"
    .$order_row['od_shipping_postal_code']."\n
    on ".date("d-M-Y", strtotime($order_row['delDate']))."\n";
    $order_items_sql=mysql_query("SELECT od_id, od.pd_id, od_qty, pd_name, pd_price, pd_thumbnail, pd.cat_id
    FROM tbl_order_item od, tbl_product pd, tbl_category cat
    WHERE od_id = '$order_id' AND od.pd_id = pd.pd_id AND cat.cat_id = pd.cat_id ")or die(mysql_error());
    if(mysql_num_rows($order_items_sql)==0){
    echo"No order items";
    }
    else{
    while($order_items_row=mysql_fetch_assoc($order_items_sql)){
    Line 47 - $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'$order_items_row['pd_price'];
    }
    }
    $mesage_content=$message_intro.$order_items; 
     
    //send confirmation email
    $subject="Thank you for your order"
    $email=$order_row['od_email'];
    $message=$message_content;
    mail($email, $subject, $message, "From: orders@lucyslunchbox.co.uk\r\nReturn-path: orders@lucyslunchbox.co.uk");
    // send notification email
    if ($shopConfig['sendOrderEmail'] == 'y') {
    $subject = "[New Order] " . $_SESSION['orderId'];
    $email   = $shopConfig['$sc_order_email'];
    $message = "You have a new order. Check the order detail here \n http://" . $_SERVER['HTTP_HOST'] . WEB_ROOT . 'admin/order/index.php?view=detail&oid=' . $_SESSION['orderId'] ;
    mail($email, $subject, $message, "From: $email\r\nReturn-path: $email");
    }
     
     
    unset($_SESSION['orderId']);
    ?>
     
    

     

    Any help would be great

  15. I have a sidebar on a page, this will contain facebook and twitter feeds, however if I put jquery tabs on the page outside of the sidebar, the tab content only shows after the height of the sidebar

     

    HTML

     

    
    <div id="sidebar1">
       <h3>Sidebar1 Content</h3>
       <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p>
       <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend  sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
     <!-- end #sidebar1 --><!--</div> -->
     <div id="mainContent"><!-- InstanceBeginEditable name="main-content" -->
       <h1>Charges</h1>
    <div id="tabs">
    <ul>
    <li><a href="#tabs-1">Details</a></li>
    <li><a href="#tabs-2">Feedback</a></li>
    </ul>
    <div id="tabs-1">
    <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
    </div>
    <div id="tabs-2">
    <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
    </div>
    
    </div>
    

    sidebar css

    
    .twoColFixRtHdr #sidebar1 {
    float: right; /* since this element is floated, a width must be given */
    width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    padding: 15px 10px;
    }
    

     

    any ideas why?

  16. Does anybody know if there is a way of flipping a letter using css. The font I want to use has the letter s back to fron (childs handwriting) the font is called CrayonExtended, however the person I am designing the site for has said that the letters have to be the correct way way around as she is dyslexia trained etc

  17. hi guys

     

    trying to get ui tabs to display, but failing miserably, can't see why

     

    
    <script src="http://www.kidzlinkz.co.uk/js/jquery-1.8.3.js" type="text/javascript">
    </script>
    <script src="http://www.kidzlinkz.co.ukjs/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
    </script>
    <script src="http://www.kidzlinkz.co.uk/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
    </script>
       <script type="text/javascript" src="http://www.kidzlinkz.co.uk/js/interface.js"></script>
    
    <link href="http://www.kidzlinkz.co.uk/css/css-dock.css" rel="stylesheet" type="text/css" />
    
    <!--[if lt IE 7]>
    <style type="text/css">
    .dock img { behavior: url(iepngfix.htc) }
    </style>
    <![endif]-->
    
       <script language="javascript" src=".http://www.kidzlinkz.co.uk/js/jquery.tweet.js" type="text/javascript"></script>
     <link href="http://www.kidzlinkz.co.uk/css/jquery.tweet.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript">
    
    $(document).ready(
    	function()
    	{
    		$('#dock').Fisheye(
    			{
    				maxWidth: 100,
    				items: 'a',
    				itemsText: 'span',
    				container: '.dock-container',
    				itemWidth: 70,
    				proximity: 90,
    				halign : 'center'
    			}
    		)
    
    	}
    );
    
    </script>
    <!-- InstanceBeginEditable name="head" -->
       <link rel="stylesheet" href="css/le-frog/jquery.ui.all.css">
    <link rel="stylesheet" href="css/jquery.tweet.css">
    <script src="js/ui/jquery.ui.core.js"></script>
    <script src="js/ui/jquery.ui.widget.js"></script>
    <script src="js/ui/jquery.ui.tabs.js"></script>
       <script>
    $(function() {
    	$( "#tabs" ).tabs();
    });
    </script>
    <!-- InstanceEndEditable -->
    <link href="css/twoColFixRtHdr.css" rel="stylesheet" type="text/css" />
    <!--[if IE 5]>
    <style type="text/css"> 
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixRtHdr #sidebar1 { width: 220px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css"> 
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixRtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixRtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]--></head>
       <div id="tabs">
    <ul>
    	<li><a href="#tabs-1">Details</a></li>
    	<li><a href="#tabs-2">Feedback</a></li>
    </ul>
    <div id="tabs-1">
    	<p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
    </div>
    <div id="tabs-2">
    	<p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
    </div>
    
    </div>
    

     

    I have only shown the code applicable to ui

  18. I am passing a radio button from a form $_POST['council']

     

    if the radio button is selected I want the value set to 1 if not then it is set to 0, this will then dictate the charge that is set. The code I am using at the moment is

     

    
    $council=0;
       if(isset($_POST['council'])){
           $council=1;
       }
       if($council=1){
           $charge='10';
       }
           else{
               $charge='2.50';
           }
    

     

    However at the moment if the radio button is not selected the charge is still set to 10, if it is selected the charge is set to 10, what am I doing wrong?

  19. Hi Guys

     

    I have the code below to explode a value split by '.' I then want to add each item to a database.

     

    
    $club_id=mysql_insert_id();
       foreach($_POST['age'] as $value)
    echo $value;
       //explode $value to insert into allocations
       $allocations=explode(".",$value);
       //insert into allocations
    
       $number = count($allocations);
       for ($i=0; $i<=$number; $i++) {
                // store a single item number and quantity in local variables
                $itno = $number[$i];
                $alloc = $allocations[$i];
    print_r($allocations);
                if ($allocations[$i] <> '') {
                    $add_allocations=mysql_query("INSERT INTO `allocations` (`club_id`,`group`) VALUES('$club_id','$alloc')") or die(mysql_error());
                    }
                    }
    

     

    This is the error I am getting

     

    1.3.Array ( [0] => 3 [1] => ) Array ( [0] => 3 [1] => ) Notice: Undefined offset: 2 in /home/sites/kidzlinkz.co.uk/public_html/add-link.php on line 90 Array ( [0] => 3 [1] => )

     

    Can someone explain how I explode an array and then add those separate values to a database.

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