Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Cross Browser Performance

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

    Arrow Cross Browser Performance

    Running 'Link A Friend' button on website at www.webitry.net and same workes as required in Firefox.
    Getting a 500 server error when using Safari, Chrome and IE.
    This is my introduction to cross browser issues!
    What work arounds are necessary to get the thing working across all browsers?

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    I don't see a "Link A Friend" button anywehre.
    - Josh

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

    Default

    Josh,

    Just either side of the phone number in the header of the pages.

  4. #4
    Join Date
    Aug 2009
    Location
    utf-8
    Posts
    203
    Thanks
    4
    Thanked 7 Times in 7 Posts

    Default

    Just as a heads up, im using Chrome and everything works, no server error.

    I think its not the code, but the actual server its self (the people who host your site) since its an "error 500 server error". It is not a client-side problem/browser problem. It could actually be your web host provider.

    Either check with your web host provider or if you've done any server side code, check for errors.

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

    Default

    I tend to agree with Trevor. If you get a server error sometimes and not others, it means that sometimes the server is having problems, others not. The fact that it appears to be browser dependent is probably just a coincidence.

    I see no error in Chrome, Opera, or IE 9. At least not when clicking the button. The popup pops up with a form in it. Or do you mean there's an error once the form is submitted? I didn't try that.

    In any case again as Trevor says, if you're getting a server error, it's probably the server, not the browser.
    - John
    ________________________

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

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

    Default

    Works fine for me in Safari (and Firefox).

    The only way the browser could change what the server does is to send a different request. The only thing about your code that looks a little unusual is that way you're using the HREF to trigger Javascript. Try the method below instead to see if that happens to fix it. I doubt it. Maybe those browsers are having issues with the JS in the HREF, but I've never seen that before.

    <a href="#" onclick="popup();return false;">
    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

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

    Default

    Whoa! I just tried submitting the form. Internal Server Error 500 in Opera. Worked once in Firefox, then tried again several times and got Internal Server Error 500 in it as well. I think we're going to need to see the server side code.
    - John
    ________________________

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

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

    Default

    John, do you have any idea whether my theory could be correct? It's the only thing I can see, and I know that the request must be different if the server's response is different. I'd be a bit surprised though because the "javascript:" method is fairly common.
    Last edited by djr33; 09-14-2011 at 05:54 AM.
    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

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

    Default

    That's not where the error is occurring. It's when you submit the form in the popup. It's on the page - webitry.net/process_friend.php

    We would need to see the raw PHP code of that page to have even a chance of discovering why this is happening.
    - John
    ________________________

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

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

    djr33 (09-15-2011)

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

    Default

    Thanks Guys,

    The process_friend.php code. Please excuse the extensive comments that I used here as I tried to understand what was going on ....

    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) <2 ) { $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) <2 ) { $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";}
    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>";}
    
    /////////////////Captcha Validation to block Spambots//////////////////////////////////////////////////////
    if (md5($visitorcode) == $_SESSION['image_random_value']) 
    /*  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>";
    }else{
    echo "<center><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></center>\n";
    echo '<center><br /><form action="form_friend.php"><input type="submit" value="Go Back to Form"></form></center>'; 
    }
    ?>
    </body>
    </html>
    The following is the form_friend.php code

    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>
    Last edited by Webiter; 09-14-2011 at 07:46 PM.

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
  •