7 Replies Latest reply: Feb 19, 2013 4:15 PM by LukePVB RSS

    Getting a blank white screen

    LukePVB Community Member

      When previewing my form page in live view I get a blank white page. This only happens after I have added "Insert Record" to my server behaviours. When i try to preview in the browser it says the page is temporarily down or has been moved to a different address. Any idea what could be causing this?

        • 1. Re: Getting a blank white screen
          Ben Pleysier CommunityMVP

          LukePVB wrote:

           

          When previewing my form page in live view I get a blank white page. This only happens after I have added "Insert Record" to my server behaviours. When i try to preview in the browser it says the page is temporarily down or has been moved to a different address. Any idea what could be causing this?

          Are you running the page within the correct server environment?

           

          I use mainly PHP and have Wamp running as the server.

           

          Have a look here http://www.kingluddite.com/tools/crud-in-dreamweaver

          • 2. Re: Getting a blank white screen
            LukePVB Community Member

            Im running Wamp as the testing server. I've had no problems testing my other pages with this server or even displaying the the form page in live view without the insert record server behaviour. For some reason after I add insert record as a server behaviour it gives me a blank white page when i preview in live view.

            • 3. Re: Getting a blank white screen
              Ben Pleysier CommunityMVP

              Please copy the contents of your document and paste it here.

              • 4. Re: Getting a blank white screen
                LukePVB Community Member

                <?php virtual('/Connections/BIZwrite.php'); ?>

                <?php

                if (!function_exists("GetSQLValueString")) {

                function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                {

                  if (PHP_VERSION < 6) {

                    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                  }

                 

                 

                  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                 

                 

                  switch ($theType) {

                    case "text":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;   

                    case "long":

                    case "int":

                      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                      break;

                    case "double":

                      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                      break;

                    case "date":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;

                    case "defined":

                      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                      break;

                  }

                  return $theValue;

                }

                }

                 

                 

                $editFormAction = $_SERVER['PHP_SELF'];

                if (isset($_SERVER['QUERY_STRING'])) {

                  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                }

                 

                 

                if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "addListingForm")) {

                  $insertSQL = sprintf("INSERT INTO ads (page_title, company_name, address, city, province_state, country, websiteurl, page_description, catagory, keywords, facebook, twitter, youTube, linkedin, pininterest) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",

                                       GetSQLValueString($_POST['pageTitle'], "text"),

                                       GetSQLValueString($_POST['companyName'], "text"),

                                       GetSQLValueString($_POST['address'], "text"),

                                       GetSQLValueString($_POST['city'], "text"),

                                       GetSQLValueString($_POST['province_state'], "text"),

                                       GetSQLValueString($_POST['country'], "text"),

                                       GetSQLValueString($_POST['websiteUrl'], "text"),

                                       GetSQLValueString($_POST['companyDescription'], "text"),

                                       GetSQLValueString($_POST['catagory'], "text"),

                                       GetSQLValueString($_POST['keywords'], "text"),

                                       GetSQLValueString($_POST['facebook'], "text"),

                                       GetSQLValueString($_POST['twitter'], "text"),

                                       GetSQLValueString($_POST['youTube'], "text"),

                                       GetSQLValueString($_POST['linkedin'], "text"),

                                       GetSQLValueString($_POST['pininterest'], "text"));

                 

                 

                  mysql_select_db($database_BIZwrite, $BIZwrite);

                  $Result1 = mysql_query($insertSQL, $BIZwrite) or die(mysql_error());

                }

                ?>

                <!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>

                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                <title>Free Canadian Business Directory &amp; Classifieds</title>

                <style type="text/css">

                <!--

                -->

                </style>

                <link href="/biz.css" rel="stylesheet" type="text/css" />

                <style type="text/css">

                <!--

                #footer {          width: 960px;

                          height: 200px;

                }

                -->

                </style>

                </head>

                 

                 

                <body>

                <div id="header">

                 

                </div>

                <div id="body"></div>

                <div id="body">

                  <div id="addListing">

                <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="addListingForm" id="addListingForm">

                      <div id="tip">Please fill out the entire form as best as you can. After your done press the &quot;create ad&quot; button on the bottom of the page. This will create your ad.</div>

                      <div id="name">

                        <p>Company Name:</p>

                        <p>

                          <input type="text" name="companyName" id="textfield" />

                        </p>

                      </div>

                      <div id="pageTitle">

                        <p>Ad Title: This should catch the user's attention</p>

                        <p>

                          <input type="text" name="pageTitle" id="textfield2" />

                        </p>

                      </div>

                      <div id="city">

                        <p>City:</p>

                        <p>

                          <input type="text" name="city" id="city2" />

                        </p>

                      </div>

                       <div id="province_state">

                              <p>Provice/State</p>

                              <p>

                                <input type="text" name="province_state" id="province_state2" />

                              </p>

                            </div>

                 

                 

                 

                 

                      <div id="country">

                        <p>Country:</p>

                        <p>

                          <input type="text" name="country" id="country2" />

                        </p>

                      </div>

                      <div id="address">

                        <p>Address:</p>

                        <p>

                <input type="text" name="address" id="address2" />

                        </p>

                      </div>

                      <div id="phoneNumber">

                        <p>Phone Number:</p>

                        <p>

                          <input type="text" name="phoneNumber" id="phoneNumber2" />

                        </p>

                      </div>

                      <div id="fax">

                        <p>Fax:</p>

                        <p>

                          <input type="text" name="fax" id="fax2" />

                        </p>

                      </div>

                      <div id="websiteUrl">

                        <p>Website: </p>

                        <p>

                          <input type="text" name="websiteUrl" id="websiteUrl2" />

                        </p>

                      </div>

                      <div id="companyDescription">

                        <p>Company Description: Should include an overview of your company, its products and/or services, and it service area.</p>

                        <p>

                          <textarea name="companyDescription" id="companyDescription2" cols="65" rows="10"></textarea>

                        </p>

                      </div>

                      <div id="catagory">

                        <p>Catagory:</p>

                        <p>

                          <select name="catagory" id="catagory2" >

                            <option value="basement waterproofing">Basement Waterproofing</option>

                          </select>

                        </p>

                      </div>

                      <div id="keywords">

                        <p>Keywords:</p>

                        <p>

                          <input type="text" name="keywords" id="keywords2" />

                        </p>

                      </div>

                      <div id="uploadLogo">

                        <p>Upload Company Logo</p>

                        <p>

                          <input name="" type="file" />

                        </p>

                      </div>

                <div id="facebook">

                        <p><strong>Facebook</strong>: Your Facebook account</p>

                        <p>

                          <input name="facebook" type="text" id="facebook2" size="65" />

                        </p>

                      </div>

                      <div id="twitter">

                        <p><strong>Twitter</strong>: Your Twitter account</p>

                        <p>

                          <input name="twitter" type="text" id="twitter2" size="65" />

                        </p>

                      </div>

                      <div id="youTube">

                        <p><strong>YouTube</strong>: Your YouTube account</p>

                        <p>

                          <input name="youTube" type="text" id="youTube2" size="65" />

                        </p>

                      </div>

                      <div id="linkedin">

                        <p><strong>Linkedin</strong>: Your Linkedin account</p>

                        <p>

                          <input name="linkedin" type="text" id="linkedin2" size="65" />

                        </p>

                      </div>

                      <div id="pininterest">

                        <p><strong>Pininterest</strong>: Your Pininterest account</p>

                        <p>

                          <input name="pininterest" type="text" id="pininterest2" size="65" />

                        </p>

                      </div>

                      <input type="hidden" name="MM_insert" value="addListingForm" />

                </form>

                  </div>

                  <div id="footer">

                   

                  </div>

                </div>

                </body>

                </html>

                 

                I tried creating a single form element in a new php file and previewing in live view after adding insert record to the servior behaviours and got a blank white page. Think it could be dreamweaver thats causing this? The new pages contents are as follows

                <?php virtual('/Connections/BIZwrite.php'); ?>

                <?php

                if (!function_exists("GetSQLValueString")) {

                function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                {

                  if (PHP_VERSION < 6) {

                    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

                  }

                 

                 

                  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

                 

                 

                  switch ($theType) {

                    case "text":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;   

                    case "long":

                    case "int":

                      $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                      break;

                    case "double":

                      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";

                      break;

                    case "date":

                      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                      break;

                    case "defined":

                      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                      break;

                  }

                  return $theValue;

                }

                }

                 

                 

                $editFormAction = $_SERVER['PHP_SELF'];

                if (isset($_SERVER['QUERY_STRING'])) {

                  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                }

                 

                 

                if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

                  $insertSQL = sprintf("INSERT INTO ads (company_name) VALUES (%s)",

                                       GetSQLValueString($_POST['company_name'], "text"));

                 

                 

                  mysql_select_db($database_BIZwrite, $BIZwrite);

                  $Result1 = mysql_query($insertSQL, $BIZwrite) or die(mysql_error());

                }

                ?>

                <!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>

                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

                <title>Untitled Document</title>

                </head>

                 

                 

                <body>

                <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">

                  <input type="text" name="company_name" id="company_name" />

                  <input type="hidden" name="MM_insert" value="form1" />

                </form>

                </body>

                </html>

                 

                • 5. Re: Getting a blank white screen
                  LukePVB Community Member

                  Maybe this will help. This is the steps I took in creating the form and adding the insert record behaviour which is what is causing the blank white page. I created a new php page, added a form element, inserted a text field inside the form, then added the insert record server behvaiour. That yielded a blank white page in live view. Is there something wrong with my process? Or is it possible that my dreamweaver installation has become corrupted?

                  • 6. Re: Getting a blank white screen
                    Ben Pleysier CommunityMVP

                    Have a look here http://php.net/manual/en/function.virtual.php.

                     

                    Why not just use 'include' or 'required'?

                    • 7. Re: Getting a blank white screen
                      LukePVB Community Member

                      Altruistic Gramps wrote:

                       

                      Have a look here http://php.net/manual/en/function.virtual.php.

                       

                      Why not just use 'include' or 'required'?

                      Thanks, that made it work.