Jump to content

Zhadus

Members
  • Posts

    376
  • Joined

  • Last visited

    Never

About Zhadus

  • Birthday 09/16/1987

Contact Methods

  • AIM
    CasualtyOfSoc
  • Website URL
    http://www.grimcode.com
  • Yahoo
    CasualtyOfSoc

Profile Information

  • Gender
    Male
  • Location
    Wisconsin, USA

Zhadus's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. If (condition1) echo '<img src="1.jpg" />'; else echo '<igm src="2.jpg" />';
  2. Submit the form to itself to do the checking, or change this redirect: if(!$resp->is_valid) { header("location:captcha_error.html"); die(); As far as saving the values if you navigate OFF of the page, you'll need to either store them in a database until they return and reload them, or if the information doesn't need to be secure, you can pass it back through the URL and use a $_GET request.
  3. I agree with Ken2k7 that a database would be optimal, but this saves on queries to the database, and there are very few people who would rather decode a URL than just click the link. Here are the two functions I use: function getLink($matches) { if (preg_match('/^www\./', $matches[2])) $link = 'http://' . $matches[2]; else $link = $matches[2]; $link = base64_encode($link); $result = $matches[1] . 'link.php?url=' . $link. $matches[3]; return $result; } function linkMask($text) { $pattern = '/(<a href=["|\'])(.*?)?(["|\']>)/'; $text = preg_replace_callback($pattern, "getLink", $text); return $text; } I can't guarantee it's bug free. You'll want to run whatever text you have through the linkMask() function and it will do the rest. It also fixes links incase you mistakenly type www.blah.com instead of using the http://. To use it, the links are just in normal "a href" format that it checks for. On my link.php page, it looks like this: $target = base64_decode($_GET['url']); header ("Location: $target"); Mine has a lot more features, but that's the basic jist and I think you're knowledgeable to modify it to your needs.
  4. If you used mine instead of his, I'm an idiot $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); $find = ''; foreach($arr as $key => $val) { $find = strstr($url, $val); echo $find; } Also, what exactly are you expecting and what are you getting?
  5. gevans made the fix, but you do realize you're overwriting $find if it finds 'dog' anyway, right? Try this: $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); $find = ''; foreach($arr as $key =>) { $find = strstr($url, $key); echo $find; }
  6. I'd recommend using a different type of system so you don't need to manually add in all the links you want to do that to. I personally use base64 encoding of my urls, and send them a link.php page with the encoded url. Then I decode and use a header to redirect. It's easy and clean, and has the same affect.
  7. $newcode = preg_replace('%{sls}(.*){/sle}%s', $replacewith, $input);
  8. If CountProfiles returns a value, you can just do this: echo '<span id="stats">'. CountProfiles() .'</span>';
  9. I'd recommend putting anything that you use more than once in a library as you never know what may use them again in the future. Also as long as you are doing some reworking, take a look at some other functions, you may be able to combine a few that do similar things.
  10. You're right for a slow load. Could have it round to the closest 2 minute interval. Just as you said, it doesn't need to be completely secure, just so that the general script kiddy won't have access basically. Just manipulate the date() command to factor it with your hash variable.
  11. Well it certainly wouldn't be easy, but it does depend on the variables and how many of them would differ from time to time. If you make your hash variable related to the current time, it would be much more difficult to brute force/experiment.
  12. How secure do you need it? If you can decrypt it, someone else can too.
  13. I guess I'm not the only one that doesn't have a clue for what you're trying to do. How is your database setup and what exactly are you trying to do?
×
×
  • 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.