Jump to content

sh0wtym3

Members
  • Posts

    121
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sh0wtym3's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok thanks. And I won't, I'll only be storing non-cc info in the database (name, address, phone, email)
  2. 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.
  3. Here's a solution, for others who may wander into this thread: $message = str_replace('\r\n', '<br />', $_SESSION["message"]);
  4. I applied that function as follows: $message = stripslashes($_POST["message"]); However instead of "\r\n" characters showing up everywhere, "rn" characters show up everywhere
  5. 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.
  6. 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.
  7. Yes!! Do you have a Paypal account? And if so what's your paypal e-mail address
  8. Nah, it's still replacing EVERYTHING with "Now Im Gone"
  9. 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
  10. 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
  11. 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]; }
  12. Thanks, I will definitely check out your links as I want to get good at regex
  13. 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?
  14. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.