sh0wtym3
Members-
Posts
121 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
sh0wtym3's Achievements
Member (2/5)
0
Reputation
-
Ok thanks. And I won't, I'll only be storing non-cc info in the database (name, address, phone, email)
-
Hey all, I'm setting up a shopping cart for a website, and I've installed an SSL certificate so the credit card information will be taken on a secure encrypted https connection. So far everything is working fine. The shopping cart will be communicating with a paypal API. This is my first time building an eCommerce website, and I wanted to know if there's any security precautions I should be aware of? Am I good to go with just a secure connection? I'm also redirecting all http requests to https on the checkout page through the .htaccess file, to make sure no user accidentally ends up filling out their credit card information on an unsecure connection.
-
Line breaks \r\n are showing up in HTML email
sh0wtym3 replied to sh0wtym3's topic in PHP Coding Help
Here's a solution, for others who may wander into this thread: $message = str_replace('\r\n', '<br />', $_SESSION["message"]); -
Line breaks \r\n are showing up in HTML email
sh0wtym3 replied to sh0wtym3's topic in PHP Coding Help
I applied that function as follows: $message = stripslashes($_POST["message"]); However instead of "\r\n" characters showing up everywhere, "rn" characters show up everywhere -
I have a simple contact form with a textarea field, where the visitor can type a message in. However, if the user enters paragraphs or any type of line breaks, then the email that is sent shows the "\r\n" characters. I've tried using the nl2br function to no avail. Here's a sample code snippet: $message = $_POST["message"]; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: '. $_POST["email"]; mail($to, $subject, $message, $headers); Am I missing something? Besides the "\r\n" characters showing, everything else works fine.
-
I've written an SQL query but it's failing and I'm trying to figure out why SQL Server 2005 is kicking it back. Is there a way to retrieve and read these error messages after executing: $sql = "My query here"; mssql_query($sql); ? Thanks in advance.
-
Yes!! Do you have a Paypal account? And if so what's your paypal e-mail address
-
Nah, it's still replacing EVERYTHING with "Now Im Gone"
-
If you could help me with this I'd be grateful, I've been working on this script nearly (7?) hours now and I'm ready to pull my hair out. I've got most of it done, but here's the last string: $FullString = ".sideAds#tripleCalc h3{ display:block; width:120px; background-image:url(images/sideAdH3_blank-top.png); background-repeat:no-repeat; background-position:top center; padding-top:15px; background-color:#909; font-size:12px; text-align:center; } .sideAds#tripleCalc .h3Floor{ display:block; width:120px; height:14px; background-image:url(images/sideAdH3_blank-floor.png); background-repeat:no-repeat; background-position:bottom center; background-color:#909; } .sideAds#CustomButton{ } .sideAds#CustomButton a{ display:block; } .sideAds#CustomButton h3{ display:block; width:120px; background-image:url(images/sideAdH3_blank-top.png); background-repeat:no-repeat; background-position:top center; padding-top:15px; background-color:#EEE; font-size:12px; text-align:center; } .sideAds#CustomButton .h3Floor{ display:block; width:120px; height:14px; background-image:url(images/sideAdH3_blank-floor.png); background-repeat:no-repeat; background-position:bottom center; background-color:#EEE; }"; Out of that string, I need a RegEx that will replace only: .sideAds#tripleCalc h3{ display:block; width:120px; background-image:url(images/sideAdH3_blank-top.png); background-repeat:no-repeat; background-position:top center; padding-top:15px; background-color:#909; font-size:12px; text-align:center; } I came up with the following, but it replaces EVERYTHING instead of just the first part, I think it's being greedy like you mentioned and looking for the last "}" $FullString = preg_replace('~^\.sideAds#tripleCalc h3{.*}$~s', "Now Im Gone", $FullString); If you have paypal I can send you $10-$20 for all your help, I just really need to get this done tonight
-
Nvm I figured it out myself. Here's the solution if anyone else is looking: $string = "ABCDEF;12345"; if (preg_match('~^\A.*[;$]~', $string, $matches)) { echo "Match was found <br />"; echo $matches[0]; } Just enclose the ";$" in brackets
-
Sorry to keep resurrecting this thread, but I couldn't find any info on your links (or google for that matter) on how to search for a string that ends in a semicolon. I think regex uses semicolons as a delimiter which throws it off? But I'm not sure. Here is what I got: $string = "ABCDEF;12345"; if (preg_match('~^\A.*;$~', $string, $matches)) { echo "Match was found <br />"; echo $matches[0]; } I tried escaping the semicolon but that didn't seem to work either: $string = "ABCDEF;12345"; if (preg_match('~^\A.*\;$~', $string, $matches)) { echo "Match was found <br />"; echo $matches[0]; }
-
Thanks, I will definitely check out your links as I want to get good at regex
-
Sorry, I have another problem... Sometimes my string will have line breaks, so while: $string = "ABCDEF12345"; if (preg_match('~^\A.*5$~', $string, $matches)) { echo "Match was found <br />"; echo $matches[0]; } ... will work, this won't: $string = "ABCDEF 12345"; if (preg_match('~^\A.*5$~', $string, $matches)) { echo "Match was found <br />"; echo $matches[0]; } How do I make it ignore the line breaks?
-
That works! Thanks
-
How can I find a string that starts with "A" and ends with "5"? I thought: $string = "ABCDE12345"; if (preg_match("/(^A)(5$)/", $string)) { echo "Match found."; } ... Would work but it's not