SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error not identified.

    The following page is in one my sites that I didn't work on. It's not linked to the site, so it's not a big deal.

    It loads up and all, but has an error. (just in the lower left hand corner of the browser.). But it's not loading the whole page.

    Any one see anything wrong with it? With out an error code or line there isn't any place for me to even start.


    PHP Code:
    <?php require("header.php");
    require(
    "restrict.php");

    if(
    mysql_num_rows(mysql_query("select * from $table4 where user_id='$userID' && id='$zone'")) != 0){
      
    $zone_getter mysql_query("SELECT * FROM $table4 where user_id='$userID' && id='$zone'");
      
    $zone_id $zone_getter->id;
      
    $zone_name $zone_getter->zone_name;
      
    $zone_views $zone_getter->views;
      
    $zone_clicks $zone_getter->clicks;
      
    $zone_category $zone_getter->category;
      
    $zone_netads $zone_getter->network_ads;
      
    $zone_password $zone_getter->password;
      
    $zone_type $zone_getter->zone_type;
      
    $zone_type ucwords(strtolower($zone_type));
      
    $zone_url $zone_getter->url;
      echo 
    "<span class=\"bigtext\">Sell Links</span><hr noshade>
    All you need to do to start selling is copy and paste the following HTML into your site:
    <p>
    <p>
    <script type=\"text/javascript\">
    function updateLayout(layout_button) {
       if ( layout_button.value == 'skyscraper' ) {
          document.mbCodeForm.page2.value = 'text_group2.php';
          document.mbCodeForm.layout2.value = '&amp;layout=skyscraper';
          document.mbCodeForm.col2.value = '';
          document.genCodeForm.newwin[0].disabled = false;
          document.genCodeForm.newwin[1].disabled = false;
          document.getElementById('link_text').innerHTML = '';
          document.getElementById('customopts').innerHTML = '';
          document.getElementById('sampleLinks').innerHTML = '<table width=\"120\" cellspacing=\"1\" cellpadding=\"0\" border=\"0\" bgcolor=\"#336699\"> <tr> <td width=\"118\" height=\"13\" align=\"left\" valign=\"middle\"> <u><font style=\"font-size:11px\" face=\"arial,sans-serif\" color=\"#ffffff\">Your ad here</font></u> </td> </tr> <tr> <td width=\"118\" valign=\"top\"> <table width=\"118\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"> <tr> <td width=\"118\" height=\"146\" align=\"left\" valign=\"middle\"> <table width=\"118\" height=\"140\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\" bgcolor=\"#ffffff\"> <tr> <td width=\"\" align=\"center\" valign=\"center\"> <table width=\"95%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"> <tr> <td> <div style=\"overflow:hidden; width:113px; padding-left:0px\"> <u><b><font style=\"font-size:13px\" face=\"arial,sans-serif\" color=\"#0000ff\">Fine Cheeses</font></b></u><br><font style=\"font-size:13px\" face=\"arial,sans-serif\" color=\"#000000\">Specialty cheese, low prices<br></font> <font style=\"font-size:10px\" face=\"arial,sans-serif\" color=\"#009900\">www.finecheese.com</font></div> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td width=\"118\" valign=\"top\"> <table width=\"118\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"> <tr> <td width=\"118\" height=\"146\" align=\"left\" valign=\"middle\"> <table width=\"118\" height=\"140\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\" bgcolor=\"#ffffff\"> <tr> <td width=\"\" align=\"center\" valign=\"center\"> <table width=\"95%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"> <tr> <td> <div style=\"overflow:hidden; width:113px; padding-left:0px\"> <u><b><font style=\"font-size:13px\" face=\"arial,sans-serif\" color=\"#0000ff\">Fine Cheeses</font></b></u><br><font style=\"font-size:13px\" face=\"arial,sans-serif\" color=\"#000000\">Specialty cheese, low prices<br></font> <font style=\"font-size:10px\" face=\"arial,sans-serif\" color=\"#009900\">www.finecheese.com</font></div> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table>';
       } else if ( layout_button.value == 'banner' ) {
          document.mbCodeForm.page2.value = 'text_group2.php';
          document.mbCodeForm.layout2.value = '&amp;layout=banner';
          document.mbCodeForm.col2.value = '';
          document.genCodeForm.newwin[0].disabled = false;
          document.genCodeForm.newwin[1].disabled = false;
          document.getElementById('link_text').innerHTML = '';
          document.getElementById('customopts').innerHTML = '';
          document.getElementById('sampleLinks').innerHTML = '<table width=\"468\" height=\"60\" cellspacing=\"1\" cellpadding=\"0\" border=\"0\" bgcolor=\"#336699\"> <tr> <td> <table width=\"466\" height=\"58\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\" bgcolor=\"#ffffff\"> <tr> <td colspan=\"2\" width=\"\" height=\"\"> <table width=\"464\" height=\"\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\"> <tr> <td width=\"229\" height=\"41\" align=\"left\" valign=\"top\"> <u><b><font style=\"font-size:11px\" face=\"verdana,arial,sans-serif\" color=\"#0000ff\">Fine Cheeses</font></b></u><br><font style=\"font-size:10px\" face=\"verdana,arial,sans-serif\" color=\"#000000\">Specialty cheese, low prices<br></font> </td> <td width=\"229\" height=\"41\" align=\"left\" valign=\"top\"> <u><b><font style=\"font-size:11px\" face=\"verdana,arial,sans-serif\" color=\"#0000ff\">Fine Cheeses</font></b></u><br><font style=\"font-size:10px\" face=\"verdana,arial,sans-serif\" color=\"#000000\">Specialty cheese, low prices<br></font> </td> </tr> </table> </td> </tr> <tr> <td nowrap width=\"360\" height=\"11\" bgcolor=\"#336699\"></td> <td nowrap width=\"100\" height=\"11\" align=\"right\" bgcolor=\"#336699\"> <u><font style=\"font-size:10px\" face=\"verdana,arial,sans-serif\" color=\"#ffffff\">Your ad here</font></u> </td> </tr> </table> </td> </tr> </table>';
       } else if ( layout_button.value == 'custom' ) {
          document.mbCodeForm.page2.value = 'text_group.php';
          document.mbCodeForm.layout2.value = '';
          document.mbCodeForm.col2.value = '';
          document.genCodeForm.newwin[0].disabled = false;
          document.genCodeForm.newwin[1].disabled = false;
          document.getElementById('link_text').innerHTML = '';
          document.getElementById('customopts').innerHTML = ' &nbsp;&nbsp;<input type=radio name=cust_layout value=\"vertical\" checked onClick=\"updateLayout(this);updateMBCode();\">Vertical<br> &nbsp;&nbsp;<input type=radio name=cust_layout value=\"horizontal\" onClick=\"updateLayout(this);updateMBCode();\">Horizontal (<input style=\"border: 1px solid #CCCCCC; font-size: 9pt;\" type=text size=2 maxlength=2 name=num_cols value=3 onKeyUp=\"updateLayout(document.genCodeForm.cust_layout[1]);updateMBCode();\"> ads per row)<br>To match the design of your site, you may use the CSS classes \"<b>adHeadline</b>\" and \"<b>adText</b>\"';
          document.getElementById('sampleLinks').innerHTML = '<span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><br> <span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><br> <span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><p><u>Your Ad Here</u>';
       } else if ( layout_button.value == 'horizontal' ) {
          if ( parseInt(document.genCodeForm.num_cols.value) ) {
             columns = parseInt(document.genCodeForm.num_cols.value);
          }
          var linkSample = '';
          var i = 0;
          while ( i < columns ) {
             linkSample += '<td class=\"table_content\"><span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span></td>';
             i++;
          }
          document.genCodeForm.cust_layout[1].checked = true;
          document.mbCodeForm.col2.value = '&amp;col=' + columns;
          document.mbCodeForm.page2.value = 'text_group.php';
          document.mbCodeForm.layout2.value = '';
          document.genCodeForm.newwin[0].disabled = false;
          document.genCodeForm.newwin[1].disabled = false;
          document.getElementById('link_text').innerHTML = '';
          document.getElementById('sampleLinks').innerHTML = '<table width=\"100%\"><tr>' + linkSample + '</tr></table><br><u>Your Ad Here</u>';
       } else if ( layout_button.value == 'vertical' ) {
          document.mbCodeForm.page2.value = 'text_group.php';
          document.mbCodeForm.layout2.value = '';
          document.mbCodeForm.col2.value = '';
          document.genCodeForm.newwin[0].disabled = false;
          document.genCodeForm.newwin[1].disabled = false;
          document.getElementById('link_text').innerHTML = '';
          document.getElementById('sampleLinks').innerHTML = '<span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><br> <span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><br> <span style=\"font-size: 9pt; font-weight: bold; text-decoration: underline;\">Fine Cheeses</span><br><span style=\"font-size: 8pt; font-weight: normal; text-decoration: none;\">Specialty cheese, low prices</span><p><u>Your Ad Here</u>';
       }
    }
    function updateNewwin(newwin_button) {
       if ( newwin_button.value == 'yes' ) {
          document.mbCodeForm.newwin2.value = '&amp;newwin=1';
       } else if ( newwin_button.value == 'no' ) {
          document.mbCodeForm.newwin2.value = '';
       }
    }
    function updateMBCode() {
       var mb_code = '';
       if ( ! document.mbCodeForm.page2.value ) {
          mb_code += \"Please choose a layout first\";
       } else {
          mb_code += \"<!-- Begin Code -->\n<script type=\\\"text/javascript\\\" src=\\\"http://2.marketbanker.com/mb/\" + document.mbCodeForm.page2.value + \"?sid=16065\" + document.mbCodeForm.newwin2.value + document.mbCodeForm.layout2.value + document.mbCodeForm.col2.value + \"\\\"></scr\";
       mb_code += \"ipt>\n\";
       if ( document.mbCodeForm.layout2.value != '&amp;layout=skyscraper' && document.mbCodeForm.layout2.value != '&amp;layout=banner' ) {
          mb_code += \"<p />\n<div><a target=\\\"_top\\\" href=\\\"http://www.
    $sitename.com/mb/commerce/purchase_form.php?opid=16065&amp;afsid=1\\\">Your Ad Here</a></div>\n\";
       }
       mb_code += \"<!-- End Code -->\";
       }
       document.mbCodeForm.codeField.value = mb_code;
    }
    </script>

    <table class=\"table_outer\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">
       <tr>
          <td>
          <b>&nbsp;Options</b>
          </td>
       </tr>
       <form name=\"genCodeForm\">
       <tr>
          <td>
             <table class=\"table_inner\" border=\"0\" cellpadding=\"12\" cellspacing=\"0\">
                <tr>
                   <td valign=top width=\"50%\" class=\"table_content\">
                      <b>Layout:</b><br>
                      <input type=radio name=layout value=\"skyscraper\" onClick=\"updateLayout(this);updateMBCode();\">Skyscraper<br>
                      <input type=radio name=layout value=\"banner\" onClick=\"updateLayout(this);updateMBCode();\">468x60 banner size<br>
                      <input type=radio name=layout value=\"custom\" onClick=\"updateLayout(this);updateMBCode();\">Custom
                      <div id=\"customopts\">
                      <br>
                      </div>
                   </td>
                   <td valign=top class=\"table_content\">
                      <b>Links:</b>
                      <span id=link_text style=\"font-size:8pt\">(Please choose a layout first)</span>
                      <br>
                      <input disabled type=radio name=newwin value=\"yes\" onClick=\"updateNewwin(this);updateMBCode();\">Open links in new window<br>
                      <input disabled type=radio name=newwin value=\"no\" onClick=\"updateNewwin(this);updateMBCode();\">Open links in same window
                   </td>
                </tr>
             </table>
          </td>
       </tr>
       </form>
    </table>
    <p>
    <table class=\"table_outer\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">
       <tr>
          <td>
          <b>&nbsp;Sample</b>
          </td>
       </tr>
       <tr>
          <td>
          <table class=\"table_inner\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
             <tr>
                <td valign=top class=\"table_content\"> <div id=sampleLinks>Please choose a layout option above</div> </td>
             </tr>
          </table>
          </td>
       </tr>
       </form>
    </table>
    <p>
    <table class=\"table_outer\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">
       <tr>
          <td>
          <b>&nbsp;Your 
    $sitename Zone</b>
          </td>
       </tr>
       <form name=mbCodeForm>
       <tr>
          <td>
          <table class=\"table_inner\" border=\"0\" cellpadding=\"12\" cellspacing=\"0\">
             <tr>
                <td class=\"table_content\">
                <input type=\"hidden\" name=\"layout2\">
                <input type=\"hidden\" name=\"newwin2\">
                <input type=\"hidden\" name=\"col2\">
                <input type=\"hidden\" name=\"page2 \">
                <textarea name=\"codeField\" rows=\"7\" cols=\"69\" readonly>
    Please choose a layout option above
                </textarea>
                </td>
             </tr>
          </table>
          </td>
       </tr>
       </form>
    </table>"
    ;
    }

    require(
    "footer.php"); ?>

  2. #2
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stma
    Any one see anything wrong with it?
    What is $zone_getter?? Why do you do your SQL query twice? Why are you echoing such a large amout of HTML/Javascript? (Why is your javascript in the same file as the HTML anyway?) Why don't you just use mysql_fetch_assoc to get an associateive array of the row instead of the $zone_getter thingie? Why do you use tables for layout instead of CSS and XHTML?

    If all that got sorted out, you'd probably be half way to getting it working. I have not idea what you are doing with all that javascipt, though hopefully it isn'tthat that is stopping you from loading your page.

    Douglas
    Hello World

  3. #3
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Parry Sound, ON
    Posts
    725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is obviously a Javascript question. But while you're here: get a real browser like Firefox that has a proper Javascript console.

  4. #4
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes the problem appears to be javascript....... I will go download firefox if it's going to show me where the errors are.

    Thanks for the tip.

  5. #5
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    Southwest US
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What browser are you using now?

  6. #6
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE, but I am installing firefox now, been thinking about doing it anyway for security.

  7. #7
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    Southwest US
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First I can't say enough good things about Firefox.

    But, using IE, you can always double click on the error sign at the bottom of the window to display the error, which will give you the line which has the problem, but better than that...

    Click 'Tools' > 'Internet Options', then in that window click on the 'Advanced' tab, find the checkbox next to the line 'Display a notification about every script error' and check it and click 'Apply'. Then whenever there is an error on the page it will open an alert box explaining the error.

    Also if your going to be doing web development it is a good idea to download all the major browsers (and some minor) so you can test your scripts in all, because they all display differently. I am currently running 5 different browsers.

    Hope this helps,
    Itshim

  8. #8
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    Southwest US
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also looking through your code...

    Since this is a javascript error, but you have the javascript coming from PHP, the error line the browser displays will correspond to the page source not the PHP code.

    You may want to add '\n' in your echo statement everytime you want to go to a newline, this will prevent the code from appearing all on one line. In fact this maybe the reason you have errors in your javascript.

    Thanks for listening,
    Itshim

  9. #9
    SitePoint Addict
    Join Date
    May 2004
    Location
    USA
    Posts
    342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's where I was heading........ hehe still not sure what this page was supposed to do

    I am liking firefox myself, thanks for tip!


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
  •