ID for enkel side ?
Når en person har signet op igennem formen,vil jeg gerne have at personen så får sit id nummer tildelt.
så han får et link ligende : http://www.xxxx.net/inhits.php?id=/
også bare id nummert efter id=
Hvordan gør man det ?
Koden ser således ud:
<html>
<body>
<title>Signup</title>
<form action=\"signup.php\" method=\"post\">
<font size=\"1\" face=\"verdana\">
Site name: <input type=\"text\" name=\"sitename\"><br>
Site url: <input type=\"text\" name=\"siteurl\" value=\"http://www.\"><br>
Email: <input type=\"text\" name=\"email\"><br>
<input type=\"hidden\" name=\"id\">
<input type=\"hidden\" name=\"joined\">
<input type=\"submit\" value=\"Signup\">
</form>
<br>
<br>
<?php
mysql_connect(\"localhost\", \"root\", \"\");
mysql_select_db(\"link\");
$result = mysql_query(\"select siteurl from exchange where siteurl = \'$siteurl\'\");
$url = mysql_num_rows($result);
if ($url > 0) {
print \"Linket findes allerede i databasen!\";
} else {
if($sitename == \'\' OR $siteurl == \'\' OR $email == \'\') {
print \"<font face=\\\"verdana\\\" size=\\\"2\\\"><b>Du mangler at indtaste noget data!</b></font>\";
} else {
mysql_query(\"insert into exchange(id, sitename, siteurl, email, joined)
values(\'\', \'$sitename\', \'$siteurl\', \'$email\', \'$joined\')\");
print \"Din side er tilføjet i databasen!\";
}
}
print \"<center>
<font size=\\\"1\\\" face=\\\"verdana\\\">Your signup info is as following:<br>
$sitename<br>
$siteurl<br>
$email<br><br>\";
$ownsite = \"http://www.xxxx.net\";
$result = mysql_query(\"select siteurl from exchange where siteurl = \'$id\'\");
while($row = mysql_fetch_array($result)) {
print \"
The link you should use to send in hits with is:<br>
<a href=\\\"$ownsite\\inhits.php?id=$row[id]\\\">$ownsite/inhits.php?id=$row[id]/</a></font>
</center>\";
}
//$in_hits = mysql_query(\"select inhits from exchange where id = \'$id\'\");
//mysql_query(\"update exchange set inhits = \'$inhits\' where id = \'$id\'\");
?>