I don't know much php and that is why I'm asking the experts here for a solution. I wish to set up a password box on a web page. I will then advertise my website at various places and hand out different passwords depending on where I advertise. When a visitor arrives at my site, they will be asked for their password to enter the site. No.1 - How do I set up this password box? No.2 - How do I keep track of the number of visitors from a particular ad by use of their password? I know simple html and I can make a password box from Dreamweaver. I just don't know how to connect that box to do anything. I can make a MySQL Table in my cpanel. I don't know what fields to put in there. I don't know how to work with submitted form data either. I can make simple sql statements but I don't know any of them except "SELECT * from Table". At the same time, is there a better way of viewing my tracking results with a user friendly interface rather than logging into my cpanel MySQL Database? I don't know any php which makes this all the more difficult. Can anybody help, JH
You're in luck. I just did this recently. <?php If ($_POST['pass'] == 4711) { echo '<br> <IFRAME SRC="http://mitch.chemicalforums.com/pass4711.php" WIDTH=1600 HEIGHT=1600 frameborder=0 framespacing=0 border=0></iframe>'; }?> <?php If ($_POST['pass'] == 1234) { echo '<br> <IFRAME SRC="http://mitch.chemicalforums.com/pass1234.php" WIDTH=1600 HEIGHT=1600 frameborder=0 framespacing=0 border=0></iframe>'; }?> <form action="pass.php" method="post"> Password: <input type="password" name="pass"><br> <p><input type="submit" /></p> </form> PHP: The 4711, 1234, just represent different passwords that the user puts in and it open that associate page in an iframe of the same page. There are much more elegant ways to do what you are asking, but I had this lying around and it'll do the trick until you learn php better. The page you do this on has to be called pass.php for this instance and you will also need to create an associated page called pass1234.php and pass4711.php . Or you can edit the above code appropriately.
First, I'm not a MySQL guy. But, I would just put webcounters on those pages to track that info for you.
User management and login forms are complex and have too many elements to properly discuss here. I suggest following a tutorial as this will give you a script to test out and modify. http://www.free2code.net/plugins/articles/read.php?id=99 http://www.phpfreaks.com/tutorials/65/0.php http://www.phpfreaks.com/tutorials/17/0.php