|
-
October 10th, 2006, 04:32 PM
#1
Help (Text Posting Form)
Ok, i think i have all the stuff for the form
Code:
<form name="strategyform"action="http://www.mediamax.com/tigermonkey/Hosted/strategies.php" method="post">
<textarea name = "strategy" cols = "30" rows = "20"></textarea>
<br>
<button name = "submit" type = "submit">Post</button>
</form>
but what do i put for the other page that gets the text?
heres a simple example, its what i found is the closest
http://pyrom.net/test/blame.php
-
October 10th, 2006, 05:19 PM
#2
Re: Help (Text Posting Form)
Well, first, you need your code right. No spaces around equals signs in HTML.
Code:
<form name="strategyform" action="http://www.mediamax.com/tigermonkey/Hosted/strategies.php" method="post">
<textarea name="strategy" cols="30" rows="20"></textarea>
<br>
<button name="submit" type="submit">Post</button>
</form>
What exactly are you trying to do on the other page. If you just want to get the text with the server use...
PHP Code:
<?php
$strategy = $_POST['strategy'];
echo $strategy;
?>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
October 11th, 2006, 05:24 PM
#3
Re: Help (Text Posting Form)
Get the text thats in the form, and send it to another page just to add on to it
Button Click = Send To Page -----> Other Page - Add textarea text to page
does it have to be a script kind of page, or can the text be added to another html
ill try your code
-
October 16th, 2006, 03:09 AM
#4
Re: Help (Text Posting Form)
 Originally Posted by code?
Get the text thats in the form, and send it to another page just to add on to it
Button Click = Send To Page -----> Other Page - Add textarea text to page
does it have to be a script kind of page, or can the text be added to another html
ill try your code
I see what you mean. When you make your form, you need a php program to parse the stuff you send it to it, and have it do stuff. Basicly, the code he provided will do nothing other then display it back in the browser. If you want it to add onto another page, then you would need to make a script that will write to a file.
Let me make you a sample code:
Code:
<?php
$strategy = $_POST['strategy'];
//To add a break so it goes to the next line use this line instead:
//$strategy = "<br />" . $_POST['strategy'];
$filename = 'filetowriteto.html';
if (!$handle = fopen($filename, 'a'))
{
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $somecontent) === FALSE)
{
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|