Jump to content

hansford

Members
  • Posts

    562
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by hansford

  1. looks like you have to do this.

     

    SDMenu.prototype.init = function() {

    var mainInstance = this;

    for (var i = 0; i < this.submenus.length; i++){

                  if(i == 0 || i == 6) { continue; }

    this.submenus.getElementsByTagName("span")[0].onclick = function() {

    mainInstance.toggleMenu(this.parentNode);

    };

     

  2. Get the articles out of your DB-that is a huge resource drainer and one of the worst errors as far as web developemt goes. Put in the path to the acrticle and the filename in the DB, but the actual file should be stored on the server. Make this change now and you will not regret it.

  3. are you storing the whole article in the DB or just the path and the filename? It should be just the path and filename, then you can get the path & filename info from DB to retrieve from the server.

     

    $path = $row['path'] . row['filename'];

    $file = fopen($path, "r", TRUE);

    $lines = //enter the number of lines you want from the file

    $count = 0;

    if($file){

    while($count < $lines){

    $buffer = fgets($file, 4096);

    echo $buffer;

    count++;

    }

    fclose($file);

    }

  4. using the mail function in php is not the way to go IMO. the recipients mail server can view it as spam and just filter it out. PHPMailer works great. You just use your smtp settings from your hosted account.

  5. sorry, I don't have the time and me doing it won't make you a better programmer. If you aren't interested in the pogramming, then re-post your question, using what I told you needs to be done, and maybe one of the others will have the time to help.

  6. image_link value in your DB holds that information. Every one of the files in your database is set to your main images forlder. You're going to have to write some code to go through your database and make thumbnails for all of your images which currently have none. You need to then run through the DB and change all of values of image_link  to point to your thumbnails directory.

  7. You can incorporate it using either get or post. Her's another basic example

     

    <body>

    <form name='form1' method='post' action="<?php $_SERVER[php_SELF] ?>">

    <input type='hidden' name='clicked' value=""/>

    </form>

     

    <?php

    if(isset($_POST['clicked'])){

     

    //make connection to DB and add 1 to the number of times clicked

    echo "link clicked";

    }

    else{

     

    echo '<a href="#" onclick="print_page(); return false;">Print Document</a>';

    }

     

    ?>

    <script language='javascript'>

     

    function print_page(){

     

    window.print();

    form1.clicked.value = '1';

    form1.submit();

    }

    </script>

     

    </body>

     

  8. The problem with that is: say $pageNumber = 1 and $parsedNumber = 1

    neither of them change when they are in the while loop, so the condition is always true, so the loop never ends.

     

    while((($pageNumber*20)-19)<= $parsedNumber && ($pageNumber*20)>= $parsedNumber)

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