PHP - Textbox Array
Like Youtube; when submitting a video; You can insert words into a Textbox named Tags.
Each space you leave is considered the start of a new word. How can I do this using PHP + MYSQL. Thanks! Similar TutorialsHello, I'm new to the forum so bare with me. I'm trying to take data entered into a text box on a form and have that data checked against an associative array. I've attached a .doc with some pictures showing how the data should be displayed. It's the checking part that I'm having trouble with. Any help would be appreciated Thanks I would appreciate if someone could figure this out or tell me the easiest way to do this. I need a count up counter that appears in a textbox so I can record the time a user is on a page. On a side note, I do have their Start and finish time timestamp recorded in myphpadmin database but I am looking for the easiest (or best) way to do this. Any advice or scripts would be very much appreciated.
Thanks in advanced.
I did find this counter that works but the numbers appear 0.0.1 if counting up. I don't want to confuse the user. I really want to display to the user how long they was on a certain page.
<script> $(document).ready(function() { var time = '00:00:00', parts = time.split(':'), hours = +parts[0], minutes = +parts[1], seconds = +parts[02], input = $('#timeInput'); var timer = setInterval(function(){ seconds++; if(seconds == 60) { seconds = 00; minutes++; if(minutes == 60) { minutes = 00; hours++; } } var newTime = hours + ":" + minutes + ":" + seconds; $('#timeInput').val(newTime); }, 1000); }); </script> <input type="text" name="time" id="timeInput"/> I am currently writing a script, well, attempting to write a script where the user is able to add an unlimited amount of text boxes via javascript: Code: [Select] var i = 1; function AddTxtBox() { new_textbox.innerHTML = new_textbox.innerHTML +"<br />Misc Item " + i + ": <input type='text' name='prod_misc[]' placeholder='Misc Product Info' />" i++; } The js code works fine adding the text boxes. My first question is: in the "name" field; the name I have is "prod_misc[]" is that correct for adding the input into an array? Second question: I want to input that data from the "prod_misc[]" array into SQL, namely PostgreSQL. Should I use a "for()" loop to extract each key of data from the array "prod_misc[]"? If so, what syntax do I use to input an array of data like that into SQL? Thanks so much in advance for this help... I am in great need and it's very appreciative. <INPUT TYPE = "Text" VALUE ="0" ID = "username2" NAME = "username2"> <?php $value1 = $_POST['username2']; $nine=$value1; $codx =$characters[$nine]->name; ?> Im tring to get '0' in username2 inputbox readit in php $nine $codx =$characters[$nine]->name;
It only works like this <?php $nine='0' $codx =$characters[$nine]->name; ?>
What i need is to get the users
the $nine will hold the number
How do I read the user input my textbox post pulls the input $nine = $_POST['username2']; $codx =$characters[$nine]->name; i noticed it wouldn't work it only works this way
$nine='0';
Let me know how to read in user input
sorry to repeat i needed to explain none I have a problem where I am unable to display a DB entry that for exampe says "John Doe". The code I am using is: Code: [Select] <tr> <td>Agent Full Name:</td> <td><input type="text" name="fullname" value='.$agentdata['fullname'].'></td> </tr> The output shows "John" instead of "John Doe", have I missed something here Hi all i have been trying for 6 hours to write some code that will show a text box and the user puts in there id then it provides a link with the id in the middle of it so say the id is 111555 the link is http://example.com.au/data/users/111555/2011/1/1 i want the user to insert their id and do if the id 343034 the link is http://example.com.au/data/users/343034/2011/1/1 can any one give me the code to this i have gotten no where from tutorials please matt sorry for posting..i already make it Hi, I would like to know how to get The Value Of An Hidden TextBox From an External Website than Mine. I'm Coding an Addons for CCBChurch.com (mychurch.ccbchurch.com/app/trx_submit_bp.php), This is a donation website, They want me to code an addons so people can place it on their website and people can donate. I made it in cURL with POST but they generate a TimeStamp and a TimeStamp encoded, The 2 are on mychurch.ccbchurch.com/app/trx_submit_bp.php on hidden textbox. I would like to get the TS and TSH from the hidden textbox on the website, Is that possible ? I would too like to put it in Variable $ts and $tsh... Thanks ! hello, is there a way to have it so that when somebody enters information into a textbox in a form, it will keep the formatting (if they have 5 lines, it will show as 5, not 1) Code: [Select] $name = $_POST['name']; $resume = $_POST['resume']; $to = "mike@web.com"; $subject = "Resume From Website"; $message = "Name: $name <br /> Resume: $resume "; $from = "resume@web.com"; $headers = "From: $from \r\n Content-Type: text/html; charset=ISO_8859-1\r\n Content-Transfer_Encoding: 7bit\r\n\r\n"; mail($to,$subject,$message,$headers); hello, i have implemented a jquery function like this: http://jsbin.com/ujuse i need to grab the contents of the textarea to store it in a session, but without sending a form, is this possible?? thanks for looking Hi,
i'm trying to display db(name,email,telephone no) values in textbox.please help me.
::HTML part::
<form class="form-signin" role="form" id="form1" action="post_user.php"> I have a text box for users to enter new text in. The box also contains text that is determined by a variable that is created from a mysql query and some other added text. I want to make a portion of the added text within the textbox bold. How would I achieve this with php? Code: [Select] <?php result = mysql_query("SELECT `something` FROM `table` WHERE `this` = '$that'"); row = mysql_fetch_row($result); $variable = $row[0]; $text = "<strong>Here is the text that I want bold</strong> $variable"; echo "<textarea name=\"textbox\">"; echo "$text"; echo "</textarea> ?> Doing this gives me this result in the textbox: "<strong>Here is the text that I want bold</strong> This is what the variable text says." Any ideas? hey, im trying to show data in a text box thats being retrived from a database, but if there is a ' in it, it will only show the text up to that point. (ie. if it has "You're" it will only show "You") here is the code im using echo "<input type='text' value='$picComment'>"; Hi, I am working on a script that will add 3 sets of information to a MySQL table. I had a script that had the fields of username password and password2. It worked just fine when password2 was used for verification to make sure you typed it right. But now I want to take password and turn it into a new data field that is submitted into the new row with the other information. The problem is it wont add the row. The script says it worked just fine but i check the db and no new row. here it is: <?php // Connects to your Database mysql_connect("//", "//", "//") or die(mysql_error()); mysql_select_db("//") or die(mysql_error()); //This code runs if the form has been submitted if (isset($_POST['submit'])) { //This makes sure they did not leave any fields blank if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { die('You did not complete all of the required fields'); } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the username '.$_POST['username'].' is already in use.'); } // this makes sure both passwords entered match if ($_POST['pass'] != $_POST['pass']) { die('Your passwords did not match. '); } // here we encrypt the password and add slashes if needed $_POST['pass'] = md5($_POST['pass']); if (!get_magic_quotes_gpc()) { $_POST['pass'] = addslashes($_POST['pass']); $_POST['username'] = addslashes($_POST['username']); $_POST['pass2'] = addslashes($_POST['pass2']); } // now we insert it into the database $insert = "INSERT INTO users (username, password, Human-Readable) VALUES ('".$_POST['username']."', '".$_POST['pass']."', '".$_POST['pass2']."')"; $add_member = mysql_query($insert); ?> <h1>Registered</h1> <p>Thank you, you have registered - you may now login</a>.</p> <?php } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table border="0"> <tr><td>Username:</td><td> <input type="text" name="username" maxlength="60"> </td></tr> <tr><td>Password:</td><td> <input type="password" name="pass" maxlength="10"> </td></tr> <tr><td>HR:</td><td> <input type="password" name="pass2" maxlength="10"> </td></tr> <tr><th colspan=2><input type="submit" name="submit" value="Register"></th></tr> </table> </form> <?php } ?> And incase you want to see it here is the original: <?php // Connects to your Database mysql_connect("//", "//", "//") or die(mysql_error()); mysql_select_db("//") or die(mysql_error()); //This code runs if the form has been submitted if (isset($_POST['submit'])) { //This makes sure they did not leave any fields blank if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { die('You did not complete all of the required fields'); } // checks if the username is in use if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $usercheck = $_POST['username']; $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'") or die(mysql_error()); $check2 = mysql_num_rows($check); //if the name exists it gives an error if ($check2 != 0) { die('Sorry, the username '.$_POST['username'].' is already in use.'); } // this makes sure both passwords entered match if ($_POST['pass'] != $_POST['pass2']) { die('Your passwords did not match. '); } // here we encrypt the password and add slashes if needed $_POST['pass'] = md5($_POST['pass']); if (!get_magic_quotes_gpc()) { $_POST['pass'] = addslashes($_POST['pass']); $_POST['username'] = addslashes($_POST['username']); } // now we insert it into the database $insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')"; $add_member = mysql_query($insert); ?> <h1>Registered</h1> <p>Thank you, you have registered - you may now login</a>.</p> <?php } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <table border="0"> <tr><td>Username:</td><td> <input type="text" name="username" maxlength="60"> </td></tr> <tr><td>Password:</td><td> <input type="password" name="pass" maxlength="10"> </td></tr> <tr><td>Confirm Password:</td><td> <input type="password" name="pass2" maxlength="10"> </td></tr> <tr><th colspan=2><input type="submit" name="submit" value="Register"></th></tr> </table> </form> <?php } ?> Many Thanks in advanced For example, I've got 10 input boxes (textbox) and 5 of them must contain date that user enters using calender script, the problem is, all of the boxes that requires date as input have the same id and now only first textbox is populated (logic I know), how can I populate the other ones? Code for showing calendar images next to textboxes which IDs are "a": if ($row['fieldtype'] == 'a') { echo '<input type="text" id="a" name="textbox[]" value=""></td><td>'; echo '<input type="hidden" id="a" name="textbox[]" value=""></td><td>'; echo '<a href="javascript:viewcalendar()"><img src="calendar.png"></a></td><td>'; } And the code in scripts.js that populates fields Code: [Select] function insertdate(d) { window.close(); window.opener.document.getElementById('a').value = d; } Hello everyone I am totally new in php i need some help in coding, Suppose I have 100 check boxes and one Textbox, I want to send the combined value of check box and textbox to another page. Like if i check a check box then the value of that check box and text box will be submitted to another page. Please see the attached b screenshot so you can get the idea Thanks in Advance Attached Files capture 2.jpg 38.69KB 0 downloads Hi there, I am working on a PHP website. The scenario is that there is page where users can enter a Group name and can specify its Members name. A group can have n-number of members under it. We cannot predict how many members will be assigned to a group. So therefore, I have given a link or button under the group name as 'add more member' where users can click and add member names in the textbox at runtime. Please see the Screenshot for a clear idea as to what I am trying to accomplish here. Thank you! All comments and feedback are always welcomed. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=329374.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=343375.0 I am doing simple program to display text entered by user.. Following is my code but its display 'error msg' instate of txtbox contents <html> <head><title>Date</title></head> <body> <form action="" enctype="multipart/form-data"> Enter Date: <input type="text" name="txtdate"/> <input type="submit" value="Display"/> </form> </body> </html> <?php if(isset($_POST['txtdate'])) { $display =$_POST['txtdate']; echo 'You have entered'.$display; } else { echo 'Error msg'; } ?> |