HTML - Form Type Hidden To Send Variable
Hello,
I have a code ( see below) with a while loop that gives me a table that shows on the right side after every entry a link 'EDIT' that sends the variabe id to the script 'editjoke.php'. while ($joke = mysql_fetch_array($jokes)) { $id = $joke['id']; $joketext = htmlspecialchars($joke['joketext']); echo "<td>$joketext</td>\n"; echo "<td ><a href='editjoke.php?id=$id'>Edit</a></ td>\n"; echo "</tr>\n"; Now I created a new code with the same idea but it should have on the left side 'radio-buttons' and on the left side only one EDIT-button. Two days ago I thought it works but now it seems so that the variable is not send to editjoke.php. Here is the code: <form action="editjoke.php" method="post"> ... ... while ($num = mysql_fetch_array($number)) { //echo "<tr valign='top'>\n"; $id = $num['id']; $Auskunft = htmlspecialchars($num['Auskunft']); //echo "<td>$Auskunft</td>\n"; <input type="hidden" name="id" value="<?php echo $id; ?>" /> <input type="submit" value="SUBMIT" /> } </form> How do I have to change the code that the variable 'id' will be send to the script edithjoke.php? Similar TutorialsForgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: Code: <form action="http://cm1web1/WebSurveyComponents/script/processform.asp" method="post"> <!-- Mandatory "hidden" objects --> <p> <input type="hidden" name="strInputElements" readonly value="Suggestion"> <input type="hidden" name="strInputElements" value="Name"> <input type="hidden" name="strInputElements" value="Email"> <input type="hidden" name="strInputElements" value="Business Unit"> <input type="hidden" name="intSendMode" readonly value="0"> <input type="hidden" name="strSendParms" readonly value="mark@website.com,CSPS Intranet Suggestion Box"> Name: <input type=text name="Name"> <br>(optional, but required if you would like a response to your comments or suggestions)</p> <p>Email: <input type=text name="Email"> <br>(optional) </p> <p>Business unit: <input type=text name="Business Unit"> <br>(optional) </p> <p> <textarea name="Suggestion" rows="12" cols="40">Write your feedback or suggestion here</textarea> <br> <br> <input name="Send" type="submit" value="Send"> <input name="Clear" type="reset" value="Clear"> </p> <p>(Unless you fill in your name and/or email, this form is completely anonymous)</p> </form> And the email I receive looks like this... Field = Suggestion Response = Write your feedback or suggestion here Field = Name Response = Field = Email Response = Field = Business Unit Response = The "Suggestion" field works fine, but the Name, Email and Business Unit fields all come through with blank responses. Any ideas? Thanks! Mark Hi all, I have a simple newsletter form, so just the email field and a submit, what I would like to do is to send this data to a larger subscriber form, so one that has name, email (with the data previously entered already added), list to subscribe to etc. Can this be done? Thanks Hi all! I'm trying to pass an array as a hidden field from a form in the URL of the browser but it's not working. Can you tell me what is wrong with this...it's my first attempt so be gentle The form HTML is <form name="filter" action="http://www.myurl.com" method="get"> <input type="hidden" name="main_page" value="index" /> <input type="hidden" name="Flt_Grade[]" value="100" /> <select name="filter_id" onchange="this.form.submit()"> <option value="1">Most Popular</option> <option value="2" selected="selected">Price: Low to High</option> <option value="3">Price: High to Low</option> <option value="4">Title</option> <option value="6">Date Added: Newest</option> <option value="7">Date Added: Oldest</option> </select> </form> I would expect, when option 4 in the dropdown is selected the URL to be http://www.myurl.com&main_page=index...00&filter_id=4 Where %5B = [ and %5D = ] But what I actually get is http://www.myurl.com&main_page=index...e=&filter_id=4 The Flt_Grade array is not passed properly. Can this be done so the hidden field is passed in the URL as an array? Thank you! How would I make a search-type form that would insert what the user typed in a text box into a web address and go to that address? (for example, if they type 'help' and click the submit button, it would go to the page "http://www.websitename.com/help.html") I know the general form code, but I can't figure out if I would use a tag in the 'onSubmit' portion, or use javascript, or something else altogether. I have a form but a text field and a hidden field don't come in form elements.I am alerting all form elements in a javascript function which is invoked on press of a button and these two form elements don't come. Any idea why that will happen. JS function which alerts the form elements is as follows :- function populateSubmitProfile() { var i =0; alert("Number of forms "+document.forms.length) ; for( i = 0 ; i < document.forms[0].elements.length ; i++) { alert("Name of the elements :"+document.forms[0].elements[i].name) ; } } I didn't make this on frontpage. I made this through notepad. my teacher asked me to make a web page for an organization on our school's website. the whole thing is basically a form. so far i've just made the basic page without any designing yet. i'm sure i did everything correctly except for the submit button. what i want is when you click the submit button, for the browser to automatically send some sort of email to the provided address. instead, it opens up outlook. i don't want that to happen. what should i do to fix this? i will copy and paste my source code here but i will hide the email address with "*'s" just for privacy. Code: <html> <head> <title>Academy of Finance</title> </head> <body> <h1 align="center">Academy of Finance</h1> <h3 align="center">All Academy of Finance Alumni are invited to attend a reunion during the Thanksgiving weekend of 2009!</h3> <hr> <form action="mailto:********@gmail.com" method="post" enctype="text/plain"> <p> <b>Would you be interested in attending an Academy of Finance reunion Thanksgiving Weekend 2009?</b> <p> <input type="radio" name="yes" value="yes"> Yes <br> <input type="radio" name="no" value="no"> No <p> <b>Even if you answered no to this question, please fill out the following information so that we can verify that you will be unable to attend the reunion. Thank you!</b> <p> <fieldset> <legend> <b>Name:</b> </legend> <p> First Name: <input type="text" name="name" size="30"> <p> Last Name: <input type="text" name="name" size="30"> </fieldset> <p> <fieldset> <legend> <b>Address:</b> </legend> <p> City: <input type="text" name="city" size="30"> <p> State: <input type="text" name="state" size="30"> <p> Zip Code: <input type="text" name="zipcode" size="30"> </fieldset> <p> <fieldset> <legend> <b>Phone:</b> </legend> <p> Home Phone: <input type="text" name="state" size="30"> <p> Cell Phone: <input type="text" name="state" size="30"> </fieldset> <p> <fieldset> <legend> <b>Graduation Year</b> </legend> <p> Year of Graduation: <select name="year of graduation"> <option value="Select">Select</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1993</option> <option value="1995">1993</option> <option value="1996">1993</option> <option value="1997">1993</option> <option value="1998">1993</option> <option value="1999">1993</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> </select> </fieldset> <p> <fieldset> <legend> <b>Current Status</b> </legend> Current Organization: <input type="text" name="current organization" size="30"> <p> Current Occupation: <input type="text" name="current occupation" size="30"> </fieldset> <p> <fieldset> <legend> <b>College</b> </legend> College Attended: <input type="text" name="college attended" size="30"> <p> Degree Attained: <input type="text" name="degree attained" size="30"> </fieldset> <p> <fieldset> <legend> <b>Additional Comments</b> </legend> <blockquote> Additional Comments: <p> <textarea name="comments" id="comments"> </textarea> </blockquote> </fieldset> <p> <input type="submit" value="Submit"> <input type="reset" value="Clear All"> </body> </html> i really don't know what i did incorrectly. i'm not sure how i can get the submit button to send everything to my email directly without the use of any email manager. please help me out. thanks. Hi guys, I'm trying to create a form which uploads an image from the user and saves it in the database. However with the code I have so far it seems the input isn't working. Any help would be appreciated. This is what I have: <html> <head><title>Store image into SQL Database</title></head> <body> PHP Code: <?php if ($_POST[submit]) { include("connect.php"); $data = addslashes(fread(fopen($_POST[form_data], "r"), filesize($_POST[form_data]))); $result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ". "VALUES ('$_POST[form_description]','$_POST[data]','$_POST[form_data_name]','$_POST[form_data_size]','$_POST[form_data_type]')"); $id= mysql_insert_id(); MYSQL_CLOSE(); } else { ?> HTML Code: <form method="post" action="imageupload.php" enctype="multipart/form-data"> File Description:<br> <input type="text" name="form_description" size="40"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <br>File to upload/store in database:<br> <input type="file" name="form_data" size="40"> <p><input type="submit" name="submit" value="submit"> </form> <?php } ?> </body> </html> Hi, Below is my line of input code where I pass a certain variable. What I want to know is - is it possible to leave that 'identifer' value out of the url string if a user does not enter anything in that field? It's for a hotel reservation system and if left blank, it causes an error. It works fine is a user enters a code though. Code: <input type="text" name="identifier" value="" style="width:70px; font-size:11px;" /> Any ideas? Thanks Any idea why the "theuploadedfile" input is not displayed when the program comes in after the submit ? PHP Code: <?php print 'Post=<pre>'; print_r($_POST);print '</pre>'; // PROBLEM $_POST['theuploadedfile'] IS NOT DISPLAYED (the text one is) ?> <form enctype="multipart/form-data" action="<?php print $_SERVER['PHP_SELF']; ?>" method="post"> <br>File to upload <input name="status" type="hidden" value="submitted"> <br>A<input name="thetexttype" type="text" size="100"> <br>B<input name="theuploadedfile" type="file" size="100" > <br><input name="submit" type="submit"> </form> Hi, I'm working on a contact form and its almost finished. There are 2 main offices the form can go to. for example UK office and France office. I want to add 2 check boxes or radio boxes so that the person filling out the form can choose which office they want the form to go to. Is this possible and if so anyone got exampel code i can use to add to my form and mail.php script? how to send e-mail from a form?... I'm trying to set up a website for my Mom, and I'm not very familiar with this stuff. I created the form below, but when I try it I get 3 or 4 pop ups about security and then it still doesn't send the data, and when I had my friend try it said she couldn't because the had no profile. Quote: <FORM METHOD="POST" ACTION="mailto:sharyl@sharylsphotojournal.com"> Name: <BR> <INPUT TYPE="text" NAME="name" SIZE="35"><BR> Email(If you want a response):<BR> <INPUT TYPE="text" NAME="email" SIZE="35"><BR> Message:<BR> <TEXTAREA NAME="message" ROWS=7 COLS=35> </TEXTAREA><BR> <INPUT TYPE="submit" VALUE="Send"> <INPUT TYPE="reset"> Can anyone help me know what I did wrong? I have a HTML form that truncates the action parameter after the "?" mark - which is NOT the desired behavior I am looking for. I simply want to open the referenced URL within the same viewport. Here is a representative HTML snippet: HTML Code: <form action="http://www.spufalcons.com/index.aspx?tab=gymnastics&path=gym"> <input type="submit" value="Gymnastics"/> </form> In this case, the submit button takes you to the "http://www.spufalcons.com/index.aspx" page, effectively ignoring "?tab=gymnastics&path=gym" parameter. It appears that URL's using HTML and PHP pages referenced in the action=URL work as expected BUT (alas) this is not the case when the target page contains index.aspx. This behavior is consistent across all major browsers (IE, FF, Safari, Chrome, Opera). Has anyone seen this problem before? Or can suggest an alternative and/or workaround consistent with my "pure" CSS/HTML/PHP web development approach? I have tried replacing the special characters with HTML entity values with no impact. I REALLY don't want to use abandon my CSS-styled submit buttons by using Javascript or button PNG's or image maps. Environment: Web Server: Apache 2.2.14 PHP: 5.2.10 OS: Mac OS X 10.5.8 HTML document info: HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> Ok, so I need something so that others can kinda half-email me (you'll get it later): Code: <form><input type="text" /></form> <form><input type="text" /></form> <img src="submit.jpg" /> So, the idea is that they write their email in the top one, and a short message in the bottom one. This is perfectly fine as it is. I don't want big text-boxes and stuff like that instead, so don't change this part. The submit.jpg is a picture that sais submit (duh..), and I'd like for this button to take this information posted into these forms and post it on another page. In other words, this can be compared to an e-mail webmaster kinda thing, and then I could go to this secret second page, and read it like this: person1@something.com There's a bug in your site. person2@something.com Cool site dude. person3@something.com Wow.. Get it? The layout of site 2 isn't important, as only I will be reading it. Also, the button would have to hide the URL it is posting to, so that others can't just read at the bottom that it will be sent to mysite.com/thispage.html. Can someone please, please, PLEASE try to help me with this??? hi everyone this is my first post here and hope i will get solution of my problem i have designed an form and want when user click on submit button i can recieve that data into my email. here is the code <FORM METHOD="POST" ACTION="mailto:mandeep@vbams.com" ENCTYPE="text/plain"> <INPUT TYPE="text" NAME="username"> : name <BR> <INPUT TYPE="text" NAME="email"> : email <BR> comments <BR> <TEXTAREA NAME="COMMENTS" ROWS="10" WRAP="hard"> </TEXTAREA> <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE="http://www.vbams.com/index.html"> <BR> <INPUT TYPE="submit" VALUE="Send"> <INPUT TYPE="reset" VALUE="Clear"> </FORM> this is not working can any one help me how to modify this code so it work properly Thanks Mandeep Hello, I am trying to to write HTML code that will let people fill out a form, but I need it sent to an email address (tcutler@lighthouseandmeyu.org) This is what I have: HTML Code: Please Provide Your Input!: <form action="tcutler@lighthouseandmeyu.org" METHOD=POST> <P><TEXTAREA ROWS=10 COLS=50 NAME=Comments></TEXTAREA></P> <P><INPUT TYPE=SUBMIT VALUE=Send></P> </FORM> Hi there, i would really appreciate if someone could help me. i have first tried a few things from searching around on google. but i either dont understand or its just not working!... first of all ill say im a beginner in html. but i created a survey/quiz page.. just a simple thing to see if i could. Using radio boxes etc.... I have a submit button at the bottom, but i want to know how to direct it to my email address? so that i receive the responses and can send the reply? i tried a form method to mailto my email but it doesnt work. so i think i may be on the wrong path.. all that happens is the page reloads. anyways could someone help. my page is being being hosted by free server, will this make a difference? thanks for your time. Hello guys, Can anyone help me with a simple form. I need a form like this: A box where the user can enter his email adress. Under it a button: Send this to my email The function will be that a certain text is sent to his email adress. The text is one I choose before. Thanks guys! |