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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.