skprbill
05-29-2003, 01:58 PM
Signup confirmation to this forum required going to:
http://www.webhostingtalk.com/register.php?a=act&u=37404&i=49696586
I am new to PHP and lots of web workings. I'm very curious. Is this a "script" and exactly how does it work???
skprbill
05-29-2003, 02:01 PM
The URL got foreshortened. Here is the whole thing:
http://www.webhostingtalk.com/register.php?
a=act&u=37404&i=49696586
Sheps
05-29-2003, 02:06 PM
This whole forum is a script...
Rich2k
05-29-2003, 02:12 PM
Order a copy of vBulletin (http://www.vbulletin.com) and you can see how it works for yourself :)
The code is open for you to look at and modify (although still copyrighted to Jelsoft)... there is a huge community of developers 'hacking' vbulletin with little addons (or even big addons!)
SynHost
05-29-2003, 03:34 PM
The whole forum is a web application; the register.php file is a script.
If you don't wish to pay the fee for vBulletin, check out phpBB, another pretty good message board application.
skprbill
05-29-2003, 03:58 PM
This this technique is not only for forums and message boards. I received others as follows:
Here is one to confirm signup to a new account-
http://www.ListFire.com/confirm.php?id=22452&code=987616777
Here is one to confirm sighnup for a course by Email-
http://www.freeauctionprofits.com/listmail/confirm.php?u=cc4f2b7
Here is one following up on an ebay order I placed-
http://vendio.com/wbn.x/01000100000000002924368483
xx/c340bf672
Here are two to confirm subscription to newsletters-
http://cgi.mail-list.com/rsvp.pl?ln=ebsen&rn=s051202134029241
http://www.topica.com/sysmsg/?cid=3.iennMEMbn.ninnNeMN
I am not concerned about what application the code is for. Rather, I want to know how the code works. Where does it go in the website after being stripped off the URL? Typically, does it add to or change a database inside the server?
Thanks for your help,
Bill
SROHost
05-29-2003, 04:41 PM
You're getting warm. Going into detail is way beyond a few forum posts, but in a nutshell:
- Application checks for a session variable indicating you are logged in.
- If that variable doesn't exist, application displays login form.
- User enters info and presses "submit" button.
- Application looks up user/pass in a database, adds user to an "activeuser" table and sets a variable/cookie allowing access.
What you really need to do is search any search engine or script site for "php mysql login script" and tear a script apart for yourself.
Darktwist
05-29-2003, 06:16 PM
I think I am good PHP scripter, the script below is example of activate/confirm script for login system… I wrote this script about 1 year ago… you might be able to understand how it works by looking at my script.
<?php
include ("Config.php");
$sqldb = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db,$sqldb);
if (isset($_GET['username']) && isset($_GET['account'])) {
if (md5($_GET['username']) == $_GET['account']) {
$user = $_GET['username'];
$resulter = mysql_query("Select username,activate from users Where username='$user'",$sqldb);
while($row = mysql_fetch_row($resulter)) {
if ($row['0'] == $user && $row['1'] == 'no') {
$result = mysql_query("Update users set activate='yes' Where username='$user'",$sqldb);
echo("Successfully activated the user account as $user<p>");
echo("You may now Login anytime :)");
exit();
}
if ($row['0'] == $user && $row['1'] == 'yes') { echo("You have already activate as $user"); exit(); }
}
if ($row['0'] != $user) { echo("No such user - $user");
}
}
else { echo("Error: Activate Failer"); }
}
?>
looks cool eh?
Rich2k
05-30-2003, 04:39 AM
Surely the script in question is actually an activation question rather than login?
DM-ISPro
05-30-2003, 06:07 AM
Bill, short and sweet ...
I am not concerned about what application the code is for. Rather, I want to know how the code works. Where does it go in the website after being stripped off the URL? Typically, does it add to or change a database inside the server?
The purpose is (as Rich2k said) to confirm your e-mail address.
You are sent a code to your e-mail that is used by this script to activate your account!
You have your user id, the code and the mode "act" (activate account) parsed to the script;
The id and code are both used, matching your registration;
What it will do is (yes) modify the database thus activating your account!