Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Guestbook alteration

    Okay, I'm creating a guestbook-links page. Basically: a guestbook that adds a picture next to the entry, and the picture itself is hyperlinked to a website that the user will specify in a form field.
    Furthermore I need the submission to: 1) upload the picture from the person's computer onto my site (and if no picture is specified then a default picture is put in its place); 2) Put a 200x200 limit on the picture; 3) Have a title and description next to the picture.
    Few notes:
    • The submission will be in its OWN table
    • The submission table will be put into a master table (which is already on the site)
    • I would prefer PHP (with some MySQL if needed)

    I know all I just said one fit into one file (I'm expecting 5).

  • #2
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you should have posted in the paid work offers and request forum here

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Er... okay something easier.
    How about a PHP code that will just add text to a html file.

  • #4
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is some code i made you ill leave formatting the text in the file to you

    write to the file save this file as post.php and make a new txt file to store the posts
    PHP Code:
    <?php
    //first we must open the file
    $fp fopen ("yourfile.TXT""w+");

    //next we write to the file
    fwrite ($fp$_POST['comments']);

    //now we close the file
    fclose ($fp);


    ?>
    html form
    Code:
    <form method="POST" action="post.php">
    	<p><textarea rows="6" name="comments" cols="29"></textarea></p>
    	<input type=submit value=submit> 
    </form>
    this will read the file
    PHP Code:
    $myFile "testFile.txt";
    $fh fopen($myFile'r'); 
    let me know if you have problems

  • #5
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. Like 2 or 3 hours before you submitted that, I figured out my own code. But thanks for the submit. Although it's just submitting to a txt file.
    Here's my code:
    Code:
    <?php
    $name = $_POST['name'];
    $url = $_POST['url'];
    $comment = $_POST['comment'];
    $user = $_POST['user' ];
    $fs = fopen("test.html","a+");
    $write = "<table width=\"400\" border=\"0\" align=\"center\"><tr><td width=\"80\"><strong>Name:</strong></td><td width=\"320\">$name</td></tr><tr><td><strong>URL:</strong></td><td>$url</td></tr><tr><td><strong>Submitter:</strong></td><td><td>$user</td></tr></td></tr><tr><td><strong>Comment:</strong></td><td>$comment</td></tr><tr><td><strong>Message:</strong></td><td>$message</td></tr></table><br> \n";
    fwrite($fs, $write);
    fclose($fs);
    ?>
    The HTML code is pretty much self explanatory.
    What I'm having trouble is like, say I want to submit all this information inside a main table. How would I do that?
    Like my code puts the information in its own little table, and instead of this table being posted at the beginning of the HTML file, I want it to appear at the top of a table within the HTML file. Get what I'm saying?


  •  

    Posting Permissions

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