Vraag over PHP!

Gestart doorJosnl6 reacties34 weergaven

7 berichten · pagina 1 van 1

Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heey!

Mijn vraag is of het mogelijk is om een soort van "shoutbox" te maken zonder MySQL?

Zoja, hoe?

Alvast bedankt voor de hulp!

Josthumbsup
Vraag 2!

Weet iemand waarom het volgende niet werkt? (Als er geen e-mail is ingevuld gaat het nog steeds door met het uitvoeren, en er staat al: Er is geen naam ingevuld als ik alleen al naar de pagina ga)

<FORM METHOD="POST" ACTION="">
<TABLE BORDER="0">
  <TR>
    <TD>Je naam:</TD>
    <TD>
      <INPUT TYPE="TEXT" NAME="name" SIZE="30px" />
    </TD>
  </TR>
  <TR>
    <TD>Verzoeknummer:</TD>
    <TD><INPUT TYPE="TEXT" NAME="vzknr" SIZE="30px" value="bijv. Rick Ross - Speedin" /></TD>
  </TR>
  <TR>
      <TD>Je e-mail adres:</TD>
      <TD><INPUT TYPE="TEXT" NAME="email" SIZE="30px" /></TD>
  </TR>
  </TABLE>
<P><INPUT TYPE="SUBMIT" VALUE="Insturen!" NAME="toevoegen"></P>
</FORM>
    
[COLOR= #0000BB]<?php[/COLOR]

 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen naam ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent je naam vergeten![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen verzoeknummer ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen verzoeknummer ingevuld![/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen email ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen e-mail adres ingevuld![/COLOR][COLOR= #007700];
}

}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #FF8000]//Query[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO verzoeknummer(name,vzknr,email) VALUES("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]);
}[/COLOR]

?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
je kan de berichten in een .txt bestandje opslaan en er uit halen
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Nielsie

Bedankt, maar het hoeft niet meer zonder MySQL! biggrin
Kan iemand vraag 2 oplossen?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
onder de echo steeds exit; doen

[COLOR= #0000BB]<?php[/COLOR]

 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen naam ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent je naam vergeten![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen verzoeknummer ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen verzoeknummer ingevuld![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen email ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen e-mail adres ingevuld![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #FF8000]//Query[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO verzoeknummer(name,vzknr,email) VALUES("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]);
}[/COLOR]
?>


hierboven kan ook
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankjewel, ik ga kijken of het werkt! wink
EDIT:
Het werkt wel, maar nog steeds als ik gewoon naar verzoek.php ga komt er alweer te staan dat ik vergeten ben om mn naam in te vullen... confused
0
Berichten
747
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
{[/COLOR]

 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen naam ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent je naam vergeten![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen verzoeknummer ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen verzoeknummer ingevuld![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #FF8000]//Er is geen email ingevuld[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen e-mail adres ingevuld![/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #FF8000]//Query[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO verzoeknummer(name,vzknr,email) VALUES("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]vzknr[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]","[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$insert[/COLOR] [COLOR= #007700]);
}

}[/COLOR]
?>


uitlijning moet je zelf maar even doen aangezien dat hier niet wil.
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje Arjan, het werkt nu! Je was alleen nog een } vergeten! yummie(Degene die je op regel 3/4 opende sloot je niet af op het eind?)
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