searls03 Posted April 30, 2011 Share Posted April 30, 2011 how do I put a get id into this form, or use $myvar?: <form action='read2.php?id=' method="post" name='myForm' id="myForm"></form> Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/ Share on other sites More sharing options...
trq Posted April 30, 2011 Share Posted April 30, 2011 <form action='read2.php?id=<?php echo $myvar; ?>' method="post" name='myForm' id="myForm"></form> Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208496 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 with this form action page, how do I make it so that the form submits, without the submit actually being present? (that is the entire form that I gave you): if ($_POST['myForm']) { $q = "UPDATE messages SET read1='1'where id='".$_GET['id']."'"; $sql = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208498 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 <form action='read2.php?id=<?php echo $myvar; ?>' method="post" name='myForm' id="myForm"></form> Honestly, I should have known that. I don't know what I was thinking. Thanks for that thorpe. Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208499 Share on other sites More sharing options...
fugix Posted April 30, 2011 Share Posted April 30, 2011 the only way that i know of is to use the onchange event using javascript...i highly doubt that it would work since you are using php however.. Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208503 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 is there a way to make the form submit when I use a hidden field with the correct name? I am using the Javascript for an automatic form run......but it doesn't run if I put the fields into it......... Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208505 Share on other sites More sharing options...
trq Posted April 30, 2011 Share Posted April 30, 2011 Your question has nothing to do with PHP. Auto submitting a form needs to be done client side using JavaScript. Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208519 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 I kinda moved to a second topic, didn't I, Sorry about that. It started out as php though Quote Link to comment https://forums.phpfreaks.com/topic/235148-form-action-with-strings/#findComment-1208520 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.