PHP - Moved: Convert An Input Into A Textarea?
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=306489.0 Similar TutorialsHi all!!! I could really use some help. I'm burning my brain out trying to figure out the easiest way to go about this. Here is what I am trying to do (in a nutshell) so I could really use full coding examples. I need to create a text area with simple formatting tools such as Bold, Italics, Underline, Bullets, and Numbering. After formatting the text with only those available formatting tools, everything in the text area needs to be converted into html tags. After the conversion, the HTML data that is create is submitted into a single field into a SQL database. Any help will be greatly appreciated!!! Hi, This is driving me to distraction. I have been using this code Code: [Select] <?php $mailto = "edwin@btconnect.com"; $subject = "enquiry"; $message = "Values submitted from web site form:"; $header = "From: ".$_POST['email']; foreach ($_POST as $key => $value) { if (!is_array($value)) { $message .= "\n".$key." : ".$value; } else { foreach ($_POST[$key] as $itemvalue) { $message .= "\n".$key." : ".$itemvalue; } } } mail($mailto, $subject, stripslashes($message), $header); ?> very successfully but now I want to receive information from a 'textarea' in a form but it just doesn't get treated as input. The form is here; <form name="enquiry" method="post" action="feedback.php"> <tr> <td align="left">Name:</td> <td align="right"><input type="text" name="name" size="25" value=""></td> </tr> <tr> <td align="left">email:</td> <td align="right"><input type="text" name="email" size="25" value=""></td> </tr> <tr> <td align="left" valign="top">Blurb:</td> <td align="right"><textarea rows="4" cols="19" value=""></textarea></td> </tr> <tr><td colspan="2" align="right"> <input name="submit" type="image" src="report.gif" width="40" height="20" border="0"> </td></tr></form> Can anyone please help? edwind Hi i would like to know what is the best way to check if a textarea or an input box is empty. Is the empty function effective? Well the topic may not sound very explicit. So I'll do my best to explain it here. I have a pull down menu as part of a form, which contains the months of the year. I'm trying to store the value of this form entry using the $_POST['month'] variable into a database but first, I need to convert the month values into their corresponding integer values( that is 1 for January, 2 for February etc), in order to easily do date calculations later down the road. Any ideas about how to do this? It may be helpful to include the code for the pull down menu. Code: [Select] <p><tab> Date of Birth: <?php //Make the month pull down menu. //Array to store months. $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); print '<select name= "month">'; foreach ($months as $key => $value) { print "\n<option value=\"$key\">$value</option>"; } print '</select>'; ?> </tab> <tab> <?php //Make the day pull down menu print '<select name= "day">'; for ($day = 1; $day <= 31; $day++) { print "\n<option value=\"$day\">$day</option>"; } print '</select>'; ?> </tab> <tab><?php //Make the year pull down menu print '<select name= "year">'; $start_year = date('Y'); for ($y = ($start_year - 18); $y >= 1900; $y--) { print "\n<option value=\"$y\">$y</option>"; } print '</select>'; ?> </tab> </p> the idea on what im doing is like a converter, like showing what your name would look like with certain images per letter, when you input text (your name for example) and when you press the submit button you would get a series of images in a row that represent each character that you typed.
here is the example that i did...
<html> <?php Hi. I have an input field where a date is entered, format dd-mm-yy. I need to query the database to see if this date exists. How can I convert the date to yyyymmdd before the query? Thanks Hi all . In my scripts , there is a textbox that allow user to enter multiple phone number separate with "," , if all valid it will echo "ok!" else will echo "error" . How if I want to know which value is in wrong format? such as I entered "0112255666,445221122200" , then it will echo " 445221122200 is not a valid phone number" . And how to echo the total phone number inserted to the textarea ? Thanks for every reply . Code: [Select] <?php if (isset($_POST["Submit"])) { $arrLines = split(",",$_POST['cellphonenumber']); foreach($arrLines as $cells){ if(!preg_match('/^[0]{1}[1]{1}[0-9]{1}[0-9]{7}?$/', $cells)){ echo "error"; } else{ echo "ok!"; } } } ?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" name="myform" method="post"> <textarea name="cellphonenumber" rows="20" cols="100"></textarea> <input type="submit" name="Submit" /> </form> Hi, PHP newbie here, and my first post. I am in the process of learning PHP. Currently I am looking at forms and DB input. I would like to verify if my current method of keeping the linebreaks from a TEXTAREA field, and still keep the DB input safe is correct. I use the following code to get the input from the TEXTAREA field. Code: [Select] $comments = mysql_real_escape_string(nl2br(filter_var($_POST["comments"], FILTER_SANITIZE_STRING)));Is this the correct way of handling this? Thanks This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333306.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=353253.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314681.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=315924.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=320413.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316747.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333153.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=306916.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333966.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347628.0 Dear All Members here is my table data.. (4 Columns/1row in mysql table)
id order_no order_date miles How to split(miles) single column into (state, miles) two columns and output like following 5 columns /4rows in mysql using php code.
(5 Columns in mysql table) id order_no order_date state miles 310 001 02-15-2020 MI 108.53 310 001 02-15-2020 Oh 194.57 310 001 02-15-2020 PA 182.22
310 001 02-15-2020 WA 238.57 ------------------my php code -----------
<?php
if(isset($_POST["add"]))
$miles = explode("\r\n", $_POST["miles"]);
$query = $dbh->prepare($sql);
$lastInsertId = $dbh->lastInsertId(); if($query->execute()) {
$sql = "update tis_invoice set flag='1' where order_no=:order_no"; $query->execute();
} ----------------- my form code ------------------
<?php -- Can any one help how to correct my code..present nothing inserted on table
Thank You Edited February 8, 2020 by karthicbabuThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=330084.0 |