Jump to content

ssffcc

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by ssffcc

  1. in my php file, I have:

    <?php // hostname or ip of server $servername='localhost'; // username and password to log onto db server $dbusername=''; $dbpassword=''; // name of database $dbname='s12921685'; connecttodb($servername,$dbname,$dbusername,$dbpassword); ////////////// Do not  edit below///////// function connecttodb($servername,$dbname,$dbuser,$dbpassword) { global $link; $link=mysql_pconnect ("$servername","$dbuser","$dbpassword"); if(!$link){die("Could not connect to MySQL");} mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error()); } ?>

    at run time, it throws this error:Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\Inetpub\wwwroot\DreamWeaverSites\wk5\db.inc.php on line 21Could not connect to MySQL
    btw, mysql database is hosted locally without username and passwordplz help
  2. I want to write some simple web pages to collect a substantial quantity of information from the user for a job application (include qualifications and job history). It uses a number of separate pages (at least two). The user can either go sequentially though the pages using a next button or jump around from the navigation bar. Store the data in some unchanging part of the frameset. When the user says he is done, verify that all required data has been collected and display it suitably formatted.I think I can work out how to collect the input data, but I am not sure where to store them (which frame or which page), I decided to use a left-right-bottom 3frames frameset, the left is the navigation links of steps. the right one displays the content of selected step. the bottom page contains a "submission" button, maybe a "next step" and "previous step" buttons too.Am I on the right track so far? plz suggest.1. how to store retrieved information from user input2. how to validate data3. where to put the buttons such as "submit" and "next step"

  3. another relevant question: I have these lines of code to generate a page with 6 horizontal frames:

    <frameset cols="20%,15%, 25%, 15%, 10%, 15%">  <frame src="frame_a.htm">  <frame src="frame_b.htm">  <frame src="frame_c.htm">  <frame src="frame_d.htm">  <frame src="frame_e.htm">  <frame src="frame_f.htm"></frameset><noframes></noframes>

    is it possible to have JavaScript to generate the HTML and display the pages side by side in a frameset (getting the same result of the above code)?

  4. I wrote this in HTML:

    <h5>details 01 </h5><br /><a href="javascript:setPage()">details01</a>

    and this in java script:

    <script type="text/javascript"> function setPage() {   parent.leftFrame.document.src="lab1_Details.html"; } </script>

    nothing is happening, plz help

  5. hi, I have a top-bottomLeft-bottomRight frameset and three pages (details01.html, details02.html and details03.html):

    <frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0">  <frame src="topFrame.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />  <frameset cols="80,*" frameborder="no" border="5" framespacing="0">    <frame src="leftFrame.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />    <frame src="mainFrame.html" name="mainFrame" id="mainFrame" title="mainFrame" />  </frameset>  </frameset>

    on leftFrame.html, I want to have navigation links to the three pages. when the link of "details01.html" is clicked, the mainFrame.html will display the details01.html, when the link of "details02.html" is clicked, the mainFrae.html will display the details02.html.is it possible to do this with javaScript? plz help, I am new to javaScript

  6. I tried this, but not working, plz help:

    <script type="text/javascript">function getcheckvalue(){  var choices = document.form1.foodmenu  var numofchoices = choices.length  var food  var i  var j = 0  var k      for (i=0; i<numofchoices; i++)  {    if (choices[i].checked)	{   food[j].value = choices[i].value   j=j+1	}  }    for (k=0; k<food.length; k++)  {    //display the checked food   }</script>

    <form name="form1" method="post" onsubmit="getcheckvalue()"><input type="checkbox" value="pizza" name="foodmenu" />pizza<input type="checkbox" value="spaghetti" name="foodmenu" />spaghetti<input type="checkbox" value="steak" name="foodmenu" />steak<input type="submit" value="submit" /></form>

  7. for dropdownlist, I can use these lines to retrieve the selected value:

    	var countrylist=document.getElementById("country")    thecountry=countrylist.options[countrylist.selectedIndex].text

    for radio buttons, I can only retrieve selected value by indexnumber:

      var gender  if (document.form1.gender[0].checked)  {    gender= "male"  }  else if (document.form1.gender[1].checked)  {    gender= "female"  }

    if there are many radio buttons on a form, it will be hard to memorize all the value's index number, is there such a way similar to retrieve value from dropdownlist that can make the coding easier for radio buttons?

×
×
  • Create New...