PHP - Unable To 'enter Pass Phrase...
Hi there...
I am working on a PHP website. And trying to install OpenSSL certificate. I'm running Wamp on Windows 7. I typed the command in command prompt as: Code: [Select] openssl genrsa -aes256 -out pass.key 2048 This command then prompts me to enter the pass key as: Code: [Select] Enter pass phrase for pass.key: But at this point I am unable to type anything in. What do we need to do here to allow the input? do we need to make any changes in any file. Please have a look at the Screenshot attached. Thank you! All comments and feedback are always welcomed Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342776.0 Hey guys. I am trying to strip everything between a key phrase and ending tag but for some reason it is not working. I always get blank data. I've tried many different ways but no luck.
basically I have a script that connect to imap and store emails into MySQL as service tickets. works great but I am trying to strip everything except for user reply because currently if a user reply to an email it re-inserts the entire email into MySQL. I added a key phrase at the top of all outgoing emails .
1. structure looks like this.
--Reply below this line to respond--
------------------------------------------------------------------------------------------------
Email body message...
2. When replying to the message it becomes
New Message reply......
--Reply below this line to respond--
old message body.
3. so I would only like to insert the new reply message only.
This is what I got so far.
$message=strip_tags($message, "<br><div><p><u><hr></section>");
$message=preg_replace("</p>", "br /", $message); $message=preg_replace('#--REPLY above this line to respond--(.*?)</section>)#s', ' ', $message); $message=clean("<br/><hr><u>Received On $rep_date / $from_email</u><br><br/>$message"); it inserts the "Received On date and From but $message is blank. If i remove $message=preg_replace('#--REPLY above this line to respond--(.*?)</section>)#s', ' ', $message); it inserts the entire email Any suggestion on what i am doing wrong? thank you all very much. I have phrases in a string with the structure of "Note: some description" I want to replace "Note with (, but how can I replace the second " with )? for example, i want to search for an the string "example@example.com" and erase it. thanks in advance ! Hey, I was just wondering if you could help. I have a search and it only searches for exact phrases. $query="SELECT * FROM table WHERE title like '%$searchfield%' OR description like '%$searchfield%' ORDER BY title LIMIT $offset, $rowsPerPage"; $result=mysql_query($query); I was wondring if I could modify it so that if someone searches for something like 'Peeling a Banana' It seaches for the words 'peeling' and 'banana' and not the whole phrase as one? Thanks Hi, and thanks for any help with this.
I have this but of php i have been trying relentlessly to get working.. for over a month. <?php $abs="one two three four words"; $mT = "testing for matching words"; $words=explode(' ', $abs); //$sf=($words); if (preg_match($words, $mT)) { echo "the url $mT contains a Word"; } else { echo "the url $mT does Not contain a Word"; echo "$words[4]"; } ?>
You see, I get a responce only using the last line "$words[4]", (obviously, because I am pointing it the Matching word, (ie: with [4]) Edited June 9, 2020 by x1705 better description. I work with a large codebase and I have this situation come up fairly often:
the legacy class has large objects such as:
$design->motor->dimensions->a; $design->motor->dimensions->bd; $design->specifications->weight; $design->data->height; //etcWhen I create a new class, that class sometimes operates on the specific data, so say: class MyClass { public function compute($weight, $height, $a) { //stuff } } //and I call this for example as such: (new MyClass())->compute($design->specifications->weight, $design->data->height, $design->motor->dimensions->a);CONS: Potential issue: if design specs change and I need to change things parameters in "compute" function, I need to "re-key" the variables I pass to the function, and adjust things accordinly in MyClass as wel. PROS: only the exact data is being passed, and this data can come from anywhere it is viable, so in effect the function is fairly well separated, I think. Alternative option for me is to pass the entire design object, i.e class MyClass { public function compute(&$design) //can also be done via DI through a setter or constructor. { print $design->specifications->weight; print ($design->data->height + $design->motor->dimensions->a); //stuff } } (new MyClass())->compute($design);PROS: In this case when things change internally in which variables are needed and how things are computed, I only need to change the code in compute function of the class itself. CONS: MyClass now needs to be aware of how $design object is constructed. When it comes to this parameter passing, and Dependency Injection like this in general, does Computer Science advocate a preference on this issue? Do I pass the entire object, or do I pass only the bits and pieces I need? I'm trying to get a simple table to display and am not sure how to make it happen. Table will have just 2 columns. A TIME and an EVENT. What I want to have happen is for the first row to show the TIME and next to that, the EVENT. If a TIME has more than one event going I want the next row to show an empty first cell and then the second event below the first. If I set up the loop the only way I know how (so far) it would also output the TIME value again and again as many times as there were events for that same time. For example what I don't want is: 9:15 Sunday School 9:15 Nursery Available What I do want is: 9:15 Sunday School Nursery Available Thanks. This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=316064.0 Hi There, I have an application that uses a Flash front end. The user fills out a card. The variables of that card are stored in an SQL Database and the recipient gets an email with a unique url to retrieve the card. The problem I am faced with ... is that if the user hits their ENTER key while typing their message to create line breaks.. the line breaks are causing the SWFOBJECT Flash Embed to break. The SWFOBJECT embed code looks like this Quote var flashvars = { yname: "<?php print "$yname";?>", yemail: "<?php print "$yemail";?>", fname: "<?php print "$fname";?>", femail: "<?php print "$femail";?>", greeting: "<?php print "$greeting";?>", message: "<?php print "$message";?>", fullname:"<?php print "$fullname";?>" }; The results look like this when data has been filled out Quote <script type="text/javascript"> var params = { quality: "high", //scale: "ExactFit", wmode: "transparent", menu: "false", allowfullscreen: "true", allowscriptaccess: "always", bgcolor: "#014872" }; var flashvars = { yname: "Jonathon", yemail: "name@email.com", fname: "TEST", femail: "jname@email.com", greeting: "TESTING", message: "Test Test Test", fullname:"" }; You can see the line breaks whe Test Test Test Was typed. Any ideas how to fix this ? Code: [Select] $sql= ("INSERT INTO custcards (username,Card_Number,Card_Type,Card_Name,Card_End) VALUES('$username','$cardnumber','$cardtype','$cardname','$cardend')"); if (isset($_GET['submitted'])) { if (checkCreditCard ($_GET['CardNumber'], $_GET['CardType'], $errornumber, $errortext)) { $errortext = 'This card has a valid format'; // Default text if card is VALID $result = mysql_query($sql)){ echo "$errortext"; // Echo/Show this text } } else { echo '<p align=center>';echo "$errortext"; // Display ERROR Type/Text echo "ERROR: ".mysql_error(); } } The code is to check details beign entered and to make sure thier correct and then print the correcrt message but i also want it to store the details into a table i know i havent got the syntax correct was wondering is anyone can help ? Sorry for the caps, but this is relatively time sensitive. I am trying to make a register form, but when I click the submit button, nothing happens. It doesn't add to the table, it doesn't bring me home, doesn't even display the errors if the PWD's don't match or the fields are blank. Here's my code, thanks guys ! PS: The DB name is phptest, and the table is called users. Code: [Select] <?php error_reporting(0); require_once('connector.php'); $errors = array(); if ($_POST["submit"]) { if (empty($_POST['username'])) { array_push($errors, 'You did not submit a username.');} if (empty($_POST['email'])) { array_push($errors, 'You did not submit a email.');} if (empty($_POST['password1'])) { array_push($errors, 'You did not submit a password.');} $old_usn = mysql_query("SELECT id FROM users WHERE name = '".$_POST['username']."' LIMIT 1") or die (mysql_error()); if (mysql_num_rows($old_usn) > 0) { array_push($errors, 'This username is already registered.');} $old_email = mysql_query("SELECT id FROM users WHERE email = '".$_POST['email']."' LIMIT 1") or die (mysql_error()); if (mysql_num_rows($old_email) > 0) { array_push($errors, 'This email is already registered.');} if ($_POST['password1'] != $_POST['password2']) { array_push($errors,'You entered two different passwords');} if(sizeof($errors) == 0) { $username = $_POST['username']; $email = $_POST['email']; $password = sha1 ($_POST['password1']); mysql_query("INSERT INTO users (name, hashed_psw, email, joined) VALUES ('{$username}', '{$password1}', '{$email}', NOW());") or die (mysql_error()); header ('Location: index.php?msg=1'); } } ?> <html> <head> <title>register</title> </head> <body> <?php foreach($errors as $e) { echo $e; echo "<br/>\n"; } ?> <form action="register.php" method="post"> <h4> Username: <br /> <input name="username" type="text" value="" size="10" maxlength="16" /> <br /> <br /> Email: <br /> <input name="email" type="text" value="" size="10" maxlength="100" /> <br /> <br /> Password: <br /> <input name="password1" type="password" value="" size="10" maxlength="16" /> <br /> <br /> Confirm Password: <br /> <input name="password2" type="password" value="" size="10" maxlength="16" /> <br /> <br /> <input name="submit" type="button" value="Register" /> </h4> </form> </body> </html> And heres the connector.php script: Code: [Select] <?php mysql_connect("localhost", "***", "***") or die (mysql_error()); mysql_select_db("phptest") or die (mysql_error()); ?>(yes, the asterisks have the name and pw, just put them just in caseys! Not sure how to even search for what I'm looking for, which is to say I'm really in need of guidance. I have a pre-populated database that I set up with about 260 names in it. It also has information like, height (basketball players) and high school. It's a list of kids I mean to invite to play in a league. From there, they will actually come to the league's site and register. I'd like for my form to check to see if they are already in the database, and if they are just add personal information, like email and phone number. If they are not, I'd like for the form to enter all of the information (name, school, etc). How can I build a form with a drop down menu with the year, day, month? And then send that information to a database. If there is another/better option besides a drop down menu? If so, please tell me. The rest of the form is working fine, and all the inforamtion is going to the database - last name, first name, address, phone number, zip code, race,,,,,,,,,. I work for a not-for-profit medical office - we provide medical services to the local people who can not afford to go to a regular doctor. We need a simple way to keep track of patient information. One of the things we need to enter is the birthdate. Searching the forums provided a lot of results, but the words date and form are used so much, I can not find anything that helped me. I also looked through php.net, but can not find anything there. Before I go digging around for code or conversion to unix time stamp, I'm curious how many of you have a birthday entry on a form which is the least hassle for the person filling out the form. For example a text box and they can enter 12/1/1992 or 12/1/92 or 12-1-1992 or three text boxes for month, day and year and if so, require an 01 or a 08 or 4 characters for year. The second method with three boxes would easily convert to a date stamp entry on the other hand if there is a php conversion that would convert any format (12/1/1992, 12/01/92, etc) to a unix time stamp that would make it easier for the person filling out the form. Thanks in advance for any ideas or help. Mike The company I work for is a not-for-profit organization, we provide medical services for people who can not afford to go to the regular doctor. We need a way to keep track of our patients and their visits and a way to search the data. I found an html form, with name, address, phone number, zip code,,,,,, and made a few changes to fit our needs. But I do not know how to get that information into the database. I also need a way to make sure the information is not a duplicate. Since we are a not-for-profit organization, funds are kinda tight. That is why I want to go with php instead of buying medical software. Most of the medical software on the market cost more then we can afford. I'am a computer tech here at the office, but my field is hardware, networking, and malware removal. PHP programming is new to me. So where do I start? I cannot redirect to other page even I enter correct information and recaptcha in activation form. Anyone who can check what going wrong in my activation script?
Here is my php activation check script:
<?php Hello everyone, I have a page with a short form with just a password field and a submit button. I also have php code setting variables depending on whether or not the password is correct. When the password is entered and the submit button is CLICKED, everything works as it should. However, when the password is entered and the ENTER button is pushed to submit the form, the form is reset and nothing else happens. Also, this only happens in I.E., it works fine with Firefox. I have plenty of other forms that I use in the same manner but they all work whether the submit button is clicked or the enter button is pushed to submit, regardless of what browser is used. The idea is to have this window close (it's opened as a pop-up) and the main window load the next page. Again, it works perfectly as long as the submit button is clicked but not if the enter button is pushed. Not sure if it has something to do with my php code or what. Any ideas on how to fix this? Here's my code: Code: [Select] <?php if (isset($_POST['submit'])) { $pword = md5($_POST['pword']); $q = mysql_query("SELECT * FROM `accounts` WHERE acct_number = '$acct' AND pword = '$pword'") or die (mysql_error()); $r = mysql_num_rows($q); // Checks to see if anything is in the db. if ($r == 1) { $student = "true"; } else { $student = "false"; } } else { $student = "unknown"; } ?> <!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" /> <title>Student Verification...</title> </head> <!-- <body> tag is in PHP --> <?php if ($student == "true") { echo "<body onunload=\"opener.location=('signup.php?acct1=$acct')\">"; } else { echo "<body>"; } if ($student == "true") { echo "<div align='center'>"; echo "<p><font size='+2'>Passcode Correct!</font></p>"; echo "</div>"; echo "<div align='justify'>"; echo "<p>You will now be directed to the signup page.</p>"; echo "</div>"; echo "<div align='center'>"; echo "<p>Thank you.</p>"; echo "<input type='button' value='Continue to Signup...' onClick='window.close()'>"; echo "</div>"; echo "<meta http-equiv=\"REFRESH\" content=\"20;url=close.php\">"; } elseif ($student == "unknown") { echo "<div align='center'>"; echo "<table width='325' height='175' border='0' cellspacing='0' cellpadding='0'>"; echo "<tr>"; echo "<td width='325' align='center' valign='middle'>"; echo "<p><font size='+1'><strong>Welcome!</strong></font></p>"; echo "<p>Please enter the school passcode.</p>"; echo "<form name='form' method='POST' action='schoolpw.php'>"; echo "<p><input type='password' name='pword' size='30' maxlength='20' /></p>"; echo "<input type='submit' name='submit' id='submit' value='Submit' /> "; echo "<input type='button' name='cancel' value='Cancel' onClick='window.close()' />"; echo "</form>"; echo "</p>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; } elseif ($student == "false") { echo "<div align='center'>"; echo "<table width='325' height='175' border='0' cellspacing='0' cellpadding='0'>"; echo "<tr>"; echo "<td width='325' align='center' valign='middle'>"; echo "<p><font size='+1'><strong>Welcome!</strong></font></p>"; echo "<p><font color='#FF0000'>Incorrect Passcode! Please try again.</font></p>"; echo "<form name='form' method='POST' action='schoolpw.php'>"; echo "<p><input type='password' name='pword' size='30' maxlength='20' /></p>"; echo "<input type='submit' name='submit' value='Submit' /> "; echo "<input type='button' name='cancel' value='Cancel' onClick='window.close()' />"; echo "</form>"; echo "</p>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; } ?> </body> </html> |