Jump to content
xisto Community
Sign in to follow this  
the ipc

Help Me With My Code Please! I cant find the bug

Recommended Posts

Howdy,

 

I've created a PHP script but it semms not to work, here's my script:

 

 

# # --> img-verwijderen.php <-- # #

 

<?

if (isset($_POST["delete"])) {

if (unlink($map.$file) == TRUE)

echo "Afbeelding met succes verwijderd <br /><a href=\"img-gallerij.php\"> Terug</a>";

else

echo "Afbeelding is niet verwijderd<br /><a href=\"img-gallerij.php\"> Terug</a>";

 

}else{

if (isset($_POST["verwijderen"])) {

?>

 

Weet je zeker dat je deze afbeelding wilt verwijderen _linenums:0'><?if (isset($_POST["bekijk"])) { $melding = ""; if ($_POST["map"] == "" ) { $melding .= "Je moet eerst <a href=\"img-gallerij.php\">hier</a> een map selecteren</span>"; } else { $map = $_POST["map"];?> <table width="520" cellpadding="0" cellspacing="0"> <tr height="20"> <td width="120px" align="center" valign="middle"><b>Afbeelding</b></td> <td width="320px" align="center" valign="middle"><b>Naam</b></td> <td width="80px" align="center" valign="middle"><b>Verwijder</b></td> </tr><$handle=opendir($map); while (false!==($file = readdir($handle))) { if ($file != "." && $file != "..") { ?> <tr height="70px" valign="middle"> <td width="120px" align="center" valign="middle"><? echo "<a href=\"".$map.$file."\" target=\"_blank\"><img src=\"".$map.$file."\" class=\"gallery\"></a>"; ?></td> <td width="320px" align="center" valign="middle"><? echo $file; ?></td> <td width="80px" align="center" valign="middle"><form action="img-verwijderen.php" method="post"><input type="hidden" name="map" value="<? echo $map; ?>" /><input type="hidden" name="file" value="<? echo $file; ?>" /><input type="Submit" value="Verwijderen" name="verwijderen" /></form><strong class='bbc'># # --> img-verwijderen.php <-- # #</strong><?if (isset($_POST["delete"])) { if (unlink($map.$file) == TRUE) echo "Afbeelding met succes verwijderd <br /><a href=\"img-gallerij.php\"> Terug</a>"; else echo "Afbeelding is niet verwijderd<br /><a href=\"img-gallerij.php\"> Terug</a>";}else{if (isset($_POST["verwijderen"])) {?>Weet je zeker dat je deze afbeelding wilt verwijderen:<br /><br /><? echo "<b>Naam:</b> " .$file. "<br />"; echo "<b>Img:</b> <br /><img src=\"".$map.$file."\" class=\"gallery\"><br /><br />";?><form action="img-verwijderen.php" method="post"><input type="hidden" name="map" value="<? echo $map; ?>" /><input type="hidden" name="file" value="<? echo $file; ?>" /><input type="Submit" value="Ja, verwijderen" name="delete" /><input type="Button" value="Nee, terug" onclick="java script:history.back();" /></form> <?} }?>


Please help me! I need this script on my website!!!!

 

Notice from electriic ink:
Please use CODE tags when writing code. Thank you.

Edited by electriic ink (see edit history)

Share this post


Link to post
Share on other sites

<

$handle=opendir($map);

while (false!==($file = readdir($handle))) { _linenums:0'><tr height="20"><td width="120px" align="center" valign="middle"><b>Afbeelding</b></td><td width="320px" align="center" valign="middle"><b>Naam</b></td><td width="80px" align="center" valign="middle"><b>Verwijder</b></td></tr><$handle=opendir($map);while (false!==($file = readdir($handle))) {


The bit in red should be <? because it begins the PHP code. If it's not that, please post the error that the code returned when it was executed.

Share this post


Link to post
Share on other sites

Posting the error that output gives you should help guys here to locate problem.If you have display_errors = off in php.ini turn it on, so you it displays error..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.