Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    4
    Member #
    2834
    I am getting this error when hitting the "submit" button.

    "Parse error: parse error in /home/loansms/public_html/virtualmail.php on line 2"

    If it cant be answered from just this message line, let me know, I will display the script.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Post the first few lines of the script.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    4
    Member #
    2834
    <?
    <form ACTION="virtualmail.php" METHOD=POST>
    <input type=hidden name="recipient" value="mortgagecheck2000@yahoo.com">
    <input type="hidden"name="redirect"value="http://loans.msshost.com">
    // formmail version (for debugging mostly)
    $version = "1.6";

    $allowed_email_recipients_array = array('yourdomain.com','www.yourdomain.com');
    # THIS IS REQUIRED FOR THE SCRIPT TO RUN. YOU MUST FILL IT IN WITH YOUR
    # DOMAIN NAME. THIS IS TO CORRECT THE SPAM GATEWAY EXPLOIT IN v1.6.
    #
    # THE VALUES CAN BE FULL EMAIL ADDRESSES OR JUST DOMAIN NAMES.

    // referers.. domains/ips that you will allow forms to
    // reside on.
    $referers = array('loans.msshost.com','yahoo.com');

    // banned emails, these will be email addresses of people
    // who are blocked from using the script (requested)
    $banlist = array ('*@somedomain.com', 'user@domain.com', 'etc@domains.com');

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Change it to this:

    my_form.htm:
    Code:
    <form ACTION="virtualmail.php" METHOD=POST>
    <input type=hidden name="recipient" value="mortgagecheck2000@yahoo.com">
    <input type="hidden"name="redirect"value="http://loans.msshost.com">
    virtualmail.php:
    PHP Code:
    <? php
    // formmail version (for debugging mostly)
    $version "1.6";

    $allowed_email_recipients_array = array('yourdomain.com','www.yourdomain.com');
    # THIS IS REQUIRED FOR THE SCRIPT TO RUN. YOU MUST FILL IT IN WITH YOUR
    # DOMAIN NAME. THIS IS TO CORRECT THE SPAM GATEWAY EXPLOIT IN v1.6.
    #
    # THE VALUES CAN BE FULL EMAIL ADDRESSES OR JUST DOMAIN NAMES.

    // referers.. domains/ips that you will allow forms to
    // reside on.
    $referers = array('loans.msshost.com','yahoo.com');

    // banned emails, these will be email addresses of people
    // who are blocked from using the script (requested)
    $banlist = array ('*@somedomain.com''user@domain.com''etc@domains.com'); 

    // ... I assume there's more code here?

    ?>
    The first page submits to the second.

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I assume there's more to the script.... be sure to change the part about "yourdomain.com" to whatever email domain you want to allow.

  7. #6
    Junior Member
    Join Date
    Aug 2003
    Posts
    4
    Member #
    2834
    Thanks Transio. I am somewhat of a newbie to scripts and html.

    Would I put:

    my_form.htm:

    <form ACTION="virtualmail.php" METHOD=POST>
    <input type=hidden name="recipient" value="mortgagecheck2000@yahoo.com">
    <input type="hidden"name="redirect"value="http://loans.msshost.com">

    ON TOP of beginning of script?

    Would it help if I displayed the whole script?

    If you go to: http://loans.msshost.com you will see the first button that says " Free Quote". Push that button, it gives you the "form" , unfortunately it all needs to be filed out, just put a few letters in each field box (email field box has to look "real" though) and it will take you to the error I'm getting.

    Thanks for any help.

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    "my_form.htm" would be a separate file entirely. The <form> style code is HTML. Pop it into your HTML contact page, and it will create a form interface when someone visits that page. When they fill the form and submit it, the browser will then redirect to virtualmail.php (the second chunk of code), which will process the form and send the email.

  9. #8
    Junior Member
    Join Date
    Aug 2003
    Posts
    4
    Member #
    2834
    If you would be so kind as to visit: http://loans.msshost.com

    click on the "Free Quote" button, it will take you to my form.
    Please look at the source code. I believe I linked the form to virtualmail.php correctly.

    Thanks

  10. #9
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Remember, HTML must always be outside <?php ?> tags and will not be read as PHP. Everything within those tags will be treated as PHP code.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  11. #10
    Junior Member Hobgoblin's Avatar
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    12
    Member #
    3248
    Actually, the pase error is coming up because you're not escaping your double-quotes.

    Your code :
    <?
    <form ACTION="virtualmail.php" METHOD=POST>

    Should be:

    <?
    echo "<form ACTION=\"virtualmail.php\" METHOD=\"post\">";

    You must put a backslash before any quotes that are inside an echo/print command. Otherwise the script reads the unescaped quote as the end of the line, and the parse error are all the other charachters after the quote abd before the line breaking semi-colon.

    Echo commands caln also be put on multiple lines, as long as the double quotes are escaped... such as:

    <?
    echo "<form ACTION=\"virtualmail.php\" METHOD=\"POST\">
    <input type=\"hidden\" name=\"recipient\" value=\"mortgagecheck2000@yahoo.com\">
    <input type=\"hidden\" name=\"redirect\" value=\"http://loans.msshost.com\">";

    // formmail version (for debugging mostly)

    $version = "1.6";

    ...... ?>

    To also print out true modern HTML, you should quote everything too, and use lowercase (in case you convert to XHTML - uppercase is illegal).

    METHOD=POST should be method="post" or method=\"post\" if it's in an echo/print command. Theoretically, you can use single quotes instead of double quotes + escaping, but I always recommend you use double quotes in HTML for a correct document. Example:

    echo "<form action='foo.php' method='post'>";

    Many a parse error are caused by misplaced and unescaped double quotes

    Good Luck!
    Michael Willey
    Southland Digital Web Design & Photography
    http://www.sldigi.com/


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:51 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com