Jump to content

El_Dudereno

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

El_Dudereno's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Is it possible to navigate to another page with a button like so: <input type="button" value="Submit" onclick= "second.php~" /> or would I have to use javascript?
  2. No these don't really help. They all seem to be people with the same problem as me but no soloution.
  3. I have placed the following piece of code in the body of my page(I have taken out my username and password): L17:<?php L18:$db=mysql_connect("**********","*******","*******") || die; L19:mysql_select_db("********"); L20:mysql_close() L21:?> But when I check the code I keep getting the following error message: XML Parsing Error: no element found Location: http://usernet.scm.tees.ac.uk/users/g7068821/wes/wes_ica/ Line Number 18, Column 1: ^ actual page source code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html> <head> <link rel="stylesheet" type="text/css" href="wes_ica.css" /> <script type="text/javascript" src="wes_ica.js"></script> <script type="text/javascript" src="../../../u0000700/wes_ica_08_09/wes_ica.js"></script> <title>Web Scripting ICA</title> </head> <body onload="globalclock()" BGCOLOR="E0FFFF"> <br /> <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in <b>/web/users/g7068821/wes/wes_ica/index.php</b> on line <b>18</b><br />
  4. Here is the page source code: Any ideas? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <html> <head> <link rel="stylesheet" type="text/css" href="wes_ica.css" /> <script type="text/javascript" src="wes_ica.js"></script> <script type="text/javascript" src="../../../u0000700/wes_ica_08_09/wes_ica.js"></script> <title>Web Scripting ICA</title> </head> <body onload="globalclock()" BGCOLOR="E0FFFF"> <br /> <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in <b>/web/users/g7068821/wes/wes_ica/index.php</b> on line <b>18</b><br />
  5. I have placed the following piece of code in the body of my page(I have taken out my username and password): L17:<?php L18:$db=mysql_connect("**********","*******","*******") || die; L19:mysql_select_db("********"); L20:mysql_close() L21:?> But when I check the code I keep getting the following error message: XML Parsing Error: no element found Location: http://usernet.scm.tees.ac.uk/users/g7068821/wes/wes_ica/ Line Number 18, Column 1: ^
  6. I am trying to declare the following variables in a .js file. dow = f or s cdate = a to p except n ctime = a to f city = 0 to 36 The problem i have is that i am not sure i have declared the variables correctly, and if i haven't how to correct it. The code below is my declaration as it is on the page. These variables are called to another page to be used so would there have to be any tags around the code or is it fine without any? Also if I was to add more functions to this page would they have to go in any tags? My variables: dow=new Array(); dow[0]=new Array("f"); dow[1]=new Array("s"); cdate=new Array(); cdate[0]=new Array("a"); cdate[1]=new Array("b"); cdate[2]=new Array("c"); cdate[3]=new Array("d"); cdate[4]=new Array("e"); cdate[5]=new Array("f"); cdate[6]=new Array("g"); cdate[7]=new Array("h"); cdate[8]=new Array("i"); cdate[9]=new Array("j"); cdate[10]=new Array("k"); cdate[11]=new Array("l"); cdate[12]=new Array("m"); cdate[13]=new Array("o"); cdate[14]=new Array("p"); ctime=new Array(); ctime[0]=new Array("a"); ctime[1]=new Array("b"); ctime[2]=new Array("c"); ctime[3]=new Array("d"); ctime[4]=new Array("e"); ctime[5]=new Array("f"); city=new Array(); city[0]=new Array("0"); city[1]=new Array("1"); city[2]=new Array("2"); city[3]=new Array("3"); city[4]=new Array("4"); city[5]=new Array("5"); city[6]=new Array("6"); city[7]=new Array("7"); city[8]=new Array("8"); city[9]=new Array("9"); city[10]=new Array("10"); city[11]=new Array("11"); city[12]=new Array("12"); city[13]=new Array("13"); city[14]=new Array("14"); city[15]=new Array("15"); city[16]=new Array("16"); city[17]=new Array("17"); city[18]=new Array("18"); city[19]=new Array("19"); city[20]=new Array("20"); city[21]=new Array("21"); city[22]=new Array("22"); city[23]=new Array("23"); city[24]=new Array("24"); city[25]=new Array("25"); city[26]=new Array("26"); city[27]=new Array("27"); city[28]=new Array("28"); city[29]=new Array("29"); city[30]=new Array("30"); city[31]=new Array("31"); city[32]=new Array("32"); city[33]=new Array("33"); city[34]=new Array("34"); city[35]=new Array("35"); city[36]=new Array("36");
  7. The following code is part of my javascript page which is called later on in another page. Within this page are the variables and function that uses them which will be called to help display a clock later on on another page. The variables are: Four variables: dow "f" or "s" cdate one from "a" to "p" except "n" ctime one from "a" to "f" city integer from 0 to 36 The code I have is: dow=new Array(); dow[0]=new Array("f"); dow[1]=new Array("s"); cdate=new Array(); cdate[0]=new Array("a"); cdate[1]=new Array("b"); cdate[2]=new Array("c"); cdate[3]=new Array("d"); cdate[4]=new Array("e"); cdate[5]=new Array("f"); cdate[6]=new Array("g"); cdate[7]=new Array("h"); cdate[8]=new Array("i"); cdate[9]=new Array("j"); cdate[10]=new Array("k"); cdate[11]=new Array("l"); cdate[12]=new Array("m"); cdate[13]=new Array("o"); cdate[14]=new Array("p"); ctime=new Array(); ctime[0]=new Array("a"); ctime[1]=new Array("b"); ctime[2]=new Array("c"); ctime[3]=new Array("d"); ctime[4]=new Array("e"); ctime[5]=new Array("f"); city=new Array(); city[0]=new Array("0"); city[1]=new Array("1"); city[2]=new Array("2"); city[3]=new Array("3"); city[4]=new Array("4"); city[5]=new Array("5"); city[6]=new Array("6"); city[7]=new Array("7"); city[8]=new Array("8"); city[9]=new Array("9"); city[10]=new Array("10"); city[11]=new Array("11"); city[12]=new Array("12"); city[13]=new Array("13"); city[14]=new Array("14"); city[15]=new Array("15"); city[16]=new Array("16"); city[17]=new Array("17"); city[18]=new Array("18"); city[19]=new Array("19"); city[20]=new Array("20"); city[21]=new Array("21"); city[22]=new Array("22"); city[23]=new Array("23"); city[24]=new Array("24"); city[25]=new Array("25"); city[26]=new Array("26"); city[27]=new Array("27"); city[28]=new Array("28"); city[29]=new Array("29"); city[30]=new Array("30"); city[31]=new Array("31"); city[32]=new Array("32"); city[33]=new Array("33"); city[34]=new Array("34"); city[35]=new Array("35"); city[36]=new Array("36"); function globalclock() { var clocktime = new Date(); clocktime.setMinutes(clocktime.getMinutes()+cities[city][1]); maketimedisp(clocktime); timestring=""; timestring+=cities[city][0]; timestring+=" - "; switch (dow) { case "n": timestring=timestring; break; case "s": timestring=timestring+startdayofweek.substring(0,3)+" "; break; case "f": timestring=timestring+startdayofweek+" "; break; default: timestring="Error"; } switch (cdate) { case "n": break; case "a": case "b": case "c": case "d": case "f": case "g": case "h": case "i": case "k": case "l": case "m": case "o": timestring=timestring+startday; break; case "j": case "e": case "p": if (startday>9) { timestring=timestring+startday } else{ timestring=timestring+"0"+startday } break; default: timestring="Error"; } if (startday<20) { de=dayending[startday]; } else { de=dayending[startday%10]; } switch (cdate) { case "n": case "b": case "d": case "e": case "g": case "i": case "j": case "l": case "o": case "p": break; case "a": case "c": case "f": case "h": case "k": case "m": timestring=timestring+de; break; default: timestring="Error"; } switch (cdate) { case "n": break; case "a": case "b": case "f": case "g": case "k": case "l": timestring=timestring+" "+startmonth+" " break; case "c": case "d": case "h": case "i": case "m": case "o": timestring=timestring+" "+startmonth.substring(0,3)+" " break; case "e": case "j": if (start31month>9) { cmonth=start31month } else { cmonth="0"+start31month; } timestring=timestring+"/"+cmonth+"/" break; case "p": if (start31month>9) { cmonth=start31month } else { cmonth="0"+start31month; } timestring=timestring+"/"+cmonth+" " break; default: timestring="Error"; } syear=startyear; switch (cdate) { case "n": case "k": case "l": case "m": case "o": case "p": break; case "a": case "b": case "c": case "d": case "e": timestring=timestring+syear+" "; break; case "f": case "g": case "h": case "i": case "j": yearstring=""+syear; tempyear=yearstring.match(/..$/); timestring=timestring+tempyear+" "; break; default: timestring="Error"; } switch (ctime) { case "n": break; case "a": case "b": case "c": case "d": timestring=timestring+starthour; break; case "e": case "f": timestring=timestring+start24hour; break; default: timestring="Error"; } switch (ctime) { case "n": break; case "a": case "b": case "c": case "d": case "e": case "f": if (startminute<10) { sminute=":0"+startminute; } else { sminute=":"+startminute; } timestring=timestring+sminute; break; default: timestring="Error" } switch (ctime) { case "n": case "b": case "d": case "f": break; case "a": case "c": case "e": if (startsecond<10) { ssecond=":0"+startsecond; } else { ssecond=":"+startsecond; } timestring=timestring+ssecond; break; default: timestring="Error" } switch (ctime) { case "n": case "c": case "d": case "e": case "f": break; case "a": case "b": timestring=timestring+" "+startmeridian;break; default: timestring="Error"; } document.getElementById("globalclock").value = timestring; id = setTimeout("globalclock()", 1000); } The problem I have is should i have tags around the work as the code stated is all i have on the page, and also are the variables declared correctly? Any help here would be appreciated!
  8. I have a text box which is to be used to take an input from a user for a bank sort code. This is shown below <body> <form> <p>The layout used in this input is three pairs of numbers seperated by -. Thanks for taking the time to read this!</p> <p><input type="text" name="Bank_Sort_Code" id="Bank_Sort_Code" onblur="validateBankSortCode($Bank_Sort_Code)" /> (Bank Sort Code)</p>//Function to validate Bank Sort Code Text Box </form> I have the textbox calling a function on blur which is stated below: <?php function validateBankSortCode($Bank_Sort_Code) { if(ereg('^[0-9]{2}-[0-9]{2}-[0-9]{2}$', $Bank_Sort_Code)) echo "Valid Bank Sort Code"; else echo "Invalid Bank Sort Code"; } ?> This i thought would validate the text box but nothing happens. any ideas what I am doing wrong and how to correct it? Cheers!
  9. I have created a text box to take in a bank sort code in the format [0-9][0-9]-[0-9][0-9]-[0-9][0-9] <input type="text" name="Bank_Sort_Code" maxlength="8" /> I have created a function to validate the entry function validateBankNo($Bank_Sort_Code) { if(ereg('^[0-9]{2}-[0-9]{2}-[0-9]{2}$', $Bank_Sort_Code)) return true; else return false; } I have created a button to call the fuction when the text box has been filled to see if the entered data is correct. My problem is I can't get the three pieces of code to fit together. Any help would be great.
  10. The problem that I have at present is as follows: I have these two pages that are loaded up when my page runs, the result of this is that a clock should be displayed. <script type="text/javascript" src="wes_ica.js"></script> <script type="text/javascript" src="../../../u0000700/wes_ica_08_09/wes_ica.js"></script> The first one is to hold 4 variables that will be used in the second. I have had my code from the second checked and this I am sure is correct. The problem that I have is I am not sure how to write the variables in this file. Does there need to be a header etc or is it ok to just write the variables with nothing else. The variables are: dow: f or s cdate: a to p but no n ctime: a to f city: 0 to 36 Any help will be appreciated!
×
×
  • 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.