Jump to content

MDanz

Members
  • Posts

    728
  • Joined

  • Last visited

Posts posted by MDanz

  1. here is the code for the javascript slideshow

    function nextslide() {
    
    	// Hide current slide
              object = document.getElementById('slide' + current); //e.g. slide1
              object.style.display = 'none';
                  
              // Show next slide, if last, loop back to front
              if (current == last) { current = 1; }
              else { current++ }
              object = document.getElementById('slide' + current);
              object.style.display = 'block';
    	  setTimeout(nextslide, 2500);
    
    
           }
       

     

    how do i stop the slideshow onmouseover?

     

    i tried

    nextslide.stop();

    ... but it never worked.

  2. The width spreads across the whole page, i only want it to be as long as the content in the div.  How can i solve this?

     

    <style type="text/css">
    .three {
    display:block;
    width:auto;
    height:100px;
    position:relative;
    border:1px solid black;
    }
    
    .three a {
    width:100%;
    height:100%;
    position:absolute;
    
    }
    
    </style>

     

    echo "<div class='three'><a href='two'></a>test</div>";

  3. i've done this

    RewriteRule ^([A-Za-z0-9-]+)/?$ profile.php?user=$1 [L]

     

    to make

    www.example.com/profile.php?user=testing

    into

    www.example.com/testing

     

    What i'd like to do is change..

     

    www.example.com/profile.php?user=testing

    into

    www.example.com/user=testing

     

    What is the RewriteRule to accomplish this?  Also if i used $_GET['user'] with the second clean url would it still work?

     

  4. Your clean URL should rewrite all the variables into the messy URL so you won't have to do anything with the $_GET. As for as the PHP script is concerened, it dosn't matter if it was a clean URL or messy.

     

    Forms are a different matter though, the action needs to be the working clean URL (not just 'submit'). If you're using GET forms then it will always look ugly. If you have several fields to submit try using POST where you can have a clean URL as the action, and all of the post data will be hidden from the URL. Depends what sort of data you're submitting in the form.

     

    Thanks for help.

     

    So your saying example.php?name=test and example/name/test.. if i use $_GET['name']; on the clean url it will be "test"?..

     

    and i should change my GET forms to POST(hidden data), for the sake of clean urls?

     

  5. I've recently used mod_rewrite and changed my .htaccess allowing clean urls.  Is there a tutorial that tells me how to use $_GET with a clean url?

     

    for instance how do i get the name with the clean url($_GET method)?

     

    messy url

    example.com/play.php?id=203&name=test

     

    clean url

    example.com/videos/play/203/test

     

     

    also when using forms is it as simple as changing

    <form action='submit.php' action='get'>

    to

    <form action='submit' action='get'>

    or do i have to do something else?

     

     

  6. onclick of the textarea, it should display the div with "TEST" in it but nothing happens.

    <script type="text/javascript">
    function popup(number) {
    document.getElementById('submit'+number).style.display == "block";
    document.getElementById('submit'+number).style.position == "absolute";
    
    
    }
    </script>

    <?php
    
    echo "<textarea id='example0' readonly='readonly' onclick='popup(0)'></textarea>";
    
    echo "<div id='submit0' style='display:none'>TEST</div>";
    ?>

  7. When the function is called it should change the width in div 'add' but it does nothing?

     

    #add {
    overflow:hidden;
    float:left;
    margin-right:5px;
    border:1px solid black;
    }
    

     

    newfield = 0;
    
    function add() {
    
    if(newfield!=6) {
    var hundred = 100;
    var newval = parseInt(newfield)*parseInt(hundred);
    document.getElementById('add').style.width = newval;
    newfield += 1;
    }else {
             document.form.add.disabled=true;
        }
    }
    

  8. when i echo my select query i now get this.

     

    SELECT * FROM test WHERE name='q test\'1' ORDER BY `id` DESC LIMIT 10

     

    in the database i have a row with name = q test\'1 but it isn't retrieving data.

     

    What do i have to change to get the query to retrieve the result.

  9. i want if this checkbox is clicked to change the value in the textarea to "Input image url".. the below isn't working though

     

    <input type='checkbox' name='image' onclick='if(this.checked) { image(0);}' />

     

    function image(number) {
    
    document.outcomes['reason["+number+"]'].value="Input image url";
    
    
    }

     

    <form action='submit.php' method='POST' name='outcomes'>
    <textarea name='reason[0]'></textarea>
    </form>

  10. i'm not getting any results for the query.  I'm sure it has something to do with the apostrophe and back slashes

    $search = "q test'yes";
    $search = mysql_real_escape_string($search);
    mysql_query("SELECT * FROM block WHERE name LIKE '%$search%' ORDER BY `id` DESC",$this->connect);
    

     

    When i echo it out i get this

    SELECT * FROM block WHERE name LIKE '%q test\\\'yes%' ORDER BY `id` DESC

  11. i tried this not working it should limit 'example' to 12 characters

     

    var example = document.getElementById(number).value;
    var exampleid = "example"+number;
    var example2 = example.substring(0,12);
    
    if(example2.length==12){
    var example3 = example+"...";
    } else {
    var example3 = example;
    }
    document.getElementById(exampleid).innerHTML = example3;
    
    

  12. var example = document.getElementById(number).value;
    var exampleid = "example"+number;
    document.getElementById(exampleid).innerHTML = example;

     

    i only want the variable 'example' to be 12 characters long then followed by three fullstops.

    How do i do this?

  13. The result should echo 1.  $_SESSION[50] is an array.

    i keep getting this error... Warning: in_array() [function.in-array]: Wrong datatype for second argument in..

     

    $value="50";
    $search = "test";
    if(in_array($search,$_SESSION[$value])) {
    
    	$duplicate = 1;
    
    	}else {
    $duplicate = 0;
    
    }
    echo $duplicate;
    

  14. Onchange of the dropdown list, the textfield should display either "testing 3" or "testing 4" but nothing is happening.

     

    <form action='submit.php' method='POST' name='form'>
        <select name='preset' onchange='preset(this);'>
           <option value='test1'>testing 1</option>
           <option value=test2'>testing 2</option>
       </select>
    
    <input type='text' name='big[]' value='' />
    
    </form>
    

     

    function preset(ele) {
    
    if(ele=="test1") {
      var action1 = "testing 3";
    } else {
      var action1 = "testing 4";
    }
    
      document.form."big[0]".value = action1;
    
    }
    
    

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