Notice: Undefined variable: submit

Gestart doorWouter17 reacties35 weergaven

18 berichten · pagina 1 van 2

Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Deze foutmelding krijg ik:

Notice: Undefined variable: submit in [i]...[/i] on line 3


bij dit script

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/require"]require[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$submit[/COLOR][COLOR= #007700]){[/COLOR]
?>


Wat is er mis met die submit?
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat mij als eerste opvalt is dat je de { niet hebt afgesloten.

maarja, ben net 2 dagen bezig met php dusseemo
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Precies wat de melding zegt; $submit bestaat niet.
Waarschijnlijk moet je $_POST[submit] hebben?
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Rogier schreef:
wat mij als eerste opvalt is dat je de { niet hebt afgesloten.
maarja, ben net 2 dagen bezig met php dusseemo
Dit klopt wel, want later sluit het script hem dan af.

@ Lennard
Hoe hoe moet ik dat daar in zitten?
helemaal bovenaan

$submit = "$_POST[submit]";
?>

zetten?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
$submit gewoon vervangen door $_POST[submit] en kijken of het werkt.
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Lennard schreef:
$submit gewoon vervangen door $_POST[submit] en kijken of het werkt.
nope cry
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Waar moet die $submit dan vandaan komen? emo
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Lennard schreef:
Waar moet die $submit dan vandaan komen? emo
<h1 class="title">Aanmelden op [COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"$sitenaam"[/COLOR][COLOR= #007700];[/COLOR] ?></h1>
<p class="entry">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR] ?>
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/require"]require[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]][/COLOR][COLOR= #007700];)[/COLOR][COLOR= #007700]{[/COLOR]
?>
Velden met een * zijn verplicht...
<form method="POST" action="[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$PHP_SELF[/COLOR] ?>">
  <input type="hidden" name="submit" value="1">
  Naam:<br>
  <input type="text" name="naam" size="30"> *<br>
  Email adres:<br>
  <input type="text" name="email" size="30"> *<br>
  Homepage:<br>
  <input type="text" name="homepage" size="30" value="http://"><br>
  Woonplaats:<br>
  <input type="text" name="woonplaats" size="30"><br>
  Geboortedatum ( dd-mm-jjjj ):<br>
  <input type="text" name="geb1" size="2" maxlength="2"> -
  <input type="text" name="geb2" size="2" maxlength="2"> -
  <input type="text" name="geb3" size="4" maxlength="4"><br>
  Geslacht:<br>
  <select size="1" name="geslacht">
  <option value="Man">Man</option>
  <option value="Vrouw">Vrouw</option>
  <option value="Weet ik niet">Weet ik niet</option>
  </select><br>
  Priv- berichten:<br>
  <select size="1" name="pm">
  <option value="1">Aan</option>
  <option value="0">Uit</option>
  </select><br>
  <br>
  Gewenste gebruikersnaam:<br>
  <input type="text" name="gebruikersnaam" size="25"> *<br>
  Wachtwoord:<br>
  <input type="password" name="wachtwoord" size="12" maxlength="12"> *<br>
  Wachtwoord [ bevestig ]:<br>
  <input type="password" name="wachtwoord2" size="12" maxlength="12"> *<br>
  <input type="submit" value="Aanmelden"> <input type="reset" value="Wis velden"></p>
</form>
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM members WHERE gebruikersnaam = $gebruikersnaam"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]){[/COLOR]
?>

Deze gebruikersnaam is al in gebruik<br><br>
<a href="javascript:history.go(-1)">Ga terug</a>

[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$naam[/COLOR] AND [COLOR= #0000BB]$email[/COLOR] AND [COLOR= #0000BB]$gebruikersnaam[/COLOR] AND [COLOR= #0000BB]$gebruikersnaam[/COLOR][COLOR= #007700]){[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700]!=[/COLOR][COLOR= #0000BB]$wachtwoord2[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De wachtwoorden zijn niet gelijk aan elkaar"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$geboortedatum[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"$geb1-$geb2-$geb3"[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$tekens[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"a"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"b"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"c"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"d"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"e"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"f"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"g"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"h"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"i"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"j"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"k"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"l"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"m"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"n"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"o"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"p"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"q"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"r"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"s"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"t"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"u"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"v"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"w"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"x"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"y"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"z"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"0"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"2"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"3"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"4"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"5"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"6"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"7"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"8"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"9"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"A"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"B"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"C"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"D"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"E"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"F"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"G"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"H"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"I"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"J"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"K"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"L"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"M"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"N"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"O"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"P"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Q"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"R"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"S"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"T"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"U"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"V"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"W"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"X"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Y"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Z"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$activeringscode[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]<[/COLOR] [COLOR= #0000BB]12[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$c[/COLOR][COLOR= #007700]++){[/COLOR]
[URL="http://www.php.net/srand"]srand[/URL][COLOR= #007700]((double)[/COLOR][URL="http://www.php.net/microtime"]microtime[/URL][COLOR= #007700]() *[/COLOR] [COLOR= #0000BB]100000000000000[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$tekens[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]62[/COLOR][COLOR= #007700])];[/COLOR]
[COLOR= #0000BB]$activeringscode[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$activeringscode[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$pass[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actmail[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$activeringscode[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actmail[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]"2"[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$activeringscode[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO members (gebruikersnaam,wachtwoord,naam,email,homepage,geboortedatum,woonplaats,geslacht,geactiveerd,pm) VALUES ($gebruikersnaam,$wachtwoord,$naam,$email,$homepage,$geboortedatum,$woonplaats, $drank, $artiest,$film,$hobbys,$geslacht,$relatie,$activeringscode,$pm)"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]

[COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Via onze website heb jij (als het goed is) een aanmeldingsformulier ingevuld waarmee je een lid van onze
website wordt, als dit niet het geval is kun je dit mailtje het beste verwijderen.nnAls je je wel wilt aanmelden voor een 
account op onze website moet je op de onderstaande url klikken om je account te activeren:nn
<a href="$script_url/activeer.php?activate=$activeringscode">$script_url/activeer.php?activate=$activeringscode</a>nnMet vriendelijke groet
Webmaster $webmaster_url"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actmail[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"$webmaster_email"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"Activeer nu je account $naam !"[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"$bericht"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De aanmelding is succesvol gelukt, er word nu een mailtje verstuurd aan <b>$email</b> waarin de activerings url staat..."[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$actmail[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #DD0000]"2"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je account is geactiveerd, je kunt nu inloggen..."[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De aanmelding is gelukt, het is nu aan de webmaster om te beslissen of hij/zij je accepteerd als member van deze website..."[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>

Je hebt niet alle verplichte velden ingevuld...<br><br>
<a href="javascript:history.go(-1)">Ga terug</a>

[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}
}
}[/COLOR]
?>
</p>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat gebeurd er als je sumbit weghaald?
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Shahiem schreef:
Wat gebeurd er als je sumbit weghaald?
errors, in het script staan nl.
}
?>
en zo.
Maar anders zoek ik wel nieuw scriptje cry
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Doe maar, dit is gewoon bagger gescript..
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Rik schreef:
Doe maar, dit is gewoon bagger gescript..
als jij het zegt zal het zo wel zijn smile
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Ja, ik zie nu al 5 variables minstens die je nergens een waarde mee hebt gegeven. Hoe wil je die dan ooit gaan gebruiken? =]
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Rik schreef:
Ja, ik zie nu al 5 variables minstens die je nergens een waarde mee hebt gegeven. Hoe wil je die dan ooit gaan gebruiken? =]
heb een nieuw script nodig emoken jij een loginsysteem met pb ZONDER layout, want altijd als ik de layout weg wil werken krijg ik errors emo
0
Tim

Lid

Berichten
712
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vervang regel 5 even door

if(!isset($_POST[submit])){
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren