Site help php/javascript stuff.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mtthwtylr
Forum Newbie
Posts: 1
Joined: Fri Sep 17, 2010 2:11 pm

Site help php/javascript stuff.

Post by mtthwtylr »

Howdy!

I've been lurking for a bit, trying to soak up the knowledge around here. Great forum.

I'm having some issue with a simple site I've created. Sometimes it loads, sometimes it doesn't, other times the site stops loading abour 2/3s the way down, the rest is blank or white.
The page contains a simple php email capture, a javascript mouseover, and a google analytics snippet. I know it probably has something to do with php and javascript interaction, but I'm not high level enough to know. Maybe my server is just freaking out, but I doubt it.

I'm no programmer, but I've been building sites for over 12 years so I do have some knowledge.

Any help or guidance is greatly appreciated in advance.

Matthew

The site is: Buffalo Casting and the code is:

Code: Select all

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.3.2.min.js"></script>
    
	<script language="javascript">
    $(document).ready(function(){ 
        $("form#register").submit(function(){ 
              var email = $("input#email").val();
              var name = $("input#name").val();
              if (email==""||email=="Email")
			  {
					$('#emailInput').append("<p class='required'>required</p>");
					document.register.email.value='Email';
					return false;
			  }else if(email.indexOf("@") < 1){ // very basic check if email address entered is valid
					$('#emailInput').append("<p class='required'>invalid</p>"); //could have a different image for invalid input
					document.register.email.focus();  //could be used to focus on email field
					return false;				  	
			  }else{
				  var sendData = 'email='+ email + '&name=' + name;
				  $.ajax({
					type: "POST",
					url: "submit.php",
					data: sendData,
					success: function() {
					  $('#right').html("<div id='submitted'></div>");
					  $('#submitted').html("<h1>Thanks!</h1>")
					  .hide()
					  .fadeIn(1000, function() {
						
					  });
					}
				  });
				  return false;
			  }
        });  
    });  
    </script>
    
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Buffalo Casting - Dallas, TX</title>
    <style type="text/css">
<!--
a {
	font-size: 9px;
	color: #9c1421;
	font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
}
a:link {
	text-decoration: none;
	color: #9C1421;
}
a:visited {
	text-decoration: none;
	color: #9C1421;
}
a:hover {
	text-decoration: none;
	color: #00B1F5;
}
a:active {
	text-decoration: none;
	color: #FF0;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<meta name="Keywords" content="casting, cast, company, actors, acting, actress, actresses, models, talent, services, coordination, selection, selects, dallas, texas, austin, houston, local, movie, movies, commercials, commercial, print, ad, advertising, spots, industrials, motion pictures, theatrical, entertainment, open calls, " />
<meta name="Description" content="Established in 1997, Buffalo Casting provides talent searches, selection and coordination services for producers of theatrical motion pictures, television, theater, commercials, industrials, print & variety entertainment." />
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1168468-10']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>



<body onload="MM_preloadImages('images/buffalo.info.2.on.png')">
    <!--main div start -->
            <div id="mainDiv" class="emailForm3Bg">
                <!--opacity part start -->
                    <div class="opacityDiv">
                     
                        <!--right part start -->
                          <div id="top"><img src="images/buffalo.info.1.png" width="482" height="82" alt="Buffalo Casting" />
                            <a href="mailto:inquiries@buffalocasting.com"><img src="images/buffalo.info.2.off.png" name="email" width="482" height="34" border="0" id="email" onmouseover="MM_swapImage('email','','images/buffalo.info.2.on.png',1)" onmouseout="MM_swapImgRestore()" /></a><img src="images/buffalo.info.3.png" width="482" height="29" />
                            
                            <div id="right">
                              <p>&nbsp;</p>
                              <p>Sign up to receive our  Casting  Notices, Open Calls & Calls for Extras.</p>
                              <form id="register" name="register" method="post" action="submit.php">
                                      
    <input name="name" id="name" type="text" value="Name" class="textBox" maxlength="54" onfocus="if(this.value=='Name')this.value='';" />
                                       
                                    <div id="emailInput" class="fromrelative">
                                    <input name="email" id="email" type="text" value="Email" class="blueTextBox" maxlength="54" onfocus="if(this.value=='Email')this.value='';" />
                                   
                                    </div>
                                    <input name="Submit" type="submit" value="" class="submit" />
                              </form>
                      </div></div>
                        <!--right part end -->
                        <br class="spacer" />
                    </div>
                <!--opacity part end -->
            </div>
        <!--main div end -->
        <div id="facebook"><a href="http://www.facebook.com/buffalocasting" target="_blank"><img src="images/facebook.png" alt="" width="48" height="48" border="0" /></a>  <a href="http://twitter.com/buffalocasting" target="_blank"><img src="images/twitter.png" alt="twitter" width="48" height="48" border="0" /></a><br>
<span class="copy">&nbsp;site by <a href="http://www.bulletproofstudios.com" title="Bulletproof Studios" target="_blank">Bulletproof Studios</a></span></div>

</body>
    </body>
    </html>
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Site help php/javascript stuff.

Post by Eran »

the site stops loading abour 2/3s the way down, the rest is blank or white
This usually indicates a fatal error. You need to turn display_errors in your PHP configuration
Post Reply