Jump to content

kennedysee

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by kennedysee

  1. Apparently i try to save the data into the mysql, but it didnt work.. Anyone help? create_users.php <script type="text/javascript"> var mac = macs.getMacAddress(); $.get('/create_users.php?mac=' + mac, function() { alert('yeah done'); }) </script> checkAvailability.php $mac = $_GET['mac']; $mac = mysql_real_escape_string($mac); $sql = "INSERT INTO test(mac) VALUES ('$mac')"; mysql_query($sql);
  2. How do i detect the visitor mac address when they visit the website? <?php function getMac(){ exec("ipconfig /all", $output); foreach($output as $line){ if (preg_match("/(.*)Physical Address(.*)/", $line)){ $mac = $line; $mac = str_replace("Physical Address. . . . . . . . . :","",$mac); } } return $mac; } $mac = getMac(); $mac = trim($mac); ?>
  3. Why the date and time is not exact with my timezone? and the data ends with a ":st"... $time = time(); $tstamp = date("m/d/y h:i:S", $time); 01/21/10 08:28:st Anyone help??
  4. The program works with sending via email with the real password that exists in database... Can anyone help me with sending a random password to the email instead of showing the real password out? Thanks... forgot_password.php <table width="380" border="0" cellpadding="3" cellspacing="1" > <tr> <td width="33%"><strong>Enter your email : </strong></td> <td width="67%"><form name="form1" method="post" action="send_password_ac.php"> <input name="email_to" type="text" id="mail_to" size="25"> <input type="submit" name="Submit" value="Submit"> </form> </td> </tr> </table> send_password_ac.php <?php $host="localhost"; // Host name $username="root"; // Mysql username //$password=""; // Mysql password $db_name="registration"; // Database name //Connect to server and select databse. mysql_connect("$host", "$username")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); // value sent from form $email_to=$_POST['email_to']; // table name $tbl_name=user; // retrieve password from table where e-mail = $email_to(mark@phpeasystep.com) $sql="SELECT password FROM $tbl_name WHERE email='$email_to'"; $result=mysql_query($sql); // if found this e-mail address, row must be 1 row // keep value in variable name "$count" $count=mysql_num_rows($result); // compare if $count =1 row if($count==1){ $rows=mysql_fetch_array($result); // keep password in $your_password $your_password=$rows['password']; // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email_to; // Your subject $subject="Your password here"; // From $header="from: your name <your email>"; // Your message $messages= "Your password for login to our website \r\n"; $messages.="Your password is $your_password \r\n"; $messages.="more message... \r\n"; // send email $sentmail = mail($to,$subject,$messages,$header); } // else if $count not equal 1 else { echo "Not found your email in our database"; } // if your email succesfully sent if($sentmail){ echo "Your Password Has Been Sent To Your Email Address."; } else { echo "Cannot send password to your e-mail address"; } ?>
  5. I need to extract data from Wireless Access Point.. My access point is running on Cisco Aironet 1200series Data like MAC Address, IP Address How do i able to get it up on my website? Pls advise..
×
×
  • 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.