New Learner Needs Help!!!!
Moderator: General Moderators
-
Chocolate_Raindrop
- Forum Newbie
- Posts: 11
- Joined: Thu May 20, 2004 6:07 pm
- Location: Alabama
- Contact:
New Learner Needs Help!!!!
I'm very new at PHP...actually I'm a CS major and PHP is not taught at my school. I was wondering if anyone can help me. I have created an HTML form and I know how to get my information to post through PHP but how can I get the entries to lock in place and add more entries to the bottom of the page. I have looked at every PHP tutorial but they don't answer my questions.
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
he might mean that .... say he starts out with 4 text fields but he needs more then 4 to gather the requiered info, but he don't wanna clutter up the page with a whole slue of text fields. so he might want to have the user fill out a few, then submit them, then fillout some more that were added to the page....and so on and so on...
maybe just maybe... thats what he ment.....
maybe just maybe... thats what he ment.....
code
Something along these lines for a multi page form..
(note: not error checked or tested)
(note: not error checked or tested)
Code: Select all
<?php
$page=$_REQUESTї'page'];
if ($page==NULL){
// Display the form, submit form to form?page=2
$form=("
<form name="form1" method="post" action="form.php">
Name:
<input type="text" name="textfield">
Email:
<input type="text" name="textfield2">
<input name="page" type="hidden" id="page" value="2">
<input type="submit" name="Submit" value="Submit">
</form>
");
echo("$form");
}
if ($page==2) {
// Assumeing these are your fields that came from your form:
$name=$_REQUESTї'name'];
$email=$_REQUESTї'email'];
$form=("
<form name="form1" method="post" action="form.php" value="$name">
Name:
<input type="text" name="textfield" value="$email">
Email:
<input type="text" name="textfield2">
<input name="page" type="hidden" id="page" value="3">
<input type="submit" name="Submit" value="Submit">
</form>
");
echo("$form");
}
?>stupid ikkle me
ok well me an my mate have a site an ive made a login so jus me an him can get on to the page with the form, then i need to be able to type in the form and put it onto another page in a list but set out well :S any one got any ideas ? 
-
Chocolate_Raindrop
- Forum Newbie
- Posts: 11
- Joined: Thu May 20, 2004 6:07 pm
- Location: Alabama
- Contact:
Help!!!
Warning: fopen(http://www.icdat.cc/cdrop/gb.txt): failed to open stream: HTTP wrapper does not support writeable connections. in /home/icdatcc/public_html/cdrop/gb.php on line 7
that's the message I get. what does it mean? here are the codes that I have.
<form action="http://www.icdat.cc/cdrop/gb.php" method="post">
Name: <input type="text" name="name" value=""><br>
Location: <input type="text" name="location" value=""><br>
Email: <input type="text" name="email" value=""><br>
Message:<br><textarea name="message" rows="10" cols="40"></textarea><br>
<input type="submit" name="submit" value="submit">
</form>
that's the message I get. what does it mean? here are the codes that I have.
<form action="http://www.icdat.cc/cdrop/gb.php" method="post">
Name: <input type="text" name="name" value=""><br>
Location: <input type="text" name="location" value=""><br>
Email: <input type="text" name="email" value=""><br>
Message:<br><textarea name="message" rows="10" cols="40"></textarea><br>
<input type="submit" name="submit" value="submit">
</form>
Code: Select all
<?php
$somecontent = "This is a test\n";
$file = fopen("http://www.icdat.cc/cdrop/gb.txt", "a+");
if (!$file) {
echo "<p>Unable to create file for writing.\n";
exit;
}
fputs ($file, $somecontent);
fclose($file);
?>-
Chocolate_Raindrop
- Forum Newbie
- Posts: 11
- Joined: Thu May 20, 2004 6:07 pm
- Location: Alabama
- Contact:
-
Chocolate_Raindrop
- Forum Newbie
- Posts: 11
- Joined: Thu May 20, 2004 6:07 pm
- Location: Alabama
- Contact: