Jump to content

Hiding a form for php upload


BallisticDK

Recommended Posts

Hey, im trying to hide a form for a upload script. but it will just look like this (see picture). its for a school project,

 

here is the code

<div class="brick-left">
<?php
	   $brugernavn = $_SESSION['brugernavn'];
	   if ($_SESSION['brugernavn']) {
        $result = mysql_query("SELECT * FROM bruger WHERE brugernavn='$brugernavn'");
        while ($row = mysql_fetch_array($result)) {
            $admin = $row['admin'];
            }
            if ($admin == 1){
echo"<center>";
echo"<form action=" . print $_SERVER["PHP_SELF"] . "method='post' enctype='multipart/form-data'>";
    echo"<p><input type='hidden' name='contxt' value='upload'>";
    echo"<input type='hidden' name='userId' value='123'>";
    echo"<input type='file' name='upFile'></p>";
    echo"<p><button type='submit'>Upload</button></p>";
echo"</form>";
}
		}
        ?>
<?php print $message ?>
</center>
</div>

post-131433-13482403313884_thumb.jpg

Link to comment
Share on other sites

hiding a form is done in html not in php.

 

Php generates the code for the page and the browser shows it. Of course, in php you can generate the html statements to cause the form to be hidden or not even on the page at all.

do it with css ? hidden or display

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.