Jump to content

getting user input and submitting on one page


mikeym

Recommended Posts

Hi,

 

I'm trying to make a series of pages that I want users to be able to select to make a comment, have a comment box open, type their comment and submit it to be shown their new comment on the same page.

 

Is this possible using php and how do I go about organising it? I want to have my pages as html with <?php whatever ?> tags in them so that the basic page is kept as simple as possible.

 

My first attempt will let me click on a new comment button which will open a box to add a comment (as long as you're logged in) - this is using a html parameter to tell it to show the box called from the link - but I have no idea how to then submit the form and open up the same page.

 

The test page for this is very scrappy so I apologise but it can be found at:http://www.getoutofglasgow.com/test/index.htm

 

Log on as "tester" with the password "test" to see how it's working so far.

 

 

This what you are talking about? 

 

<?

if ($_POST['submit']) {

       echo $_POST[comment];

} else {

?>

<form enctype="multipart/form-data" action="" method="post">

Comment:<textarea name="comment" cols="40" rows="10" style="overflow: auto"></textarea>

<input type="submit" name="submit" value="Submit"  />

</form>

<? } ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.