Jump to content

ssffcc

Members
  • Posts

    13
  • Joined

  • Last visited

Everything 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()); } ?> btw, mysql database is hosted locally without username and passwordplz help
  2. I dont quite understand "if (name==false)". what is it for?
  3. please help on this:when user clicks on "cancel" button, I want to popup a window asking "are you sure to cancel", if user clicks "yes", the code for "cancel" will execute, otherwise do nothing
  4. 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"
  5. done, I think i previously put it into <body> section, that why nothing worked. now i put them in heading section, it works fine. thx for your help again very much scott!
  6. 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)?
  7. thx scott very much for your help, it works well
  8. 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
  9. 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
  10. done, thx very much for help
  11. 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>
  12. thx verymuch, all done!what about a checkbox? e.g. I have 3 checkboxes on same form, how can I retrieve the details of which checkboxes are checked with least coding?
  13. 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...