Jump to content

irkevin

Members
  • Posts

    295
  • Joined

  • Last visited

Posts posted by irkevin

  1. well.. have a look at this code

     

    <script type="text/javascript">
    function validate(){
      if (document.test.chk.checked == true)
      {
    if(document.test.sl.selectedIndex == 0)
    {
    	location.href = "http://www.mu-anime.com/index.php?id=" + document.test.chk.value;
    }
    else if(document.test.sl.selectedIndex == 1)
    {
    	location.href = "http://www.mu-anime.com/index.php?id=" + document.test.chk.value;
    }
      }
    }
    </script>
    </head>
    <body>
    <form name="test">
    <input type="checkbox" name="chk" value="1">1
    <input type="checkbox" name="chk" value="2">2
    <select name="sl" onblur="return validate();">
    <option>google</option>
    <option>waaa</option>
    </select>
    </form>

     

     

    For now it doesn't work because i have two checkboxes..

     

    but this one works, when only with one checkbox

     

    <script type="text/javascript">
    function validate(){
      if (document.test.chk.checked == true)
      {
    if(document.test.sl.selectedIndex == 0)
    {
    	location.href = "http://www.mu-anime.com/index.php?id=" + document.test.chk.value;
    }
      }
    }
    </script>
    </head>
    <body>
    <form name="test">
    <input type="checkbox" name="chk" value="1">1
    <select name="sl" onblur="return validate();">
    <option>google</option>
    <option>waaa</option>
    </select>
    </form>
    

     

    I will need this to work even if i have multiple checkbox.. any ideas?

  2. did this work for you?

     

    Because here when i use this code, when i move my mouseover the textbox, the page still refresh, even when i type in .. i wonder why it wont accept to function stopReload :S

     

    i made a test like this:

     

    function stopReload ( ) {

    alert("I work");

    }

     

    when i put my mouse over the textbox, i get a message with 'i work'.. Which mean the function works but it looks like the clearTimeout isn't working.. Any ideas?

  3. Hi,

     

    what i have is a block of javascript code to refresh contents in an Iframe. So far it works,

     

    Now, on the page containing the iframe, i have a form, what i want is, when i move my mouse over the form, the refresh function should stop.

     

    here is the html

     

    <iframe name="shout" id="shout" src="chat.php" style="overflow:auto;overflow-x: hidden;" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" height="150" width="100%"></iframe><br /><br />
    
    <form method="post" name="posting" id="posting">
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
    	<td colspan="6">Your Message:</td>
      </tr>
      <tr>
    	<td colspan="6"><input type="text" name="post" id="post" style="width:300px;" />
    
    <input type="submit" value="Submit Shout" name="submit" /></td>
      </tr>
    </table>
    

     

    The JS code:

     

    <script type="text/javascript">
    
    var milliSecondsToWait = 1000;
    
    function reloadIFrame(){
    document.frames['shout'].location.href =
    "chat.php?" + (new Date().getTime());
    myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
    }
    var myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
    
    </script>
    

     

    Thats it, how do i clear the timeout when i move my mouse over the <input type="text" .. Help plz

  4. I have another question if you don't mind.

     

    Right now the links on my website, when i click them, they still points to the dynamic urls.. is there a way so that when i click the links, it shows the nice url in the address bar?

  5. ah its working now..  Hava a look at the codes

     

    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteRule ^completed/([0-9]+)\.html$ /index.php?page=CompletedSeries&id=$1 [L]
    
    

     

    This wont cause any further problem i presume?

  6. no errors, but the place where the contents should show is blank.

     

     

    Here is the code

     

    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteRule ^completed/(.*)\.html$ /index.php?page=$1&id=$2 [L]
    

  7. Hi,

     

    I don't know if this is the right place to post this, if it isn't, please move it.

     

    I'm trying to use ur mod-rewrite to make my url look nice. Here is the code

     

    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteRule ^completed/([0-9]+)/$ /index.php?page=CompledSeries&id=$1 [NC,L]
    

     

    the dynamic url is http://www.mu-anime.com/index.php?page=CompletedSeries&id=1

     

    and using mod_rewrite, its like this http://www.mu-anime.com/completed/1/, but the only problem is that it doesn't display my images and also, the css isn't working anymore..

     

    Why is it so?

  8. Hey, its working  ;D it did what i expected. Thanks for your help

     

    the complete code. Had to change strlen($badword) to strlen($row['words'])

    <?php
    function filterBadWords($str)
    {
    include("../config.php");
    
        $result = mysql_query("SELECT words FROM badword") or die(mysql_error()); 
        $replacements = "*";
        
        while($row = mysql_fetch_assoc($result))
        {
              $str = eregi_replace($row['words'], str_repeat('*', strlen($row['words'])), $str);
        }  
        
        return $str;
    }
    
    echo filterBadWords("your_badword_from_database");
    ?> 
    

  9. Hi,

     

    I've been searching for hours for a solution and now i'm stuck. I have this code

     

    function filterBadWords($str)
    {
        $badwords = array("barwords_goes_here","barwords_goes_here","barwords_goes_here");
        $replacements = "*";
        
        foreach ($badwords as $badword)
        {
              $str = eregi_replace($badword, str_repeat('*', strlen($badword)), $str);
        }  
        
        return $str;
    }  
    

     

    I created a mysql table, and store the bad words there.

     

    My question is : How do I replace the 'barwords_goes_here', with the data in the mysql table?

  10. <?php
    
    		$submit = $_POST['submit'];
    
    		if(isset($submit))
    		{
    
    			include("scripts/config.php");
    
    			//the path for our logo to be stored
    			$target_path = "uploads/";
    			$target_path = $target_path . basename( $_FILES['logo']['name']);
    
    
    			if(move_uploaded_file($_FILES['logo']['tmp_name'], $target_path))
    			{
        				$logo = "../uploads/".basename( $_FILES['uploadedfile']['name']);
    			}
    			else
    			{
        				echo "There was an error uploading the file, please try again!";
    			}
    
    
    			$title = $_POST['title'];
    			$surname = $_POST['surname'];
    			$name = $_POST['name'];
    			$profile = $_POST['profile'];
    			$company = $_POST['company'];
    			$nature = $_POST['nature'];
    			$position = $_POST['position'];
    			$industry = $_POST['industry'];
    			$addline1 = $_POST['addline1'];
    			$addline2 = $_POST['addline2'];
    			$phone = $_POST['phone'];
    			$fax = $_POST['fax'];
    			$email = $_POST['email'];
    			$website = $_POST['website'];
    
    			$insert = "INSERT INTO directory(id,title,surname,name,profil,company,nature,position,industry,add1,add2,phone,
    						fax,email,website,path)VALUES('','$title','$surname','$name','$profile','$company',
    						'$nature','$position','$industry','$addline1','$addline2','$phone','$fax','$email',
    						'$website','$target_path')";
    			$result = mysql_query($insert,$link)or die(mysql_error());
    
    
    			if($result)
    			{
    				echo "Your information was successfully sent to our Directory Database";
    			}
    			else
    			{
    				"An error occured. Contact the administrator";
    			}
    
    		}// end if
    		else
    		{
            ?>
        	<form method="post" action="app_data.php?id=<?php echo $_GET['id'];?>" enctype="multipart/form-data">
                <fieldset>
                    <legend>Directory Details</legend>
                    <ol>
                        <li>
                            <label for="title">Title</label>
                            <select name="title">
                            	<option value="Mr" selected="selected">Mr</option>
                                <option value="Mrs">Mrs</option>
                                <option value="Miss">Miss</option>
                                <option value="Dr">Dr</option>
                            </select>
                        </li>
                        <li>
                            <label for="surname">Surname</label>
                            <input type="text" name="surname" id="name" class="text" />
                        </li>
                        <li>
                            <label for="name">Name</label>
                            <input type="text" name="name" id="idnumber" class="text" />
                        </li>
                        <li>
                            <label for="profile">Profile</label>
                           	<select name="profile">
                            	<option value="Professional" selected="selected">Professional</option>
                                <option value="Businessman">Businessman</option>
                            </select>
                        </li>
                        <li>
                            <label for="company">Company</label>
                            <input type="text" name="company" class="text" />
                        </li>
                        <li>
                            <label for="nature">Nature</label>
                            <input type="text" name="nature" class="text" />
                        </li>
                        <li>
                            <label for="position">Position</label>
                            <input type="text" name="phone" class="text" />
                        </li>
                         <li>
                            <label for="industry">Industry</label>
                            <input type="text" name="industry" class="text" />
                        </li>
                        <li>
                            <label for="addline1">Address (Line 1)</label>
                            <input type="text" name="addline1" class="text" />
                        </li>
                        <li>
                            <label for="addline2">Address (Line 2)</label>
                            <input type="text" name="addline2" class="text" />
                      </li>
                       <li>
                            <label for="phone">Phone No.</label>
                            <input type="text" name="phone" class="text" />
                      </li>
                      <li>
                            <label for="fax">Fax</label>
                            <input type="text" name="fax" class="text" />
                      </li>
                      <li>
                            <label for="email">Email</label>
                            <input type="text" name="email" id="addline2" class="text" />
                      </li>
                      <li>
                            <label for="logo">Upload your Logo</label>
                            <input type="file" name="logo" id="addline2" class="text" accept="image/jpeg" />
                             <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
                      </li>
                      <li>
                            <label for="website">Website</label>
                            <input type="text" name="website" id="addline2" class="text" />
                           	without the http://
                      </li>
                    </ol>
              </fieldset>
              <fieldset class="submit">
                   <input type="submit" name="submit" value="Submit my Information" class="submit" />
              </fieldset>
    	</form>
    	<?php
    	}
    	?>
    
    
    
    As for the error, it's exactly what is says in the Title.
    
    Got error -1 from storage engine
    
    Its the first time i got this message. Everything is working well on Local, but on the server it throws the -1 error
    
    
    

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