Need help to create detail in a page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • arnage
    replied
    This is one of ways to write to file and to read and display you will try to do yourself. ;)

    PHP Code:
    if (!empty($_POST['submit']) && $_POST['submit'] == 'done') {
        
    $name = !empty($_POST['name']) ? htmlentities($_POST['name'], ENT_QUOTES'UTF-8') : null;
        
    $phno = !empty($_POST['phno']) ? htmlentities($_POST['phno'], ENT_QUOTES'UTF-8') : null;
        
    $request = !empty($_POST['request']) ? htmlentities($_POST['request'], ENT_QUOTES'UTF-8') : null;
        if (isset(
    $name$phno$request)) {
            
    $file 'req.txt';
            
    $data "|-|$name|-|$phno|-|$request|-|\n";
            if (
    is_writeable($file)) {
                
    $handle = @fopen($file'a');
                @
    fwrite($handle$data);
                
    fclose($handle);
            } else { exit; }
        } else {
            echo 
    'All fields are requiered.';
        }
    } else {
        echo 
    '<form method="post" action="./index.php" enctype="multipart/form-data">'.PHP_EOL;
        echo 
    '<p>'.PHP_EOL;
        echo 
    'Name: <br/>'.PHP_EOL;
        echo 
    '<input type="text" name="name" value=""/><br/>'.PHP_EOL;
        echo 
    'Phone: <br/>'.PHP_EOL;
        echo 
    '<input type="text" name="phno" value=""/><br/>'.PHP_EOL;
        echo 
    'Request: <br/>'.PHP_EOL;
        echo 
    '<input type="text" name="request" value=""/><br/>'.PHP_EOL;
        echo 
    '<input type="submit" name="done" value="Done"/>'.PHP_EOL;
        echo 
    '</p>'.PHP_EOL;
        echo 
    '</form>'.PHP_EOL;

    Last edited by arnage; 17.03.12, 08:58. Reason: Typing error, was one ) more.

    Leave a comment:


  • Lue_chin
    replied
    can we crate it without sql table

    Leave a comment:


  • arnage
    replied
    To the party killer...

    Leave a comment:


  • softwarefreak
    replied
    can any create this code for me i realy say thanks to him/her
    So many helpers, Now decide whom to say thanks

    Leave a comment:


  • arnage
    replied


    E, now you are screwed Shusant.

    Leave a comment:


  • shushant
    replied
    Originally posted by just_m3. View Post
    PHP Code:

    <?php 
    echo '<form action="index.php" method="post">';
    echo 
    '<p>';
    echo 
    'name:<input type="text" name="name" value=""/><br/>';
    echo 
    'ph no :<input type="text" name="phno" value="" /><br/>';
    ?>



    Added after 2 minutes:




    Ain't funny bro ) you skrewd the party ... bleah
    party Is Over :P he he :D

    Leave a comment:


  • just_m3.
    replied
    Originally posted by arnage View Post



    come on guys make it right
    PHP Code:

    <?php 
    echo '<form action="index.php" method="post">';
    echo 
    '<p>';
    echo 
    'name:<input type="text" name="name" value=""/><br/>';
    echo 
    'ph no :<input type="text" name="phno" value="" /><br/>';
    ?>



    Added after 2 minutes:

    Originally posted by shushant View Post
    Code:
    <?
    if(isset($_POST["PST"])){
    if (!empty($_POST["name"]) && !empty($_POST["phn"]) && !empty($_POST["about"])){
    mysql_query("INSERT INTO misc SET name='".$_POST["name"]."', phone='".$_POST["phn"]."',about='".$_POST["about"]."'");
    }
    else
    {
    echo "Missing Input";
    }
    ?>
    <form action='' method='post'>
    <b>Name:</b><input type='text' name='name'/><br>
    <b>phone:</b><br>
    <textarea name='about' rows='50' cols='50'>+91</textarea><br/>
    <b>About u:</b><br>
    <textarea name='about' rows='50' cols='50'></textarea><br/>
    <input type='submit' name='PST' value='Here we go'/>
    </form>
    SQL
    Code:
    CREATE TABLE IF NOT EXISTS misc (
      id int(10) NOT NULL AUTO_INCREMENT,
      name varchar(100) NOT NULL,
      phone varchar(300) NOT NULL,
      about text NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `name` (`name`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

    Ain't funny bro ) you skrewd the party ... bleah
    Last edited by just_m3.; 15.03.12, 13:28.

    Leave a comment:


  • shushant
    replied
    Code:
    <?
    if(isset($_POST["PST"])){
    if (!empty($_POST["name"]) && !empty($_POST["phn"]) && !empty($_POST["about"])){
    mysql_query("INSERT INTO misc SET name='".$_POST["name"]."', phone='".$_POST["phn"]."',about='".$_POST["about"]."'");
    }
    else
    {
    echo "Missing Input";
    }
    ?>
    <form action='' method='post'>
    <b>Name:</b><input type='text' name='name'/><br>
    <b>phone:</b><br>
    <textarea name='about' rows='50' cols='50'>+91</textarea><br/>
    <b>About u:</b><br>
    <textarea name='about' rows='50' cols='50'></textarea><br/>
    <input type='submit' name='PST' value='Here we go'/>
    </form>
    SQL
    Code:
    CREATE TABLE IF NOT EXISTS misc (
      id int(10) NOT NULL AUTO_INCREMENT,
      name varchar(100) NOT NULL,
      phone varchar(300) NOT NULL,
      about text NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `name` (`name`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

    Leave a comment:


  • arnage
    replied
    I mean really...

    Here is next...
    PHP Code:
    <?php 
    echo '<form action="index.php" method="post">';
    echo 
    '<p>';
    echo 
    '<input type="text" name="name" value=""/>';
    ?>

    Leave a comment:


  • just_m3.
    replied
    Originally posted by something else View Post
    heres some help to get you started:
    PHP Code:
    <?php
    echo '<form action="index.php" method="post">';
    ?>
    :D
    you'r a criminal , ram pam pam pam !

    Leave a comment:


  • something else
    replied
    heres some help to get you started:
    PHP Code:
    <?php
    echo '<form action="index.php" method="post">';
    ?>
    :D

    Leave a comment:


  • just_m3.
    replied
    Originally posted by arnage View Post
    This is not request for help.
    why i'm not surprised ? =) .....
    Hey buddy no one will do free work for you .. instead posting here you better start learning basic stuff here
    PHP: Hypertext Preprocessor or you may still try your luck who knows =]]...

    Leave a comment:


  • arnage
    replied
    This is not request for help.

    Leave a comment:


  • Lue_chin
    started a topic Need help to create detail in a page

    Need help to create detail in a page

    hello thanks to view my post now i tell what i need
    i want to create a request zone
    where any user request me with detail but any one cannot see the detail
    for ex :
    name :
    ph no :
    request:
    done!!
    when click on done a file which already exits req.txt
    or any else add a new line with full detail can any create this code for me i realy say thanks to him/her
Working...
X