Jump to content

PravinS

Members
  • Posts

    459
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by PravinS

  1. try replacing this code

    <form action="add_bk_insert.php">
    Name <input type="text"  name="name"/><br />
    E-mail <input type="text"  name="email" /><br />
    Contact <input type="text"  name="contact" /><br />
    Requirement <input type="text"  name="requirement" /><br />
    <input type="submit" value="Submit" name="btnSubmit"/>
    </form>
    
    <?php
    mysql_connect("localhost","root","");
    mysql_select_db("test");
    if (isset($_POST['btnSubmit']))
    {
    	$name = isset($_POST[name]) ? $_POST[name] : '';
    	$email_id = isset($_POST[email_id]) ? $_POST[email_id] : '';
    	$contact = isset($_POST[contact]) ? $_POST[contact] : '';
    	$requirement = isset($_POST[requirement]) ? $_POST[requirement] : '';
    	$order = "INSERT INTO sal2 (name,email_id, contact,requirement) VALUES('".$name."','".$email_id."','".$contact."','".$requirement."')";
    	$result = mysql_query($order); 
    	if($result)
    	{
    	 echo "Inserted";   
    	 //include_once("testimonials.php");
    	} else{
    
    		echo("<br>Input data is fail");
    
    	}
    }
    ?>
    
    
  2. while uploading files use $_FILES instead of $_POST for file data

    $fileName = $_POST["uploaded_file"]["name"]; // The file name
    $fileTmpLoc = $_POST["uploaded_file"]["tmp_name"]; // File in the PHP tmp folder
    $fileType = $_POST["uploaded_file"]["type"]; // The type of file it is
    $fileSize = $_POST["uploaded_file"]["size"]; // File size in bytes
    

    the above code should be

    $fileName = $_FILES["uploaded_file"]["name"]; // The file name
    $fileTmpLoc = $_FILES["uploaded_file"]["tmp_name"]; // File in the PHP tmp folder
    $fileType = $_FILES["uploaded_file"]["type"]; // The type of file it is
    $fileSize = $_FILES["uploaded_file"]["size"]; // File size in bytes
    
  3. try using this

    $num = mysql_num_rows($allusers = mysql_query("SELECT * FROM PMs WHERE `status` = '0' AND ReceiveID ='".$myU->ID."' ORDER BY ID"));
    $PMs = mysql_num_rows($allusers = mysql_query("SELECT * FROM PMs WHERE `status` = '0' AND LookMessage = '0' AND ReceiveID = '".$myU->ID."' ORDER BY ID"));
    
×
×
  • 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.