[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - formuliertje in if else lus
Pagina 1 van 1

formuliertje in if else lus

BerichtGeplaatst: 10 jun 2006 08:04
door Weeeyaa
Ik zou graag een formuliertje maken in een if else lus.
hoe moet dit, ik heb al geprobeerd om php in de lus te sluiten, het formuliertje te maken en php weer te openen, maar dat werkt niet.

wie weet hoe dit wel kan?

dit is de bedoeling:

[code="php"]if(iets)
{
echo "verwijderen?";
<form>
<input type="submit" value="ja"> <input type="submit" value="nee">
</form>
}

else
{
echo "snap je? ";
}
[/code]
alvast bedankt,

Thijs

Re: formuliertje in if else lus

BerichtGeplaatst: 10 jun 2006 08:35
door KillerSponge
[code="php"]<?
if (blaat)
{
?>
formulier
<?
}
else
{
?>
dit zou gewoon moeten werken
<?
}
?>[/code]

Re: formuliertje in if else lus

BerichtGeplaatst: 10 jun 2006 08:40
door Weeeyaa
dan ga ik dat toch nog eens proberen Smile

bedankt!

Re: formuliertje in if else lus

BerichtGeplaatst: 10 jun 2006 08:56
door Weeeyaa
ja nou jij het zo zegt werkt het wel Smile bedankt!

ik heb nu het volgende, het cotroleerd eerst of er een id in de url staat, als dat zo is dan echot hij dat formulier, maar klik je op Ja, en verwijdert hij niets wat wel de bedoeling is.

hoe kan dat?

[code="php"]// het daatwerkelijke deleten
$delete_id = $_GET['delete'];

if(isset($delete_id))
{
echo "<br />weet u zeker dat u deze persoon wilt verwijderen uit de database?<br />";
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<input type="submit" value="Ja" name="delete_ja"> <input type="submit" value="nee" name="delete_nee">
</form>
<?php

if(isset($delete_ja))
{
$sql = "DELETE FROM gegevens WHERE id=$delete_id";
$query = mysql_query($sql) or die("Er is iets mig gegaan tijdens het verwijderen van de persoon.<br />
Klik <a herf=\"verwijder.php\">hier</a> om terug te gaan.");
}

else
{
echo "";
}
}

else
{
echo "<br />Klik op de link \"Delete\" om de persoon te verwijderen uit uw database.<br />";
}
[/code]

de variable van het formulier heb ik makkelijker geschreven naar $delete_ja en $delete_nee. ik hoop dat je er wijs uit word Wink

alvast bedankt,

Thijs

Re: formuliertje in if else lus

BerichtGeplaatst: 18 jun 2006 12:44
door Weeeyaa

Re: formuliertje in if else lus

BerichtGeplaatst: 18 jun 2006 13:20
door KillerSponge
Je moet $delete_ja wel met $_POST['delete_ja'] aanroepen Wink

Re: formuliertje in if else lus

BerichtGeplaatst: 18 jun 2006 16:30
door Weeeyaa
ik heb in de file config.php die ik iets hoger include:

$delete_ja = $_POST['delete_ja'];

Thijs

Re: formuliertje in if else lus

BerichtGeplaatst: 18 jun 2006 16:46
door Robin
Laat hem achter
[code="php"]
if(isset($delete_ja))
{
[/code]
iets echoën, om te kijken of $delete_ja het doet...

Re: formuliertje in if else lus

BerichtGeplaatst: 18 jun 2006 16:54
door Weeeyaa
ga ik proberen bedankt

Thijs