SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Caryn's Avatar
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need expert js eye

    Hi,

    Can someone take a look at the javascript in this page and let me know if everything is cool or not?

    For some reason, it's not working in IE6 but it's fine in IE5.5.

    Let me know if you need more info...

    PHP Code:
    <?
    //include "config.inc.php";
    //include "$phpWebEd_language.inc.php";
    ?>
    <html>
    <head>
    <title>Edit a Joblisting</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="http://www.ncworkforce.com.au/images/_styles.css" type="text/css">
    <script language="Javascript1.2"><!-- // load htmlarea
    _editor_url = "http://www.spd.net.au/ncworkforce/admin/htmlarea/";                     // URL to htmlarea files
    var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
    if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
    if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
    if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
    if (win_ie_ver >= 5.5) {
      document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
      document.write(' language="Javascript1.2"></scr' + 'ipt>');  
    } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
    // --></script>
    </head>
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="http://www.ncworkforce.com.au/images/nav_bg.gif">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" name="employment">
    <tr align="left" valign="top"> 
    <td background="http://www.ncworkforce.com.au/images/nav_bg.gif" width="206"><a href="http://www.ncworkforce.com.au/index.html"><img src="http://www.ncworkforce.com.au/images/logo.gif" width="229" height="47" vspace="0" hspace="0" border="0" alt="North Coast Workforce"></a><br>
    <img src="http://www.ncworkforce.com.au/images/nav_sp1.gif" width="229" height="9" vspace="0" hspace="0" border="0" alt="North Coast Workforce"><br>
    <a href="http://www.ncworkforce.com.au/index.html"><img src="http://www.ncworkforce.com.au/images/nav1_home.gif" width="229" height="22" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="temporary"></a><br>
    <a href="http://www.ncworkforce.com.au/about.html"><img src="http://www.ncworkforce.com.au/images/nav2_about.gif" width="229" height="21" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="secretarial"></a><br>
    <a href="http://www.ncworkforce.com.au/temp_staff.html"><img src="http://www.ncworkforce.com.au/images/nav3_temp.gif" width="229" height="22" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="contract"></a><br>
    <a href="http://www.ncworkforce.com.au/recruit_services.html"><img src="http://www.ncworkforce.com.au/images/nav4_recruit.gif" width="229" height="23" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="recruitment"></a><br>
    <a href="http://www.ncworkforce.com.au/_current_positions.html"><img src="http://www.ncworkforce.com.au/images/nav5_current.gif" width="229" height="21" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="bookkeeping"></a><br>
    <a href="http://www.ncworkforce.com.au/contact.html"><img src="http://www.ncworkforce.com.au/images/nav6_contact.gif" width="229" height="23" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="workforce"></a><br>
    <a href="http://www.ncworkforce.com.au/disclaimer.html"><img src="http://www.ncworkforce.com.au/images/nav7_disclaimer.gif" width="229" height="22" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="construction"></a><br>
    <img src="http://www.ncworkforce.com.au/images/nav_sp2.gif" width="206" height="282" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="clerical"></td>
    <td width="100%"> 
    <h1>Edit a Job Listing</h1>
    <table width="100%" border="0" cellspacing="5" cellpadding="0" align="center" name="staff">
    <tr> 
    <td align="left" valign="top">
    <form name="editform" action="<? echo $PHP_SELF ?>" method="post">
    <?
    mysql_pconnect
    ("localhost","spd_ncworkforce","********"); //enter name and password
    mysql_select_db("spd_ncworkforce"); //select the database

    if(!$cmd)
    {
        print 
    "<table>";    
        
    $result mysql_query("select * from ncw_joblistings order by title"); 
        while(
    $r=mysql_fetch_array($result))
        {    
            
    $title=$r["title"];
            
    $job_id=$r["job_id"];
            
    $description=$r["description"];
            
    $adv_id=$r["adv_id"];
            
    ?>
    <tr>
    <td width=20><INPUT TYPE="RADIO" NAME="job_id" VALUE="<? echo $job_id;?>"></td>
    <!-- <td width=20><? echo $job_id?></td> -->
    <td width=80%><? echo $title?></td>
    </tr>
    <? ?>
    <TR><td colspan=3 align=center><input type="submit" name="cmd" value="edit"></TD></tr>
    </table>
    <p align="center"><a href="joblisting_add.php">Add</a>  - <a href="joblisting_edit.php">Edit</a> - <a href="joblisting_delete.php">Delete</a></p>
    <p align="center"><a href="/ncworkforce/admin/">Back to the Admin Page</a></p>
    </form>
    <? 

    if(
    $cmd=="edit")
    {
        if (!
    $submit)
        {
            
    $sql "SELECT * FROM ncw_joblistings WHERE job_id=$job_id order by title";
            
    $result mysql_query($sql);        
            
    $myrow mysql_fetch_array($result) or die(mysql_error());
            
            
    $job_id=$myrow["job_id"];
            
    $title=$myrow["title"];
            
    $job_ref=$myrow["job_ref"];
            
    $ind_id=$myrow["ind_id"];
            
    $description=$myrow["description"];
            
    $con_id=$myrow["con_id"];
            
    $adv_id=$myrow["adv_id"];
            
    ?>
    <table>
    <tr>
    <input type=hidden name="job_id" value="<?php echo $myrow["job_id"?>">
    <td valign="top"><b>Job Title:</b></td>
    <td>
    <INPUT TYPE="TEXT" NAME="title" VALUE="<?php echo $myrow["title"?>" SIZE=30>
    </td>
    </tr>
    <tr>
    <td valign="top"><b>Job Reference No.:</b></td>
    <td>
    <INPUT TYPE="TEXT" NAME="job_ref" VALUE="<?php echo $myrow["job_ref"?>" SIZE=30>
    </td>
    </tr>
    <tr>
    <td valign="top"><b>Industry:</b></td>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr valign="top">
    <td><b>Currently:</b></td>
    <td>
    <?
    $result2 
    mysql_query("select * from ncw_industry where ind_id=$ind_id");
    $r=mysql_fetch_array($result2);
    $industry1=$r["industry"];
    echo 
    $industry1;
    ?>
    <br>
    </td>
    </tr>
    <tr valign="top">
    <td><b>Change to:</b></td>
    <td>
    <select name="ind_id">
    <?
    $link 
    mysql_connect("localhost","spd_ncworkforce","********"); 
    mysql_select_db("spd_ncworkforce"); 
    $result mysql_query("select * from ncw_industry where ind_id=$ind_id");
    $r=mysql_fetch_array($result);
            
    $industry =$r["industry"];    
            
    $ind_id =$r["ind_id"];    
    ?>
    <option value="<? echo $ind_id ?>"><? echo $industry ?></option>
    <?
    $result 
    mysql_query("select * from ncw_industry order by industry");
    while(
    $r=mysql_fetch_array($result))
        {    
            
    $industry =$r["industry"];    
            
    $ind_id =$r["ind_id"];    

    ?>
    <option value="<? echo $ind_id ?>"><? echo $industry ?></option>
    <? 
    ?>
    </select>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td valign="top"><b>Description:</b></td>
    <td>
    <textarea name="description" cols=50 rows=60>
    <?php echo $description ?>
    </TEXTAREA><br>
    <b>Example "InsertHTML" links: </b> &nbsp;
    <a href="javascript:editor_insertHTML('description','<font style=\'background-color: yellow\'>','</font>',1);">Highlight selected text</a> -
    <a href="javascript:editor_insertHTML('description',':)');">Insert Smiley</a>
    <a href="javascript:alert(editor_getHTML('description'));">getHTML</a>
    <a href="javascript:editor_setHTML('description','<b>Hello World</b>!!');">setHTML</a>
    <script language="javascript1.2">
    editor_generate('description');
    </script>
    </td>
    </tr>
    <tr>
    <td valign="top"><b>Contact:</b></td>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr valign="top">
    <td><b>Currently:</b></td>
    <td><?
    $result3 
    mysql_query("select * from ncw_contact where con_id=$con_id");
    $r=mysql_fetch_array($result3);
    $name1=$r["name"];
    echo 
    $name1;
    ?>
    <br>
    </td>
    </tr>
    <tr valign="top">
    <td><b>Change to:</b></td>
    <td>
    <select name="con_id">
    <?
    $result3b 
    mysql_query("select * from ncw_contact where con_id=$con_id");
    $r=mysql_fetch_array($result3b);
            
    $con_id =$r["con_id"];    
            
    $name =$r["name"];
            
    ?>
    <option value="<? echo $con_id ?>"><? echo $name ?></option>        
            <?
    $result3b 
    mysql_query("select * from ncw_contact order by name");
    while(
    $r=mysql_fetch_array($result3b))
        {    
            
    $con_id =$r["con_id"];    
            
    $name =$r["name"];    
            
    $email =$r["email"];    
            
    $phone =$r["phone"];    
            
    $address =$r["address"];    
            
    $city =$r["city"];    
            
    $state =$r["state"];                
            
    $postcode =$r["postcode"];        
    ?>
    <option value="<? echo $con_id ?>"><? echo $name ?></option>
    <? 
    ?>
    </select>
    </td>
    </tr>

    </table>
    </td>
    </tr>
    <tr>
    <td valign="top"><b>Advertiser</b></td>
    <td>
    <select name="adv_id">
    <?
    $result3b 
    mysql_query("select * from ncw_advertisers where adv_id=$adv_id");
    $r=mysql_fetch_array($result3b);
            
    $adv_id =$r["adv_id"];    
            
    $company =$r["company"];    
    ?>
    <option value="<? echo $adv_id ?>"><? echo $company ?></option>        
            <?
    $result3b 
    mysql_query("select * from ncw_advertisers order by company");
    while(
    $r=mysql_fetch_array($result3b))
        {    
            
    $adv_id =$r["adv_id"];    
            
    $company =$r["company"];    
    ?>
    <option value="<? echo $adv_id ?>"><? echo $company ?></option>
    <? 
    ?>
    </select>
        
    </td>
    </tr>
    <tr>
    <td colspan=2 align=center>
    <input type="hidden" name="cmd" value="edit">
    <input type="Submit" name="submit" value="Enter information">
    </td>
    </tr>
    </table>
    <p align="center"><a href="joblisting_add.php">Add</a>  - <a href="joblisting_edit.php">Edit</a> - <a href="joblisting_delete.php">Delete</a></p>
    <p align="center"><a href="/ncworkforce/admin/">Back to the Admin Page</a></p>
    <br>
    </form>
    <? 

        if(
    $submit)
        {
            
    $sql "UPDATE ncw_joblistings SET title='$title',job_ref='$job_ref',description='$description',ind_id='$ind_id',con_id='$con_id',adv_id='$adv_id' WHERE job_id=$job_id";
            
    $result4 mysql_query($sql);
            echo 
    "<p align=center>Thank you! Information updated.</p>";
            print 
    "<p align=\"center\"><a href=\"joblisting_add.php\">Add</a>  - <a href=\"joblisting_edit.php\">Edit</a> - <a href=\"joblisting_delete.php\">Delete</a></p>"?>
    <p align="center"><a href="/ncworkforce/admin/">Back to the Admin Page</a></p>
    <?
        
    }
    }
    ?>
    </td>
    </tr>
    </table>
    </td>
    <td valign="top" align="left" width="52"><img src="http://www.ncworkforce.com.au/images/right_bdr1_city.jpg" width="52" height="520" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="accounting"></td>
    <td valign="top" align="left" width="49"><img src="http://www.ncworkforce.com.au/images/_.gif" width="30" height="27" alt="North Coast Workforce" vspace="0" hspace="0" border="0"><a href="http://www.ncworkforce.com.au/index.html"><img src="http://www.ncworkforce.com.au/images/right_bdr2.gif" width="49" height="435" vspace="0" hspace="0" border="0" alt="North Coast Workforce" name="building"></a></td>
    </tr>
    <tr align="left" valign="top"> 
    <td width="49">&nbsp; </td>
    <td align="center" valign="middle"> 
    <p class="footer"><b>&copy; 2002 North Coast Workforce</b><br>
    104 Conway Street<br>
    PO Box 312<br>
    Lismore NSW 2480, AUSTRALIA </p>
    <p class="footer"> <b>Phone</b>: (02) 6622 0500 <b>Fax</b>: (02) 6622 0414</p>
    <p class="footer"><b>Email: <a href="mailto:info@ncw.net.au">info@ncw.net.au</a> WWW: <a href="http://www.ncw.net.au/">[url]www.ncw.net.au[/url]</a></b></p>
    <p class="footer">Site Design, Construction and Online Marketing by <a href="http://www.spinningplanetdesign.com/" target="_blank"><b>Spinning Planet Design</b></a></p>
    <table border="0" cellspacing="0" cellpadding="5">
    <tr align="center" valign="top"> 
    <td> <!--WEBBOT bot="HTMLMarkup" startspan ALT="Site Meter" --> 
    <div align="center"> 
    <script type="text/javascript" language="JavaScript">var site="s11ncworkforce"</script>
    <script type="text/javascript" language="JavaScript1.2" src="http://s11.sitemeter.com/js/counter.js?site=s11ncworkforce">
    </script>
    <noscript> <a href="http://s11.sitemeter.com/stats.asp?site=s11ncworkforce" target="_top"> <img src="http://s11.sitemeter.com/meter.asp?site=s11ncworkforce" alt="Site Meter" border=0></a> 
    </noscript> <!-- Copyright (c)2002 Site Meter --> <!--WEBBOT bot="HTMLMarkup" Endspan --> </div>
    </td>
    </tr>
    </table>
    <p>&nbsp;</p>
    </td>
    <td valign="top" align="left" width="52">&nbsp;</td>
    <td width="49">&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What isn't working in IE6?
    The appVersion thing?

    Try this:
    var ua = navigator.userAgent;
    var os = navigator.platform;
    var ie55_win = /msie\s(5\.5|[6789])/ig.test(ua) && !/opera/i.test(ua) && /win32/i.test(os);

  3. #3
    SitePoint Addict Caryn's Avatar
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jofa,

    I'm not sure if it is the app version thing.

    I think it may have something to do with either missing code, or system configuration.

    The reason I think it might be these things is that the exact same code on: http://www.interactivetools.com/prod...ndex.html#demo works fine on the same computer using IE 6, as the code above.

    So I reckon I've made a mistake somewhere cutting and pasting the code.

    I will post the exact error that occurs as soon as I can.


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
  •