Jump to content

ShadowMetis

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

About ShadowMetis

  • Birthday 04/13/1989

Contact Methods

  • AIM
    NarutoMetis
  • MSN
    ShadowMetis@hotmail.com
  • Website URL
    http://ma.dragondiscussion.com
  • ICQ
    254006871
  • Yahoo
    ShadowMetis

Profile Information

  • Gender
    Not Telling
  • Location
    Trapped Between Life And Death

ShadowMetis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a script which draws text from another website through cURL functions. All of the non-ascii characters are look something like this though. €¢. I have the charset on utf-8 in my html header though so I don't see why they're being displayed in this manner. Can anyone shed some light on this for me?
  2. After many attempts I went back to my original pattern and added the U(ungreedy) internal option (ie. /pattern/U) as I originally assumed was my problem but for some stupid reason never bothered to try. Thanks anyway.
  3. Please read the first post carefully. All applicable information is included. Though my pattern may be incorrect, I believe it clearly shows what it is I'm trying to accomplish.
  4. Ok it's obvious to me at this point that my problem lies with the pattern. I've tried a few different things with adverse results. I don't have all that much experience with PCRE so if anyone can help me figure out the best pattern to use I'd love you for a few minutes and be grateful for even longer. Thanks in advance.
  5. I'd recommend changing your webhosting or asking your serveradmin to update php. 2.5.3 is a pretty old version of php and many current functions aren't supported by it.
  6. if($_POST['textbox_name'] == "") { echo "This box is empty!"; }
  7. For some reason my preg_replace() is only replacing the first matched $pattern in the $subject. Before this the $pattern and $replacement were arrays and the second half worked flawlessly to replace all the matches, however I separated it out to try to isolate the problem. No luck though. Any advice would be greatly appreciated. This is the snippet of $subject that is the target of this replacement. <a href="/w/index.php?title=Special:Search&search=blaz&fulltext=Search&offset=20&limit=20">2</a> <a href="/w/index.php?title=Special:Search&search=blaz&fulltext=Search&offset=40&limit=20">3</a> <a href="/w/index.php?title=Special:Search&search=blaz&fulltext=Search&offset=60&limit=20">4</a> <a href="/w/index.php?title=Special:Search&search=blaz&fulltext=Search&offset=80&limit=20">5</a> <a href="/w/index.php?title=Special:Search&search=blaz&fulltext=Search&offset=20&limit=20"><span style='font-size: small'>Next</span> »</a> This is the pattern, replacement, and preg_replace() code. $pattern = "/<a href=\"\/w\/index\.php\?title=Special:Search&search=(.+)&fulltext=Search&offset=(\d+)&limit=(\d+)\">(.+)<\/a>/"; $replace = '<a href="' . $_SERVER['PHP_SELF'] . '?submit=true&fulltext=Search&search=${1}&offset=${2}&limit=${3}">${4}</a>'; $result = preg_replace($pattern, $replace, $result);
  8. Is there a way within MySQL to order the selected rows by one column, then by a second column if two rows have the same value for the first colum? For Example: [code] | foo | bar | |=====|=====| |  4  |  2  | |  6  |  6  | |  3  |  3  | |  7  |  0  | |  8  |  9  | |  6  |  1  | |  2  |  5  | [/code] If I wanted those ordered by foo, since foo has the same value for the second and sixth row, I'd want it to know to put the second row first because the bar value is higher than that of the sixth. Is this possible and what is the syntax?
  9. I'm trying to make a single directory where .phps files will show as php source files. I want the rest of my server to parse them as regular PHP files. I already have it set to parse them as PHP files, however the problem I'm at is making the exception directory. I have tried several different things in httpd.conf and with .htaccess files, but nothing seems to be working. Can someone give me a hand here?
  10. Not to but into an argument that doesn't involve me, but your way _is_ silly because it contains pointless extra syntax. However, it _is_also_ correct, as you say, because it still outputs the intended string.
×
×
  • 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.