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

Edited by cyberRobot
added [code][/code] tags
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

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.