Topic awaiting preservation: PHP form updater... need help |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: 1393 |
posted 08-02-2004 17:35
I'm a newbie with PHP and I need a quick and easy way to build an online form that will update the contents of another pages table cells... would this be difficult? Basically it's just a table with five columns with text and the last cell being a link. I would like to write a PHP script that adds another row with the inputed information from a form. Will be willing to pay if needed. |
Maniac (V) Inmate From: under the bed |
posted 08-02-2004 18:01
That should be pretty simple. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-02-2004 18:08
For a quick and dirty solution all I would do is maintain a text file with the rows if information. Then use that to create the table, with each row in the text file corresponding to the rows in the table. code: $array[0] = $_POST['someformvariable1'];
|
Nervous Wreck (II) Inmate From: 1393 |
posted 08-02-2004 20:20
bitdamaged, that's what i'm looking for. I see what you're saying. I've read throught the different links and I understand the process but I'm still confused as how to actually set it up. The only work i've done with PHP is just manipulating other's scripts... |
Nervous Wreck (II) Inmate From: 1393 |
posted 08-02-2004 22:03
Alright... I think I may be somewhat close... I don't have access to the server with PHP on it right now so I was hoping you could look this over and see what the heck I'm doing. code: <form action="go-update-standard.php" method="post" name="standard">
code: <?
code: <table class="lisps" cellpadding="0" cellspacing="0">
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-03-2004 01:34
That looks about right. code: $array[0] = $_POST['file-name']; code: $array = array();
code: foreach ($lines as $line_num => $line) { ..
code: foreach ($lines as $line) {
code: $pieces = explode(" ", $line);
|
Nervous Wreck (II) Inmate From: 1393 |
posted 08-03-2004 03:32
Sweet! Everything is working except it's writing all the entries in the txt file on one line... how do I get it to "bumb" down a line very time an entry is added? |
Nervous Wreck (II) Inmate From: 1393 |
posted 08-03-2004 04:23
K... I think I got it. I added a '\n' to my array... code: $inp = array();
|
Bipolar (III) Inmate From: Australia |
posted 08-03-2004 04:29
try putting \r\n |
Maniac (V) Mad Scientist From: :morF |
posted 08-03-2004 05:32
I'd actually put \n\r, becuase otherwise you'll go back ot the start of the line and *then* go down a line, taking the last line of text with you. |
Bipolar (III) Inmate From: Australia |
posted 08-03-2004 05:44
ahh is that how it works |
Nervous Wreck (II) Inmate From: 1393 |
posted 08-09-2004 04:52
Sweet, my first php script is alive! Thanks for all the help. |