Showing posts from May, 2013

Generate Unique Name and ID based on table's first row

The code below will generate unique name and id based on table's first row, paste it before </body>

$(document).ready(function () { var rows = $("table tbody tr"); rows.each(function (i) { var inputs = $(this).find('input'); i++; inputs.eq(0).attr('id', 'txtTitle'+i ) .attr('name', 'txtTitle'+i ); inputs.eq(1).attr('id', 'txtLink'+i ) .attr('name', 'txtLink'+i ); }); });
Let's say for example you have this line of code in HTML:
<table id="matt">
        <td><input id="txtTitle" name="txtTitle" type="text" value="title" /></td>
        <td><input id="txtLink" name="txtLink" type="text" value="link" /></td>
        <td><input type=&…

Simple Log-in/Logout and Registration in PHP with Sessions

Before anything else, the interface is based on Facebook but it's on green. :D
Anyway, I'm too lazy to post the codes here so I decided to just upload all the files and you can download it if you like.