Jump to content

Scary japanese/chinese figures appear instead of code!


TeddyKiller

Recommended Posts

I'm not sure what place this should be in, but it's compltely driving me nuts. I'm having chinese/japanese figures showing up instead of doing anything the code states.

Example here

 

This is my code..

<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<script> 
function selectMenu(VALUE) {
    var HTML = '';
    
    HTML += '<table>';
    for(var VAL = 1; VAL <= VALUE; VAL++) {
        HTML += '<tr><td>Choice ' + VAL + '</td><td><input type="text" name="field' + VAL + '" /></td></tr>';
    }
    HTML += '</table>';
    
    document.getElementById('selects').innerHTML = HTML;
}

function setCookie(VALUE) {
    var NAME = 'myCookie';
    var DATE = new Date();

    DATE.setTime(DATE.getTime()+(15*60)); // Minutes * Seconds

    var EXPIRE = DATE.toGMTString();

    document.cookie = NAME + "=" + VALUE+"; expires=" + EXPIRE + " path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name,"",-1);
}
</script>
<style> 
table.td {
    padding:5px;
}
</style>
</head>

<body>
<form action="" method="post"> 
    <table> 
        <tr>
            <td>Poll Name</td>
            <td><input type="text" name="pollName" onkeyup="setCookie(this.value)" value="readCookie('myCookie')"/></td>
        </tr> 
        <tr>
            <td>Number of fields</td>
            <td>
                <select name="fields" onchange="selectMenu(this.value)"> 
                    <option value="" selected disabled> </option>
                    <?php
                    for($i = 1; $i < 11; $i++) {
                        echo '<option value="' . $i . '" '; if($i == 1) { echo 'disabled'; } echo '>' . $i . '</option>';
                    }
                    ?>
                </select>
            </td>
        </tr> 
    </table> 
    
    <div id="selects"></div> 
    
    <table>
        <tr>
            <td><input type="submit" name="submit" value="create" /></td>
            <td></td>
        </tr>
    </table> 
</form>
</body>
</html>

 

My host allows php, the rest of my domain uses PHp and it works fine... whats the problem?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.