Jump to content

nee help with script...read me..


danny74

Recommended Posts

??? ???
Hello.
this is my problem.
go to http://test.burningdesire.nl
(this is my own site, and it contains no virusses or dailers!!)
there u will get a popup.
go to jezelf toevoegen.
some translations
leave stellen on stellen please
advertentie naam= name of youre auction.
advertentie omschrijving= discription of your auction.
prijs=price.
if ready press:toevoegen. then pagina2

wel here comes the problem....
there is a selection box that containes youre auctionname and other names.
Where u can put up an image to the selected name.

What i want is:
that the auctionname what u have putted in before, the only name will be in the selectiobox on pagina 2.
BUT, when the user closes the popup, that when he login again he can NOT chance the auction again,or put up another image.

i hope somebody can help
i will give the codes also.

########################################################################################
here is the first code  artikel_toevoegen.php  (to put in data for auction)
######################################################################################
[list]
[*]<?php
session_start();






require "header.php";
$admin = true;
require "authenticatie.php";

if ($knop && $naam && $omschrijving && $prijs) { // artikel ingevoerd?
$sql = "INSERT INTO Artikel (Naam, Omschrijving, Prijs) VALUES ('$naam', '$omschrijving', $prijs)";
if (!mysql_query($sql)) { // voer SQL code uit
echo "Toevoegen advertentie mislukt!";
                exit;
} else {
$artikelid = mysql_insert_id(); // primaire sleutel van zojuist toegevoegde rij
$sql = "INSERT INTO Categorie_per_Artikel (ARTIKEL_ID, CATEGORIE_ID) VALUES ($artikelid, $categorieid)";
if (!mysql_query($sql)) { // voer SQL code uit
echo "Toevoegen categorie mislukt!";
                exit;
                }
}
echo "OK, uw advertentie $naam is toegevoegd.";     
} elseif ($knop) {
$sql = "INSERT INTO Categorie_per_Artikel (ARTIKEL_ID, CATEGORIE_ID) VALUES ($artikelid, $categorieid)";
if (!mysql_query($sql)) { // voer SQL code uit
echo "Toevoegen categorie mislukt!";
                exit;
}
echo "OK, uw advertentie $naam is toegevoegd.";

   
}
if ($knop) {
?>
<form method="post" action="<?php echo $PHP_SELF ?>">
<input type="hidden" name="naam" value="<?php echo $naam ?>">
<input type="hidden" name="artikelid" value="<?php echo $artikelid ?>">

<?php

}  else {
?>

<form method="post" action="<?php echo $PHP_SELF ?>">
Selecteer een categorie: <select name="categorieid">
<?php
        $sql = "SELECT * FROM Categorie";
        $resultaat  = mysql_query($sql); // voer SQL code uit
        while ($rij = mysql_fetch_array($resultaat)) {
echo "<option value=\"";
echo $rij["CATEGORIE_ID"]."\">";
echo $rij["Naam"]."</option>\n";
        }
?>
</select><br>
Advertentie naam: <input type="text" name="naam"><br>
Advertentie omschrijving: <textarea name="omschrijving" cols="30" rows="4"></textarea><br>
jouw prijs per uur (word niet op de site weergegeven!)<BR>vergeet dus niet je prijs te noemen in de advertentie: <br> prijs per uur:<input type="text" name="prijs"><br>
<input type="submit" name="knop" value="toevoegen">
</form>
<?php
  }
$_SESSION['$naam'];

require "footer.php";

?><BIG>
<a target="_self" href="artikel_afbeelding.php"><BIG>pagina 2><br></a>


[/list]
################################################################################
here is the second page (to put in a image)
##################################################################################
[list]
[*]<?php

$sql=$naam;
require "header.php";
$admin = true;
require "authenticatie.php";

if(isset($_POST['knop'])) {

if (is_uploaded_file($_FILES['afbeelding']['tmp_name'])) {

        // Controleer grootte
        if ($_FILES['afbeelding']['size'] > 300000) {
                echo $rij, "Het bestand is te groot!";
                exit;
        }
        // Controleer extensie
        if (!ereg("((.gif|.jpg|.JPG|.GIF|.bmp|.BMP)$)", $_FILES['afbeelding']['name'], $extensie)) {
                echo "Het bestand bevat is niet van het juiste type";
                exit;
        }
        $extensie = $extensie[0];
        $sql = "INSERT INTO Afbeelding (ARTIKEL_ID, Bestandstype) VALUES ($artikelid, '$extensie')";
        if (!mysql_query($sql)) {
                echo $naam,"Het bijwerken van de database is mislukt!";
        }
        $doelbestandsnaam = mysql_insert_id().$extensie; // naam bestaat uit sleutel en extensie.

        if (!move_uploaded_file($_FILES['afbeelding']['tmp_name'], $pad.$doelbestandsnaam)) {
                echo "Het bestand kan niet verplaatst worden!";
        }
        echo $rij,"Uw bestand ".$_FILES['afbeelding']['name']." is geupload<br>U mag maximaal 3 foto's plaatsen<BR>Sluit nu uw browser of klik op de terug<BR>
button om nog een foto te plaatsen.";

} else {

        echo "Het uploaden is mislukt!";


}


} else {

?>
<p><div class="big">Afbeelding uploaden bij artikel</div><br>


<form enctype="multipart/form-data" action=<?php echo $PHP_SELF ?> method="post">
staat hier uw advertentie?? nee. kies dan de juiste..maak hier geen misbreuk van<BR>dit probleem word zsm opgelost.<br><select name="artikelid">...........</big>



<?php
$sql = "SELECT * FROM Artikel";
$resultaat = mysql_query ($sql); // voer SQL code uit
while ($rij = mysql_fetch_array ($resultaat)) {
echo "<option value=\"";
echo $rij["ARTIKEL_ID"]."\"";
echo artikelid;

// Link tussen artikeloverzicht en afb. uploaden
if ($_GET["artikelid"] == $rij["ARTIKEL_ID"]) {
echo "selected";
}
echo ">";
echo $rij["Naam"]."</option>\n";
}
echo "$naam";
echo "$rij";
echo "$adv";

?>
</select><br>
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
Upload afbeelding: <input name="afbeelding" type="file">
<input type="submit" value="Verzend!" name="knop">
</form>
<?php

}

require "footer.php";

?>[/list]



please help, i am despered to solve this...
tnx
[list][*]
[/list]
[list][*]
[/list]

[attachment deleted by admin]
Link to comment
https://forums.phpfreaks.com/topic/35725-nee-help-with-scriptread-me/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.