Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by zq29

  1. I can't think of [i]just one[/i] function that does this, I know a handfull exist for replacements, but not searches, well, none come to mind. YOu could do it like this though:
    [code]<?php
    $words = array("cat","dog","fish","bucket","cheese","wheel");
    $str = "the monkey jumped from the bucket";
    $found = array();
    foreach($words as $w) {
        if(stripos($str,$w) !== FALSE) $found[] = $w;
    }
    ?>[/code]
  2. I normally start out with a canvas 770px wide, so I can put together a design that looks nice on an 800x600 screenm then in the coding stages adapt the design to either stay fixed width, or scale to the screen size.
  3. [quote author=Barand link=topic=101730.msg402850#msg402850 date=1153771454]
    [quote]if(substr($l,0,2) != "--") $new .= $l."\r\n";[/quote]

    You don't need to add the "\r\n" as they will already be there. file() doesn't strip them.
    [/quote]Right you are - I don't always think before I type :)
  4. You'd also need to write some code to filter out the crap like:
    [quote]--
    -- Table structure for table `users`
    -- [/quote]
    Of which I guess could be done with something like:
    [code]<?php
    $new = "";
    $file = file("dump.sql");
    foreach($file as $l) {
        if(substr($l,0,2) != "--") $new .= $l."\r\n";
    }
    $h = fopen("stripped.sql","wb");
    fwrite($h,$new);
    fclose($h);
    ?>[/code]
  5. [quote author=onlyican link=topic=101662.msg402755#msg402755 date=1153764617]In PHP
    You can create an image of a website, and save it a jpg
    (imagecreatetruecolor I think, cant remember now)[/quote]
    I'd be interested to know how you've managed to achieve that strictly with PHP...

    I don't think you're going to be able to do this without the aid of some third party command line software sitting on the server...
  6. There is some software called [url=http://www.swftools.org/]SWFTools[/url] that has a command line tool called swfextract which can be used to extract images from an swf file. You could use this tool along with PHPs exec() function to auto-extract frames from the swf - Would this be any use to you?
  7. I started my own web development company up back in Jan 2005 (with an actual office, not from home) and have since been doing that every day. I mainly provide all of the dynamic functionality and more advanced interactivity for a handful of other web design companies, so they design the site, send it to me, and I make it do everything they want - I like it this way as I get to spend my time doing what I like, coding, and not having to deal with the end client, which I don't enjoy doing really. Although I do have a small amount of clients that a manage fully, I much prefer my other work where I do projects for other companies where you can talk to them about the features and possible solutions without them looking at you as though you're speaking another language!

    As the saying goes, 'Don't have all of your eggs in one basket', I have also started a web marketing company a couple of months back. Where I just sell other companies products, or get visitors onto the companies site via the affiliate marketing model. This is more of an 'on the side / evenings and weekends' company though and currently does not take up a lot of my time, I can set up a site and leave it to work its magic with just a tweak here and there to optimise traffic.

    I'm also in the process of starting up an online shop, selling audio visual accessories. This again won't be taking up too much of my time, as I will be taking some people on to take care of the finances, stock control and order forfillment and I'll "just" be taking care of the web site build and maintenance and general day to day running of the company.

    Most of my time is taken up by my main business though, the web development company, I almost allways have a good number of projects on, and lined up to be worked on. Although I think I'd have a problem if I woke up one day to find that the internet has imploded having 3 purely web based businesses!
  8. In my opinion, you should [i]never[/i] store passwords in plain text form.
    [quote]the first parameter is the type sha1, you could use as a type instead of a standalone function, is this true, I also read sha1 has been decrypted somewhere[/quote]I don't quite understand what you mean there, but yes, you can either use the sha1() function, or as an algorythm type within hash(). From what I have read, SHA-1 [i]has[/i] been cracked, but not in a way that is totaly useful. I think it requires a technique similar to brute-forcing, but based on collisions.
    [quote]So if I hash something how do I match the text passwords up to see if there the same, is there anychance of it being wrong.[/quote]You hash the string and match it against the stored hash of the password.
×
×
  • 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.