Jump to content

easy form question


Evanthes

Recommended Posts

Hey guys im making a submit form function and for some reason it is just sending all the data to the same page instead of added.php like it should. could someone take a look at my code and let me know why its not doing that? much appreciated!

[code=php:0]
function addnew()
{
global $today, $searchterm;
echo "<form action='inserted.php' method='get'>";
echo '<tr><td>';
echo "<textarea name=id rows=0 cols=25>$searchterm</textarea>";
echo '</td>';
echo "<td>";
echo "<textarea name=comments rows=0 cols=25>N/A</textarea>";
echo '</td><td>';
echo "<textarea name=date rows=0 cols=25>".$today."</textarea>";
echo '</td><td>';
echo "<input type='submit' value='submit'";
echo '</td>';
echo '</tr>';
echo '</form>';
}



[/code]
Link to comment
https://forums.phpfreaks.com/topic/17264-easy-form-question/
Share on other sites

[code]
<?php

function addnew()
{
global $today, $searchterm;
echo "<form action='inserted.php' method='get'>";
echo '<tr><td>';
.....
?>
[/code]

So, if it's supposed to submit to "added.php" then your issue is that your form doesn't point to that page, it points to "inserted.php".  I may be acting on a typo here, so let me know.
Link to comment
https://forums.phpfreaks.com/topic/17264-easy-form-question/#findComment-73222
Share on other sites

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.