Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Cross Browser Performance

  1. #11
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I don't see anything in that that would cause any errors. There isn't anything that would vary by browser either.

    The only thing that looks strange is that your text type inputs consist of multiple lines with the default value like that. You should really put the value on a single line:

    Code:
    <input type="text" value="like this">
    
    <input type="text" value="
    Not Like This
    ">
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. The Following User Says Thank You to djr33 For This Useful Post:

    Webiter (09-16-2011)

  3. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    I agree, and that error could then be taking place on mail (line breaks and tab characters don't belong in those parameters). There is a non-fatal error in logic on process_friend.php. Even if one or more of the names and/or one or more of the email addresses fails validation, as long as the CAPTCHA is passed, the email is sent. This (if my theory is correct) allows the invalid values to get passed to mail and cause the error.

    You need a test for $status == 'is_ok' in there somewhere, probably replacing the current CAPTCHA one, And the CAPTCHA test shouldn't surround the mail code, it should just be another test that adds (on failure) to the $write variable and as to whether or not the $status remains 'is_ok'.

    Another issue is that, since it's never mentioned anywhere else:

    Code:
    if(empty($inputfields)) 
    { echo "<center><font face='Verdana' color='grey'><h3>Please note the following :-</h3><font face='Verdana' size='2' color=red>$write</font><center>";}
    Is always true. But that content should only be echoed if there is a problem.

    process_friend.php
    PHP Code:
    <?php
    // never forget to start the session
    session_start();
    $_SESSION['form_data'] = $_POST
    ?>


    <html>
    <head><title>Friend Link Processor</title></head>
    <body>
    <?php
    //////////////VAIRABLES STORED HERE///////////////////////////////////////////////////////////////
    $visitorcode=$_POST['visitorcode'];// VALIDATE CODE //
    $status="is_ok";
    $write="";
    $m_name=$_POST['m_name']; $m_email=$_POST['m_email'];$f_name=$_POST['f_name'];$f_email=$_POST['f_email'];
    ///////////////////////////////////////COMMENCE FORM VALIDATION/////////////////////////////////////
    /////////////////////STEP ONE VALIDATES THAT MY NAME IS ENTERED///////////////////////////////////// 
    if (strlen($m_name) <) { $write.="Please enter your Name<BR />";$status="not_ok";}
    ////////////////////STEP TWO VALIDATES THAT MY CORRECT EMAIL ADDRESS IS USED////////////////////////
    /////////////if (preg_match('/http:/', $notes)) 
    if (!preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$^"$m_email)) 
    $write.="Your email address is not correct!<BR />"$status="not_ok";}
    /////////////////STEP THREE VALIDATES THAT FRIENDS NAME ENTERED/////////////////////////////////////
    if (strlen($f_name) <) { $write.="Please enter your Friend's Name<BR />"$status="not_ok";}
    //////////////////STEP FOUR VALIDATES MY FRIENDS EMAIL///////////////////////////////////////////////
    if (!preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$^"$f_email)) 
    $write.="Your Friends email address is not correct!<BR />"$status="not_ok";}
    ///////////////////STEP FIVE VALIDATES NUMBER OF EMAIL ADDRESSES USED/////////////////////////////////
    if(substr_count($m_email,"@") > 1  or substr_count($f_email,"@") > 1)
    $write.="Use only one email address please<BR />";$status="not_ok";}
    if(empty(
    $visitorcode))
    $write.="Do not forget to fill out the <b>VALIDATE</b> code!<BR />";$status="not_ok";}
    /////////////////Captcha Validation to block Spambots//////////////////////////////////////////////////////
    if (md5($visitorcode) !== $_SESSION['image_random_value']) 
    $write.="<br /><font face='Verdana' size='2' color=blue>Your message was not sent because you entered the invalid letters - <b>$visitorcode</b><br />Please note that the letters are case sensitive. </font><BR />";
    $status="not_ok"; }
    if(!empty(
    $write)) 
    { echo 
    "<center><font face='Verdana' color='grey'><h3>Please note the following :-</h3><font face='Verdana' size='2' color=red>$write</font><center>";
    echo 
    '<br /><form action="form_friend.php"><input type="submit" value="Go Back to Form"></form>';
    die();}

    /*  echo "<h2>Code $visitorcode valid </h2>\n"; */
    ///////////////////////////// INSTALL MESSAGE HERE ////////////////////////////////////////////////////
    $header_message="Hi $f_name , \n\nYour friend $m_name invites you to visit Website at www.webitry.net \n\nYou can view a eCommerce Shopping Demonstration just to see how easy it is to sell online. \n\nIf you or any of your friends would like to sell online just contact the Webitry and discuss your requirement. They will be delighted to hear from you.\n\nHave a nice day!";

    $body_message=$header_message."\n";
    //// MAIL POSTING STARTS HERE /////////
    $headers="";
    //$headers="Content-Type: text/html; charset=iso-8859-1\n".$headers; 
     // Un comment the above line to send mail in html format
    $headers4=$m_email;         // Change this to change from address
    $headers.="Reply-to: $headers4\n";
    $headers.="From: $headers4\n"
    $headers.="Errors-to: $headers4\n"
    $subject="$m_name - Invitation to visit Website";
    mail($f_email,$subject,$body_message,$headers);
    ///////////////////// END OF POSTING /////////////// & PRESENTING THANK YOU PAGE  /////////////////////
    echo "<center><font face='Verdana' size='3' color=green><br />Thank You, <br /><br />You sent a link for this Website to your friend $f_name. This is a great help to us. Your assistance is much appreciated.<br /><h3>The Webmaster.</h3></font></center>";

    ?>
    </body>
    </html>
    The Form:
    PHP Code:
    <form method="post" action="process_friend.php">
        <legend>Send Website Link to my Friend.</legend><br />    
        <label>My Name: </label><input type='text' id="textfield" name='m_name' 
        value='<?php if(isset($_SESSION['form_data']['m_name'])) { echo htmlspecialchars($_SESSION['form_data']['m_name']);}?>' /><br />    
        <label>My Email: </label><input type='text' id="textfield" name='m_email' 
        value='<?php if(isset($_SESSION['form_data']['m_email'])) { echo htmlspecialchars($_SESSION['form_data']['m_email']);}?>' /><br />    
        <label>Friend's Name: </label><input type='text' id="textfield" name='f_name' 
        value='<?php if(isset($_SESSION['form_data']['f_name'])) { echo htmlspecialchars($_SESSION['form_data']['f_name']);}?>' /><br />
        <label>Friend's Email: </label><input type='text' id="textfield" name='f_email' 
        value='<?php if(isset($_SESSION['form_data']['f_email'])) { echo htmlspecialchars($_SESSION['form_data']['f_email']);}?>' /><br />
        <hr>
        <div>
            <label>Validate Form:</label>&nbsp;&nbsp;<img src="randomImage.php"/>        
            <a href><img src="album/refresh.jpg" img style="border:0;" onclick="history.go()" alt="Get new Code" /></a>&nbsp;&nbsp;
            <input type="text" name="visitorcode" size="5" />
        </div>    
        <input type="submit" name="submitbutton" id="submitbutton" value="Send the Website Link to my Friend" />    
    </form>
    Note: The form page should probably have (if it doesn't already):

    PHP Code:
    <?php
    // never forget to start the session
    session_start();
    ?>
    at the beginning.
    Last edited by jscheuer1; 09-15-2011 at 09:55 PM. Reason: add updated code, later - spelling
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #13
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default

    Hi Guys, Update on status further to your comments and alterations.

    Firefox = Working as required
    IE = Working as required
    Chrome = Now indicating 'My Email' not correct even though email is entered correctly in field !
    Safari = Now indicating 'My Email' and 'Friend Email' not correct even though they are entered correctly in fields !

    I cannot figure out why email validation can be working fine when using Firefox and IE and not working to requirement in Chrome and Safari ?

  5. #14
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,372
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    I just tested your site in Safari 5.1 Win 7 with:

    bob
    bob@bob.com
    ted
    ted@ted.com

    And it worked fine. What kind of information are you putting in that gives you an error?

    Before you answer that, make sure to clear the browser's cache and refresh the form_friend.php page in the popup. It might be working from a previously cached version.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Webiter (09-16-2011)

  7. #15
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default

    Oops, sorry. Cleared the cache and all seems to be working fine now. Thanks for the assistance guys.

Tags for this Thread

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
  •