PHP - Variable Issue With A Form
I am stuck on trying to get the form to repopulate after a failed validation. The real form involves REST calls and such but I trimmed the code back to this issue. I think I need to declare the variables differently. I also tried to use the variables in the PHP script to refill the form with the original form entries. I have tried numerous ways of getting the variables to repopulate but could never get it to work consistently (such as declaring global variables.
Here is the form code: Code: [Select] <div> <a name="error_field"></a> <?php if($_GET['error']): ?> <div style="padding:10px;border:1px solid;color:#C70C0C;"><?php echo $_GET['error'] ?></div> <?php endif; ?> <div> <form method="post" action="process2.php"> <fieldset name="Group1"> <legend>Account Registration</legend> <div id="field"><label id="Firstname">First Name:</label></div> <div id="input"><input name="Firstname" id="Firstname" type="text" value="<?php $_POST['Firstname']?>"/></div> <div id="field"><label id="Lastname">Last Name:</label></div> <div id="input"><input name="Lastname" id="Lastname" type="text" value="<?php $_POST['Lastname']?>"/></div> <div id="field"><label id="Username">E-Mail Username):</label></div> <div id="input"><input name="Username" type="text" value="<?= $_POST['Username']?>"/></div> <div id="field"><label id="Password">Password:</label></div> <div id="input"><input name="Password" type="password" /></div> <div class="center" style="margin-top:15px;margin-bottom:15px"> <input name="Submitx" type="submit" value="submit" /> <input name="Reset1" type="reset" value="reset" /> </div> </fieldset></form> </div> </div> and here is the PHP which I have on a different page Code: [Select] <?php $new_user_username = check_input($_POST['Username'], "Enter your e-mail"); $new_user_password = check_input($_POST['Password'], "Enter your password"); $new_user_first_name = check_input($_POST['Firstname'], "Enter your first name"); $new_user_last_name = check_input($_POST['Lastname'], "Enter your last name"); /* If e-mail is not valid show error message */ if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $new_user_username)) { show_error("E-mail address not valid"); } else{ header('Location: TY.php'); } function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem && strlen($data) == 0) { show_error($problem); } return $data; } function show_error($myError) { header('Location: tp1.php?error=' . $myError); exit(); } ?> Thanks in advance for any help. Similar Tutorialshaving issues with Code: [Select] echo curl_setopt($ch, CURLOPT_POSTFIELDS,"name='. $name .'&email='. $email .'&macs='.$mac_addresses.'&serial=".$serialnumber); the thing is $mac_addresses is a serialized array that should look like this Code: [Select] 4a:4:{i:0;s:14:"98340234820384";i:1;s:16:"0980342883408230";i:2;s:11:"72843729374";i:3;s:16:"4209384082304980";} but when I unserilize $mac_addressed and echo it I get Code: [Select] \'.a:4:{i:0;s:14:\"98340234820384\";i:1;s:16:\"0980342883408230\";i:2;s:11:\"72843729374\";i:3;s:16:\"4209384082304980\";}.\' can anyone see what my issue is? Hi: I am trying to pass/request a Variable/QueryString from one page to another, but it isn't working. Seems like it would be simple, so maybe I am overlooking the obvious. I have the 1st page: Code: [Select] <a href="NewCity.php?abbr_state=<?php echo $abbr_state ?>">Insert New City</a> Writes the URL properly - CityList.php?abbr_state=CT The 2nd page: Code: [Select] <?php $abbr_state = $_REQUEST['abbr_state']; ?> <form> State: <input type="text" name="abbr_state" value="<?php echo $abbr_state; ?>" readonly=""/><br /> </form> But it does not get the variable/QueryString for "CT" and add it to the form field (it's not the "readonly" causing it). Why? What did I miss? For this example, $row2['author'] = "1" $user = 'user'.$row2['author']; if (!isset($$user)){ $result = $connector->query('SELECT * FROM users WHERE ID = '.$row2['author']); $$user = $connector->fetchArray($result); } echo '<a href="user.php?user='.($$user['ID']).'">'.$$user.'</a></p>'; The problem is it is a weird variable that also has an array, but when i use echo $$user['ID']; It errors out saying Notice: Quote Undefined variable: u So I am wondering how to word it to set the variable up properly, and how to call items in the array. Thanks in advance Hi I am hoping someone can help. My hosting company has just moved my website to a different server, and I noticed that it was giving me blank pages, I added in some debug and now I am getting undefined variable errors and I don't know why or how to fix it. The Page which has broken currently gets its information from the database from the url. RewriteRule ^reviews/([^/]*)\/$ /bingosite.php?h1=$1 [L] The code in the broken page that is throwing out undefined variable errors is the following: <? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='".StripUrl101(ucwords($h1))."'"); { while($row =mysql_fetch_assoc($query)) extract($row);?> <? if ($linkType=="bingo") { ?> <?php echo "$h1"; ?> <? } } ?> I have used this code for years so it could be that it is old but as I only know basic PHP I am very stuck and the hosting company isn't being very helpful. Just to add if I write <? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='Quick Bingo'"); { while($row =mysql_fetch_assoc($query)) extract($row);?> The results for Quick Bingo appear on the page. However it needs to work dynamically like it was doing before. If anyone can help it would be appreciated. Thanks Rachael Edited by rachae1, 17 May 2014 - 04:29 PM. The code below works echo '<script language="javascript">'; echo 'top.location.href = "/breaking-news/bsnewsstorygoeshere/";'; echo '</script>'; this also works echo '<script language="javascript">'; echo 'top.location.href = "http://anywebsite.com";'; echo '</script>'; the problem, is I have a URL listed in a url variable that can be retreived via $_GET['url'] my question is how to get that variable into the above code? I've tried echo '<script language="javascript">'; echo "top.location.href = \"$_GET['url']\";"; echo '</script>'; but that doesnt seem to work, can anyone advise? Hi, I have a weather app, coded which creates weather based on a set zip code. I want to create a form which when the user fills out their local code and clicks the send button that will change the zip code variable. Currently it is set up like this $zip = '90210'; //change to your zipcode need help with getting started with this. Thanks! <head> <script language="javascript" type="text/javascript" src="datetimepicker.js"> </script> </head> <form action="main.php?id=test.php" method="post"> <p>Start Date: <input name="start" id="start" type="text" size="10"> <a href="javascript:NewCal('start','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> End Date: <input name="end" id="end" type="text" size="10"> <a href="javascript:NewCal('end','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> <input name="submit" type="submit" value="Look Up"> </form> <?php if(isset($_POST['submit'])) { $start = $_POST['start']; $end = $_POST['end']; $sql = "SELECT * FROM `corps` WHERE `notedate` BETWEEN '$start' AND '$end'"; $results = mysql_query($sql) OR DIE(mysql_error()); $numrow = mysql_num_rows($results) ; $i = 0; While ($i < $numrow) $shownotes = mysql_result($results,$i,'notes'); echo $shownotes."<br>"; { Echo "Records found ".$i."<br>"; $i++; } } The $start, and $end don't seem to be getting any values Hi , how I can save something into form? I mean , insert something in variable and than insert it into value in the form so when i send the form the value will be send too. I also want that it will be can not change. for example : <input name="email" value="a@s.d"/> but this example can be change if you insert something else. thanks , Mor. Here's my PHP form code: Code: [Select] <form method='POST' action="<?php basename($_SERVER['PHP_SELF']);?>" onSubmit="return stripInputBoxes(1)"> <?php echo "<div id = 'purchaseOrderRow1' style = 'display:none;border: 1px solid black;'>"; echo $integrityBuildingProductsPDF; echo '<input type = "hidden" id = "pdf1" value = "" name = "pdf1" />'; echo '<button name = "savePurchaseOrder" type = "submit">Save Purchase Order</button>'; echo "</div>"; ?> </form> Here's my Javascript: Code: [Select] function stripInputBoxes(pdfNumber) { if (!document.getElementsByTagName) return; for (i = 0; i < document.getElementById('tableBody').getElementsByTagName('tr').length - 3; i++) { document.getElementById(i).parentNode.innerHTML = document.getElementById(i).value; } document.getElementById("pdf" + pdfNumber).value = "ljkasdkljf"; return true; } Will this set the value of the hidden variable? I'm trying to echo the value of $_POST['pdf1'] but it comes out to nothing when the page reloads. How do I do this? What I'm trying to do here is display a purchase order on the screen and the user can edit the quantities in the purchase order. They click SAVE to save the new updated quantities and it auto generates a PDF that's saved on the server with those new quantities. The problem is I need to run the stripInputBoxes function to take the <input> tags out of the HTML code before creating the PDF because the PDF generator doesn't recognize the tags. Hi all I am in the process of creating a product page where the user can type in three initials into a form and then 'clicks add to basket'. The button doesn't use a form just a url: basket.php?action=add&id=1&qty=1 This adds the item into a basket using sessions rather than a database. The question is, how do I add three variables into my form so that they are sent via the URL and into the session? Wil I have to start again with a form? Here's the code: <td class="table-font-grey">Why not make your whip extra special by adding up to three elegantly engraved Kunstler script initials.</td> <td width="42" style="border: 1px solid grey;"><input name="initial_1" type="text" size="8" maxlength="1" height="40px" /></td> <td width="43" style="border: 1px solid grey;"><input name="initial_2" type="text" size="8" maxlength="1" height="40px" /></td> <td width="43" style="border: 1px solid grey;"><input name="initial_3" type="text" size="8" maxlength="1" height="40px" /></td> </tr> <tr> <td height="15"> </td> <td width="328" class="table-font"> </td> <td width="42" align="center" class="table-font">1</td> <td width="43" align="center" class="table-font">2</td> <td align="center" class="table-font">3</td> </tr> <tr> <td> </td> <td colspan="3" class="table-font"> </td> <td align="right" class="table-font"> </td> </tr> </table> <hr /> <p> </p> <table width="494" border="0"> <tr class="table-font"> <td width="263" height="24"> <a href="<?php echo "basket.php?action=add&id=1&qty=1" ?>" title="Add <?php echo $product['name'] ?> to Cart"> <a href="<?php echo WEB_URL."basket.php?action=add&id=1&qty=1" ?>" title="Add <?php echo $product['name'] ?> to Cart"> <img src="<?php echo WEB_URL."images/product-add-button.gif" ?>" alt="Buy <?php echo $product['name'] ?>" /></a> Many thanks Pete I have a form passing user's search term, ie name. $pname = mysql_real_escape_string($pname; Not sure on proper syntax to include this in my select statement. I also want it to return for partial string matched, like 'mik' for 'mike': $result = mysql_query( "SELECT * FROM guest WHERE name like '$pname'" ); I have a php index page that includes a form page with a delete button for that row. When I hit the delete button nothing happens. I am not sure if the variable is not passing or if the index.php page is not processing it correctly. Here is the index page that includes the form page: Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Welcome Page Test</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <body> <?php if (get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); $_REQUEST = array_map('stripslashes_deep', $_REQUEST); } if (isset($_GET['addjoke'])) { include 'form.html.php'; exit(); } $link = mysqli_connect('localhost', 'root', 'password'); if (!$link) { $output = 'Unable to connect to the database server.'; include 'output.html.php'; exit(); } if (!mysqli_set_charset($link, 'utf8')) { $output = 'Unable to set database connection encoding.'; include 'output.html.php'; exit(); } if (!mysqli_select_db($link, 'database')) { $output = 'Unable to locate the database.' . mysqli_error($link); include 'output.html.php'; exit(); } if (isset($_POST['joketext'])) { $joketext=mysqli_real_escape_string($link,$_POST['joketext']); $sql = "INSERT INTO jokes2 (joketext, jokedate) VALUES ('$joketext', CURDATE() )"; if (!mysqli_query($link,$sql)) { $error = 'Error adding submitted joke: ' . mysqli_error($link); include 'error.html.php'; exit(); } header('Location: .'); exit(); } if (isset ($_GET['deletejoke'])) { $id= mysqli_real_escape_string($link,$_POST['id']); $sql = "DELETE FROM jokes2 WHERE id='$id'"; if(!mysqli_query($link,$sql)) { $error= 'Error deleting actor: ' . mysqli_error($link); include 'error.html.php'; exit(); } header('Location: .'); exit(); } $result = mysqli_query($link, 'SELECT jokes2.id, joketext, name, email FROM jokes2 INNER JOIN author ON authorid = author.id'); if (!$result) { $error = 'Error retrieving data' . mysqli_error($link); include 'error.html.php'; exit(); } while ($row = mysqli_fetch_array($result)) { $jokes[] = array('id'=>$row['id'], 'joketext'=>$row['joketext'], 'name'=>$row['name'], 'email'=>$row['email']); } include 'jokes.html.php'; ?> </body> </html> The $_GET array should be getting the variable id passed when the Delete button is pressed on the form, but nothing is happening when I press the button. Here is the form: Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Welcome Page Test</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <body> <p> <a href="?addjoke">Add Joke </a> </p> <p> Here are all the jokes: </p> <form action="?deletejoke" method="post"> <?php foreach($jokes as $joke): ?> <p> <?php echo htmlspecialchars($joke['id'], ENT_QUOTES, 'UTF-8'), htmlspecialchars($joke['joketext'], ENT_QUOTES, 'UTF-8'), htmlspecialchars($joke['name'], ENT_QUOTES, 'UTF-8'), htmlspecialchars($joke['email'], ENT_QUOTES, 'UTF-8'); ?> <input type="hidden" name="id" value="<?php echo $joke['id']; ?>" /> <input type="submit" value="Delete"/> </p> </form> <?php endforeach; ?> </p> </body> </html> All of my other variables seem to be passing just fine. Any ideas why this one is a problem? Ok here is what im trying to do: 1. drop down list pulled from mysql database.( working ) 2. after you select the name in the drop down list 3. Use selected name to another page. here is code Code: [Select] <?php include('include/db_connection.inc'); $table = "truck_master"; $result = mysql_query( "SELECT driver_name FROM $table" ); $options=""; while ($row=mysql_fetch_array($result)) { $driver_name=$row["driver_name"]; $options.="<OPTION VALUE=\"driver_name\">".$driver_name.'</option>'; } ?> <html> <head> </head> <body> <table align="center"> <form name="form1" method="GET" align="center" action="issue.php"> <tr> <td>Driver Name :</td> <td><SELECT name="driver_name"><OPTION VALUE=''>Choose<?php echo $options?></SELECT> </td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"> </td> </tr> </form> </table> </body> <html> Second Code IS Code: [Select] $driver = $_GET['driver_name']; Hello everyone, I'm having a difficult time figuring out what my problem is here. I'm trying to submit a couple of strings (to the user they are messages to be sent to other users) and I am having trouble with the string being cut off at quotation marks. Here is the code that I'm using: Code: [Select] <?php if (isset($_POST['submit'])) { $staffmessage = $_POST['staffmessage']; $studentmessage = $_POST['studentmessage']; echo "$staffmessage<br /> <br />$studentmessage"; } ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <?php $message1="This is a test message. It does not get cut off here when the \"quotation marks\" are added."; $message2="This is a test message. It DOES get cut off here when the \"quotation marks\" are added."; ?> <form name="form" method="post" action="test.php"> <textarea class="textarea" name="staffmessage" rows="12"> <?php echo $message1; ?> </textarea></p> <input name="studentmessage" type="hidden" value="<?php echo $message2; ?>" /> <input class="submit2" type="submit" name="submit" value="Send Message" /> </form> </body> </html> The result that I'm getting is that when $staffmessage is echoed, I get the full message. When $studentmessage is echoed, the message gets cut off at the first quotation mark. The only thing that is different when creating these two variables is that $staffmessage is submitted using a "textarea" field in the form, and $studentmessage is submitted using a "hidden" field in the form. Other than that, they are handled the exact same way. Can anyone please help me figure out how to remedy this so that $studentmessage is not cut off at the quotation mark? Thanks in advance for your help! First, apologies if this is in the wrong section, basically I am not sure what language my problem lies! Here is the general over view. I have a jquery script that automatically selects a group of sub categorys and pus them in a select list depending on the input of a first select list, so you can choose you main cat and then the sub cats for this cat appear in the next list, this all works fine, the basic code is below: Code: [Select] <script type="text/javascript"> $(document).ready(function() { $('#wait_1').hide(); $('#drop_1').change(function(){ $('#wait_1').show(); $('#result_1').hide(); $.get("scripts/func.php", { func: "drop_1", drop_var: $('#drop_1').val() }, function(response){ $('#result_1').fadeOut(); setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400); }); return false; }); }); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } </script> <form action='do.php' method='post'> <select name="drop_1" id="drop_1"> <option value="" selected="selected" disabled="disabled">Select a Category</option> <?php getTierOne(); ?> </select> <span id="wait_1" style="display: none;"> <img alt="Please Wait" src="images/ajax-loader.gif"/> </span> <span id="result_1" style="display: none;"></span> This calls scripts/func.php Code: [Select] <?php //************************************** // Page load dropdown results // //************************************** function getTierOne() { $result = mysql_query("SELECT * FROM blog_cats") or die(mysql_error()); while($tier = mysql_fetch_array( $result )) { echo '<option value="'.$tier['cat_id'].'">'.$tier['cat_name'].'</option>'; } } //************************************** // First selection results // //************************************** if($_GET['func'] == "drop_1" && isset($_GET['func'])) { drop_1($_GET['drop_var']); } function drop_1($drop_var) { include_once('../connect.php'); $result = mysql_query("SELECT * FROM blog_subs WHERE cat_id='$drop_var'") or die(mysql_error()); echo '<select name="tier_two" id="tier_two"> <option value=" " disabled="disabled" selected="selected">Select Sub Catergory</option>'; while($drop_2 = mysql_fetch_array( $result )) { echo '<option value="'.$drop_2['sub_id'].'">'.$drop_2['sub_name'].'</option>'; } echo '</select> '; } ?> The problem I am having is getting the second select (tier_two) to pass to my form processing page. I just get an undefined variable error Many Thanks Currently I have a PHP file that is pulling information from a table in the Database and inserting it into an HTML table. It consists of the fields: Last_Name, First_Name, Party, District, Address, CIty, State, Zip, and Email. And the Email field is being converted to a Hyperlink. (All working fine so far) I also have a form that has a prewritten letter to be sent to the email address. I need to have the HyperLink from the Email pass the address to the form to allow me to send it. I am not sure how to get this to happen. Here is the code I have so far: The pull from the database: <?php $dbhost = 'localhost'; $dbuser = 'removed'; $dbpass = 'removed'; $db = 'removed'; $link = mysql_connect($dbhost, $dbuser, $dbpass)or die(mysql_error()); mysql_select_db($db)or die(mysql_error()); $result = mysql_query("SELECT * FROM 2011members") or die(mysql_error()); echo "<table border='1'>"; echo "<tr> <th>Last Name</th> <th>First Name</th> <th>Party</th> <th>District</th> <th>Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>Email</th> </tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['Last_Name']; echo "</td><td>"; echo $row['First_Name']; echo "</td><td>"; echo $row['Party']; echo "</td><td>"; echo $row['District']; echo "</td><td>"; echo $row['Address']; echo "</td><td>"; echo $row['City']; echo "</td><td>"; echo $row['State']; echo "</td><td>"; echo $row['Zip']; echo "</td><td>"; //Normal Pull //echo $row['Email']; //echo "</td><td>"; //Just Hyperlink //echo '<a href="http://',Email,'">',Email,'</a>'; //echo "</td></tr>"; echo '<a href="http://'.$row['Email'].'">'.$row['Email'].'</a>'; echo "</td></tr>"; } echo "</table>"; ?> The Form: Code: [Select] <?php if($_POST){ $to = 'becca@windfallstudio.com'; $subject = "WHAT SHOULD THIS BE"; $message = "Date: $date\n\r". "Dear $legislator,\n\r". "As a constituent of yours, I urge you to closely review $bill as it pertains to the distribution and allotment of the 4 percent bed tax collected at lodging properties in Montana.\n\r". "Tourism is very important to Montana. Not only it is the second largest industry in Montana, it is also a key economic engine for businesses and the thousands of Montanans that have jobs because of tourism.\n\r". "Nearly 10 million visitors travel to our state each year, contributing between $2.4 billion and $3 billion annually into our economy. In addition to bringing new money into our state, these visitors also help support more than 42,000 Montana jobs and $897 million in worker salaries. (Source: Montana Office of Tourism Annual Report - 2010)\n\r". "Please rest assured that these millions of visitors don't come on their own. They are enticed to come here through marketing and outreach done by various organizations that include the Montana Office of Tourism, Glacier Country Regional Tourism Commission and Missoula Convention and Visitor Bureau.\n\r". "While there is a 7 percent bed tax collected at all lodging entities in the state, 3 percent supports the General Fund and 4 percent supports travel-related partners. The 4 percent is vital to marketing our stage and it is imperative for that money to remain solely dedicated to travel and tourism promotion. I would urge you to vote no on any bill that would direct any portion of that 4 percent elsewhere.\n\r". "Thank you for your consideration in this request and for doing all you can to represent us, your constituents, to the best of your ability. I look forward to hearing from you soon.\n\r". "Sincerely,\n".u "$name \n". "$street \n". "$city, $zip \n". "$email \\n". $headers = "From: $email"; mail($to, $subject, $message, $headers); // SUCCESS! echo '<p class="notice">'. 'Thank you for your submission. '. '</p>'; // clear out the variables for good-housekeeping unset($date,$legislator,$bill,$name,$street,$city,$zip,$email); $_POST = array(); } ?> <div id="content" class="section"> <?php arras_above_content() ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php arras_above_post() ?> <div id="post-<?php the_ID() ?>" <?php arras_single_post_class() ?>> <?php arras_postheader() ?> <div class="entry-content clearfix"> <form method="post" action="" id="letter"> <p><label for="name">Date</label> <input type="text" name="date" id="date" value="<?php echo $_POST['date'];?>"/></p> <p>Dear Senator/Representative <select name="legislator"> <option>Choose a Legislator</option> <option>Senator John Q. Public</option> <option>Rep. Jane Q. Public</option> <option>Some Third Person</option> </select>,</p> <p>As a constituent of yours, I urge you to closely review Bill <select name="bill"> <option>Choose a Bill</option> <option>SB 13 / LC0448</option> <option>LC0505</option> <option>LC0532</option> </select> as it pertains to the distribution and allotment of the 4 percent bed tax collected at lodging properties in Montana.</p> <p>Tourism is very important to Montana. Not only it is the second largest industry in Montana, it is also a key economic engine for businesses and the thousands of Montanans that have jobs because of tourism.</p> <p>Nearly 10 million visitors travel to our state each year, contributing between $2.4 billion and $3 billion annually into our economy. In addition to bringing new money into our state, these visitors also help support more than 42,000 Montana jobs and $897 million in worker salaries. (Source: Montana Office of Tourism Annual Report - 2010)</p> <p>Please rest assured that these millions of visitors don't come on their own. They are enticed to come here through marketing and outreach done by various organizations that include the Montana Office of Tourism, Glacier Country Regional Tourism Commission and Missoula Convention and Visitor Bureau.</p> <p>While there is a 7 percent bed tax collected at all lodging entities in the state, 3 percent supports the General Fund and 4 percent supports travel-related partners. The 4 percent is vital to marketing our stage and it is imperative for that money to remain solely dedicated to travel and tourism promotion. I would urge you to vote no on any bill that would direct any portion of that 4 percent elsewhere.</p> <p>Thank you for your consideration in this request and for doing all you can to represent us, your constituents, to the best of your ability. I look forward to hearing from you soon.</p> <p>Sincerely,<br /> <label for="name">Name:</label> <input type="text" name="name" id="name" value="<?php echo $_POST['name'];?>"/><br /> <label for="email">Street:</label> <input type="text" name="street" id="street" value="<?php echo $_POST['street'];?>"/><br /> <label for="email">City:</label> <input type="text" name="city" id="city" value="<?php echo $_POST['city'];?>"/><br /> <label for="email">Zip:</label> <input type="address" name="zip" id="zip" value="<?php echo $_POST['zip'];?>"/><br /> <label for="email">E-mail:</label> <input type="text" name="email" id="email" value="<?php echo $_POST['email'];?>"/></p> <input type="submit" class="button" value="Submit" /> </form> <?php the_content( __('<p>Read the rest of this entry »</p>', 'arras') ); ?> <?php wp_link_pages(array('before' => __('<p><strong>Pages:</strong> ', 'arras'), 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> What do I need to do to get the Email link from the HTML table to pass to the Email variable in the Form? Can someone please tell me what I am doing wrong here? For some reason, the variable doess not seem to be getting passed to the "action" php script this input is in my html form (action=post)... <input type="hidden" name="httpreferer" value="<?php echo $_SERVER['HTTP_REFERER'] ?>" /> this is in the action script... $httpreferer=$_POST['httpreferer']; echo $httpreferer; Hi I struggle with something i'm trying to achieve. Maybe this is not the correct approach, i don't know. My goal is to attribute a string of a field of the form to a string variable in order to use this string variable in order to "auto fill" the field of the form previously completed. This is to do what is apparently called a sticky form... First the program attributes the string of a field of the form to a string variable : $EmitterFirstName = $_POST["EmitterFirstName"]; Then in the html form there is a field called "EmitterFirstName", and i want to use the string variable $EmitterFirstName in order to auto fill the field with the string previously typed by the user : <input type="text" name="EmitterFirstName" value="<?php $EmitterFirstName ?>"/> But it doesn't work as expected. Do you have any idea why or maybe an advice on how to code such a thing ? Thanks, |