Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by tibberous

  1. Are the all going to start with 'job'? Why use substr on the key on _GET or _POST?

     

    Something like...

     

    foreach($_POST as $key => $postvar){

    if(!strcasecmp(substr($key, 0, 3), "job")){

      list($firstpart) = explode('quest', $key);

      $firstpart .= "quest";

      $$firstpart = $postvar;

    }

    }

  2. I have an image with two colors, black and white. I am trying to make the black transparent, and replace the white with a given color. Does anyone know how to do this? I tried

     

    $image = imagecreatefromgif("sheep.gif");
    
    imagecolortransparent($image, imagecolorallocate($image, 0, 0, 0));
    

     

    To try to make black transparent, but it doesn't seem to work.

  3. I'm not 100% sure, but I might have had this same error with fopen on external urls.

     

    Try making a PHP page with:

     

    <?php

    echo phpinfo();

    ?>

     

    And visiting it in a browser. Go to where it has SERVER_NAME and make sure that is right. If it is wrong, some functions give errors and it can't be a bitch to fix because it's the last thing you'd think to check.

     

    If that isn't it, maybe post your code?

  4. I sent up a script with an ion cube protected header on my local server, and got the message "Your license key is not valid. Your license only supports one domain name, and no subdomains. If you like, you can purchase another license key for a subdomain."

     

    I know the domain name it's registered too, so I pinged it to get the server ip. I changed my hosts file so that the domains it is registered to shows up as 127.0.0.1. I made a test page that prints out $_SERVER and dies, it shows the HTTP_HOST, SERVER_SIGNATURE, and HTTP_HOST as what it should be. I then opened the script and set $_SERVER['SERVER_ADDR'] and $HTTP_SERVER_VARS['SERVER_ADDR'] to the ip string I got for the site.

     

    I still get the message!

     

    I don't know what other variables it can be using to see what domain the site is at - I even tried killing my internet connection. Is there a way I can somehow see what code is getting called? Or does anyone know of other ways the might be checking the domain? Anyway to attacked the encoded ion cube code? My only other approach is to delete the ioncube file, then try to use the rest of the script to see what was in there.

  5. I almost got this. Basically I am cleaning it with Tidy, cleaning it with str_replace and preg_replace, wrapping it in a root node and then parsing it as XML.

     

    Only think that is still giving me a problem is with html entities (&lt, &nbsp, &gt, ect). I replaced &nbsp with ' ', but I can't do the same thing for &lt because it will break my xml. Is there some way I can have the PHP XML parser ignore HTML entities? I thought about replacing & with a random string, then replacing it back, but it seems inefficient and tacked together.

  6. Big difference your looking at is javascript is client side and PHP is server side. PHP your guaranteed it will work, while javascript you have to worry about different browsers, and it still might never work. Javascript is nice though in that it is instantaneous, the user doesn't have to refresh the page.

     

    I'd do it with a mix of both, unless you just have a set amount of items and are not looking to let people do orders online.

  7. I have some html that looks like this.

     

    <body>

     

    <td id="top" align="center">

    <div id="topNav">Rate

    PeopleMeet

    PeopleBest OfMeet Jim and

    James</div>

    <div id="userPanel">

     

    <td>

    Login</td>

    <td>Join<br>

    HOTorNOT</td>

    </body>

     

    This html will always have the right amount of opening to closing tags. Basically, I just need the content from the inner cells. If a tag is nested, like <div>Outter div<div>Hello</div>text</div>, then I want the inner div to get the value Hello, and the outer div to get the value 'outer div text'. I'm not sure if I should use xml functions for this, or explodes, or preg_match and replace. Anyone know a good way to do this?

×
×
  • 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.