Problem Linking to FTP site with PHP script

Discussion in 'PHP' started by echarnley, May 3, 2010.

  1. #1
    Hello - I am new to PHP. I have written a simple php page that works fine in chrome and FF. Is there any reason that the following would not work in IE, but work fine in Firefox? I thank you kindly for any help offered!

    <?php if($_SERVER['REQUEST_METHOD'] == 'POST') : $projectid = $_POST['projectid']; header('Location: ftp://'.$projectid.'@ftp.domain.com/'); else:?>
    <form action="<?php echo $_SERVER['../PHP_SELF']; ?>" method="post">
    <p><strong>Enter Your Project ID</strong> :
    <input type="text" name="projectid" />
    <input type="submit" value="Go" />
    </p>
    </form>
    <?php endif; ?>
     
    echarnley, May 3, 2010 IP
  2. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #2
    What errors are you seeing? (or not seeing).

    Also, not sure if $_SERVER['../PHP_SELF'] is correct, I've only ever used $_SERVER['PHP_SELF'].
     
    mfscripts, May 4, 2010 IP
  3. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #3
    In fact, the $_SERVER['../PHP_SELF'] may be the issue. I remember something about IE having issues if there is no action defined within a form. If $_SERVER['../PHP_SELF'] is incorrect, i.e. empty, the your action would be action="" and may fail in IE. Try setting it to $_SERVER['PHP_SELF'] to see if that resolves it.
     
    mfscripts, May 4, 2010 IP
  4. echarnley

    echarnley Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you for the reply. I have tried changing it to ['PHP_SELF'] and it makes no difference. But it does look like this is where the problem might stem from.

    I am very new to php so I don't really have a clue, but I thought maybe I should have separate html and php files, and call the php from the html. Do you think IE would like this better than calling itself from one php file?
     
    echarnley, May 4, 2010 IP
  5. echarnley

    echarnley Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I found the answer. There is a setting in IE advanced options to check or uncheck a box labeled: Show friendly HTTP error messages. When this is unchecked, IE will work with my site. See kb328785.

    So now I have to tell the client to have everyone change that setting in IE, or figure out how to make this change from the server side somehow. We are dealing with very low-level users here, so any way I can do this without having them make a setting adjustment manually would be great. Thoughts?
     
    echarnley, May 4, 2010 IP