Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Posts posted by nogray

  1. if you have php5, you'll be missing a ) in this like
    $num=count(scandir($dir);

    change it to
    $num=count(scandir($dir));

    if you dont, then you'll need to go through the directory and count the files. You can go to [a href=\"http://us3.php.net/manual/en/function.opendir.php\" target=\"_blank\"]http://us3.php.net/manual/en/function.opendir.php[/a] for more details regarding the open directory function, and here is a small example to count the files

    [code]
    <?php
    $dir = "/etc/php5/";

    $num_of_files = 0;

    // Open a known directory, and proceed to read its contents
    if (is_dir($dir)) {
       if ($dh = opendir($dir)) {
           while (($file = readdir($dh)) !== false) {
               if (is_file($dir . $file)) $num_of_files++;
           }
           closedir($dh);
       }
    }

    echo "There are $num_of_files file(s)";
    ?>
    [/code]

    make sure the dir is the correct path.
  2. My space won't allow you to include a javascript in your file. For a counter, you'll need to use a php image file like <img src="http://www.domain/my_count_script.php" />

    Also, if you want to count the unique, return, and number of pages, you'll need to generate a PP3 (I think that what's called) privacy policy that is sent with the header in your image. This way, the browser can except your cookies.

    If you want, you can click on my signture and check out the "Free Tracking" service.
  3. You can use a check box instead of the radio button like this

    Example check box
    [code]
    <input type="checkbox" name="Department_name" value="Yes" /> Department Name
    [/code]

    in you php, you just need to add the extra email address to the "To"
    [code]
    $to = "your_email@domain.com";
    if ($_POST['Department_name'] == "Yes"){
         $to .= ", department_email@domain.com";
    }
    [/code]

    Let me know if you need radio buttons and an example of your form if you need more help.
  4. I agree with poirot that the script is a resource hog and if there are a lot of people running at the same time, it may crash your server.

    But you always can flush the output by using [a href=\"http://us2.php.net/manual/en/function.flush.php\" target=\"_blank\"]flush()[/a] This way the user will start seeing data before the script is done processing.
  5. too complicated for just opening a search page.

    Just use the "target=_blank" in the form and you don't need any javascript
    [code]
    <form method="get" action="http://www.google.com/search" target="_blank" name="form1">
    <input type="hidden" name="hl" value="en" />
    [/code]

    If you still want to use javascript

    you'll need to use (document.getElementById('put your field box id here').value) instead of the (document.form1.search.value) and value shouldn't have () after it.
  6. you can trying something like this. Let's say you are passing ID as a variable to page.php?ID=3
    [code]
    <?PHP
    $iframe_link = "iframe_page.php?ID=".$_GET['ID']
    ?>
    <iframe src="<?= $iframe_link ?>"></iframe>
    <button onclick="window.close();">Close</button>
    [/code]
    this should pass the ID variable to the iframe page.
  7. I don't see any 1s but try this

    "link"=>"<A HREF=\"profile.php?id=".$row['id']."\"><IMG SRC=\"pictures/".$row['gallery1']."\" WIDTH=\"132\" HEIGHT=\"175\" BORDER=\"0\"></A>",
  8. I found a few websites that offers alternative service to cron a while back, but I never tried them. you can search Cron Service on google to find more details. Here are two quick links

    [a href=\"http://www.fastcron.com/\" target=\"_blank\"]http://www.fastcron.com/[/a]

    [a href=\"http://www.webbasedcron.com/\" target=\"_blank\"]http://www.webbasedcron.com/[/a]
  9. You'll need to use the attachEvent for IE and addEventListener for FireFox. Check this page out for more details

    [a href=\"http://www.captain.at/howto-addeventlistener-attachevent-parameters.php\" target=\"_blank\"]http://www.captain.at/howto-addeventlisten...-parameters.php[/a]

    You still need ids for your divs
  10. You only can close a window if it was open by a script. Once the page is reloaded (or the URL is changed) the page is not considered to be opened by a script anymore, so the self.close() won't work.
  11. your shop script uses relative paths, so it'll always look for the files in the same folder (not the shop folder) if you include it in the index.

    You can try to use file_get_contents('../shop/index.php') function which will run the '../shop/index.php' and return the HTML output.

    Otherwise, you'll need to change you shop files to use absolute paths
  12. you can also call the php from your cron job "php /path/to/your/php/script.php"

    and you need the path to the php compiler (I think that what it's called) in the tob of you php file "#!/usr/local/bin/php -q"
  13. check [a href=\"http://us2.php.net/manual/en/function.time.php\" target=\"_blank\"]time()[/a] and [a href=\"http://us2.php.net/manual/en/function.mktime.php\" target=\"_blank\"]mktime()[/a]

    You can use the [a href=\"http://us2.php.net/manual/en/function.date.php\" target=\"_blank\"]date()[/a] function to format the date or time
  14. Height is a mystery for all browsers and CSS (none of them treat it the same way). If you want to use height:100% you have to set all the parent elements height (including the body and html)

    What I usually do when I have a lot of column is to set the height using javascript. when the page load, I get the window height and the three columns, than set the height to the highest amount.
  15. I never done it personally, but you can use the .htpasswd to create a password protected directories. You can search for it online for more details.

    Here are a couple of links I found.

    [a href=\"http://koivi.com/php-http-auth/\" target=\"_blank\"]http://koivi.com/php-http-auth/[/a]

    [a href=\"http://elonen.iki.fi/code/misc-notes/htpasswd-php/index.html\" target=\"_blank\"]http://elonen.iki.fi/code/misc-notes/htpasswd-php/index.html[/a]
  16. Well, I am not really sure if this is the best solution, but since you have php, html, javascript, and css all stored togather I don't think you can do anything else.

    Try to write the $body content to a file, and than include that file in an include("new_file.php");

    If the content of the body will change for different users and over time. You can delete the file when the page is done processing.

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