Jump to content

n3ightjay

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything 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. try: echo "<div class='title_class'>.$row['title'].</div>";
  4. php.net/array_multisort if you show me the var_dump of your array i can help more
  5. &nbsp ... that will render a blank space when outputted to html .. not sure if that will work when going to xml or sms .... but worth a try ?!?!?
  6. 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
  7. 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
  8. you have a typing error "msysql_connect()" should be "mysql_connect()"
  9. 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 ?!?!?
  10. try simply setting your $dbhost variable to localhost; i check out the site and they mentioned not allowing outside connections so this leads me down this path $dbhost = "localhost";
  11. a quick google brought this up ... looks interesting : http://flumpcakes.co.uk/php/msn-messenger
  12. personally most of the sites i make ... use a template system and have files like about.php or www.example.com/about/ but I definately agree with maq on the mod_rewrite
  13. $fdate = strtotime("m / d / y H:i:s A", $date); try $fdate = date("m / d / y H:i:s A",mktime($date));
  14. I'm thinking more along the lines of javascript-> settimeout() to an Ajax call that would update maybe a session variable and or write to the database ???
  15. if its a timestamp try this instead : <?php function prettydate($format,$datetime) { return date($format,strtotime($datetime) ); }
  16. 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
  17. 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
  18. you can just use strtotime('mysqlDateField') to get the same data
  19. if you don't set the action property of a form, the form will reference itself including the get variables in the URL .. im not sure if that will help or not
  20. Hey i'm not sure why this hasn't been brought up before or if it has i apologize but in the PHP Tutorials section ... OO PHP Part 1: OOP in Full Effect -> Page 5 -> Section 4 ... appears that it has no styles for the headings or paragraphs ... everyother page in the tutorial appears fine just not the last one using WIN xp with IE 7
  21. Thanks sasa thanks for the direction and resources NRG Neight
  22. 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.