Results 1 to 3 of 3
  1. #1
    Oni Guest

    Default How would i do this?

    Right i want is so there are 2 boxes right above eachother where people type in their site name and its url. They then press submit and it enters it into a .txt file in this format
    text1 = "entered name";
    link1 = "entered url";
    but then the next person who enters their site in it will add it but like
    text2 = "entered name";
    link2 = "entered url";
    So eventually it would be like
    text1 = "entered name";
    link1 = "entered url";
    text2 = "entered name";
    link2 = "entered url";
    text3 = "entered name";
    link3 = "entered url";
    text4 = "entered name";
    link4 = "entered url";
    What would the code of this be in php or whatever?
    [incase your wondering its for a flash]

  2. #2
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php
      
    if(isset($_POST['text1'], $_POST['link1'])){
      
    $handle fopen('list.txt''a+');
      
    fwrite($handle"text1 = \"$_POST['text1']\" \n link1 = \"$_POST['link1']\"\n\n");
      }
    ?>
    <form method="post">
    <input type="text" name="text1" />
    <input type="text" name="link1" />
    <input type="submit" />
    </form>
    if you decide to use a different file type other than text (e.g. html), ask for something more secure.
    Last edited by nets; 16-02-2007 at 06:16 PM.
    kinda quit.

  3. #3
    Oni Guest

    Default

    Thanks nets +rep

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •