PDA

View Full Version : Team KA


hughesie89
16th January 2008, 08:32
Hi all, i know this isn't really an insim thing, but i thought it was the best place to ask


i am looking at create a form for people to put in their infomation so that they can register for upcoming events (like the one used to sign up to this forum, the one that ask username and password and so on)

any idea of how to do it

edit:
the web host offers me database options of
mysql
and
phpmyadmin

Krammeh
16th January 2008, 11:54
Basically, you need to make a HTML output, with a form, the form will include several fields (username,pass and so on).

It will then post the form to post.php - and that script will take those variables, and put it into the database.


Here is a very very simple sample I just made- shoudl work - but not tested it

<html>
<head>
<title>test</title>
</head>
<body>
<form action="post.php" method="post">
lfs user: <input name="lfsuser"><br>
which event: <input name="event"><br>
<input type="submit" value="send">
</form>
</body>
</html>

<?php
// this file needs to be called post.php - if changed, also in above code

$db=mysql_connect("dbhost", "dbuser", "dbpass");
mysql_select_db("dbname");

$query='INSERT INTO `event_log` (`lfsuser`, `event`)
VALUES("'.addslashes($_POST['lfsuer']).'",
"'.addslashes($_POST['event']).'")';
mysql_query($query, $db);
echo 'Your request has been stored';
?>

the_angry_angel
16th January 2008, 12:31
Cross site scripting issues there Krammeh.

Krammeh
16th January 2008, 13:18
well of course you would have to include an auth MD5 code, or similar (randomised) or such like.

its just an example.

hughesie89
16th January 2008, 22:47
alright, i think im over my head here, i do most of my webdev in dreamweaver and contribute and im not a very techniclly minded person.

but i shall give it a go and be back :)