Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by zq29

  1. [!--quoteo(post=377017:date=May 25 2006, 02:48 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ May 25 2006, 02:48 PM) [snapback]377017[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    prismatic - script does not work. it does not update the progress bar. whatsoever. but (surprise!) it does say it's all done... when it's all done.

    p.s.- "omg, I have this strictly PHP progress bar script... but I didn't make it so if it doesn't work.. don't ask support on it!"

    ... right. you either have a script that works, or you don't.

    I was interested in seeing a working script. Even AFTER i had to do much debugging and tweaking just to make it do it's core job - actually xfering file in question - it still does not do what it's supposed to on the surface - showing a progress bar that updates (yeh i didn't see THAT one coming).
    [/quote]
    And it doesn't actually do what the user originally wanted anyway - To enable a user to upload a file and receive feedback on its progress. I'm sure a script like the one posted has its uses, transfering a file from one server to another, but I just can't think of one right now...
  2. Change this:
    <form action="php.php" method="$_POST" enctype="multipart/form-data">
    To this:
    <form action="php.php" method="post" enctype="multipart/form-data">

    Change this:
    $filename = $_GET["$imagename"];
    To this:
    $filename = $_FILES['imagename']['tmp_name'];
  3. You can parse a CSV file as easily as something like this:
    [code]<?php
    $contents = file("http://www.thewebsite.com/file.csv");
    foreach($contents as $line) {
        $line = explode(",",$line);
        //$line is now an array of all of the fields in the current line in the csv.
    }
    ?>[/code]
    That code should point you in the right direction, might be worth checking out file functions in the php manual too.

    As for running once a day, you'd need to set up a cron job (if using *NIX) or an entry in Scheduler (if using Win).
  4. Not strictly with PHP no. It can however be done with a mixture of HTML, PHP and JavaScript to create an illusion of a progress bar (i.e. the animated gif method), to get a true progress bar with a percentage and maybe even an upload speed, you'd need something like AJAX or asp.net I guess.
  5. There's a class called JPGraph that is excellent for this, and straight forward to use.

    You can get the current date with the date() function, and it's possible to grab the users browser with $_SERVER['HTTP_USER_AGENT'] although this doesn't work with [i]all[/i] browsers, but does with the most common ones, so you should be ok.
  6. No, this can't be done with PHP unless you refresh the page. I'd recommend you go with JavaScript. Heres a little something to get you on your way...
    [code]<input type="radio" name="member" value="yes" onclick="showfield('yes')"/> Member<br/>
    <input type="radio" name="member" value="no" onclick="showfield('no')"/> Not Member<br/>
    <input type="text" name="memberid" id="memberid" style="visibility:hidden;"/>

    <script type="text/javascript">
    function showfield(x) {
        switch(x) {
            case "yes":
                document.getElementById("memberid").style.visibility = "visible";
                break;
            case "no":
                document.getElementById("memberid").style.visibility = "hidden";
                break;
        }
    }
    </script>[/code]
  7. Try this:
    [code]<?php
    function stringcomp($string1, $string2, $toup) {
        $false = 0;
        $ct = 0;

        if($toup == 1) {
            $string1 = strtoupper($string1);
            $string2 = strtoupper($string2);
        }

        if(strlen($string1) <> strlen($string2))
            return 0;

        while($ct < strlen($string1)) {
            if(ord(substr($string1, $ct, 1)) !== ord(substr($string2, $ct, 1)))
                $false++;
            $ct++;
        }
        if($false <> 0)
            return 0;
        else
            return 1;
    }
    ?>[/code]I moved the closing bracket on your while.

    I don't understand why you have gone to so much trouble though, surely this would do the same thing...
    [code]<?php
    function stringcomp($string1, $string2, $toup) {
        if($toup == 1) {
            $string1 = strtoupper($string1);
            $string2 = strtoupper($string2);
        }

        if($string1 !== $string2)
            return 0;
        else
            return 1;
    }
    ?>[/code]
  8. Maybe you could post up some code? I run a test with the following code and everything appears to work fine, is this how you're doing it?
    [code]<?php
    $h = fopen("new.php","wb")
    fwrite($h,"<?php\r\n phpinfo()\r\n ?>")
    fclose($h)
    include "new.php"
    ?>[/code]
    Please Note: I have not included the semi-colons on the end of the the functions, there is a forum bug that prevents this.
  9. Thanks for the link Ober, interesting stuff. Although, something to consider is your target audience, this can make a difference - If you're designing a site about computer games, it's very likely that the target audience will generally be running their res over 1024x768. In the other direction, if it's a news site, it could be anyone viewing it and therefore 800x600 is probably a fair consideration.

    Personally, I say screw them. The more sites that are built for a minimum of 1024x768, the better the chance these users will upgrade their equipment and get with the times (I mean come on, 800x600 was considered crap 5+ years ago), and then we can all be happy to disregard the need to design for 800x600. Everyone's a winner.
  10. Please be aware that the PHP Help forum is for requesting help with scripts that you are writing, not for general questions, so I'll move this over to our Misc forum.

    With regards to your question, I personally don't really design things for a minimum of 800x600 any more. I've stepped my minimum up to 1024x768, I'd expect the 800x600 number are dropping by the day by now. I think you can grab the users screen resolution with a bit of JavaScript, although I can't remember what it is off the top of my head.
  11. You're calling $titel before it has been defined, you need to create, or assign a variable a value before you can use it.

    You can't assign an include to a variable either. You could set your variable to a value and then decide what to display depending on that variable.

    [code]<?php    
    if(isset($_GET['game'])) {
        $titel = $_GET['game'];
        // $content = "";
                    
        if(isset($_GET['server'])) {
            $titel = $_GET['game']." ".$_GET['server'];
            // $content = "";
            
            if(isset($_GET['amount'])) {
                $titel = $_GET['game']." ".$_GET['server']." ".$_GET['amount'];
                // $content = "";        
            }
        }
    } else {
        $titel = "News";
        $content = "news.php";
    }
        
    if(!empty($content)) include $content;

    echo "<div class=\"content\">\n";
    echo "    <div class=\"title\">";
    echo $titel.":";
    echo "</div>\n";
    echo "    <div class=\"text\">\n";
    echo "</div></div>";
    echo "</body>\n";
    echo "</html>\n";
    ?>[/code]
×
×
  • 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.