SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Correct PHP installation on Apache (win2k)

  1. #1
    SitePoint Enthusiast mahmoud's Avatar
    Join Date
    May 2001
    Location
    Egypt
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Correct PHP installation on Apache (win2k)

    I installed PHP on my local server and it works but some things does not work example :

    <?php
    $server1 = "test1";
    $server2 = "test2";
    $server3 = "test3";

    $random = rand (1, 3);
    $srvnow = "server".$random;
    eval ("\$server = \"$$srvnow\";");

    echo "<b>".$server."</b>";
    ?>

    Such a code will result to test1 on my local server but works great on my host

    the code with let you use the "/" instead of "?" also does not work
    also <?xml version="1" ?> if I added it cause to view the xml source not the page but this does not happen on my host ..

    what could be the problem ?
    Mahmoud

  2. #2
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well it does work, i.e if you keep refreshing the page you will get 'random' values, but I assume that you mean that the first time you call the page you always get test1 returned?

    add

    srand ((double) microtime() * 1000000);
    $random = rand (1, 3);

    to seed the random number generator for a more 'random' effect.

  3. #3
    SitePoint Enthusiast mahmoud's Avatar
    Join Date
    May 2001
    Location
    Egypt
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know it does work..
    It works on my host
    but not on local server ( it only gets test1)

    What could be wrong?
    - I have php installed
    Mahmoud

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •