Jump to content

Millar

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by Millar

  1. Forms default method is GET so you have to remember to set method to POST if you want to use the $_POST variable.Also [ if ($badlogin = 0) { ] Would automaticaly set $badlogin to 0 rather than see if the value is equal.

  2. I have made a recursive function -

    function croncount ( $sec, $count ) {	if ( $sec > 299 ) {			$count = $count + 1;				$sofar =  $count * 300;				$poo = $sec - $sofar;				croncount ( $poo, $count );		} else {			return "$count";		}}

    It is supposed to work out how many lots of 300 there are in the number ($sec).But when I print out this function, nothing is returned?What have I done wrong?I set $count to "0" when calling the function, so it starts from "0".EDIT: Nevermind just found the problem, I wasn't returning the function in the first IF bit.

  3. When I insert emails into my database ( MySQL ) with PHP 'Blah@sdfsdf.com' would be in the database as 'Blah@sdfsdf' how can I fix this problem?Do I simply escape the .'s with a \ ?

  4. Can anybody give me the code for a countdown that will count down 5 minutes repeatedly, also I want it to be live so not just it changes when the age is reloaded.I would like it to follow a pattern of counting donw 5 minutes so that it finnishes on the 0, 5, 10, 15 etc minute of the hour.

  5. I don't mean that I mean this.Say the legend looks like this,Users online - An Admin, A mod, Normal Member, Normal Member.Legend: Admin | Mods | Members.and I put my mouse over Admin, this happens...Users online - An Admin, A mod, Normal Member, Normal Member.Legend: Admin <-Mouse Over Here. | Mods | Members.

  6. I was wondering if there is anyway I could use javascrip in a member legend so that when you hover over the word admin on the legend it would make admins bold, I would be able to make it happen if say you clicked the word, but is there anyway you can make it live, so that when you hover over the world they become bold, I would think you would need to assign CSS styles to each group and make some sort of on hover that value = bold but I don't know how to do that so help is appreciated.Extra Info -A member legend on a forum so say for example it was like this -Users online - An Admin, A mod, Normal Member, Normal Member.Legend: Admin | Mods | Members.Say you hovered your mouse over Admin the name of the admins online would become bold.

  7. Try putting name in quotes.  You don't need all the quotes around everything else though.
    <?//------------------------------------------------------// Require MySQL...//------------------------------------------------------require_once("MySQL.php");$sesID = $_COOKIE['xM_ID'];class user {function data ( $rowinfo ) { $rowinfo = "'$rowinfo'"; $query = "SELECT * FROM xM_members WHERE id = '$sesID'"; $result = mysql_query( $this->query ); $row = mysql_fetch_array( $this->result );  $return = $row[$rowinfo];  return $return;} //var $query = "SELECT * FROM xM_members WHERE id = "; //var $result = mysql_query( $this->query ); //var $row = mysql_fetch_array( $this->result );var $name = $this->data("name");}$user = new user;print "Logged in as: {$user->name}";print $sesID;?>

    Didn't work :'(....
  8. :'(, I have written a script, also I haven'e configured the MySQL to work yet so I know it wont. The problem I have is, on the area - var $name = $this->data(name); - I get a parse error, Parse error: parse error, unexpected T_VARIABLE. When I put that variable in quotes I get this error, Parse error: parse error, unexpected '\"'.Here is the code I'm using.

    <?//------------------------------------------------------// Require MySQL...//------------------------------------------------------require_once("MySQL.php");$sesID = $_COOKIE['xM_ID'];class user {	function data ( $rowinfo ) {	  $rowinfo = "'$rowinfo'";	  $query = "SELECT * FROM xM_members WHERE id = '$sesID'";  $result = mysql_query( $this->query );  $row = mysql_fetch_array( $this->result );    $return = "$row[$rowinfo]";    return $return;		}	  //var $query = "SELECT * FROM xM_members WHERE id = ";  //var $result = mysql_query( $this->query );  //var $row = mysql_fetch_array( $this->result );		var $name = "$this->data(name)";}$user = new user;print "Logged in as: $user->name";print "$sesID";?>

×
×
  • Create New...