Jump to content

lucy

Members
  • Posts

    98
  • Joined

  • Last visited

    Never

Posts posted by lucy

  1. Is there any way i can embed a webpage within another without an iframe?

     

    I want to embed an online radio onto a page but i cant find out how to do so.

     

    The player for the station is located at http://bassdrivearchive.com/flashme/ so i was maybe thinking of having that page sit in my webpage i want to make.

     

    Could i perhaps take the player out and embed only the player and not the whole page?

     

    I know there may be copywrite issues, but i will clear that up with the station before putting online.

     

    Thanks,

    Lucy

  2. Thanks il look into it :)

     

    Could i do something like this, to retain the cid, and the pid, which are both auto-incrementing primary keys:

    mysql_query("INSERT INTO customer ( title, name, housenumber, add1, add2, pc, email, tel)
                    VALUES ('$_POST[title]','$_POST[customer_name]','$_POST[customer_house_number]','$_POST[customer_road_name]', '$_POST[customer_city]', '$_POST[customer_postcode]', '$_POST[email]', '$_POST[c_tel]' )")
             or die('Error: ' . mysql_error());
             
    	 $cid = mysql_insert_id();
    
          mysql_query("INSERT INTO services(cid, number_of_owners, number_of_neighbours, directlyattached, special_circumstances, owner_name, house_number, road_name, city, county, postcode, email, nature_of_work, month, year, uptoboundary, askpermission, underpin, description)
                    VALUES ( $cid,  '$_POST[number_of_owners]', '$_POST[no_of_neighbours]', '$_POST[neighbour_attached]', '$_POST[owner_name]', '$_POST[special_circumstance]','$_POST[house_number]', '$_POST[road_name]', '$_POST[city]', '$_POST[county]', '$_POST[postcode]', '$_POST[email]', '$_POST[nature_of_work]', '$_POST[month]','$_POST[year]', '$_POST[boundry_with_neighbour]', '$_POST[ask_for_permission]','$_POST[underpin_foundations]', '$_POST[description_of_works]' )")
             or die('Error: ' . mysql_error());
    
    	 $pid = mysql_insert_id();

     

    N.B. They are both different values, so i would be expecting the cid of the latest customer, and the pid of the latest service.

  3. Thanks, that works a treat!

     

    Do you suggest using get? would i simply replace post, for get?

     

    I am running javascript validation (i know it can be turned off), as well as php validation to try ensure what the user is sending me is what i want.

     

    Thanks for all the help :)

    Lucy

     

     

  4. I put the following function in, as you said:

     

    mysql_query("INSERT INTO customer ( title, name, housenumber, add1, add2, pc, email, tel) 
    				 VALUES ('$_POST[title]','$_POST[customer_name]','$_POST[customer_house_number]','$_POST[customer_road_name]', '$_POST[customer_city]', '$_POST[customer_postcode]', '$_POST[email]', '$_POST[c_tel]' )") 
    		or die('Error: ' . mysql_error());
    
    	mysql_query("INSERT INTO services (NULL, last_insert_id(), number_of_owners, owner_name, house_number, road_name, city, county, postcode, email, nature_of_work, month, year, uptoboundary, askpermission, underpin, description) 
    				 VALUES ('$_POST[number_of_owners]', '$_POST[owner_name]', '$_POST[house_number]', '$_POST[road_name]', '$_POST[city]', '$_POST[county]', '$_POST[postcode]', '$_POST[email]', '$_POST[nature_of_work]', '$_POST[month]','$_POST[year]', '$_POST[boundry_with_neighbour]', '$_POST[ask_for_permission]','$_POST[underpin_foundations]', '$_POST[description_of_works]' )") 
    		or die('Error: ' . mysql_error());

     

    but its threw me an error:

    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL, last_insert_id(), number_of_owners, owner_name, house_number, road_name, c' at line 1

     

    Does last_insert_id() simply return the last auto-incremented filed which was created, even if it was in a different table?

     

    Thanks a lot,

    Lucy

  5. Hi. I am trying to insert data into a table called CUSTOMER. This is all captured from a form. The input of this data goes into the CUSTOMER table, and the customer is assigned a 'cid' which is the primary key and auto incrementing.

     

    I also insert data into the SERVICE table, which is yet again captured from the input of the same form.

     

    The problem begins when i try to link the 'cid' (which has just been auto assigned to the customer), to the 'cid' in the SERVICE table.

     

    Basically, i want to be able to show which services a customer has bought.

     

    I have made 'cid' in the SERVICE table a foreign key, which references CUSTOMER(cid).

     

    The only data that are showing in the 'cid' field of SERVICE is 0 in every entry, and not the correct 'cid' for the customer which has just made the purchase.

     

    Any help will be readily accepted.

     

    Thanks,

    Lucy

  6. Can anyone point me in the right direction of a tutorial or something similar which can explain how i can make an image gallery, with multiple image sets, with thumbnails, a next and previous  button...you get the idea.

     

    Im guessing i could slightly modify the image gallery code to include video, by linking to videos instead of images?

     

    Thanks for any help :)

    Lucy

  7. I have a form with a text box and a combo box on. I have a javascript file which checks that the combo box has been changed from the default value (which is a blank space with a value of -1) and also it checks that the text field is not empty.

     

    If either of these two requirements are not met, it should highlight the box and then let the user update the field by either selecting a value, or entering some text.

     

    It works, but not when i use include the code for the combo box and i dont have a clue why.

     

    Below is my javascript file:

    
    
    //Check is string is empty, less or greater than allowed
    function checkLength(text, min, max){
    min = min || 1;
    max = max || 10000;
    
    if (text.length < min || text.length > max) {
      return false;
    }
    return true;
    }
    
    //Enable submit button
    function validate_check(chk){
       if (chk.checked){
          document.main_form.submit_button.disabled = false;
       }
       else{
          document.main_form.submit_button.disabled = true;
       }
    }
    
    //Main vlidation form
    function validateForm(){
    
    var errors = [];
    var owner_name = document.main_form.owner_name.value;
    
    if (document.main_form.number_of_owners.value = -1) {
            errors[errors.length] = "New error";
    	document.main_form.number_of_owners.style.border='1px solid red';
        }
    		else if (document.main_form.number_of_owners.value!=-1) {
    		document.main_form.number_of_owners.style.border='';
    	}
    
    if (!checkLength(owner_name)) {
            errors[errors.length] = "New error";
    	document.main_form.owner_name.style.border='1px solid red';
        }
    		else if (checkLength(owner_name)) {
    		document.main_form.owner_name.style.border='';
    	}
    
       //Report errors
       if (errors.length > 0) {
             return false;
        }
    
    }
    
    

     

    The html code is:

    <body>
    <form action="" method="get">
        <select name="number_of_owners">
            <option value="-1"></option>
            <option>one</option>
        </select>
        <input name="owner_name" type="text" />
    </form>
    </body>

     

    Please can you help me as to why the javascript works when i omit the combo requirement.

     

    Thanks,

    Lucy

  8. Ive been looking for this for ages!

     

    I cant change the border colour of a combo box using javascript, like i can with text boxes, so i was thinking of changing the background colour of it, but i cant find out how to do that.

     

    Does anybody know of any ways to either change the border colour of a combo box or the background colour of a combo box?

     

    Thanks,

    Lucy

  9. Like, it sticks all of the titles at the top of the page and then continues with the table.

     

    Here is the code which does that, including the .title class from my previous post.

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="layout.css" />
    
    </head>
    <body>
    
    <form action='cation.php' name='main_form' id='main_form' method='post'>
      <table width='750' border='1' cellspacing='0' cellpadding='0'>
      <tr><p class='ijfg'><strong>foprk eofjk</strong></p></tr>
      <tr> </tr>
        <tr><p class="title">text here</p><br /></tr>
             <tr>
              <td>df </td>
              <td><select name='df'>
                <option selected='selected' value='-1'></option>
                <option value='1'>1</option>
                <option value='2'>2</option>
                <option value='3'>3</option>
              </select></td>
            </tr>
            <tr><p class="title">text here</p></tr>
            <tr>
              <td><input name='df' type='text' size='30' maxlength='30'/></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
          <tr>
              <td>df</td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
          <tr>
              <td>df</td>
              <td><select name='okefoed'>
                <option selected='selected' value='-1'></option>
                <option value='1'>Yes</option>
                <option value='2'>No</option>           
               </select></td>
            </tr>
          <tr>
              <td>df </td>
              <td><textarea name='dfd' cols='25' rows='8'></textarea></td>
            </tr>
        <tr>
          <td colspan="2"> kjnk</td>
       </tr>
           
           
          <tr> </tr>
      <tr><td colspan="2"><p class='class_NAME'><strong>Ydfkcod</strong></p></td></tr>
      <tr> </tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
          <tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
          <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
          <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
          <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
             <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>dsfdf df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
          </table>
    
    </form>
    
    
    
    </body>
    </html>

     

    Thanks,

    Lucy

  10. I dont know if i can use one table, as it is broken down into 4 parts (hence 4 tables) and each one has a formatted paragraph at the top of it, like a title.

     

    When i tried doing it all in one table, the formatting got even more messed up.

     

    How can i do this in CSS?

     

    I use a class called .title to format the titles at the top of each table and its contents are below:

    .title {
    				background-color:#99cc33;
    				border:1px solid black;
    				width:100%;
    				height:auto;
    				padding:2px 0 2px 20px;
    			}

     

    How could i fix this problem, either with CSS or with plain HTML tables?

     

    Thanks,

    Lucy

  11. For the sake of me, i cant get the text fields to align up. The bottom table's text fields, aremuch further to the right than the first table's text fields and i cant work out why.

     

    Code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    
    
    </head>
    <body>
    
    <form action='cation.php' name='main_form' id='main_form' method='post'>
      <table width='750' border='0' cellspacing='0' cellpadding='0'>
      <tr><p class='ijfg'><strong>foprk eofjk</strong></p></tr>
      <tr> </tr>
        <tr><p>text here</p><br /></tr>
    		<tr>
              <td>df </td>
              <td><select name='df'>
                <option selected='selected' value='-1'></option>
                <option value='1'>1</option>
                <option value='2'>2</option>
                <option value='3'>3</option>
              </select></td>
            </tr>
            <tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30'/></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
    	<tr>
              <td>df</td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
    	<tr>
              <td>df</td>
              <td><select name='okefoed'>
    			<option selected='selected' value='-1'></option>
    			<option value='1'>Yes</option>
    			<option value='2'>No</option>				
    		  </select></td>
            </tr>
    	<tr>
              <td>df </td>
              <td><textarea name='dfd' cols='25' rows='8'></textarea></td>
            </tr>
    	</table>
            kjnk
            
            <table width='750' border='0' cellspacing='0' cellpadding='0'>
    	<tr> </tr>
      <tr><p class='class_NAME'><strong>Ydfkcod</strong></p></tr>
      <tr> </tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
    	<tr>
              <td>df </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
    	<tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
    	<tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30'  /></td>
            </tr>
    	<tr>
              <td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
    		<td>df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
            <tr>
              <td>dsfdf df: </td>
              <td><input name='df' type='text' size='30' maxlength='30' /></td>
            </tr>
          </table>
      
    </form>
    
    
    
    </body>
    </html>

     

    Thanks,

    Lucy

  12. I am trying to make it so if the check box is checked, then the button is enabled, otherwise it should be disabled.

     

    If the box is already checked, and then is unchecked, the button should become disabled.

     

    Below is my (unworking) code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script language="javascript">
    
    function enableField(){ 
    if (document.form1.button.disabled=true){
    	document.form1.button.disabled=false;
    }
    else {document.form1.button.disabled=true;}
    }
    
    
    </script>
    
    
    
    </head>
    <body>
    <form id="form1" name="form1" method="post" action="">
          <input type="checkbox" name="check1" id="check1" onclick="enableField()"/>
    
        <input name="button" type="button" value="button" disabled="disabled"/>
    
    </form>
    </body>
    </html>
    

     

    Thanks,

    Lucy

  13. How can i manually enter a date into a mysql database field by using php and html.

     

    I am unsure on how to format the date and how to handle the date i.e. the value of 3 combo boxes (one for day, month and year).

     

    Any help would be great.

     

    Thanks,

    Lucy

×
×
  • 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.