Jump to content

[SOLVED] Not submitting Form with Javascript, suspected problem within PHP echo


MasterACE14

Recommended Posts

hello everyone,

 

I have a small script I had been using by itself to submit a form by pressing a hyperlink(which is javascript) but I need to using it on the page I am currently working on, and I am putting all HTML and javascript in PHP echo's and I believe I have concocted the PHP within the echo's and PHP incorrectly.

 

When I press one of the hyperlinks, it doesn't do anything, or doesn't submit the form.

 

here's the script:

<?php
echo "<form method=\"post\" action=\"index.php?page=player_interaction\" name=\"otherplayersid_" . $row['sender_id'] . " id=\"otherplayersid_" . $row['sender_id'] . ">";
		echo "<input type=\"hidden\" name=\"otherplayersid\" value=" . $row['sender_id'] . ">";

		echo "<td><center><a href=\"javascript:document.otherplayersid_" . $row['sender_id'] . ".submit();\">" . $row['sender_name'] . "</a></center></td>";

		echo "</form>";

?>

 

here's the original script on the other page:

<form id="otherplayersid_<?php echo $all_id;?>" method="post" name="otherplayersid_<?php echo $all_id;?>" action="http://www.crikeygames.com.au/conflictingforces/index.php?page=player_interaction">
<input type="hidden" name="otherplayersid" value="<?=$all_id ?>">
</form>

 

any help is greatly appreciated.

 

Regards ACE

running your code then viewing the HTML source that it produced showed

 

<form method="post" action="index.php?page=player_interaction" name="otherplayersid_ id="otherplayersid_>

 

A couple of missing quotes

 

(You could heve done this in less time that it took to post and bump).

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.