Jump to content

printing textbox value on page


myselfamit47

Recommended Posts

<form method="post" action="">

<input type="text" name="username">

<input type="button" name="sbutton" value="click button ">

<?php

if(isset($_POST['sbutton']))
{
        $value=$_POST['username'];
        echo "$value";
}
?>

</form>

i want to print the value of textbox on that same page ..but it is not working..

plz help me...

i have done this also

<?php

        $value=$_POST['username'];
        echo "$value";

?>

and

this also

<?php

        $value=$_GET['username'];
        echo "$value";

?>

but it is not working..........plz help me

Link to comment
Share on other sites

i have written this code for uploading a file ...

 

<form method="post" action="" enctype="multipart/form-data">
<input type="file" name="upload">
<input type="submit" name="fileupload" value="upload the file">

</form>


<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES['upload']['name']);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST['submit'])) {
    $check = getimagesize($_FILES['upload']['tmp_name']);
   if($check !== false) {
        echo "File is an image - " . $check['mime'] . ".";
        $uploadOk = 1;
    } else {
        echo "File is not an image.";
        $uploadOk = 0;
    }
}
?>

 

but it is not working.....plz help me....

Link to comment
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.