View Full Version : Guestbook alteration
09-03-2006, 01:39 AM
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.
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).
09-03-2006, 02:46 PM
you should have posted in the paid work offers and request forum here (http://www.codingforums.com/forumdisplay.php?f=36)
09-04-2006, 07:43 PM
Er... okay something easier.
How about a PHP code that will just add text to a html file.
09-05-2006, 05:56 PM
here is some code i made you ill leave formatting the text in the file to you :p
write to the file save this file as post.php and make a new txt file to store the posts
//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
<form method="POST" action="post.php">
<p><textarea rows="6" name="comments" cols="29"></textarea></p>
<input type=submit value=submit>
this will read the file
$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
let me know if you have problems :)
09-05-2006, 10:41 PM
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:
$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";
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?
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.