Jump to content

wannabephpdude

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Posts posted by wannabephpdude

  1. I have a table called 'intake'... I need every field in this table (23 fields). This table has a field named rec_id. The second table is named 'insurance'... I need only one field from it named 'claim_type'. 'intake.rec_id' = 'insurance.intake_id'... How can I join them with all the 'intake' field values available and add to it the one 'insurance.claim_type'?

     

    Thanks in advance... My join skills seem to be slipping :(

  2. Or... something like this for a bit more expandability.

     

    Overbleed, what this means is that you can set the maxLength for each use of this function.

     

    <?php
      function cut_str($maxLength,$string){
        $suffix    = '...';
        $finalStr  = '';
    
        if(strlen($string) > $maxLength) {
          while($string{$maxLength} != ' '){
            $finalStr .= $str{$maxLength};
            $maxLength++;
          }
          return substr($string,0,$maxLength).$suffix;
        } else {
          return $string;
        }
    
      }
    
      $postTitle = 'This is my post title, just a filler really.';
      echo cut_str(23,$postTitle);
    ?>
    

     

    Max length is now set to 23 and the result becomes => "This is my post title, just..."

     

    [edit] Nice code Paul ^5!

  3. OldWest, an AJAX solution could be used here... which is a whole other animal.

     

    Try sending HTTP requests to the script itself via a form or a bit of javascript attached to a button and pass a $_GET var like such:

     

    <button name="clickMeButton" type="button" onclick="window.location='index.php?var=true'">Click Me!</button>

     

     

  4. <?php
    if(!empty($page)) {
      include($page.".php");
    } else {
      include("home.php");
    }
    ?>

     

    If you wish to capture $GET vars be sure to clean them...

     

    Here's a bit of my code I use to clean up strings:

    // Clean all incoming strings
    function clean($string) {
    $k = trim($string);
    $k = htmlspecialchars($string);
    $k = mysql_real_escape_string($string);
    return $k;
    }

     

    You will need to call the database before you can use => mysql_real_escape_string($string);

     

    Good Luck

    - tony

  5. Try something like this...

     

    <?php
    if (empty($_POST['reg']) || empty($_POST['title'])) {
      $fillinform = "Please fill in all the form to add a listing.";
      // anything else you can think of here
    } else {
      // Then place your positive outcome here
    }
    ?>

     

    Good Luck

    - tony

  6. OK SA. I'm on it. One question though for future reference. Have you much experience using hash? I may ask you some more questions, if that's not a problem.

    Thanks :)
  7. I have written a [color=red]"login"[/color] system for one of my websites that works with a [color=green]MySQL[/color] database and a [color=orange]cookie[/color]. I would like to store the password in the MySQL database encrypted (via hash). I know phpBB does it using hash some how. Does anyone know of some tutorials I can read about HASH?

    Thanks in advance. PEACE.
×
×
  • 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.