Jump to content

n3ightjay

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Posts posted by n3ightjay

  1. Hi all, I just have a question as to how you individually would handle something.

     

    I have a site that users populate a database table (45 fields) 2 - 5 fields at a time via ajax, now my question to you is:

    Would you insert the data each time the "next" button is hit (i.e. 2 - 5 fields at a time) or store in a session variable for example ... Im definately leaning towards on each submit to avoid data lose. Anyways just looking for some experienced insight thanks in advance

     

    Neight

  2. Hi All I'm in need of an explanation, Im working through a sitepoint book and in one of the examples they declare a function in this syntax:

     

    a.onclick = function(that){ }(this);

     

    I'm having trouble understanding what the last set of parenthesis are doing ... the specific example is this:

     

    a.onclick = function(that){
        return function(){
            that.sortCol(this);
            return false;
        }
    }(this);
    

     

    The book says it's so the browser handles the function immediately but is there a more detailed explanation available ... ive been hunting for a bit but haven't found anything yet

  3. You can use a cron job to query an email server ... but a simplier approach would be just to set up a forwarder if you have that ability ... ie set up a forwarder to receive from: messageboard@mysite.com and forwards it to a php file to handle it ...

     

    This information is coming from a magazine article from PHP Architect in regards to dealing with sms and php but the concept is the same.. so for more information perhaps a google for ' php sms ' would provide you with more information

  4. I think you have to quote you values in your SQL Query IE...

    $addrecord = "INSERT INTO regtable (Time, User) VALUES ('".$_POST["time"]."' , '".$_POST["user"]."')";
    

     

    try that ... A little trick i sometimes use when im having troubles with SQL is to echo out the statement then run it on in the database itself to see if it's processing and if not it will tell you where the error is

  5. Can anyone give me insight or a solution (preferably) as how to have this render correctly in IE 5/6

     

    <style>
    #navigation{
    float:left;
    width:100%;
    margin:0px;
    padding-bottom:5px;
    text-align:right;
    background:url('/app/webroot/img/layout/navBG.gif') repeat-x;
    background-position:bottom;
    }
    
    #navigation a{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#999999;
    text-decoration:none;
    }
    
    #navigation a:hover{color:#333333;}
    
    #navigation ul {list-style:none;margin:0px 0px 0px 250px;padding:0;}
    
    #navigation li {float:left;width:auto;height:20px;margin:0px 5px 0px 5px;padding:0;text-align:center;}
        li a {display:block;padding:0;margin:5px;height:100%;color:#FFF;text-decoration:none;}
        li a:hover, li a:focus, li a:active {background:url(/app/webroot/img/layout/navHover.gif) no-repeat;background-position:50% 100%;;}
    </style>
    </head>
    <body>
    <div id="navigation">
    <ul>
    	<li><a href="/about">About</a></li>
    	<li><a href="/about_resume">Resume</a></li>
    	<li><a href="/about_portfolio">Portfolio</a></li>
    	<li><a href="/about_hire">For Hire</a></li>
    </ul>
    </div>
    

     

    It renders inline with the hover effect in every browser except IE 5/6 in which it still renders as a vertical list ?!?!?

  6. The only thing i can see wrong is you have to checks against $_GET['logout'] both of which are destroying sessions ... i would get rid of the second if(isset($_GET['logout'])) and put the call to the log_out function in the first if... and also delete the session_destroy() line in the first if .. I hope thats clear

  7. Although I write my navigation the same way as ashton ... the way to achieve what your looking for is...

     

    <?php 
    $current = explode("/"$_SERVER['PHP_SELF']);
    $query="select linkname, id, url from tbl ORDER BY id";
    if($result = mysql_query($query)){
    echo '<ul>';
    while($row = mysql_fetch_assoc($result)) {
    ?>
    	<li<?=($current[1] == $row['url']?" id=\"current\"":"")?>><a href=' .$row['url']. '>' .$row['linkname']. '</a></li>
    <?
    } // while
    echo '<ul>';
    }
    ?>
    

     

    assuming your pages are all at root level if not you have to play with the $current variable and such

  8. Hey Guys ... never used regex and don't really get it (yet fingers crossed) but i need to check a string meets a length and prefix expression.

     

    i need the string to match:

     

    "SNPLXXXXX" where the "X"'s are integers and "SNPL" is the manditory prefix

     

    what i know is (is not much):

     

    if (eregi("", $_POST['barCode'])){
    

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