Jump to content

crazysaint

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

crazysaint's Achievements

Member

Member (2/5)

0

Reputation

  1. this is what i have $vowels = array('a','e','i','o','u'); $string = 'An example string'; $length = strlen($string); $count = 0; for ($i = 0; $i !== $length; $i++ { if (array_search($length[$i], $vowels)) { $count++; } } echo 'There are (' . $count . ') vowels in the sentense(' . $string . ').';
  2. Write an algorithim in pseudo code that will ask a user to input a sentence and that will return the number of vowels that are found in a sentense. i am a newbie to programming so all assistance will be highly appreciated.
  3. RussellReal thanks for the help but am still having a small problem.let me post the entire form that is being affected by the onsubmit code <td><select name="series"> <?php $sql="select * from series"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $val1=$row['series']; ?> <option value="<?php echo $val1; ?>"><?php echo $val1; ?></option> <?php } ?> </select> </td> <td height="33"><input name="file_ref" type="text" value="" size="5" /></td> <td><select name="type"> <?php $sql="select * from file_types"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $val1=$row['type']; ?> <option value="<?php echo $val1; ?>"><?php echo $val1; ?></option> <?php } ?> </select> <input name="subj_ref" type="text" size="30" /></td> <td><select name="file_miss"> <option value="YES">Y</option> <option value="NO" selected="selected">N</option> </select> </td> <td><select name="restore"> <option value="YES">Y</option> <option value="NO" selected="selected">N</option> </select></td> <td><select name="investigate"> <option value="YES">Y</option> <option value="NO" selected="selected">N</option> </select></td> <td><select name="remarks"> <?php $sql="select * from remarks"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $val1=$row['remarks']; ?> <option value="<?php echo $val1; ?>"><?php echo $val1; ?></option> <?php } ?> </select></td> <td><select name="locality"> <?php $sql="select * from locality"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { $val1=$row['locality']; ?> <option value="<?php echo $val1; ?>"><?php echo $val1; ?></option> <?php } ?> </select></td> <td><input name="vol_no" type="text" size="5" /></td> </tr> </table> <p> <input name="submit" type="submit" /> <input type="hidden" name="subject_repl" /> <input type="hidden" name="loc_repl" />
  4. the folowing is an extract of a code that i wouild like some help with. i want on submit the code to give a warning that some fields are null and that the user should fill them in. function ref() { var reference; reference=document.myForm.file_ref.value; if (reference=="") { window.prompt('All fields must be filled'); return false; window.focus=document.myForm.file_ref.file_ref; } esle { return true; } } </script> </head> <body> <?pHp include "connection.php"; ?> <div align="center"> <p>DATA CAPTURE INTERFACE </p> </div> <?php mysql_select_db("lands",$connection) or die(mysql_error()); $sql="select file_ref from data_entry order by file_ref desc limit 1"; $result=mysql_query($sql); //$num=mysql_numrows($result); if ($result==0) { $fr="1"; } else { $select=mysql_fetch_array($result); $field=$select['file_ref']; $fr=++$field; } ?> <p> </p> <p> </p> <form id="form1" method="post" action="" onsubmit="return ref()">
  5. hey, am facing the same sort of problem and am sure that this might be the solution.i am a bit green on mysql and mssql so go easy on the bashing. so how do i set up a cron job and could you please try give me the script that is needed to be assigned to the cron?
  6. after much thought,i decided to us a different approach to solve my issue. sorry for not mentioning but am using MySQL 5.0. i would like to come up with a php code that can access the db online and download it to a local machine to a specified folder in .CSV file format. i wouldn't mind a php code that i can run on my local host and on request it downloads the sql dump.
  7. Hey everyone,its been ages since i was here.anyway i need some help.does anyone know how i can get an sql script to download data from an online server to a local machine runnin MS SQL.am hopin my question makes sense
  8. To begin with, i have a primary server running mssql located at the office. There's going to be a secondary server located in another site, in this site a secondary server will be running L.A.M.P.. My issue is that information from the primary server must be copied to the secondary server every half hour, definitely on the first run it will be all the info. but there after it will be just updates to the secondary. My question is, is it possible through PHP to copy data from a remote mssql database to a mysql database without having to create some form of temporary data storages; if yes how do i go about it? Secondly, clients have to connect to the temporary database over the internet and would like to implement secure http from login to viewing their online reports; again how do i go about this? Lastly, on one of the pages, the content changes every half hour and the client must be in a position to see the changes (if any), how do i make the page refresh every half hour or once there's a refresh in the secondary database?
  9. i would like to come up with two codes in ASP that will a) simulate the throeing of a dice: when run it should display the face value of the dice(between 1 and 6) b)then also i would like to come up with another code that shows that all faces have equal liklihood of being shown.(should throw it for about 6000 times). i know it has something to do with using a counter for eah face and increment as it wins.
  10. am not sure if am posting this in the right place but i need abit of you guys help here. i want to write a code that will print the string "ASPSTRINGCODE" but one character less using ASP.
  11. i have the following page and i would like to modify it using html such that in the sum text box it gives me the sum of x and y <html> <body> <form name="frm1"> x<input type="text" name="txt1" value="5"><br> y<input type="text" name="txt2" value="10"><br> sum<input type="text" name="sum"> </form> </body> </html>
  12. okay guys i manged to work with the above code but it didnt seem to give me what i needed so i worked around it and came up with the following, if((mark>100)||(mark<0)) alert("Marks out of range"); else
  13. hi guys, am still trying to learn javascript and i have come across a small problem in the following code, i would like to validate it sucj that if one enters a values >0 or<100 it gives an error message. cheers <html> <script> mark=prompt("Enter the mark of the student", " "); if(mark>=80) document.write("The grade for"+mark+"is DISTINCTION"); else if(mark>=60) document.write("The grade for"+mark+"is MERIT"); else if(mark>=50) document.write(mark+"is PASS"); else document.write(mark+"is FAIL"); </script> </html>
  14. thanks guys for the help, i have used toomariners option and it has worked but now the problem is that even the previous page is also being redirected, how can i work on this?
  15. hi, i have the following hyperlink but i want it to open a pop up window. am still new to php and any help is welcome <?php Spacer(); ?> <TR><td align=center><img <?php echo createComIcon($root_path,'qkvw.gif','0','',FALSE) ?>></td> <TD vAlign=top ><FONT face="Verdana,Helvetica,Arial" size=2> <nobr> <a href="show_encounter_list.php<?php echo URL_APPEND ?>&pid=<?php echo $pid ?>&target=<?php echo $target ?>"><?php echo $LDListEncounters ?></a> </nobr> </FONT></TD> </TR>
×
×
  • 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.