Jump to content

dcro2

Members
  • Posts

    489
  • Joined

  • Last visited

    Never

Everything posted by dcro2

  1. Ohh yeah.. sorry, I was in the middle of class I think he meant: $ms=mysql_query("SELECT * from `messages` WHERE (`from`='{$_SESSION['id']}' OR `to`='{$_SESSION['id']}') AND `mail_id`='$id' ORDER BY `id` DESC LIMIT $start,$per_page"); while($row = mysql_fetch_array($ms)) { $rows[] = $row; } $rows = array_reverse($rows);
  2. Why would you want to list it like that? o_o
  3. I got it to work, but the effect seems to be coded in Flash, not PHP or anything. You couldn't really do this in PHP alone. You'd have to use at least Javascript in addition to PHP. And still, I'm wondering why exactly you thought of file_get_contents?
  4. So you want to remove anything that's NOT one of these characters? Use ^ $string = preg_replace("/[^\p{L}a-z0-9]/iu", "", $string); Remember that space is included...
  5. dcro2

    BBcode

    I think people might be more willing to help if you post your code...
  6. Have you tried looking for the cookie in your browser? I know Firefox and Chrome let you look at the full list of cookies you have set. The directory or something might be set differently than you expect, since you don't specify the cookie domain or path.
  7. No.. that would just print the code onto the page in your browser. You have to join your html with what nl2br outputs: $HTML = "<font size=2 face=arial><b><u>" . $name ." from " . $location . "</font></u></b><br><br>\n"; $HTML .= nl2br($_POST['message']); Don't know if you know about string concatenation so here's a link on what it is: http://php.net/manual/en/language.operators.string.php
  8. It wasn't meant to be plug and play... I don't know what you're trying to replace or allow, I was just showing you an example. Maybe if you post the code and what you're trying to do...
  9. Do you mean... $gmap->showLocation($cross,$town,$county, $state); ? or.. $gmap->showLocation($cross,$town,$county.$state);
  10. You didn't wrap it in quotes, so to the browser every word after the first is just another attribute for that tag... title='".$translation."' Also... don't try to use bb code in or [php] tags.
  11. Did you switch browsers or something? Because, again, this is because you sent POST information through a form to the page you're trying to go back to. Most browsers will tell you the page has expired and to refresh if you want to re-submit the form. They do this because if, for example, you had just clicked the 'buy' button on the page before that, it might mean that you're buying or paying for it again.
  12. What exactly do you mean by not working properly? I don't know where the first part comes from so that's up to you. $max = 3; $i = 1; foreach($otherfans as $other) { if($i > $max) break; if($i > 1) echo ', '; if($i == $max || $i == count($otherfans)) echo 'and '; $displayName = ucwords($other['firstname'].' '.$other['lastname']); echo '<a href="../u/'.$other['username'].'">'.$displayName.'</a>'; if($i == $max && count($otherfans) > $i) { $others = count($otherfans) - $i; echo ' with '.$others.' other'.($others>1 ? 's' : ''); } $i++; }
  13. I think your problem is riiight here: date("g") 'g' returns a 12 hour-format hour. mktime() expects a 24-hour format hour, otherwise it would ask for AM/PM as well. Change it to a capital G. Btw, you know you can get the current timestamp with time(), right? $now = time();
  14. Yeah, it makes sense, but only if you copy the default profile pic. If you rename it you won't be able to use it again after the first time someone doesn't upload a pic... because it won't exist as that file name anymore.
  15. $file_in = "Rainbow-code-1_blck.jpg"; $filename = $this->getMsisdn().".jpg"; if(!rename($file_in, $filename)) echo "Failed to rename image."; You do understand that as soon as you run this once, the code will fail if you try to run it again, right? It won't be able to find 'Rainbow-code-1_blck.jpg' because it's been renamed. That's why I was suggesting you make a copy of it (under that new name). To do that just replace the rename call with copy.
  16. This work? function getYesMin($arr) { sort($arr, SORT_NUMERIC); foreach($arr as $val) { $parts = explode('|', $val); if(strtolower($parts[1]) == 'yes') return $val; } }
  17. $filename is the result of rename, which returns TRUE or FALSE depending on whether it was able to rename the file or not... if it's blank that means it probably failed.
  18. Unless you changed some table fields around... //to display image from source $dir = "profpics"; $sql = "SELECT prof_pic FROM users WHERE username = '{$_SESSION['MM_Username']}'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0) die("Username not found in database."); $row = mysql_fetch_array($res); echo "<img src='$dir/{$row['prof_pic']}' width='88' height='88'><br>";
  19. Meaning this: class packet { private $SERVER; function __construct() { //or packet() if on PHP4 $this->SERVER = $_SERVER['SERVER_ADDR']; } }
  20. Eh? echo "<a href='#'>".$var."</a>"; Try rephrasing your question...
  21. Don't you mean: $filename = rename($file_in,$this->getMsisdn()."jpg"); $filename will just have TRUE or FALSE based on whether it succeeded or not. Are you sure you want to just rename it or make a copy?
  22. Try this: $body = "<html><body><p>This email TO AP is confirmation of your appointment of Clear Appointments as your agent for service of process under the agreement between $parties. Our appointment starts on $appdate and you have appointed us for $term years from this date. We have attached our letter of confirmation to this email for your records.</p> <p>You can log into your account on our website (<a href=\"http://www.clearappointments.co.uk\">www.clearappointments.co.uk</a>) at any time to review your documents and change your contact details. Your user name is: $username and your password is: $password.</p> <p>We appreciate your custom and hope that you will use us again.</p> <p>Kind regards</p> <p>Clear Appointments Team</p> </body></html>"; Are the username and password the only things that don't show up? PS: next time, use tags around your code.
  23. Yes. Do you use any $_POST in the previous page? Remember, that javascript will take you back one page in the current tab/window's history, so make sure that's actually what you think it is.
  24. Should've said that from the beginning $max = 3; $i = 1; foreach($otherfans as $other) { if($i > $max) break; if($i > 1) echo ', '; if($i == $max || $i == count($otherfans)) echo 'and '; $displayName = ucwords($other['firstname'].' '.$other['lastname']); echo '<a href="../u/'.$other['username'].'">'.$displayName.'</a>'; $i++; }
  25. Don't know how you'd get a css class error... I think it looks cleaner without all the backslashes.. but to each his own. (Obviously I meant newstext, not newstest )
×
×
  • 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.