PHP - Moved: Regular Expressions
This topic has been moved to PHP Regex.
http://www.phpfreaks.com/forums/index.php?topic=341968.0 Similar TutorialsThis topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=351100.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=315565.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=334128.0 i need to split words and add to a array from filter input. i can split words with [ ] (Space character). But also i need to not split "word1 word2" with space character. for example: Filter input "word1 word2" word3 word4 my array will need to be like this after split arr[0] = word1 word2 arr[1] = word3 arr[2] = word4 can some one help me about this? By the way im sorry for my poor english Thanx Okay, I have a problem. I need to display multilple output of a file with a similar file name I.E. file1: 6002010.pdf file2: 6002010.mmddyyyy.pdf Now the first part of the file stays the same, but there is a time stamp on modified versions of the file. But in my output I need to display all the files with the 6002010. Could I use a wildcard such as 6002010* to get all the files to output on the screen? Or do I need to use a regular expression? I have a payment form that submits its results to Authorize.net. It works on my laptop without an SSL certificate using an Authorize.net test account. But when I transfer this one file over to my GoDaddy account - which has cURL enabled and an SSL certificate - the page crashes when you submit the form results. (Actually you just get a blank page except for echo statements I added?!) If I take out my "Form Validation" block - which uses Regular Expressions - then the form runs on the server?! Someone said it might be that "cURL must have SSL enabled in the build", but that isn't the issue, because I can send data to an HTTPS connection and receive a response back?! Here is a streamlined version of my code... Code: [Select] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href=".css"> <style type="text/css" > someStyleHere{ font-weight: bold; } </style> </head> <body> <?php // Check Form. echo '*** Checking for Submitted Form ***<br />'; if (isset($_POST['submitted'])){ // Handle Form. echo '*** Form was Submitted ***<br />'; echo '*** Handling Form ***<br />'; // Trim all incoming data. $trimmed = array_map('trim', $_POST); // CHECK BILLING INFORMATION. echo '*** Check for Form Errors ***<br />'; // Check First Name. if (!empty($_POST['firstName'])){ if (preg_match('/^[A-Z \'.-]{2,20}$/i', $_POST['firstName'])){ $firstName = $_POST['firstName']; }else{ $errors['firstName'] = 'Must be 2-20 characters (A-Z \' . -)'; } }else{ $errors['firstName'] = 'Please enter your First Name.'; } // Determine if any errors. if (empty($errors)){ // PROCESS PAYMENT. echo '*** Processing Form ***<br />'; $post_url = "https://test.authorize.net/gateway/transact.dll"; // Output the Response Array to the screen as an HTML Numbered List. echo "<OL>\n"; foreach($response_array as $value){ echo "<LI>" . $value . " </LI>\n"; } echo "</OL>\n"; // Printe Response Code. switch($response_array[0]){ case "1": echo "Response Code: Approved"; break; case "2": echo "Response Code: Declined"; break; } // Do not re-display Payment Form!!! exit(); // ********************************************************************* }// End of PROCESS PAYMENT. }// End of HANDLE FORM. ?> <!-- HTML PAYMENT FORM --> <form id="payment" action="" method="post"> <fieldset> <legend>Billing Details</legend> <ol> <!-- First Name --> <li> <label for="firstName">First Name:</label> <input id="firstName" name="firstName" class="text" type="text" maxlength="20" value="<?php echo $firstName; ?>" /> <?php if (!empty($errors['firstName'])){ echo '<span class="error">' . $errors['firstName'] . '</span>'; } ?> </li> </ol> </fieldset> <!-- Submit Form --> <fieldset id="submit"> <input name="submit" type="submit" value="Place Order" /> <input name="submitted" type="hidden" value="true" /> </fieldset> </form> </body> </html> With my Regular Expressions in, I get this output after submitting the form... Quote *** Checking for Submitted Form *** *** Form was Submitted *** *** Handling Form *** With NO Regular Expressions in, I get this output after submitting the form... Quote *** Checking for Submitted Form *** *** Form was Submitted *** *** Handling Form *** *** Check for Form Errors *** *** Processing Form *** post-string = x_login= and so on... Response Code: Approved (Which means the code is working...) I am at wit's end with this problem... Thanks, Debbie This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=312614.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=306546.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=315144.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=325430.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=325429.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=310676.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=316160.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=317585.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=318398.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=349184.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=334308.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=351154.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=345635.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=311051.0 |