Here's a rough coding in PHP of the contents of the form to be displayed. This saves the inputs in a text file (with a .log extension). Remember to set the form method to post, and give your text boxes names.
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$city = $_POST['city'];
$input = "Name: " . $name . "\nMobile: " . $mobile . "\nCity: " . $city . "\nEnd of Input.\n\n\n";
if (!$opf = fopen("inputs.log", "a")) {
print "Could not open the file.";
} else {
fwrite($opf, $input);
fclose($opf);
print "Name: " . $name . "\n";
print "Mobile: " . $mobile . "\n";
print "City: " . $city . "\n";
}
?>
Here's the rough coding of the index page of all the user input (still in PHP).
if (!$opf = fopen("inputs.log","r")) {
print "Could not open the file.";
} else {
$inputs = file("inputs.log");
$cname = "Name";
$i = 0;
$ci = count($inputs);
$onum = 0;
if($ci==0) {
print "There's no data to be displayed.";
} else {
print "
";
for ($i = 0; $i <= $ci; $i++) {
if (preg_match("/$cname/",$inputs[$i])) {
$onum++;
print "- Input Number $onum
";
print "$inputs[$i]
";
print "
";
}
$i++;
}
print "
";
}
fclose($opf);
}
?>
And here's the display page of each input set (also a rough code in PHP).
$i = $_GET['index'];
if (!$opf = fopen("input.log","r")) {
print "Could not open the file.";
} else {
$inputs = file("input.log");
$ceoi = "End of Input.";
$ci = count($inputs);
while(!preg_match("/$ceoi/",$inputs[$i])) {
print "$inputs[$i]
";
$i++;
}
fclose($opf);
}
?>
And there you are. You can also do those in Javascript but I'm not that adept in coding in Javascript as in PHP. Really hope that helped. If was difficult typing that. Haha... ^_^
PS. Btw, those codes should work. You just need to place a few HTML tags to pretty up the pages and add a few more lines to the PHP codes, but those should work fine (you can put HTML tags with PHP, just separate them with the tags). The last code is the link specified in the second code.
2007-09-23 23:52:38
·
answer #1
·
answered by Daal 2
·
0⤊
0⤋
I think you need a script,
and looking at the details, I think some kind of "guestbook" script will work for you.
I have a simple script like that in my hard disk, but you can easily google it too.
A guestbook script provides a form (you can decide what the questions will be) that your website visitors can fill in, and after they click "submit" or whatever, it will be displayed in another page in the lay out of your choice.
2007-09-24 05:03:02
·
answer #2
·
answered by little muses' dad is in love 3
·
0⤊
0⤋
"Passing forms" is a hurdle for many beginners, but it is actually quite simple.
Since you do "something" with the data, once it is sent, you must treat the data on the server and that, your best bet is to do it with PhP (NOT ASP!).
Email-me with the code of your form, I'll send you a procedure on how to treat it.
Visit www.skytargets.com, web designs, to read some useful articles on codes and coding...
2007-09-24 05:03:08
·
answer #3
·
answered by just "JR" 7
·
0⤊
0⤋
Yes you can try ASP.net and put it up on a server or just find a host where you can put your site in search engines like ex. Yahoo, Google... With ASP.net you can create pages like that easily.
2007-09-24 03:46:17
·
answer #4
·
answered by rav 3
·
0⤊
0⤋
Do you have MySql hosting on your server? if so email me at james@center-fold.co.uk and I could always script something for you.
2007-09-24 06:57:58
·
answer #5
·
answered by centerfolddesign 1
·
0⤊
0⤋
sorry i dont understand your question.
2007-09-24 03:39:28
·
answer #6
·
answered by benjoe021 5
·
0⤊
0⤋