PHP - Serial Key Help
Hi Guys,
I want to go about creating a CMS, that'd cost per license key, however I'm not sure how to go about the checking of the Serial Key. For example, I could have a simple PHP script, that checked for the Serial Key, however they could then just go into a file, and delete that section of the file, which checks for the Serial Key. The reason I want to add a serial key checker, is incase people decide to leak my software, and could use it without paying. Whilst I'm aware they're will be cracks for it, I want to make sure that it'd be a good start. Could anybody please put forward any methods or suggestions? Thanks Guys! Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=332690.0 Hi all,
I want to send a string of data to serial port. Below is the code. Sdata contains the string. for example "<LT-ON-50>".
<?php exec("mode com3: BAUD=600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off"); if (isset($_GET['action'])) { $SData = $_GET['action']; $fp = fopen("com3","w"); fwrite($fp,$SData); fclose($fp); } ?>unfortunately, it will send only one character i.e '<'. the remaining characters will be lost. What could be wrong in the code. Any help can be greatly appreciated. Thanks, I made a function which displays the left and right children of the root. However i need to add serial numbers to them. Due to Recursive functions i'm not quite able to to do so . Can someone please help me? Code: [Select] function side_display($root) { $sql = "SELECT lchild,rchild FROM tree WHERE parent='".$root."'"; $sqlexec = mysql_query($sql); $array = mysql_fetch_array($sqlexec); if(!empty($array['lchild']) && $array['lchild'] != '0') { echo "<tr>"; echo "<td>".($array['lchild'])."</td>"; $get = "SELECT * FROM member WHERE member_id='".$array['lchild']."'"; $execget = mysql_query($get); $getarray = mysql_fetch_array($execget); echo "<td>".$getarray['fname']." ".$getarray['lname']."</td>"; echo "<td>".$getarray['id_sponsor']."</td>" ; echo "<td>Left</td>"; echo "<td>".$getarray['doj']."</td>" ; echo "</tr>"; side_display($array['lchild']); } if(!empty($array['rchild']) && $array['rchild'] != '0') { echo "<tr>"; echo "<td>".($array['rchild'])."</td>"; $get = "SELECT * FROM member WHERE member_id='".$array['rchild']."'"; $execget = mysql_query($get); $getarray = mysql_fetch_array($execget); echo "<td>".$getarray['fname']." ".$getarray['lname']."</td>"; echo "<td>".$getarray['id_sponsor']."</td>" ; echo "<td>Right</td>"; echo "<td>".$getarray['doj']."</td>" ; echo "</tr>"; side_display($array['rchild']); } } So I have this function which generates a random serial # that is 12 characters long. However I want to insert a dash every four characters like so: XXXX-XXXX-XXXX Any suggestions? Code: [Select] <?php $serial1 = get_serial_num(12); //Serial # function function get_serial_num($number_cnt){ $ret_arr = array(); $serial = ""; $ser_num = array("1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); for($i = 0; $i < $number_cnt; $i++){ $rand = rand(0,count($ser_num)-1); $val = wordwrap($ser_num[$rand],1,"\n", true); $serial .= $val; } return $serial; } echo ''.$serial1.''; ?> Warning: I am a bit noobish. How can you use PHP to generate a serial number? e.g. DF34-VB89-98AP-34NQ-QQUI-23AW Please i'm working on a project and i need to write a code that generates a unique random serial number.How can i go about it? |