473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

help...adduser

Hi!

I have a problem and wonder if anyone can help me with that. I am trying
to make a community in php/mysql to work but it don't. I hope you can
help me even if the community is in swedish.

Php an mysql is up and running and it works.

Here is the comminity:
http://kamrate.se/iwcommunity/default.php

The problem is when I try to registrate a new user here:
http://kamrate.se/iwcommunity/login/...?login=newuser

I choose a username=användarnamn, a password=lösenord and an
emailadress=E-post, but when I press Create account=Skapa konto I get
this error:

No username?=
Inget användarnamn?

A username have to contain at least four signs!=
Ett användarnamn måste bestå av minst fyra tecken!

The add user page looks like this:

<?php // top.inc ?>
<?php require ('\program\apache
group\apache2\htdocs\iwcommunity\_inc\top.inc'); ?>

<?php // Innehåll ?>

<?php if($login = "adduser") { ?>

<table cellpadding="0" cellspacing="0" style="border-width: 1pt;
border-color: #000000; border-style: solid" align="left">

<tr>
<td class="menux" width="20"></td>
<td class="menux"><br><span class="rubrik">Skapa
användarkonto</span><br><img src="/iwcommunity/_media/line.gif"
vspace="5" height="1" width="100%"></td>
<td class="menux" width="10"></td>
</tr>

<tr>
<td class="menux" width="10"></td>
<td class="menux" width="600" height="200" valign="top"><span
class="brodtext">

<?php $kontroll = 1;
$andrakontroll = 0;
$length = strstr($epost, '@');
$for = substr($length, 0, 1);
if($username == "") { ?>
<span class="rubrik">Inget användarnamn?<br>
<img src="/iwcommunity/_media/line.gif" vspace="5" height="1"
width="100%"><p></span>

<?php echo("Ett användarnamn måste bestå av minst fyra tecken!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif($password == "") { ?>

<span class="rubrik">Inget lösenord?<p></span>

<?php echo("Du måste skriva in ett lösenord för att skapa ett
användarkonto!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif($epost == "") { ?>

<span class="rubrik">Ingen e-postadress?<p></span>

<?php echo("Du måste skriva in en e-postadress!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif(strlen($username) < 4) { ?>

<span class="rubrik">För kort användarnamn!<p></span>

<?php echo("Ditt användarnamn måste bestå av minst fyra tecken!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif(strlen($password) < 4) { ?>

<span class="rubrik">För kort lösenord!<p></span>

<?php echo("Ditt lösenord måste bestå av minst fyra tecken!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif($for != "@") { ?>

<span class="rubrik">Inget @-tecken?<p></span>

<?php echo("Din e-postadress måste innehålla ett @-tecken!");
echo("<p>");
echo("<a href=/iwcommunity/login/login.php?login=newuser
class=menulank>Återgå</a>");

$kontroll = 0;

} elseif($kontroll = 1) {

$open = mysql_connect("localhost", "iwcommunity", "iwcx");

$sql = mysql_db_query("iwcusers", "SELECT * FROM users", $open);

while ($rad = mysql_fetch_array($sql)) {

if($username == $rad["username"]) { ?>

<span class="rubrik">Användarnamnet finns redan<p></span>

<?php echo("Användarnamnet du vill använda finns redan!
Återgå och välj ett nytt!");
echo("<p>");
echo("<a
href=/iwcommunity/login/login.php?login=newuser class=menulank>Återgå</a>");

$andrakontroll = 1;

break;

}

}

if($andrakontroll != 1 & $kontroll == 1) {

mysql_close($open);

$blevmedlem = date("Y-m-d");
$antalbesok = 1;
$saknas = 0;

$open = mysql_connect("localhost", "iwcommunity", "iwcx");

mysql_db_query("iwcusers", "INSERT users (username, password,
epost, blevmedlem, antalbesok, year, month, day, mek, senast, egensida,
presentation, intressen, favoritfarg, hogstaonskan, yrke)
VALUES('$username', '$password', '$epost', '$blevmedlem', '$antalbesok',
'$saknas', '$saknas', '$saknas', '$saknas', '$saknas', '$saknas',
'$saknas', '$saknas', '$saknas', '$saknas', '$saknas')");

mysql_close($open);

?>

<span class="rubrik">Nytt användarkonto skapat<p></span>

Hallå där <b><?php echo($username) ?></b>! Nu är ditt användarkonto
klart att börja användas. Gå till <a href="/iwcommunity/default.php"
class="menulank">inloggningssidan</a>
och logga in som vanligt.<p>

<b>Glöm inte dina uppgifter!</b><p>

Användarnamn: <b><?php echo($username)?></b><br>
Lösenord: <b><?php echo($password)?></b><br>

<?php } ?>
<?php } ?>
<?php } ?>

<?php // bottom.inc ?>
<?php require ('\program\apache
group\apache2\htdocs\iwcommunity\_inc\bottom.inc') ; ?>

Thanks
Yvonne
Aug 15 '05 #1
0 1658

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
3
by: Graham Parsons | last post by:
We are experiencing the following on two PCs running WebLogic server .... even though every other PC in the organisation has no such problems running the same software. Anyone who could shed any...
2
by: morphex | last post by:
Hi there, does anyone here know of a script that enables adding of users on UNIX platforms via python? Thanks, Morten
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
3
by: Vagabond | last post by:
I have a section of code that seems to work untill I go to get the result but can't see what I am doing wrong. function Edit_User(){ global $conn; Connect_to_db(); $sql = "SELECT * FROM...
3
by: wdandrews1 | last post by:
/* Remove.c ** Usage: remove < In_file Out_file (using redirection) */ #include <stdio.h> #include <stdlib.h> int main(void) { char c; int space = 0;
13
by: Apostle | last post by:
Hi all, after thinking for sometimes, I thought it will be great opportunity to learn if I will start from scratch and build my own register/login system. Here is the thread that I will be posting...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.