-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Your welcome You know.. if you removed the days_old and in your select statement changed the * to *, DATEDIFF(NOW(),joindate)+1 as days_old ie change SELECT * FROM table to SELECT *, DATEDIFF(NOW(),joindate)+1 as days_old FROM table you would still get the days_old field without needed to update it everyday
-
try this $rowDB = $db->query("SELECT * FROM myarticles WHERE date(`date`) = date(now()) ORDER BY `date` DESC LIMIT 20") or die("Not grabbing articles"); while($r = $db->fetch_array( $rowDB )) { } also you sure you have record with today's date
-
"SELECT * FROM myarticles WHERE date(joindate) = date(now()) ORDER BY date DESC LIMIT 20" change joindate to the timestamp field name
-
Yes your need to run it everyday.. or you could do this and it will update to the correct date even if you skipped a day.. UPDATE table SET days_old=DATEDIFF(NOW(),joindate)+1 However the real question is why do you wish to update the field ? I assume you are pulling data from a database and you need to know how may days the account has been active. right ? question #2 field you have that stores the date they joined.. what type is that and what's its name?
-
UPDATE table SET days_old=days_old+1 however, you could do it during the select and not use a field SELECT *, DATEDIFF(NOW(),joindate)+1 as days_old FROM table EDIT: the +1 would mean from the second they start its 1 day old, so you may want to remove it
-
Dreamweaver has a feature "Automatically upload files to server on save" or you can use the upload changed files but your need to click the button, I don't know any that can read minds
-
Your welcome, and welcome to PHP Freaks responses here are normally in minute to hours, just remember to rules Now this thread is solved can you click "Topic solved" bottom left, (it saves other opening this thread hoping to help and finding it solved ) and Happy PHPing
-
You could just get something like Map a drive letter to your FTP, with something like NetDrive
-
i assume it worked without the [], but you got the error, try this if(!empty($_REQUEST['parking'])) { $parking = $_REQUEST['parking']; while(list($key, $val) = each($parking)) { $print_parking .=$val .= " "; } }
-
maybe add a something to the site itself saying its for sale with an email address. I be honest, if your lucky your probably only get the url price, everything else was based on the linkage/visits. if you can keep the visits up then the adverts will pay well,
-
Humm error 22, sounds like you messed up the ubuntu partition, in any case, boot from a windows recovery disk (or windows boot disk and choose recovery console) and type FIXBOOT FIXMBR that should sort it for the restore partition, but your loss grub you could also try to keep grub Boot off of the live CD Open a Terminal sudo grub root (hd0,0) setup (hd0) To Add windows to grub, sudo gedit /boot/grub/menu.lst and add title Windows XP root (hd0,0) makeactive chainloader +1 hope that helps
-
Okay first off, Saying only know the basics when it comes to using unix, maybe an understatement. however i don't normally have many problems, and most I can solve, but now i am stuck! I am running CentOS release 5.3 (Final), and i started to get "Disk quota exceeded" i found and account which had the quota to high and dropped it down, but the problem persisted, I logged in a root and.. I checked for remaining disk space seams fine checked quota *** Report for user quotas on device /dev/simfs Block grace time: 00:00; Inode grace time: 00:00 Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 11337084 0 0 188818 0 0 techie -- 6872592 10240000 10240000 215 0 0 There are more but didn't see the point posting all Ran a check that fails due to Disk quota exceeded quotacheck: Scanning /dev/simfs [/] done quotacheck: Checked 19824 directories and 184122 files quotacheck: Can't create new quotafile //aquota.user.new: Disk quota exceeded quotacheck: Cannot initialize IO on new quotafile: Disk quota exceeded quotacheck: Can't create new quotafile //aquota.group.new: Disk quota exceeded quotacheck: Cannot initialize IO on new quotafile: Disk quota exceeded Decided i needed more help.. posted here So that's it.. any ideas ?
-
So more like this <?php $html = <<<EOD <tr align="left"><td align="center"><input class="checkbox" type='checkbox' name='Kick5' value='True'> </td> <td align="center"><input class="checkbox" type='checkbox' name='Ban5' value='True'> </td> <td align="left" nowrap>FireX</td> <td align="center" nowrap><span style='background-color: Blue'> </span>Blue</td> <td align="center">48</td> <td align="center">0</td> <td align="center"> 89.164.221.222</td> <td align="center"> 5h600ez07dcda5a64685985d955c1552</td> </tr> <tr align="left"><td align="center"><input class="checkbox" type='checkbox' name='Kick99' value='True'> </td> <td align="center"><input class="checkbox" type='checkbox' name='Ban5' value='True'> </td> <td align="left" nowrap>FdfdsfsdfireX</td> <td align="center" nowrap><span style='background-color: Blue'> </span>Blue</td> <td align="center">48</td> <td align="center">0</td> <td align="center"> 89.155.221.222</td> <td align="center"> 5h600ez07dcgfjh5985d955c1552</td> </tr> <tr align="left"><td align="center"><input class="checkbox" type='checkbox' name='MadTechie' value='True'> </td> <td align="center"><input class="checkbox" type='checkbox' name='Ban5' value='True'> </td> <td align="left" nowrap>Fire111</td> <td align="center" nowrap><span style='background-color: Blue'> </span>Blue</td> <td align="center">48</td> <td align="center">0</td> <td align="center"> 89.164.221.222</td> <td align="center"> 5h600eBLAR64685985d955c1552</td> </tr> EOD; preg_match_all('%<tr align="left"><td align="center"><input class="checkbox" type=\'checkbox\' name=\'([^\']*)\' value=\'True\'>.*?<td align="left" nowrap>([^<]*)</td>.*?<td align="center"> ([^<]*)</td>\s*<td align="center"> ([^<]*)</td>%sm', $html, $players, PREG_SET_ORDER); foreach($players as $player) { list($void, $name, $group, $ip, $hash) = $player; echo "$name, $group, $ip, $hash<br>\n"; } ?>
-
If its not working i would guess you have a query problem try this $charname = $_GET['char']; $msg = $_GET['msg']; $time = time(); $message = $_GET['msg']; if (strpos($message, '/me ') === 0) { $message = substr($message, 4); //remove the "/me " $insert = "INSERT INTO chat (time, username, msg, me) values ('$time', '$charname', '$message', 'y')"; mysql_query($insert) or die(mysql_error()); //updated }else{ $insert = "INSERT INTO chat (time, username, msg) values ('$time', '$charname', '$msg')"; mysql_query($insert); } ?>
-
try this <?php $html = <<<EOD <tr align="left"><td align="center"><input class="checkbox" type='checkbox' name='Kick5' value='True'> </td> <td align="center"><input class="checkbox" type='checkbox' name='Ban5' value='True'> </td> <td align="left" nowrap>FireX</td> <td align="center" nowrap><span style='background-color: Blue'> </span>Blue</td> <td align="center">48</td> <td align="center">0</td> <td align="center"> 89.164.221.222</td> <td align="center"> 5h600ez07dcda5a64685985d955c1552</td> </tr> EOD; if (preg_match('%<tr align="left"><td align="center"><input class="checkbox" type=\'checkbox\' name=\'([^\']*)\' value=\'True\'>.*?<td align="left" nowrap>([^<]*)</td>.*?<td align="center"> ([^<]*)</td>\s*<td align="center"> ([^<]*)</td>%sm', $html, $regs)) { $name = $regs[1]; $group = $regs[2]; $ip = $regs[3]; $hash = $regs[4]; } echo "$name, $group, $ip, $hash<br>"; ?>
-
I would probably do this, if (preg_match('%([^/.]+)\.?[^/.]{0,3}$%', $link, $regs)) { $titles= $regs[1]; } EDIT: typo
-
You don't need to put it into an if, as it's a "ternary" (aka shorthand if), Your could do this $message = "/me is here!"; if (strpos($message, '/me ') === 0) { $message = substr($message, 4); //remove the "/me " //Preg_Match insert into DB }else{ //normal insert into DB } BUT if the insert into database is going to be the same, then this is the same as $message = "/me is here!"; if (strpos($message, '/me ') === 0) { $message = substr($message, 4); //remove the "/me " } //normal insert into DB Make sense ?
-
Great So word wrapping issue ? (Can you click solved bottom left)
-
$78 it the value of the URL, the value of the site by traffic is between $512.64 and $10,300.30, this is due to your site's link backs and page rankings and hits however 98% is from INDIA, so it would be an idea to stick some adverts on your site, The value of the site can mean many things, the URL could be worth a lot or it could be the traffic, the cost of running it, (hardware etc.) or even its uniqueness, all play a factor.
-
Okay i think i found the problem.. the ocw.txt (opml) file is not valid i have attached a valid one this is your file <?xml version="1.0" encoding="UTF-8" ?> - <opml version="1.1"> - <head> <title>OpenLearn RSS Feeds</title> <ownerName>The Open University</ownerName> <dateCreated>Thu, 17 Sep 2009 09:51:24 BST</dateCreated> </head> - <body> - <outline text="Science and Nature"> heres mine <?xml version="1.0" encoding="UTF-8" ?> <opml version="1.1"> <head> <title>OpenLearn RSS Feeds</title> <ownerName>The Open University</ownerName> <dateCreated>Thu, 17 Sep 2009 09:51:24 BST</dateCreated> </head> <body> <outline text="Science and Nature"> basically i removed the - and spaced at the start of the line, I have added a extra line of code to clean your files up, function getContent($url='') { $html = @file_get_contents($url); $html = preg_replace('/^[\s-]*(.*?)[\s-]*$/sm', '\1', $html); //clean up return $html; } however i would highly recommend getting a valid file hope that helps [attachment deleted by admin]
-
could I get a copy of the file, your trying to use, so i can test, the code dose have some bad practices in it. and i know its going to generate errors
-
If your talking basing it on publicly available information, you can workout the value of a site using estimated traffic levels 1. http://w3calculator.com is worth $78 - $512.64 - $10,300.30 2. http://divinequran.com is worth $86 - $2,604.65 - $13,059.70 This is due the links and visitors. However as 98.0% and 98.8% of visitors are form INDIA, your probably only get interest from INDIA companies if anyone is interested.. phpfreaks.com Estimated Worth is $119 - $192,654.30 - $228,184.10 US 24.0% INDIA 19.3% UK 7.4% GERMANY 5.3% PAKISTAN 4.4%
-
Never has limit problems myself, Need more info..
-
this looks fine to me <?php session_start(); #include("connect.php"); #include("getbutton.php"); function confirmUser($username, $password){ global $conn; /* Add slashes if necessary (for query) */ if(!get_magic_quotes_gpc()) { $username = addslashes($username); } /* Verify that user is in database */ $q = "select password from users where username = '$username'"; $result = mysql_query($q); if(!$result || (mysql_numrows($result) < 1)){ return 1; //Indicates username failure } /* Retrieve password from result, strip slashes */ $dbarray = mysql_fetch_array($result); $dbarray['password'] = stripslashes($dbarray['password']); $password = stripslashes($password); /* Validate that password is correct */ if($password == $dbarray['password']){ return 0; //usernmae/password correct } else{ return 2; //password failure } } // Function to see if cookie is set, then checks the username with the password function loggedIn(){ if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){ $_SESSION['username'] = $_COOKIE['cookname']; $_SESSION['password'] = $_COOKIE['cookpass']; } if(isset($_SESSION['username']) && isset($_SESSION['password'])){ if(confirmUser($_SESSION['username'], $_SESSION['password']) != 0){ unset($_SESSION['username']); unset($_SESSION['password']); // username/password wrong return false; } // user logged in and correct username/password return true; } // no cookies set else{ return false; } } $logged_in = loggedIn(); // check if logged if($logged_in){ // if logged on already redirect to homepage #header("Location: http://www.website.net/homepage.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <div id="loginDiv"> <?php include ("loginform.php"); ?> </div> </body> </html> <?php if(isset($_POST['sublogin'])){ session_start(); $username = $_POST['userName']; $password = md5($_POST['userPass']); include_once("connect.php"); $ress=mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error()); $rows=mysql_fetch_array($ress); if(($rows["username"]==$username)&&($rows["password"]==$password)){ $_SESSION['username']=$username; $_SESSION['password']=$password; if(isset($_POST['remember'])){ setcookie("cookname", $_SESSION['username'], time()+60*60*24*100, "/"); setcookie("cookpass", $_SESSION['password'], time()+60*60*24*100, "/"); } echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.mywebsite.net/homepage.php\" />"; return; }else{ echo "<font style=\"color:#F00; margin-left:20px\">Wrong username or password</font>"; } } ?> <form action="" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="0"> <tr><td style="color:#999; font-weight:bold; text-align:right;">Username:</td><td colspan="2"><input type="text" name="userName" height="10" size="15" maxlength="30"></td></tr> <tr><td style="color:#999; font-weight:bold; text-align:right;">Password:</td><td colspan="2"><input type="password" name="userPass" height="10" size="15" maxlength="30"></td></tr> <tr><td align="right" style="color:#999; font-weight:bold; text-align:rigt;">Remember:</td><td align="left" style="padding-left:0"><input style="margin-left:0" type="checkbox" name="remember"></td><td align="right" style="padding-right:5px"><input class="textassubmitbutton" style="text-align:right" type="submit" name="sublogin" value="Login"></td></tr> </table> </form>