
n3ightjay
Members-
Posts
64 -
Joined
-
Last visited
Never
Everything posted by n3ightjay
-
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
-
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
-
Keep getting errors when tryng to apply CSS
n3ightjay replied to renegade44's topic in PHP Coding Help
try: echo "<div class='title_class'>.$row['title'].</div>"; -
  ... 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 ?!?!?
-
Advanced: Updating database when server receives an email?
n3ightjay replied to mikefrederick's topic in PHP Coding Help
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: [email protected] 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 -
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
-
you have a typing error "msysql_connect()" should be "mysql_connect()"
-
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 ?!?!?
-
try addslashes($body);
-
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";
-
a quick google brought this up ... looks interesting : http://flumpcakes.co.uk/php/msn-messenger
-
question on SEO and database-driven site integration...
n3ightjay replied to mac007's topic in PHP Coding Help
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 -
$fdate = strtotime("m / d / y H:i:s A", $date); try $fdate = date("m / d / y H:i:s A",mktime($date));
-
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 ???
-
[SOLVED] Working with Time and Date - Getting wrong output
n3ightjay replied to MasterACE14's topic in PHP Coding Help
if its a timestamp try this instead : <?php function prettydate($format,$datetime) { return date($format,strtotime($datetime) ); } -
<?php phpinfo(); ?>
-
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
-
Pull menu items from MySQL DB and still specify current page
n3ightjay replied to Horse's topic in PHP Coding Help
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 -
you can just use strtotime('mysqlDateField') to get the same data
-
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
-
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
-
Thanks sasa thanks for the direction and resources NRG Neight
-
[SOLVED] getting a paragraph to not display first 4 lines
n3ightjay replied to scarhand's topic in PHP Coding Help
wheres the text / paragraph coming from ? database ? -
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'])){