Jump to content


Photo

easy form question


  • Please log in to reply
4 replies to this topic

#1 Evanthes

Evanthes
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 11 August 2006 - 05:33 PM

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!

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>';
}





#2 corbin

corbin
  • Staff Alumni
  • Advanced Member
  • 8,129 posts

Posted 11 August 2006 - 05:38 PM

Uhhhh... For it to out put on any page besides its self it will need to be included and then the function called on that page.
Why doesn't anyone ever say hi, hey, or whad up world?

#3 mewhocorrupts

mewhocorrupts
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationParker, CO

Posted 11 August 2006 - 05:39 PM

<?php

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

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.
-mewhocorrupts

#4 Evanthes

Evanthes
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 11 August 2006 - 05:46 PM

Uhhhh... For it to out put on any page besides its self it will need to be included and then the function called on that page.


yeah i know...
thanks for the help though i found the problem

#5 mewhocorrupts

mewhocorrupts
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationParker, CO

Posted 12 August 2006 - 05:37 AM

Post the solution for posterity.
-mewhocorrupts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users