SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moving php files from unix to Win2K

    I've just moved a site from a unix server to a Win2K server and my .php contact form has lost its way. The refresh response is showing in a box above the form and the submit just doesn't work. I've tried renaming to .php, .phtm, .phtml, etc. but that's not it - is there some general .php thing that I should change in the code like <doctype=""> that would fix this or is it a total code rewrite for W2K?

    Any help or suggestions would be appreciated, my php guy is out for awhile.

    http://216.64.211.139/contact.php4

  2. #2
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,811
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hmmmm - looks to me like it's not parsing the php at all - is it configured to do so?

    Also, the <? echo $PHP_SELF; ?> should be <?PHP_SELF;?> I believe.

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it is ChicagoWebs.com and they said they supported .php4. Their only suggestion was to change the name to .php. It works fine at http://www.frommykiln.com where it came from.

  4. #4
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe you have to specifically ask them to install php on a windows machine, where php is default standard on a Linux machine (virtually). I've had that before.

    Sketch
    Aaron Brazell
    Technosailor



  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, but they're looking at it and telling me they don't know whats wrong.

  6. #6
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is your .htaccess file set to parse php files?

    Sketch
    EDIT - Nix that. I forgot this was a Windows machine
    Aaron Brazell
    Technosailor



  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tell me, is there some basic difference - or great difference for that matter - between using php on Windows/Unix?

  8. #8
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, it looks like you have got it running through the php engine now

    There should not be any major differences between running php scripts on *nix / windoze. There will be some, but if you run into troubles post in the php forum and someone will be able to help you out.

    However, one problem you do have with your new server is that your host has error reporting set to a very anal retentive level. That is what is causing this warning at the url you posted:

    Warning: Undefined variable: action in w:\inetpub\wwwroot\frommykiln\www\contact.php4 on line 13

    You might be able to change the error reporting level in a .htaccess file or you could suggest to your host that they edit their php.ini file and set error_reporting to:

    error_reporting = E_ALL & ~E_NOTICE


    More info:
    http://www.php.net/manual/en/functio...-reporting.php

    When I first started coding in PHP, not having to declair and initialise variables ahead freaked me out! However, most PHP hackers will not do so, and consider PHP being able to automatically define a variable upon its first use as a "feature" of the language. So, having error reporting set such that encountering an undefined variable throws an error is not the convention.



    PS: Sorry, I don't know if this server is running Apache or something else. If it is apache, the AccessFilename in windows will not be .htaccess but something else. Check with the host.
    Last edited by freakysid; Dec 22, 2001 at 00:22.

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks sid, actually it looks better, but it still isn't working - on submit the clock spins for awhile and then errors out. Do you think it might be the parser?

  10. #10
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, if there was a parse error you would be shown a warning. The script is timing out OR the script has finished executing but did not produce any output so the client browser has timed-out the request.

    What is supposed to happen when the user submits the page? (database updated, data written to file, or emailed?)

    As a hunch - I bet you are trying to email the data and the mail function is timing out.

    In any case, post your code or a link to where we can view the code. I would suggest you open a new thread in the php/mysql forum as you will get a better response there. I personally have no experience of web serving on windoze.

  11. #11
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, the code is simply to collect data and send an email. its not long so i'll attach it. thanks. i'll look at the other forum shortly.

    well, that doesn't appear to have worked:
    PHP Code:
    <html>
    <head>
        <title>Contact From My Kiln</title>
        <style>
            TD,BODY{font-family:arial;font-size:11px;color:#000000;}
            .title{font-family:arial;font-size:13px;color:#000000;font-weight:bold;}
            .disclaimer{font-family:arial;font-size:9px;color:#000000;}
        </style>
    <link rel="stylesheet" href="kilnstyles.css">
    </head>
    <body bgcolor="#0066CC" text="#000000">
    <?
    if ($action=="send"){
    $mailtxt "Name: $name\n" .
               
    "Address: $addr1$addr2$addr3  $addr4\n" .
               
    "Phone: $phone\n" .
               
    "E-Mail: $email\n" .
              
    "Inquiry: $inquiry\n"
        echo 
    "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"100%\">
      <tr align=\"center\" valign=\"middle\"> 
        <td> 
          <table width=\"500\" cellspacing=\"0\" cellpadding=\"10\">
            <tr align=\"center\" valign=\"middle\"> 
              <td>
                <p><font class=\"bighead\">Thank 
                  you for your interest.</font></p>
                <p><font class=\"bodycopy\">Thank you 
    $name. The evolutionary nature of pottery as art makes it impossible to guarantee that any item will be available at any given time. We will respond to your request as soon as possible.</font></p>
                <p><img src=\"images/kilnsig.gif\" width=\"112\" height=\"87\"></p>
                <p class=\"disclaimer\">&copy; 2001 From My Kiln<br>
                <a href=\"http://www.thedesignsmith.com\"><font color=\"#000000\">Site Design by The Designsmith</font></a></p>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    "
    ;
        
    mail("paul@thedesignsmith.com""Web Contact"$mailtxt,"From: $email ($name)\n");

    }else{

    ?>
    <form action="<? echo $PHP_SELF?>?action=send" method="post">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="middle">
        <table width="700" border="0" cellspacing="0" cellpadding="4">
      <tr valign="top"> 
        <td width="200">
          <table width="200" border="0" cellspacing="0" cellpadding="0">
            <tr><td align="right">
             <p class="bighead"><font color="#FFFFFF">Contact From My Kiln</font></p>
             <p class="bodycopy">Please write me a description of the item you are interested in or use the headline from our showcase and we will do our best to complete your order.  Thank you.</p>
             <p class=\"disclaimer\">&copy; 2001 From My Kiln<br>
             <a href=\"http://www.thedesignsmith.com\"><font color=\"#000000\">Site Design by The Designsmith</font></a></p>
            </td></tr> 
          </table>
       </td>
        <td width="225" align="right"> 
          <table width="225" border="0" cellspacing="0" cellpadding="2">
            <tr align="right"> 
              <td align="right" class="bodycopy">Name</td>
              <td align="right" width="50"> 
                <input type="text" name="name" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">Email Address</td>
              <td align="right"> 
                <input type="text" name="email" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">Address</td>
              <td align="right"> 
                <input type="text" name="addr1" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">City</td>
              <td align="right"> 
                <input type="text" name="addr2" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">State</td>
              <td align="right"> 
                <input type="text" name="addr3" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">Zip Code</td>
              <td align="right"> 
                <input type="text" name="addr4" size="20">
              </td>
            </tr>
            <tr> 
              <td align="right" class="bodycopy">Phone</td>
              <td align="right"> 
                <input type="text" name="phone" size="20">
              </td>
            </tr>
          </table>
        </td>
        <td width="275" align="center"> 
          <p>
            <textarea name="inquiry" cols="35" rows="8"></textarea>
          </p>
          <p>
            <input type="submit" name="Submit" value="Submit" class="headline">
          </p>
        </td>
      </tr>
    </table>
      </td>
      </tr>
    </table>
    </form>
    <? ?>
    </body>
    </html>
    PHP tags added by freakysid. More info here
    Last edited by freakysid; Dec 22, 2001 at 03:33.

  12. #12
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, I am going to move this into php/mysql forum. So no need to post a new thread in there. you will get a better response in that forum.

    Anyway, I suspect that the problem is with the call to the mail() function.

    You host has to have the correct paths set to the MTA on your server in php.ini

  13. #13
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    forgive my ineptitude please. i don't know what an MTA or a php.ini is, but if you're saying that the form doesn't work because the mail path is bad would that be because i'm mailing to an address from another site? this form is on frommykiln.com (or will be when the name servers are tuned into it) but the mail is going to thedesignsmith.com.

  14. #14
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know what MTA means either. but, php.ini is PHP's configuration file. there is a setting in there that needs to be set correctly in order for you to be able to send mail correctly.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  15. #15
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MTA = Mail (or Message) Transport Agent. In fact I am the inept one, because the MTA is responsible for delivering incoming mail on a server, whereas the mail function sends mail to the outgoing mail server - the SMTP server (Simple Mail Transfer Protocol). The fact is that (on unix anyway) these are often the same thing: postfix, sendmail, qmail, etc).

    A simple intro to mail() and PHP:
    http://www.onlamp.com/pub/a/php/2001...etworking.html

    Always consult the manual:
    http://www.php.net/manual/en/ref.mail.php

    The php.ini file is the file that loads all the user defined settings (preferences) for php. It's in here that you define where the mail function sends the email to (ie, where your SMTP server is).

    The good thing about the php.ini file is that there are plenty of comments in the file itself.

    It sounds like your web host has not set up php very well. Perhaps you are the first customer they have that's using PHP?

    Good luck

  16. #16
    SitePoint Enthusiast
    Join Date
    Dec 2001
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you guys are great. hope i can find someplace to reciprocate but it looks like you've answered everybody's questions! i'll discuss the php.ini with my host, see what happens and let you know. thanks again.


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
  •